mirror of
https://github.com/TheRedShip/RT_GPU.git
synced 2025-09-27 10:48:34 +02:00
~ | Imgui material
This commit is contained in:
10
imgui.ini
10
imgui.ini
@ -3,6 +3,14 @@ Pos=60,60
|
||||
Size=400,400
|
||||
|
||||
[Window][Settings]
|
||||
Pos=1511,75
|
||||
Pos=1515,93
|
||||
Size=368,276
|
||||
|
||||
[Window][Material]
|
||||
Pos=1620,199
|
||||
Size=297,259
|
||||
|
||||
[Window][Camera]
|
||||
Pos=1614,5
|
||||
Size=279,183
|
||||
|
||||
|
@ -151,7 +151,7 @@ vec3 pathtrace(Ray ray, inout uint rng_state)
|
||||
hitInfo hit = traceRay(ray);
|
||||
if (hit.obj_index == -1)
|
||||
{
|
||||
// light += GetEnvironmentLight(ray);
|
||||
light += GetEnvironmentLight(ray);
|
||||
// light += vec3(135 / 255.0f, 206 / 255.0f, 235 / 255.0f); //ambient color
|
||||
break;
|
||||
}
|
||||
|
@ -171,13 +171,12 @@ void Window::imGuiRender()
|
||||
{
|
||||
bool has_changed = false;
|
||||
|
||||
ImGui::Begin("Settings");
|
||||
ImGui::Begin("Camera");
|
||||
|
||||
ImGui::Text("Fps: %d", int(_fps));
|
||||
ImGui::Text("Frame: %d", _frameCount);
|
||||
|
||||
if (ImGui::CollapsingHeader("Camera"))
|
||||
{
|
||||
ImGui::Separator();
|
||||
if (ImGui::Checkbox("Accumulate", &accumulate))
|
||||
_frameCount = 0;
|
||||
|
||||
@ -185,6 +184,32 @@ void Window::imGuiRender()
|
||||
has_changed |= ImGui::SliderFloat("FOV", &_scene->getCamera()->getFov(), 1.0f, 180.0f);
|
||||
has_changed |= ImGui::SliderFloat("Aperture", &_scene->getCamera()->getAperture(), 0.0f, 1.0f);
|
||||
has_changed |= ImGui::SliderFloat("Focus", &_scene->getCamera()->getFocus(), 0.0f, 150.0f);
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Begin("Material");
|
||||
|
||||
for (unsigned int i = 0; i < _scene->getMaterialData().size(); i++)
|
||||
{
|
||||
GPUMaterial &mat = _scene->getMaterialData()[i];
|
||||
|
||||
ImGui::PushID(i);
|
||||
|
||||
ImGui::Text("Material %d", i);
|
||||
has_changed |= ImGui::ColorEdit3("Color", &mat.color[0]);
|
||||
has_changed |= ImGui::SliderFloat("Emission", &mat.emission, 0.0f, 10.0f);
|
||||
|
||||
if (mat.type == 1)
|
||||
has_changed |= ImGui::SliderFloat("Roughness", &mat.roughness, 0.0f, 5.0f);
|
||||
else
|
||||
has_changed |= ImGui::SliderFloat("Roughness", &mat.roughness, 0.0f, 1.0f);
|
||||
|
||||
has_changed |= ImGui::SliderFloat("Metallic", &mat.metallic, 0.0f, 1.0f);
|
||||
has_changed |= ImGui::SliderInt("Type", &mat.type, 0, 1);
|
||||
|
||||
ImGui::PopID();
|
||||
|
||||
ImGui::Separator();
|
||||
}
|
||||
|
||||
ImGui::End();
|
||||
|
Reference in New Issue
Block a user