Render 3DGS debug splats as quads
This commit is contained in:
@@ -209,7 +209,7 @@ FrameConstants BuildFrameConstants(uint32_t width, uint32_t height, uint32_t spl
|
||||
constants.settings[0] = static_cast<float>(splatCount);
|
||||
constants.settings[1] = 1.0f; // opacity scale
|
||||
constants.settings[2] = 3.0f; // SH order
|
||||
constants.settings[3] = 1.0f;
|
||||
constants.settings[3] = 0.9f;
|
||||
return constants;
|
||||
}
|
||||
|
||||
@@ -1108,7 +1108,7 @@ bool App::InitializeDebugDrawResources() {
|
||||
|
||||
GraphicsPipelineDesc pipelineDesc = {};
|
||||
pipelineDesc.pipelineLayout = m_debugPipelineLayout;
|
||||
pipelineDesc.topologyType = static_cast<uint32_t>(PrimitiveTopologyType::Point);
|
||||
pipelineDesc.topologyType = static_cast<uint32_t>(PrimitiveTopologyType::Triangle);
|
||||
pipelineDesc.renderTargetCount = 1;
|
||||
pipelineDesc.renderTargetFormats[0] = static_cast<uint32_t>(Format::R8G8B8A8_UNorm);
|
||||
pipelineDesc.depthStencilFormat = static_cast<uint32_t>(Format::D24_UNorm_S8_UInt);
|
||||
@@ -1117,6 +1117,11 @@ bool App::InitializeDebugDrawResources() {
|
||||
pipelineDesc.rasterizerState.cullMode = static_cast<uint32_t>(CullMode::None);
|
||||
pipelineDesc.depthStencilState.depthTestEnable = false;
|
||||
pipelineDesc.depthStencilState.depthWriteEnable = false;
|
||||
pipelineDesc.blendState.blendEnable = true;
|
||||
pipelineDesc.blendState.srcBlend = static_cast<uint32_t>(BlendFactor::One);
|
||||
pipelineDesc.blendState.dstBlend = static_cast<uint32_t>(BlendFactor::InvSrcAlpha);
|
||||
pipelineDesc.blendState.srcBlendAlpha = static_cast<uint32_t>(BlendFactor::One);
|
||||
pipelineDesc.blendState.dstBlendAlpha = static_cast<uint32_t>(BlendFactor::InvSrcAlpha);
|
||||
|
||||
pipelineDesc.vertexShader.fileName = ResolveShaderPath(L"DebugPointsVS.hlsl").wstring();
|
||||
pipelineDesc.vertexShader.entryPoint = L"MainVS";
|
||||
@@ -1908,8 +1913,8 @@ void App::RenderFrame(bool captureScreenshot) {
|
||||
m_commandList.SetPipelineState(m_debugPipelineState);
|
||||
RHIDescriptorSet* debugSets[] = { m_debugDescriptorSet };
|
||||
m_commandList.SetGraphicsDescriptorSets(0, 1, debugSets, m_debugPipelineLayout);
|
||||
m_commandList.SetPrimitiveTopology(PrimitiveTopology::PointList);
|
||||
m_commandList.Draw(1u, m_gaussianSceneData.splatCount, 0u, 0u);
|
||||
m_commandList.SetPrimitiveTopology(PrimitiveTopology::TriangleStrip);
|
||||
m_commandList.Draw(4u, m_gaussianSceneData.splatCount, 0u, 0u);
|
||||
|
||||
if (captureScreenshot) {
|
||||
AppendTrace("RenderFrame: close+execute capture pre-screenshot");
|
||||
|
||||
Reference in New Issue
Block a user