Sign in to follow this  
IronNerd

OpenGL Real-Time Tessellation Techniques of Note?

Recommended Posts

IronNerd    112

I've been working on learning OpenGL 4.3 tessellation and compute shaders for a while now.  In the process, I've been learning and implementing several different tessellation techniques for meshes (tri+quad).  When I'm done, I plan on writing an article which compares their relative merits and possibly implementation guides for some of the less straightforward methods.  I've implemented a couple, am working on more, and would like further suggestions.

 

So Far:

If anybody can think of more techniques or variants of note, please let me know so I can add them to my list.  I'm especially interested in techniques that have seen or are likely to see use in real games.

Edited by IronNerd

Share this post


Link to post
Share on other sites
FreneticPonE    3294

Never seen anyone actually use Catmull/Clark, and there are good reasons not to. Phong tesselation is basically a useless smoothing hack that most artists I know despise "you're ruining my model, what are you doing!" Same with PN from what I'm looking at.

 

Displacement maps are almost always what's used, as far as such things are used anyway (just getting started relatively). They give artists full control (small imprecisions aside) and thus is the most useful thing to do for most situations. Artists want people to see what they themselves are looking at in Z-Brush or whatever modeling program they use, and they don't want to have to guess what some bloated smoothing thing is going to do to their carefully sculpted models.

Edited by Frenetic Pony

Share this post


Link to post
Share on other sites
Sock5    162

Never seen anyone actually use Catmull/Clark, and there are good reasons not to. Phong tesselation is basically a useless smoothing hack that most artists I know despise "you're ruining my model, what are you doing!" Same with PN from what I'm looking at.

 

Displacement maps are almost always what's used, as far as such things are used anyway (just getting started relatively). They give artists full control (small imprecisions aside) and thus is the most useful thing to do for most situations. Artists want people to see what they themselves are looking at in Z-Brush or whatever modeling program they use, and they don't want to have to guess what some bloated smoothing thing is going to do to their carefully sculpted models.

Could you share your impressions with tessellation performance and scaling?I haven't fully integrated it yet into my engine, since I fear it might really hurt me, aspecially when I need multiple geometry passes.Then again I'm doing it on an old laptop, maybe the newer desktops have better tessellation units that can cope with this kind of stuff.Still, it "burns" me in the brain.

I found this on another topic http://www.freepatentsonline.com/7639252.pdf it seems really efficient for the actual tessellation part, however the displacement always kills my performance when I experiment with it.

Share this post


Link to post
Share on other sites
Dawoodoz    461

If the model editor can preview the result while editing (like my own editor), normal based tessellation is not so terrible since it feels like drawing triangle patches and only require geometry shaders on DirectX 10 hardware.

Share this post


Link to post
Share on other sites
galop1n    937

To me the next standard for characters, weapons and important landmark will be catmull-clark with this solution :

 

http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf with this update for crease edges http://research.microsoft.com/en-us/um/people/cloop/EG2012.pdf

 

This is the research and fundation of the opensubdiv initiative from pixar ( open subdiv do not yet have everything done, but the paper is enough to write your own implementation ).

Share this post


Link to post
Share on other sites
Hodgman    51234

"you're ruining my model, what are you doing!"
Artists want people to see what they themselves are looking at in whatever modeling program they use, and they don't want to have to guess what some bloated smoothing thing is going to do to their carefully sculpted models.

This is a workflow issue rather than a problem with any particular technique. The artists need to have these tesselation options available in their modeling tools, and an exact implementation in the engine too. Then if they model something using catmull-Clark surfaces, it will just work, and look exactly as they expect.

You simply can't take a low-poly model and tesselate it while retaining the artists ideas, in general. They need to have this expressive control, either by directl modeling with some flavour(s) of subdiv surfaces, or by giving you a high-poly 'target' model.

Share this post


Link to post
Share on other sites
IronNerd    112

http://research.microsoft.com/en-us/um/people/cloop/tog2012.pdf with this update for crease edges http://research.microsoft.com/en-us/um/people/cloop/EG2012.pdf

Thanks!  I'm working on an implementation of the first paper (and know about opensubdiv), but didn't realize that they had expanded upon it.  I'll have to read that paper tonight.  Do you know of any further research in that area?

 

You simply can't take a low-poly model and tesselate it while retaining the artists ideas, in general. They need to have this expressive control, either by directl modeling with some flavour(s) of subdiv surfaces, or by giving you a high-poly 'target' model.

When I do my final evaluation of each scheme, I should probably look at which ones are supported in modeling software and how hard it would be to add support for the ones that aren't.

Share this post


Link to post
Share on other sites
MJP    19755

So far tessellation uptake is extremely low. This is both because of low hardware penetration (it's not available on a console yet, most PC users don't have a DX11-level GPU) and because it's both expensive and difficult to use effectively. PN Triangles and Phong tessellation are pretty similar, and aren't terribly useful. They can improve the look of certain organic shapes but they require a lot of tuning to get right, and possibly per-vertex parameters. I haven't heard of anybody even being interested in Catmull-Clark or subdivision surfaces in general. It's not a good match for existing artist workflow, and you Catmull-Clark surfaces can't even be fully implemented on DX11 hardware since the algorithm is recursive. Displacement mapping is probably the most useful on paper, but in practice it has a lot of issues that need to be worked around. Avoiding cracks at UV seams is particularly expensive, since you need to guarantee consistent tessellation factors across all adjacent patches.

There are also some special-case situations where tessellation can be used (terrain, water, and hair come to mind) but I'm guessing that you're interested in that?

Edited by MJP

Share this post


Link to post
Share on other sites
lipsryme    1522

I thought PN triangle tesselation was quite useful for characters ? At least crytek has been using it in their engine for characters (or at least their heads wink.png ) afaik.

In my own little test it also seemed to look quite nice. The only problem I had was cracks. Had to disable it and haven't picked up on that since then...so I'd also be interested to know why it fails in your opinions ?

Share this post


Link to post
Share on other sites
IronNerd    112

So far tessellation uptake is extremely low. This is both because of low hardware penetration (it's not available on a console yet, most PC users don't have a DX11-level GPU) and because it's both expensive and difficult to use effectively. PN Triangles and Phong tessellation are pretty similar, and aren't terribly useful. They can improve the look of certain organic shapes but they require a lot of tuning to get right, and possibly per-vertex parameters. I haven't heard of anybody even being interested in Catmull-Clark or subdivision surfaces in general. It's not a good match for existing artist workflow, and you Catmull-Clark surfaces can't even be fully implemented on DX11 hardware since the algorithm is recursive. Displacement mapping is probably the most useful on paper, but in practice it has a lot of issues that need to be worked around. Avoiding cracks at UV seams is particularly expensive, since you need to guarantee consistent tessellation factors across all adjacent patches.

There are also some special-case situations where tessellation can be used (terrain, water, and hair come to mind) but I'm guessing that you're interested in that?

I'm mostly interested in it as a thesis area.  So long as I can assume that the general PC user will have it in 5 years, its fair game on my end.  I'm beginning to notice why Phong and PN tessellation aren't well liked.  It seems like they may have a place, but they aren't very general purpose.

 

Catmull-Clark surfaces (and many other subdivision schemes) converge to an analytically obtainable limit surface which can be represented as a network of bicubic bezier patches. The "Feature Adaptive GPU Rendering of Catmull-Clark Subdivision Surfaces" and "Ef?cient Evaluation of Semi-Smooth Creases in Catmull-Clark Subdivision Surfaces" papers address their realtime performance quite well and it looks fairly promising.  I'm admittedly not familiar enough with render budgets to know how good 1-2ms is for a car, but it seems good enough to me.  My only comparison point right now is 3.4ms on the same model card for Valve's displacement mapped monster frog model; a rather unfair comparison.

 

I've been looking into eliminating seams in displacement maps recently.  I located a paper (http://lgdv.cs.fau.de/get/1682) which appears to have found an interesting solution.  They eliminate the seams by natively storing the data along with the mesh.  The results look promising to me, but their indexing scheme and cache coherency leave something to be desired.  If I could find a better indexing scheme, it might be well suited for games (as it also solves the swimming problem).  I'd be interested in hearing what you think about it.

 

I'm actually interested in basically every use of tessellation in games right now, though I have started with surfaces.  If you could point me to any good sources for terrain, water, or hair, that would be awesome :)

 

I thought PN triangle tesselation was quite useful for characters ? At least crytek has been using it in their engine for characters (or at least their heads wink.png ) afaik.

In my own little test it also seemed to look quite nice. The only problem I had was cracks. Had to disable it and haven't picked up on that since then...so I'd also be interested to know why it fails in your opinions ?

That does seem to be one of the better uses for it.  It really fails when you want a surface without smooth normals.  

 

Once I've worked the algorithmic bugs out of my algorithms so far, I haven't seen any cracks... If you want, I can post my PN shaders (GLSL) when I'm done with them. My standard license is WTFPL (http://en.wikipedia.org/wiki/WTFPL).

Share this post


Link to post
Share on other sites

You pretty much hit the 4 techniques popular for surfaces in the last few years. From my experience with trying to integrate these techniques into existing pipelines, the two worth your time are flat-dicing + displacement textures and Phong. The main reason is that they are low investment compared to the other two. 

 

Like mentioned, flat-dicing + displacement textures gives pretty full control to the artists. Phong is useful for smoothing objects, specifically their silhouettes. One problem with Phong can be that it balloons objects. A common solution is to clamp how much it can displace vertices.

 

Another use I've seen is to tessellate particles so that you can do shading in the domain shader. It's somewhat of a happy medium between doing vertex shading versus pixel shading for lit particles.

 

As for tessellated hair, I feel it's a mixed bag. You leverage tessellation for hair to generate extra line segments and/or copies of the line segments of hair. They're fully parameterized so you can use that however you like to make them visually different. My experience was a big perf hit for a single object. It also was hard for an artist to work with since it was very new and they had to spend the majority of their time in engine with it. Artist like control and a parameterized system can be tough to get all the control they desire. I've also heard from others (see the literature from GDC 2013 for Tomb Raider) that just pre-tessellating hair offline was more efficient. This also gives more direct control back to the artist again.

 

As for the theoretical, The concept of a limit surface you mentioned is key. You'll likely want to look ahead into how content pipelines may change in the next decade if you really want to go into that area. Another area I see as related and worth mentioning is changes to content authoring and pipeline such as ptex. In the long run, Content tools, pipelines, and maybe even methods are going to have to change before tessellation can be integrated in a productive and tight manner imo. 

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  

  • Similar Content

    • By povilaslt2
      Hello. I'm Programmer who is in search of 2D game project who preferably uses OpenGL and C++. You can see my projects in GitHub. Project genre doesn't matter (except MMO's :D).
    • By ZeldaFan555
      Hello, My name is Matt. I am a programmer. I mostly use Java, but can use C++ and various other languages. I'm looking for someone to partner up with for random projects, preferably using OpenGL, though I'd be open to just about anything. If you're interested you can contact me on Skype or on here, thank you!
      Skype: Mangodoor408
    • By tyhender
      Hello, my name is Mark. I'm hobby programmer. 
      So recently,I thought that it's good idea to find people to create a full 3D engine. I'm looking for people experienced in scripting 3D shaders and implementing physics into engine(game)(we are going to use the React physics engine). 
      And,ye,no money =D I'm just looking for hobbyists that will be proud of their work. If engine(or game) will have financial succes,well,then maybe =D
      Sorry for late replies.
      I mostly give more information when people PM me,but this post is REALLY short,even for me =D
      So here's few more points:
      Engine will use openGL and SDL for graphics. It will use React3D physics library for physics simulation. Engine(most probably,atleast for the first part) won't have graphical fron-end,it will be a framework . I think final engine should be enough to set up an FPS in a couple of minutes. A bit about my self:
      I've been programming for 7 years total. I learned very slowly it as "secondary interesting thing" for like 3 years, but then began to script more seriously.  My primary language is C++,which we are going to use for the engine. Yes,I did 3D graphics with physics simulation before. No, my portfolio isn't very impressive. I'm working on that No,I wasn't employed officially. If anybody need to know more PM me. 
       
    • By Zaphyk
      I am developing my engine using the OpenGL 3.3 compatibility profile. It runs as expected on my NVIDIA card and on my Intel Card however when I tried it on an AMD setup it ran 3 times worse than on the other setups. Could this be a AMD driver thing or is this probably a problem with my OGL code? Could a different code standard create such bad performance?
    • By Kjell Andersson
      I'm trying to get some legacy OpenGL code to run with a shader pipeline,
      The legacy code uses glVertexPointer(), glColorPointer(), glNormalPointer() and glTexCoordPointer() to supply the vertex information.
      I know that it should be using setVertexAttribPointer() etc to clearly define the layout but that is not an option right now since the legacy code can't be modified to that extent.
      I've got a version 330 vertex shader to somewhat work:
      #version 330 uniform mat4 osg_ModelViewProjectionMatrix; uniform mat4 osg_ModelViewMatrix; layout(location = 0) in vec4 Vertex; layout(location = 2) in vec4 Normal; // Velocity layout(location = 3) in vec3 TexCoord; // TODO: is this the right layout location? out VertexData { vec4 color; vec3 velocity; float size; } VertexOut; void main(void) { vec4 p0 = Vertex; vec4 p1 = Vertex + vec4(Normal.x, Normal.y, Normal.z, 0.0f); vec3 velocity = (osg_ModelViewProjectionMatrix * p1 - osg_ModelViewProjectionMatrix * p0).xyz; VertexOut.velocity = velocity; VertexOut.size = TexCoord.y; gl_Position = osg_ModelViewMatrix * Vertex; } What works is the Vertex and Normal information that the legacy C++ OpenGL code seem to provide in layout location 0 and 2. This is fine.
      What I'm not getting to work is the TexCoord information that is supplied by a glTexCoordPointer() call in C++.
      Question:
      What layout location is the old standard pipeline using for glTexCoordPointer()? Or is this undefined?
       
      Side note: I'm trying to get an OpenSceneGraph 3.4.0 particle system to use custom vertex, geometry and fragment shaders for rendering the particles.
  • Popular Now