Sign in to follow this  
IronNerd

OpenGL Real-Time Tessellation Techniques of Note?

Recommended Posts

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

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

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

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

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

"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

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

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

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

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  

  • Forum Statistics

    • Total Topics
      627737
    • Total Posts
      2978873
  • Similar Content

    • By DelicateTreeFrog
      Hello! As an exercise for delving into modern OpenGL, I'm creating a simple .obj renderer. I want to support things like varying degrees of specularity, geometry opacity, things like that, on a per-material basis. Different materials can also have different textures. Basic .obj necessities. I've done this in old school OpenGL, but modern OpenGL has its own thing going on, and I'd like to conform as closely to the standards as possible so as to keep the program running correctly, and I'm hoping to avoid picking up bad habits this early on.
      Reading around on the OpenGL Wiki, one tip in particular really stands out to me on this page:
      For something like a renderer for .obj files, this sort of thing seems almost ideal, but according to the wiki, it's a bad idea. Interesting to note!
      So, here's what the plan is so far as far as loading goes:
      Set up a type for materials so that materials can be created and destroyed. They will contain things like diffuse color, diffuse texture, geometry opacity, and so on, for each material in the .mtl file. Since .obj files are conveniently split up by material, I can load different groups of vertices/normals/UVs and triangles into different blocks of data for different models. When it comes to the rendering, I get a bit lost. I can either:
      Between drawing triangle groups, call glUseProgram to use a different shader for that particular geometry (so a unique shader just for the material that is shared by this triangle group). or
      Between drawing triangle groups, call glUniform a few times to adjust different parameters within the "master shader", such as specularity, diffuse color, and geometry opacity. In both cases, I still have to call glBindTexture between drawing triangle groups in order to bind the diffuse texture used by the material, so there doesn't seem to be a way around having the CPU do *something* during the rendering process instead of letting the GPU do everything all at once.
      The second option here seems less cluttered, however. There are less shaders to keep up with while one "master shader" handles it all. I don't have to duplicate any code or compile multiple shaders. Arguably, I could always have the shader program for each material be embedded in the material itself, and be auto-generated upon loading the material from the .mtl file. But this still leads to constantly calling glUseProgram, much more than is probably necessary in order to properly render the .obj. There seem to be a number of differing opinions on if it's okay to use hundreds of shaders or if it's best to just use tens of shaders.
      So, ultimately, what is the "right" way to do this? Does using a "master shader" (or a few variants of one) bog down the system compared to using hundreds of shader programs each dedicated to their own corresponding materials? Keeping in mind that the "master shaders" would have to track these additional uniforms and potentially have numerous branches of ifs, it may be possible that the ifs will lead to additional and unnecessary processing. But would that more expensive than constantly calling glUseProgram to switch shaders, or storing the shaders to begin with?
      With all these angles to consider, it's difficult to come to a conclusion. Both possible methods work, and both seem rather convenient for their own reasons, but which is the most performant? Please help this beginner/dummy understand. Thank you!
    • By JJCDeveloper
      I want to make professional java 3d game with server program and database,packet handling for multiplayer and client-server communicating,maps rendering,models,and stuffs Which aspect of java can I learn and where can I learn java Lwjgl OpenGL rendering Like minecraft and world of tanks
    • By AyeRonTarpas
      A friend of mine and I are making a 2D game engine as a learning experience and to hopefully build upon the experience in the long run.

      -What I'm using:
          C++;. Since im learning this language while in college and its one of the popular language to make games with why not.     Visual Studios; Im using a windows so yea.     SDL or GLFW; was thinking about SDL since i do some research on it where it is catching my interest but i hear SDL is a huge package compared to GLFW, so i may do GLFW to start with as learning since i may get overwhelmed with SDL.  
      -Questions
      Knowing what we want in the engine what should our main focus be in terms of learning. File managements, with headers, functions ect. How can i properly manage files with out confusing myself and my friend when sharing code. Alternative to Visual studios: My friend has a mac and cant properly use Vis studios, is there another alternative to it?  
    • By ferreiradaselva
      Both functions are available since 3.0, and I'm currently using `glMapBuffer()`, which works fine.
      But, I was wondering if anyone has experienced advantage in using `glMapBufferRange()`, which allows to specify the range of the mapped buffer. Could this be only a safety measure or does it improve performance?
      Note: I'm not asking about glBufferSubData()/glBufferData. Those two are irrelevant in this case.
    • By xhcao
      Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness. 
  • Popular Now