Jump to content
  • Advertisement
Sign in to follow this  
Christoph

Triangle Strip Culling

This topic is 5123 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

Hi, a probably simple question: given is a the following vertex group: v1 v3 v5 | /| /| |/ |/ | v2 v4 v6 it is rendered using a triangle strip. I wonder why DirectX doesn't cull some of the triangles, because not all of them are clockwise. v1, v2, v3 are counterclockwise. v2, v3, v4 are clockwise. v3, v4, v5 are counterclockwise and so on... How does DirectX order the vertices in a triangle strip so that it does not have to cull away half of the triangles? thx

Share this post


Link to post
Share on other sites
Advertisement
In order for stripping to work, the culling order toggles each triangle. The 1st, 3rd, 5th, etc. are one winding order. 2nd, 4th, 6th, etc. are in the opposite winding order.

Also, if you're ever calculating normals from tri-strip face data you should be aware that the normal will keep flipping.

Share this post


Link to post
Share on other sites
Correct, and the first triangle defines the order. So, if you set DirectX up to cull out clockwise and start your triangle strip in a clockwise direction (by making the first triangle clockwise), the entire strip will be culled. If you make the first triangle counter-clockwise, the entire strip will be rendered.

Chris

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!