Skip to content

Commit

Permalink
Attempt workaround for fog issue #5384
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Mar 22, 2014
1 parent 8dfadf7 commit 63aeb31
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions GPU/GLES/ShaderManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,14 @@ void LinkedShader::UpdateUniforms(u32 vertType) {
// not really sure what a sensible value might be.
fogcoef[1] = fogcoef[1] < 0.0f ? -10000.0f : 10000.0f;
}
if (my_isnan(fogcoef[1])) {
// Workaround for https://github.com/hrydgard/ppsspp/issues/5384#issuecomment-38365988
// Just put the fog far away at a large finite distance.
// Infinities and NaNs are rather unpredictable in shaders on many GPUs
// so it's best to just make it a sane calculation.
fogcoef[0] = 100000.0f;
fogcoef[1] = 1.0f;
}
glUniform2fv(u_fogcoef, 1, fogcoef);
}

Expand Down

1 comment on commit 63aeb31

@thedax
Copy link
Collaborator

@thedax thedax commented on 63aeb31 Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also fixed the missing skies and black stages in #5507, making it much more playable now (though the missing geometry and "polygons coming up on the screen" issues still exist). Nice one.

Please sign in to comment.