Jump to content

  • Log In with Google      Sign In   
  • Create Account


What is the point of using Catmull-Clark subdivision shaders?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 mrheisenberg   Members   -  Reputation: 356

Like
0Likes
Like

Posted 26 January 2013 - 06:15 AM

I've been checking out demos of Catmull-Clark subdivisions implemented with DX11 tessellation,however I don't understand what exactly is the benefit of this technique.The visual effects are identical to the simpler,basic dynamic-LOD-tessellation shaders in the samples,yet the Catmull-Clark samples are a LOT heavier on performance.What am I missing?



Sponsor:

#2 Hodgman   Moderators   -  Reputation: 28645

Like
1Likes
Like

Posted 26 January 2013 - 07:27 AM

I'm not that familiar with the samples, but they're probably just implementing "linear" tesselation, where more triangles are added, but they don't curve at all to better match the curved surface that's roughly defined by their 'source' triangles. This is useful when you need extra vertices for something like displacement mapping, but not for smoothing out edges.


Catmull-Clark subD surfaces add curvature to the generated "sub triangles", e.g. on the Wikipedia page, you can see a cube bulge out into a sphere. The artist has control over how/where this "bulging" will occur.

Also, these surfaces and their behaviours are programmed into many 3D modelling packages, so if you implement them in the exact same way, then an artist working with Max/Maya/Blender/Softimage/etc can tweak their "bulge"/"smooth" parameters to get the kind of shape that they want, and then know it's actually going to appear that way in the engine too.


Edited by Hodgman, 26 January 2013 - 07:28 AM.


#3 Krypt0n   Crossbones+   -  Reputation: 2358

Like
1Likes
Like

Posted 26 January 2013 - 09:34 PM

actually, the artist have barely control over where bulging etc. happens, if you look for it on the net, you'll see that a lot of beginner artist wonder how they can control it. e.g. if you have a cylinder and you tessellate it with catmull-clark to make it rounder, you will end up with a capsule shape. some editing packages add extensions where artist can define hard borders, but most work-arounds for the original algorithm are to add two borders on edges you want to preserve to some degree (beveling in 3ds max), but you still get some smoothing at them.

but that's actually what makes catmull clark so nice and why artist who worked with the pure version, don't like the tools that extend it. if you have some nurb surfaces or bezier patches or ..., artist have to tweak them, and if you have an animated mesh, you have to tweak those control points in every keyframe, which makes it quite a lot of work. catmull clark meshes just work, they deliver mostly the expected result, they have no control points to skin with the mesh or to adjust. you tessellate an object, it looks nice, you apply a displacement texture and that's it. and while other algorithms usually get into trouble when you vary in the valence of your polys, catmull clark also works nicely in those special cases.

 

I also think you haven't seen a DX11 tessellation implementation of catmull clark, the tessellator hardware of dx11 cannot really be used for catmull clark as catmull clark is a recursive approach. there are ways to make it none-recursive, but the higher the tessellation factor, the more of the mesh you evaluate, it's not doable beyond some simple shapes. you've probably seen some approximation of catmull clark using e.g. bezier patches. but those are quite complex and error prone to implement and you need to run them on every animation step of a mesh, to re-create the approximation (at least that's what I've read in the papers when I was implementing it).

 

however, it's quite straight forward to implement catmull clark via compute. it's actually really nice for GPUs, working on every vertex independently etc.

http://twitpic.com/3ud6cx

:)



#4 Hodgman   Moderators   -  Reputation: 28645

Like
0Likes
Like

Posted 27 January 2013 - 04:59 AM

actually, the artist have barely control over where bulging etc. happens

I've never modelled anything with catmull-clark surfaces -- is the tesselation shape dependent only on the vertex positions and normals, like phong tesselation?

#5 JoeJ   Members   -  Reputation: 199

Like
3Likes
Like

Posted 27 January 2013 - 07:27 AM



actually, the artist have barely control over where bulging etc. happens

I've never modelled anything with catmull-clark surfaces -- is the tesselation shape dependent only on the vertex positions and normals, like phong tesselation?
Normals are ignored. The new points are build by averaging neighbouring polygon centers, edge centers, vertices... The different rules for subdivided corner points / edge-, poly-centers are simple, but because the process is recursive, it's difficult to accelerate.

I've done a lot of modeling with catmull clark and also made my own editor because i was not happy with crease options from commercial apps.
For modeling organic shapes catmull clark is the best option. With proper creases it's also a very good alternative to nurbs for things like cars etc., while still easier to understand.
Cons are: You need to avoid triangles and use regular quad grids whenever possible. A good model will end up with mostly quads, some 5 sided and a few 6 sided polygons.
Subdividing a typical triangulated mesh makes no sense - you need to have the original quadbased model to get good results.

The first subdivision step is special, it does the most important work and ends up with a mesh containing quads only.
For a good HW-acceleration it gives sense to do it with its own algorithm, maybe on CPU.
For following steps it could give sense to switch to a more hardware friendly method, like bezier patches.

If anyone has experience with practical HW-acceleration i would like to hear something about it too...
Note that this can be a very good thing, because if you do the skinning with the low res control mesh, you get MUCH better final high res skinning! This also saves some work, as you don't need to skin the subdivided stuff.

Skinning is where difference to other tesselation methods shows up most noticeably. Because the corner vertices get smoothed too, not just the surface around them. Maybe it's hard for a programmer to get the point why they are so good compared th other methods - but with skinning the difference in visual quality is really huge. Trust me :)

Edited by JoeJ, 27 January 2013 - 08:31 AM.


#6 Krypt0n   Crossbones+   -  Reputation: 2358

Like
2Likes
Like

Posted 28 January 2013 - 09:36 AM

Hodgman

JoeJ pretty much hits the spot :)

just to emphasize it, while just positions are taken and it sounds like you loose a lot of informations (e.g. curvature that normals might express), it's actually the really good point of the algorithm, it is very very simple, you know what to expect, every implementation will lead to the same result (if you try to get some data from one modeling package to the other, tessellated stuff can be a horror, while catmull-clark basically is just an obj mesh, no extra features/data).

 

If anyone has experience with practical HW-acceleration i would like to hear something about it too...
Note that this can be a very good thing, because if you do the skinning with the low res control mesh, you get MUCH better final high res skinning! This also saves some work, as you don't need to skin the subdivided stuff.

you mean the tessellator on GPU? I've used it to implement an approximation described in this paper: http://faculty.cs.tamu.edu/schaefer/research/acc.pdf

 

as I said in my first post here, the sad thing comes with animation, I had to evaluate the skinned mesh every time, to generate those patches and to make it leak-free is quite an effort, nothing compared to the simplicity and beauty of catmull-clark tessellation.

 

 

Skinning is where difference to other tesselation methods shows up most noticeably. Because the corner vertices get smoothed too, not just the surface around them. Maybe it's hard for a programmer to get the point why they are so good compared th other methods - but with skinning the difference in visual quality is really huge. Trust me smile.png

I totally agree, that's why I've made the GPGU version of it, it works flawlessly with skinned characters, it's fast even in the cpu version (vectorized), you can go crazy to 1Mio vertices, then displace them (also with GPGPU) and it just works. :)

 

Hardware tessellation units are way faster, of course, but even without HW, you can get to a point where the polycount exceeds the pixelcount by far (while you still have normalmaps etc) and it's still running smoothly on average GPUs.



#7 JoeJ   Members   -  Reputation: 199

Like
0Likes
Like

Posted 28 January 2013 - 10:36 AM

Thx for summing up again, that gives a lot of sense to me now. I'm not really up to date with GPU stuff and missed the point that OGL/DX now have their own compute stuff and we can avoid to choose between Cuda or OpenCL :)



#8 Krypt0n   Crossbones+   -  Reputation: 2358

Like
0Likes
Like

Posted 28 January 2013 - 12:02 PM

Thx for summing up again, that gives a lot of sense to me now. I'm not really up to date with GPU stuff and missed the point that OGL/DX now have their own compute stuff and we can avoid to choose between Cuda or OpenCL smile.png

I've actually implemented it in OpenCL.

I've also written an rasterizer in OpenCL (for this renderer) rather than inter-op with OGL/DX ( tho, I have sadly no Catmull+software screenshot, just http://twitpic.com/40e85b ), but abusing the massive compute power for rasterization works actually quite nicely. you setup 1024 triangles into the local memory, then you can work on them in 8x8 pixel granularity, I think I got 10% to 20% of the theoretical peak hardware rasterization performance in a real world scenario. it wasn't even fully optimized, I just stopped when it was fast enough (was just like 2 or 3 days of work to make the rasterizer).






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS