Display List Problem

Started by
6 comments, last by shane1985 18 years, 8 months ago
I'm getting some strange results when trying to render some simple terrain using display lists. When I just render the triangle strips immediately, I get this, which is how it should look. On the other hand, when I use display lists for the same exact data, it looks like this. Notice the extra two horizontal lines where it almost seems like it continues the triangle strips. Has anyone run into this problem before? If you need code I'll post it, but it is basically just 4 triangle strips rendered horizontally. Thanks -Shane
Advertisement
It seems you had not 'cut' the triangle strip when reached the end of the run so the new run (triangles on the same row) begin with a vertex of the previous row.
You must render each run in separate blocks

begin(GL_TRIANGLE_STRIP){  row i}endbegin(GL_TRIANGLE_STRIP){  row i+1}end

But that is how I'm doing it already, and it works fine in immediate mode.

Here are the rendering calls:
glBegin(GL_TRIANGLE_STRIP);	glVertex3f(0,5,0);	glVertex3f(0,4,1);	glVertex3f(1,5,0);	glVertex3f(1,0,1);	glVertex3f(2,4,0);	glVertex3f(2,0,1);	glVertex3f(3,4,0);	glVertex3f(3,4,1);	glVertex3f(4,5,0);	glVertex3f(4,2,1);glEnd();glBegin(GL_TRIANGLE_STRIP);	glVertex3f(0,4,1);	glVertex3f(0,5,2);	glVertex3f(1,0,1);	glVertex3f(1,5,2);	glVertex3f(2,0,1);	glVertex3f(2,1,2);	glVertex3f(3,4,1);	glVertex3f(3,3,2);	glVertex3f(4,2,1);	glVertex3f(4,1,2);glEnd();glBegin(GL_TRIANGLE_STRIP);	glVertex3f(0,5,2);	glVertex3f(0,5,3);	glVertex3f(1,5,2);	glVertex3f(1,1,3);	glVertex3f(2,1,2);	glVertex3f(2,2,3);	glVertex3f(3,3,2);	glVertex3f(3,3,3);	glVertex3f(4,1,2);	glVertex3f(4,0,3);glEnd();glBegin(GL_TRIANGLE_STRIP);	glVertex3f(0,5,3);	glVertex3f(0,3,4);	glVertex3f(1,1,3);	glVertex3f(1,0,4);	glVertex3f(2,2,3);	glVertex3f(2,2,4);	glVertex3f(3,3,3);	glVertex3f(3,3,4);	glVertex3f(4,0,3);	glVertex3f(4,4,4);glEnd();


Added source tags, please look at the forum FAQ to for details about the tags in use on this board

[Edited by - phantom on August 15, 2005 9:24:13 PM]
I know this sounds stupid, but did you check to make sure they are the exact same calls in the display list. I have never seen a display list change any data ever. Any time I use them, they do the exact same thing, only faster. If you already did and they match, ignore this post.


Yeah, actually it's the same exact code - if I set COMPILE_AND_EXECUTE, and then call the function that generates the list every frame, it works. If I just compile, and then call the list every frame, it doesn't.
So I'm stumped.
Anyone have any ideas?
If I put each triangle strip in it's own display list (right now all four are in one) it also works. For some reason when I put multiple triangle strips in the same list I get the shown effect.

What could cause this?
-Shane
Never seen strange results with disp lists.
A driver problem?
Well, maybe there's some other way to do it.

If I compile multiple display lists into one, would it run at the same speed?
Because if I put each strip into its own list, and then make another list that hierarchicly calls the base lists, it works fine.

Anyone have any ideas?
-Shane

This topic is closed to new replies.

Advertisement