Sign in to follow this  
Reitano

Tool or algorithm for mesh tessellation

Recommended Posts

Reitano    727

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
eppo    4877

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
Reitano    727

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
eppo    4877

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this