Opengl and D3D are doing the perspective division differently

Thanks to glennricster for catching this.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@6061 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
pierre 2010-08-05 23:04:34 +00:00
parent d5d7beb6c7
commit 92b180b71f
1 changed files with 5 additions and 1 deletions

View File

@ -465,7 +465,11 @@ const char *GenerateVertexShaderCode(u32 components, API_TYPE api_type)
//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 (is_d3d) {
WRITE(p, "o.pos.z = "I_DEPTHPARAMS".x * o.pos.w + o.pos.z * "I_DEPTHPARAMS".y;\n");
} else {
WRITE(p, "o.pos.z = "I_DEPTHPARAMS".x * o.pos.w + o.pos.z * "I_DEPTHPARAMS".y * 2.0f;\n");
}
WRITE(p, "return o;\n}\n");