mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-04 15:19:09 +00:00
VideoBackends: Enable depth clamping.
This commit is contained in:
parent
b1ed7e80fb
commit
e9e81ece65
6 changed files with 7 additions and 21 deletions
|
@ -407,10 +407,6 @@ ShaderCode GenerateVertexShaderCode(APIType api_type, const vertex_shader_uid_da
|
|||
// the normal depth range of 0..1.
|
||||
out.Write("o.pos.z = o.pos.w * " I_PIXELCENTERCORRECTION".w + o.pos.z * " I_PIXELCENTERCORRECTION".z;\n");
|
||||
|
||||
// We have to clamp to 2^24 - 1 here, because we map our depth range to 0..2^24 to prevent round-trip errors.
|
||||
// Thus we test for values that will result in 2^24 or higher after the perspective divide.
|
||||
out.Write("if (o.pos.z / o.pos.w >= 1.0) o.pos.z = 16777215.0 / 16777216.0 * o.pos.w;\n");
|
||||
|
||||
// write the true depth value, if the game uses depth textures pixel shaders will override with
|
||||
// the correct values
|
||||
// if not early z culling will improve speed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue