Archived

This topic is now archived and is closed to further replies.

Jansic

Obscure missing triangles with bright colours.

Recommended Posts

Hi, I''ve got a question about obscure gl behaviour and am at a loss for solutions. I have a medium-sized mesh of trangle fans, plain, unshaded, untextured. These fans can be drawn using glBegin/glVertex/glEnd or by calling glDrawElements (the result is the same in either case). If I set the vertex colours to _any_ colour (as long as it''s not bright white) when I draw the mesh then everything turns out mostly ok. If, however, I use bright white (or colours very near to white) (i.e. glColor3f(1,1,1)) then I get a very strange triangle popping/flickering effect; where random vertices in my triangle fans flicker toward some random point in space. The triangles aren''t actually _disappearing_, just triangulating with some common point. I''m running a nVidia Geforce 2 GTS on Win32, and initially thought it was a driver problem, but I''ve incrementally rolled back several driver revisions (44.03 -> 40.41) to no avail. Annoyingly, if I boot into Linux, and run almost exactly the same code, this effect doesn''t happen. Nor does this effect happen in OpenGL games (either OS). Has anybody seen/experienced/fixed such a strange effect before??? Any help greatly appreciated. Jans.

Share this post


Link to post
Share on other sites
If the problem is what I think it is, then yes, Ive seen the problem myself.

I was creating a tesselated filed for a terrain, and sometimes, at certain number of subdevisions, I would get the effect you re describing. I have no idea whats causing it, or how to make it go away.

Im using a TNT2 btw.

Share this post


Link to post
Share on other sites
quote:
Original post by Jansic

The triangles aren't actually _disappearing_, just triangulating with some common point.

Jans.





Isn't this what a triangle fan does ??? A screen shot would be very helpful, and maybe the relevant portion of code.

[edited by - jeffno10 on July 8, 2003 4:42:01 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by Jeffno10
Isn't this what a triangle fan does ??? A screen shot would be very helpful, and maybe the relevant portion of code.



Yes, that's what a triangle fan does, what I'm saying is that triangles from _other_ fans are randomly connecting themselves to the same random point; but _only_ when they're coloured white.

A screenshot is hard to get at the moment as I'm at work (miles away from the code)

The general gist of the code goes something like:


// For all fans

CVertex3 *pVertices = /*start of this fan's vertices*/;
INT32 *pIndices = /*start of this fan's indices*/;
::glBegin(GL_TRIANGLE_FAN)
::glColor3f(1,1,1); // happens only using this colour

for (loop=0 to 10 exclusive)
::glVertex3f(pVertices[pIndices[loop]].x,
pVertices[pIndices[loop]].y,
pVertices[pIndices[loop]].z);
::glEnd();


Doesn't matter how simple I make the source it still happens, I need only draw one triangle of each fan to cause the effect.

Jans.



[edited by - jansic on July 8, 2003 5:21:01 AM]

Share this post


Link to post
Share on other sites
For those even remotely interested...

http://www.cathelius.co.uk/temp/broken.zip

and

http://www.cathelius.co.uk/temp/better.zip

Two screen captures (avi''s) of the two situations, and the offending line of code in view...

Waaaah.

Jans.

Share this post


Link to post
Share on other sites