Jump to content
  • Advertisement
Sign in to follow this  
Reitano

Tool or algorithm for mesh tessellation

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

Recently I switched to logarithmic depth buffer in order to fix depth-fighting artifacts in large scenes. Sadly, while this technique works brilliantly on highly tessellated meshes, it performs poorly on low poly ones. One solution to this issue consists in writing depth from the pixel shader but I'd prefer to avoid it for reasons related to performance and complications to the shader pipeline. Furthermore, I cannot use a floating point depth buffer, as suggested in other threads, as I need the stencil and I want to keep bandwidth and memory consumption down to a minimum.

Most of my 3D models have a high poly count and behave well but some have long big triangles that suffer from obvious depth testing artifacts. I would like to  preprocess them, either using an existing free tool or by writing my own tessellation algorithm. I'm still using DirectX 9 so HW tessellation is not an option yet. Do you know any tool or simple subdivision schemes that would help in this case?

 

Thanks a lot

Share this post


Link to post
Share on other sites
Advertisement

Can't you use a D24S8 depth stencil format? If you want to keep memory consumption low, then I don't see how needlessly adding more detail to meshes would help.

 

A simple subdivision algorithm (basically tension-less Catmull-Clark subdivision):

 

- add a point to the center of every edge 

- add a point to the center of every face (average of all its vertices)

- connect face and edge points

subdiv.png

Share this post


Link to post
Share on other sites

I'm already using a D24S8 depth buffer format with a logarithmic encoding. As explained above, it works brilliantly except for large triangles. My goal is to subdivide only these triangles (based on an area metric), not all triangles of all meshes indiscriminately. Your suggested subdivision scheme seems appropriate and I will try it soon. Are T junctions going to complicate the algorithm ? I vaguely remember an article in a ShaderX book dealing with this topic but can't remember what is was.

Share this post


Link to post
Share on other sites

Are you saying your meshes already contain t-junctions, or are you afraid a subdivision pass might create them? Because you'll want to prevent those to avoid rendering artefacts.

 

You can do adaptive subdivision by creating a triangle-fan on non-subdiv faces that connect to an edge-point on a subdiv face.

 

subdiv2.png

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!