mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-25 11:19:03 +01:00
Round depth in the fragment shader. Simpler alternative to #7920 but will not work on ES 2.0, and will in many cases be slower.
So possibly this could be an option for modern devices, and possibly for games that #7920 can't fix.
This commit is contained in:
1 parent
608117085a
commit
fecc825e66
1 file changed
+7
@@ -1003,6 +1003,13 @@ void GenerateFragmentShader(char *buffer) {
|
||||
WRITE(p, " %s = vec4(1,0,1,1);\n", fragColor0);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (true) {
|
||||
WRITE(p, " highp float z = gl_FragCoord.z;\n");
|
||||
WRITE(p, " z = (1.0/65535.0) * floor(z * 65535.0);\n");
|
||||
WRITE(p, " gl_FragDepth = z;\n");
|
||||
}
|
||||
|
||||
WRITE(p, "}\n");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user