- add gl_ssao_debug mode showing the depth

This commit is contained in:
Magnus Norddahl 2019-04-16 05:29:32 +02:00
parent 558760c090
commit 67490d13cb
2 changed files with 4 additions and 1 deletions

View file

@ -669,6 +669,7 @@ void PPAmbientOcclusion::Render(PPRenderState *renderstate, float m5, int sceneW
float r2 = aoRadius * aoRadius;
float blurSharpness = 1.0f / blurAmount;
blurSharpness = 0.0f;
auto sceneScale = screen->SceneScale();
auto sceneOffset = screen->SceneOffset();
@ -760,7 +761,7 @@ void PPAmbientOcclusion::Render(PPRenderState *renderstate, float m5, int sceneW
renderstate->Shader = gl_multisample > 1 ? &CombineMS : &Combine;
renderstate->Uniforms.Set(combineUniforms);
renderstate->Viewport = screen->mSceneViewport;
if (gl_ssao_debug < 3)
if (gl_ssao_debug < 4)
renderstate->SetInputTexture(0, &Ambient0, PPFilterMode::Linear);
else
renderstate->SetInputSceneNormal(0, PPFilterMode::Linear);

View file

@ -37,6 +37,8 @@ void main()
FragColor = vec4(fogColor, 1.0 - attenutation);
else if (DebugMode < 3)
FragColor = vec4(attenutation, attenutation, attenutation, 1.0);
else if (DebugMode == 3)
FragColor = vec4(ssao.yyy / 1000.0, 1.0);
else
FragColor = vec4(ssao.xyz, 1.0);
}