Skip to content

Commit f823771

Browse files
committed
use dropdown, more options
1 parent 78de4f5 commit f823771

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

31_HLSLPathTracer/main.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
4141
{
4242
ERM_GLSL,
4343
ERM_HLSL,
44-
ERM_CHECKERED,
44+
// ERM_CHECKERED,
4545
ERM_COUNT
4646
};
4747

@@ -68,6 +68,11 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
6868
"ELG_RECTANGLE"
6969
};
7070

71+
const char* shaderTypes[E_RENDER_MODE::ERM_COUNT] = {
72+
"ERM_GLSL",
73+
"ERM_HLSL"
74+
};
75+
7176
public:
7277
inline HLSLComputePathtracer(const path& _localInputCWD, const path& _localOutputCWD, const path& _sharedInputCWD, const path& _sharedOutputCWD)
7378
: IApplicationFramework(_localInputCWD, _localOutputCWD, _sharedInputCWD, _sharedOutputCWD) {}
@@ -935,7 +940,8 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
935940
ImGui::SliderFloat("Fov", &fov, 20.f, 150.f);
936941
ImGui::SliderFloat("zNear", &zNear, 0.1f, 100.f);
937942
ImGui::SliderFloat("zFar", &zFar, 110.f, 10000.f);
938-
ImGui::ListBox("Shader", &PTPipline, shaderNames, E_LIGHT_GEOMETRY::ELG_COUNT);
943+
ImGui::Combo("Shader", &PTPipeline, shaderNames, E_LIGHT_GEOMETRY::ELG_COUNT);
944+
ImGui::Combo("Render Mode", &renderMode, shaderTypes, E_RENDER_MODE::ERM_COUNT);
939945
ImGui::SliderInt("SPP", &spp, 1, MaxBufferSamples);
940946
ImGui::SliderInt("Depth", &depth, 1, MaxBufferDimensions / 3);
941947

@@ -1063,7 +1069,7 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
10631069

10641070
// cube envmap handle
10651071
{
1066-
auto pipeline = renderMode == E_RENDER_MODE::ERM_HLSL ? m_PTHLSLPipelines[PTPipline].get() : m_PTGLSLPipelines[PTPipline].get();
1072+
auto pipeline = renderMode == E_RENDER_MODE::ERM_HLSL ? m_PTHLSLPipelines[PTPipeline].get() : m_PTGLSLPipelines[PTPipeline].get();
10671073
cmdbuf->bindComputePipeline(pipeline);
10681074
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 0u, 1u, &m_descriptorSet0.get());
10691075
cmdbuf->bindDescriptorSets(EPBP_COMPUTE, pipeline->getLayout(), 2u, 1u, &m_descriptorSet2.get());
@@ -1347,7 +1353,7 @@ class HLSLComputePathtracer final : public examples::SimpleWindowedApplication,
13471353
float viewWidth = 10.f;
13481354
float camYAngle = 165.f / 180.f * 3.14159f;
13491355
float camXAngle = 32.f / 180.f * 3.14159f;
1350-
int PTPipline = E_LIGHT_GEOMETRY::ELG_SPHERE;
1356+
int PTPipeline = E_LIGHT_GEOMETRY::ELG_SPHERE;
13511357
int renderMode = E_RENDER_MODE::ERM_HLSL;
13521358
int spp = 32;
13531359
int depth = 3;

0 commit comments

Comments
 (0)