mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
OGL: Depth range inversion.
This commit is contained in:
@ -380,6 +380,10 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
||||
//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
|
||||
if (g_ActiveConfig.backend_info.bSupportsClipControl)
|
||||
{
|
||||
out.Write("o.pos.z = -o.pos.z;\n");
|
||||
}
|
||||
else if (api_type == API_D3D)
|
||||
{
|
||||
out.Write("o.pos.z = o.pos.w + o.pos.z;\n");
|
||||
}
|
||||
@ -387,7 +391,7 @@ static inline void GenerateVertexShader(T& out, u32 components, API_TYPE api_typ
|
||||
{
|
||||
// this results in a scale from -1..0 to -1..1 after perspective
|
||||
// divide
|
||||
out.Write("o.pos.z = o.pos.w + o.pos.z * 2.0;\n");
|
||||
out.Write("o.pos.z = o.pos.z * -2.0 - o.pos.w;\n");
|
||||
|
||||
// the next steps of the OGL pipeline are:
|
||||
// (x_c,y_c,z_c,w_c) = o.pos //switch to OGL spec terminology
|
||||
|
Reference in New Issue
Block a user