| 1437 | if (ImGui::Button("Reset window")) |
| 1438 | perf.Reset(); |
| 1439 | } |
| 1440 | void DrawRenderTab() |
| 1441 | { |
| 1442 | if (!GEngine) |
| 1443 | { |
| 1444 | ImGui::TextDisabled("engine not up"); |
| 1445 | return; |
| 1446 | } |
| 1447 | |
| 1448 | int samples = GEngine->GetMsaaSamples(); |
| 1449 | int sampleIdx = samples >= 8 ? 3 : samples >= 4 ? 2 : samples >= 2 ? 1 : 0; |
| 1450 | if (ImGui::Combo("MSAA", &sampleIdx, |
| 1451 | "Off\0" |
| 1452 | "2x\0" |
| 1453 | "4x\0" |
| 1454 | "8x\0")) |
| 1455 | { |
| 1456 | static const int kSamples[] = {0, 2, 4, 8}; |
| 1457 | GEngine->SetMsaaSamples(kSamples[sampleIdx]); |
| 1458 | } |
| 1459 | |
| 1460 | float scale = GEngine->GetRenderScale(); |
| 1461 | if (ImGui::SliderFloat("Render scale (SSAA)", &scale, 1.0f, 2.0f, "%.2f")) |
| 1462 | GEngine->SetRenderScale(scale); |
| 1463 | ImGui::SameLine(); |
| 1464 | if (ImGui::Button("1x")) |
| 1465 | GEngine->SetRenderScale(1.0f); |
| 1466 | ImGui::SameLine(); |
| 1467 | if (ImGui::Button("1.5x")) |
| 1468 | GEngine->SetRenderScale(1.5f); |
| 1469 | ImGui::SameLine(); |
| 1470 | if (ImGui::Button("2x")) |
| 1471 | GEngine->SetRenderScale(2.0f); |
| 1472 | |
| 1473 | bool a2c = GEngine->GetAlphaToCoverage(); |
| 1474 | if (ImGui::Checkbox("Alpha-to-coverage (cutout AA; needs MSAA)", &a2c)) |
| 1475 | GEngine->SetAlphaToCoverage(a2c); |
| 1476 | |
| 1477 | bool flat = GEngine->GetDebugFlatColor(); |
| 1478 | if (ImGui::Checkbox("Flat shading (objects -> solid red; shading-vs-geometry probe)", &flat)) |
| 1479 | GEngine->SetDebugFlatColor(flat); |
| 1480 | |
| 1481 | ImGui::Separator(); |
| 1482 | ImGui::Text("window %d x %d", GEngine->Width(), GEngine->Height()); |
| 1483 | ImGui::Text("target scale %.2fx, %dx MSAA", GEngine->GetRenderScale(), GEngine->GetMsaaSamples()); |
| 1484 | ImGui::TextDisabled("settings are session-only; persist via graphics.cfg"); |
| 1485 | } |
| 1486 | void DrawMouseTab() |
| 1487 | { |
no test coverage detected