Search
lxdream.org :: lxdream/src/pvr2/rendcore.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/pvr2/rendcore.c
changeset 331:a6048d3a9a79
prev322:354407942957
next338:8c68d9097846
author nkeynes
date Fri Jan 26 01:37:39 2007 +0000 (13 years ago)
permissions -rw-r--r--
last change Z should be rendered as 1/Z - fixes a host of depth issues
file annotate diff log raw
1.1 --- a/src/pvr2/rendcore.c Thu Jan 25 08:18:03 2007 +0000
1.2 +++ b/src/pvr2/rendcore.c Fri Jan 26 01:37:39 2007 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: rendcore.c,v 1.13 2007-01-25 08:18:03 nkeynes Exp $
1.6 + * $Id: rendcore.c,v 1.14 2007-01-26 01:37:39 nkeynes Exp $
1.7 *
1.8 * PVR2 renderer core.
1.9 *
1.10 @@ -250,9 +250,9 @@
1.11 (unpacked[3].y - unpacked[1].y) * diff1.x) / detxy;
1.12 float s = ((unpacked[3].y - unpacked[1].y) * diff0.x -
1.13 (unpacked[3].x - unpacked[1].x) * diff0.y) / detxy;
1.14 - diff0.z = unpacked[0].z - unpacked[1].z;
1.15 - diff1.z = unpacked[2].z - unpacked[1].z;
1.16 - unpacked[3].z = unpacked[1].z + (t*diff0.z) + (s*diff1.z);
1.17 + diff0.z = (1/unpacked[0].z) - (1/unpacked[1].z);
1.18 + diff1.z = (1/unpacked[2].z) - (1/unpacked[1].z);
1.19 + unpacked[3].z = 1/((1/unpacked[1].z) + (t*diff0.z) + (s*diff1.z));
1.20
1.21 diff0.u = unpacked[0].u - unpacked[1].u;
1.22 diff0.v = unpacked[0].v - unpacked[1].v;
1.23 @@ -298,7 +298,7 @@
1.24 vertexes[i]->offset_rgba[1],
1.25 vertexes[i]->offset_rgba[2] );
1.26 }
1.27 - glVertex3f( vertexes[i]->x, vertexes[i]->y, vertexes[i]->z );
1.28 + glVertex3f( vertexes[i]->x, vertexes[i]->y, 1/vertexes[i]->z );
1.29 }
1.30
1.31 glEnd();
1.32 @@ -353,7 +353,7 @@
1.33 glSecondaryColor3ubEXT( (GLubyte)(spec >> 16), (GLubyte)(spec >> 8),
1.34 (GLubyte)spec );
1.35 }
1.36 - glVertex3f( vertexf[0], vertexf[1], vertexf[2] );
1.37 + glVertex3f( vertexf[0], vertexf[1], 1/vertexf[2] );
1.38 vertexes += vertex_size;
1.39 }
1.40
1.41 @@ -613,5 +613,5 @@
1.42
1.43 } while( ((segment++)->control & SEGMENT_END) == 0 );
1.44
1.45 - return maximumz;
1.46 + return 1/maximumz;
1.47 }
.