Jump to content
  • Advertisement
Sign in to follow this  
Kest

Extra polygon

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

My decal and particle engine use a static index buffer that references in the pattern, 0,1,2,2,1,3, where these values get increased by 4 every 6 indices. I set it up this way to avoid the need to lock the buffer, since all sprites were quads. Now I'm enhancing my decal engine to project onto individual triangles. The clipping routine I'm planning to use will generate a fan pattern set of polygons, which can sometimes create an odd number of triangles, which will cause the static index buffer to mismatch. The number of decals that will be generated like this will usually be small - most will still be planted on a single triangle wall, generating a simple two-triangle quad. I'm unsure of where to go from here. What would the best course of action be? I have a few options in mind.. 1. Generate the entire decal index buffer each frame. 2. Render without making use of an index buffer. 3. Add some type of degenerate triangle for each decal that has an odd number of them. I don't really like any of these options, but I can't come up with a better solution. Anyone have any advice or suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Let me rephrase that question. Which of those three options do you think would be most efficient, assuming that about 10% of my decals had an odd number of triangles?

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!