Move worldpos into it's own varying.

Previously it was packed into spare slots in clippos.xy and normal.w,
but it's ugly and more importantly it's causing bugs.

This was discovered during the debugging of a zfreeze branch, which
expected clippos.xy to be xy position coordinates in clipspace (as
the name suggested).

Turns out the stereoscopy shader had also run into this trap, modifying
clippos.x (introducing errors with per-pixel lighting).

This commit has been moved outside of the zfreeze PR for fast merging.
This commit is contained in:
Scott Mansell
2015-01-03 01:44:04 +13:00
parent 9c6795c7b7
commit 1b771deb56
4 changed files with 24 additions and 8 deletions

View File

@ -219,7 +219,6 @@ static inline void GenerateGeometryShader(T& out, u32 primitive_type, API_TYPE A
// the depth value. This results in objects at a distance smaller than the convergence
// distance to seemingly appear in front of the screen.
// This formula is based on page 13 of the "Nvidia 3D Vision Automatic, Best Practices Guide"
out.Write("\tf.clipPos.x += " I_STEREOPARAMS"[eye] * (f.clipPos.w - " I_STEREOPARAMS"[2]);\n");
out.Write("\tf.pos.x += " I_STEREOPARAMS"[eye] * (f.pos.w - " I_STEREOPARAMS"[2]);\n");
}