Feedback needed

Started by
9 comments, last by sunhp2 20 years, 3 months ago
Hi,

I tried to fix the zfight on ATI cards.. with a "glPolygonOffset(-1.0, -1.0);".
Since I it seems to never zfight on my nvidia card, i put here a news binary here :

Get the new exe (patch) here

If you use ATI card, could u tell me if that fix the problem plz, many thanks!
The renderer seems to be faster with glDephMask off, and an useless texture binding removed.


Julien Meyer
contact@jadeware.org


Here is the new lightamaping fonction :


void shader_Lightmap(pFace pCurr)
{
int line;
int col;
int i;

if(!pCurr)
return;

glEnable(GL_BLEND);
glBlendFunc(GL_ZERO,GL_SRC_COLOR);
glEnable(GL_TEXTURE_2D);
glEnable(GL_DEPTH_TEST);

gl_BindTexture((int)(txid_LIGHTMAP_N[ + (pCurr->LightID*ONEOVER256)));
line = (int)((pCurr->LightID%256) * ONEOVER16);
col = (pCurr->LightID%256) % 16;

glDepthFunc(GL_LEQUAL);
glDepthMask(GL_FALSE);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0, -1.0);

glBegin(GL_TRIANGLES);
for(i=0 ; i<3 ; i++)
{ glTexCoord2f((pCurr->Vertice.U_lm+col)*ONEOVER16,(pCurr->Vertice.V_lm+line)*ONEOVER16);<br>glVertex3f(pCurr->Vertice.X,pCurr->Vertice.Y,pCurr->Vertice.Z);<br>}<br>glEnd();<br><br>glDisable(GL_POLYGON_OFFSET_FILL);<br>glDepthMask(GL_TRUE);<br>glDepthFunc(GL_LESS);<br><br>glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);<br>glDisable(GL_BLEND);<br>}<br> </i> <br><br><SPAN CLASS=editedby>[edited by - sunhp2 on January 8, 2004 3:49:33 PM]</SPAN>

This topic is closed to new replies.

Advertisement