mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Attempt workaround for fog issue #5384
This commit is contained in:
parent
8dfadf7b8e
commit
63aeb31e07
1 changed files with 8 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue