Jump to content
  • Advertisement
Sign in to follow this  
shane1985

Display List Problem

This topic is 4839 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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
}
end

begin(GL_TRIANGLE_STRIP){
row i+1
}
end


Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!