Hacky fix for ortho projections
This commit is contained in:
parent
8add817086
commit
5407e9643e
12
GL/draw.c
12
GL/draw.c
|
@ -1173,10 +1173,14 @@ GL_FORCE_INLINE void divide(SubmissionTarget* target) {
|
||||||
vertex->xyz[0] *= f;
|
vertex->xyz[0] *= f;
|
||||||
vertex->xyz[1] *= f;
|
vertex->xyz[1] *= f;
|
||||||
|
|
||||||
/* We have to use 1/z instead of reusing 1/w from above because
|
/* FIXME: OK, so. This is using 1/w as Z. Which is great for perspective projections
|
||||||
* orthographic projections always product a W == 1 and so would not
|
* but absolutely broken for orthographic ones (because all Z values end up with 1.0).
|
||||||
* correctly render ordered transparent surfaces */
|
* To fix this, we need to switch to 1/z *BUT* that breaks clipping as it's currently
|
||||||
vertex->xyz[2] = MATH_Fast_Invert(vertex->xyz[2]);
|
* written... I'm not sure why.
|
||||||
|
* Also, switching to 1/z results in coordinates between -1 and 1 (well, inf) and Z
|
||||||
|
* coordinates *MUST* be > 0.0f to render on the PVR. So we'll need to make use
|
||||||
|
* of glDepthRange when that happens */
|
||||||
|
vertex->xyz[2] = f;
|
||||||
|
|
||||||
/* FIXME: Consider taking glDepthRange into account. PVR is designed to use 1/w
|
/* FIXME: Consider taking glDepthRange into account. PVR is designed to use 1/w
|
||||||
* which is unlike most GPUs - this apparently provides advantages.
|
* which is unlike most GPUs - this apparently provides advantages.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user