mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
vk/gl: Preserve clamped z precision to some extent
- Use edges of depth range to map clamped stuff Disable range compression on regular draws vs extended range draws - Some applications require full 0-1 usage without compromises. -- TODO: This leaves the extended range z values to fight with regular draws in the .99 - 1.0 range
This commit is contained in:
parent
f908daf323
commit
743928b379
1 changed files with 3 additions and 3 deletions
|
@ -345,11 +345,11 @@ namespace glsl
|
|||
OS << "{\n";
|
||||
OS << " float d = pos.z / pos.w;\n";
|
||||
OS << " if (d < 0.f && d >= near_plane)\n";
|
||||
OS << " d = 0.f;\n";
|
||||
OS << " d = 0.f;\n"; //force clamp negative values
|
||||
OS << " else if (d > 1.f && d <= far_plane)\n";
|
||||
OS << " d = 1.f;\n";
|
||||
OS << " d = min(1., 0.99 + (0.01 * (pos.z - near_plane) / (far_plane - near_plane)));\n";
|
||||
OS << " else\n";
|
||||
OS << " return pos;\n";
|
||||
OS << " return pos; //d = (0.99 * d);\n"; //range compression for normal values is disabled until a solution to ops comparing z is found
|
||||
OS << "\n";
|
||||
OS << " pos.z = d * pos.w;\n";
|
||||
OS << " return pos;\n";
|
||||
|
|
Loading…
Add table
Reference in a new issue