سؤال

I have the need to replicate GPU tessellation on the CPU (ie get the same uvw coordinates on the CPU side as I will get on the GPU from the tessellator). The reason for this is rather complicated, but simply put I have an algorithm that stores data per tessellation point, and to calculate it in the first place I need the uvw coordinates on the CPU.

I have googled a lot for the exact details of the tessellation pattern, but I only find very vague texts speaking about it in a general nature, the best one being this one: http://fgiesen.wordpress.com/2011/09/06/a-trip-through-the-graphics-pipeline-2011-part-12/

Is the reason for the lack of texts on this that it's vendor dependent, or have I simply not found the not found the right page?

I'm interested in texts both on the OpenGL and DX11 implementation, if they differ.

هل كانت مفيدة؟

المحلول

I was also very interested by tessellation, and specifically subdivision surfaces some time ago. This is a very complicated topic. It was researched from early 70th and it's still in research.

It isn't clear if you want to re-implement whole shader tessellation pipeline (which I think will take years for a single programmer) or just a single subdivision algorithm (or even algorith that isn't subdivision).

Anyway, there is some links about subdivision:

Theory

Typically we implement subdivision surfaces in tessellation shaders using Catmull–Clark subdivision surface algorithm. You can find some papers from original authors in Google. There is main one:

"Recursively generated B-spline surfaces on arbitrary topological meshes" (year 1978, PDF)

Closer to code

Check papers of those cool guys from Microsoft Research:

Even more closer to code.

You can find some libraries on the web. When I searched a while ago, there was a dozen of libs, that implemented subdivision on CPU. I didn't look they much, because I was interested in GPU implementation. The keyword for search is "subdivision lib" =)

The most interesting one is Pixar's OpenSubdiv. Take a look at their code.

Also look at "NVIDIA Instanced Tessellation" Sample (DirectX, OpenGL). They've implemented tessellation pipelne in Vertex and Geometry shaders.

Hope it helps!

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top