Jump to content
  • Advertisement
Sign in to follow this  
avocados

interrupt GL_TRIANGLE_STRIP w/o glEnd

This topic is 3079 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 thought I read that if two consecutive points are the same or if a triangle has 0 surface area that it breaks the strip.

I'm rendering a heightmap. Do I have to use glMultiDrawElements to draw rows of strips or is there some way to use the trick I'm describing?

[Edited by - avocados on July 11, 2010 4:35:16 AM]

Share this post


Link to post
Share on other sites
Advertisement
Hi,

What you'll want to use for rendering heightmaps are degenerate triangles. Essentially, you have one long triangle strip to define the whole landscape, using "triangles" of 0 area to handle new rows. That should get you started; see Google.

-G

Share this post


Link to post
Share on other sites
Better again, don't use strips at all. Use GL_TRIANGLES and indexes and it won't matter whether or not triangles are connected.

Share this post


Link to post
Share on other sites
GL_TRIANGLES would triple the indices unnecessarily. I have read that the last 10 or 20 transformed vertices are cached so maybe that greater index size is the only inefficiency.

http://www.opengl.org/wiki/Vertex_Specification#Primitive_Restart
This seems to be perfect for what I need in the heightmap but it crashes w/ GLEW 1.5.4 for me.

http://www.mathwords.com/d/degenerate.htm
This is good.

[Edited by - avocados on July 13, 2010 2:47:50 AM]

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!