Munging with viewport stuff. Nasty.
This commit is contained in:
parent
be05ab6ffe
commit
1c068a601d
|
@ -77,21 +77,21 @@ bool GL4Shader::PrepareVertexShader(
|
|||
" // w is not 1/W0. Common case.\n"
|
||||
" w = 1.0 / w;\n"
|
||||
" }\n"
|
||||
" if (state.vtx_fmt.x == 0.0) {\n"
|
||||
" if (state.vtx_fmt.x != 0.0) {\n"
|
||||
" // Need to multiply by 1/W0.\n"
|
||||
" pos.xy /= w;\n"
|
||||
" pos.xy *= w;\n"
|
||||
" }\n"
|
||||
" if (state.vtx_fmt.z == 0.0) {\n"
|
||||
" if (state.vtx_fmt.z != 0.0) {\n"
|
||||
" // Need to multiply by 1/W0.\n"
|
||||
" pos.z /= w;\n"
|
||||
" pos.z *= w;\n"
|
||||
" }\n"
|
||||
" pos.w = 1.0;\n"
|
||||
" pos.w = w;\n"
|
||||
" // Perform clipping, lest we get weird geometry.\n"
|
||||
// TODO(benvanik): is this right? dxclip mode may change this?
|
||||
" if (pos.z < gl_DepthRange.near || pos.z > gl_DepthRange.far) {\n"
|
||||
" // Clipped! w=0 will kill it in the hardware persp divide.\n"
|
||||
" pos.w = 0.0;\n"
|
||||
" }\n"
|
||||
//" if (pos.z < gl_DepthRange.near || pos.z > gl_DepthRange.far) {\n"
|
||||
//" // Clipped! w=0 will kill it in the hardware persp divide.\n"
|
||||
//" pos.w = 0.0;\n"
|
||||
//" }\n"
|
||||
" // NDC transform.\n"
|
||||
" pos.x = pos.x * state.viewport_scale.x + \n"
|
||||
" state.viewport_offset.x;\n"
|
||||
|
|
Loading…
Reference in New Issue