Lights problem

Started by
12 comments, last by willyx 22 years, 2 months ago
what an awful english
j/k last time I listened to an Italian speaking english, I thought he was speaking Japanese. lol
well, hum, I apologize. back on topic...

You can not use per-pixel lighting. In fact, it is possible but it is either very slow or very very difficult to use.

I agree that if you set texture coordinates with the 4 corners, there''s a problem.
If you split the geometry (like I recommended) you have to define different texture coordinates than 0.0f or 1.0f.

For example :
glNormal3f( 0.0f, 0.0f, 1.0f);
glBegin(GL_QUAD_STRIP);// Draw Our Quad
glTexCoord2f(0.0f, 0.0f); glVertex3f(-Dim, -Dim, LACOSTANTE);
glTexCoord2f(1.0f, 0.0f); glVertex3f(+Dim, -Dim, LACOSTANTE);
glTexCoord2f(0.0f, 0.75f); glVertex3f(-Dim, Dim/2, LACOSTANTE);
glTexCoord2f(1.0f, 0.75f); glVertex3f(+Dim, Dim/2, LACOSTANTE);
glTexCoord2f(0.0f, 1.0f); glVertex3f(-Dim, Dim, LACOSTANTE);
glTexCoord2f(1.0f, 1.0f); glVertex3f(+Dim, Dim, LACOSTANTE);
glEnd();

be careful of the calling order, because these are quad strips and not quads
Advertisement
The best thing to do would be to avoid T-junctions with your polygons.

By T-junctions, I mean where the edges of polys make a T-shape. There should never be an edge touching a vertex. Split the edge!

- Pete
Thanks, I can void the problem in the background tiling, now looks better:

http://www.geocities.com/gnomorinco/Image1.jpg
well done.
and good work for thy... huh... game (I suppose ).

This topic is closed to new replies.

Advertisement