- rewrite depthblur.fp to workaround what seemed to be a bug in the NVidia driver

This commit is contained in:
Magnus Norddahl 2019-04-16 16:17:23 +02:00
commit 15dae4cfe6
3 changed files with 35 additions and 36 deletions

View file

@ -697,6 +697,10 @@ void PPAmbientOcclusion::Render(PPRenderState *renderstate, float m5, int sceneW
ssaoUniforms.Scale = sceneScale;
ssaoUniforms.Offset = sceneOffset;
DepthBlurUniforms blurUniforms;
blurUniforms.BlurSharpness = blurSharpness;
blurUniforms.PowExponent = gl_ssao_exponent;
AmbientCombineUniforms combineUniforms;
combineUniforms.SampleCount = gl_multisample;
combineUniforms.Scale = screen->SceneScale();
@ -735,11 +739,6 @@ void PPAmbientOcclusion::Render(PPRenderState *renderstate, float m5, int sceneW
// Blur SSAO texture
if (gl_ssao_debug < 2)
{
DepthBlurUniforms blurUniforms;
blurUniforms.BlurSharpness = blurSharpness;
blurUniforms.PowExponent = gl_ssao_exponent;
blurUniforms.InvFullResolution = { 1.0f / AmbientWidth, 0.0f };
renderstate->Clear();
renderstate->Shader = &BlurHorizontal;
renderstate->Uniforms.Set(blurUniforms);
@ -749,8 +748,6 @@ void PPAmbientOcclusion::Render(PPRenderState *renderstate, float m5, int sceneW
renderstate->SetNoBlend();
renderstate->Draw();
blurUniforms.InvFullResolution = { 0.0f, 1.0f / AmbientHeight };
renderstate->Clear();
renderstate->Shader = &BlurVertical;
renderstate->Uniforms.Set(blurUniforms);