Skip to content

Commit 6defbe3

Browse files
committed
Do not create an imgui.ini file.
Added help text. Added image to README.
1 parent 497e549 commit 6defbe3

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

LucySettings.jpg

264 KB
Loading

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Ray Tracing In Vulkan
22

3+
<img align="center" src="https://github.com/GPSnoopy/RayTracingInVulkan/blob/master/LucySettings.jpg">
4+
35
My implementation of [Peter Shirley's Ray Tracing in One Weekend](https://github.com/petershirley/raytracinginoneweekend) book using Vulkan and NVIDIA's RTX extension (VK_NV_ray_tracing). This allows most scenes to render at interactive speed on appropriate hardware.
46

57
This real-time ray tracer can also load full geometry from OBJ files as well as render the procedural spheres from the book. An accumulation buffer is used to increase the sample count when the camera is not moving while keeping the frame rate interactive. I have added a UI built using [Dear ImGui](https://github.com/ocornut/imgui) to allow changing the renderer parameters on the fly. Unlike projects such as [Q2VKPT](http://brechpunkt.de/q2vkpt/), there is no denoising filter. So the image will get noisy when moving the camera.

src/UserInterface.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,11 @@ UserInterface::UserInterface(
7474
Throw(std::runtime_error("failed to initialise ImGui vulkan adapter"));
7575
}
7676

77+
auto& io = ImGui::GetIO();
78+
79+
// No ini file.
80+
io.IniFilename = nullptr;
81+
7782
// DPI
7883
const auto dpi = window.Dpi();
7984
const auto scaleFactor = static_cast<float>(dpi / 110);
@@ -82,8 +87,6 @@ UserInterface::UserInterface(
8287
ImGui::GetStyle().ScaleAllSizes(scaleFactor);
8388

8489
// Upload ImGui fonts
85-
auto& io = ImGui::GetIO();
86-
8790
if (!io.Fonts->AddFontFromFileTTF("../assets/fonts/Cousine-Regular.ttf", 13 * scaleFactor))
8891
{
8992
Throw(std::runtime_error("failed to load ImGui font"));
@@ -174,6 +177,13 @@ void UserInterface::DrawSettings()
174177
scenes.push_back(scene.first.c_str());
175178
}
176179

180+
ImGui::Text("Help");
181+
ImGui::Separator();
182+
ImGui::BulletText("Press F1 to toggle Settings.");
183+
ImGui::BulletText("Press F2 to toggle Statistics.");
184+
ImGui::BulletText("Press R to toggle ray tracing.");
185+
ImGui::NewLine();
186+
177187
ImGui::Text("Scene");
178188
ImGui::Separator();
179189
ImGui::PushItemWidth(-1);

0 commit comments

Comments
 (0)