mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 13:20:27 -06:00
VertexShaderGen: Use reversed depth range.
This commit is contained in:
@ -387,9 +387,12 @@ void VertexShaderManager::SetConstants()
|
||||
constants.pixelcentercorrection[0] = pixel_center_correction * pixel_size_x;
|
||||
constants.pixelcentercorrection[1] = pixel_center_correction * pixel_size_y;
|
||||
|
||||
// The depth range is handled in the vertex shader.
|
||||
// The depth range is handled in the vertex shader. We need to reverse
|
||||
// the far value to get a reversed depth range mapping. This is necessary
|
||||
// because we have the most precision at the near plane, while the console
|
||||
// has the most percision at the far plane.
|
||||
constants.pixelcentercorrection[2] = xfmem.viewport.zRange / 16777215.0f;
|
||||
constants.pixelcentercorrection[3] = xfmem.viewport.farZ / 16777215.0f;
|
||||
constants.pixelcentercorrection[3] = 1.0f - xfmem.viewport.farZ / 16777215.0f;
|
||||
|
||||
dirty = true;
|
||||
// This is so implementation-dependent that we can't have it here.
|
||||
|
Reference in New Issue
Block a user