Display List Problem
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
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
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:
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]
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?
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
What could cause this?
-Shane
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement