PDA

View Full Version : Tessellation with displacement



JoshKlint
10-17-2009, 01:17 PM
I'm not very interested in making low-poly models appear more rounded, but the idea of a high-poly displaced surface is interesting. Is there any mechanism in OpenGL to achieve this right now, by automatically splitting a surface up into more detail on the GPU?

Alfonse Reinheart
10-17-2009, 01:36 PM
Is there a method? Yes. Geometry shaders can output many primitives for one input primitive. Is it "automatic"? No ;)

ATI has a tessellation extension that happens at the front of the pipeline, instead of in the middle. Of course, it's limited to ATI hardware only.

JoshKlint
10-17-2009, 01:42 PM
The ATI extension doesn't actually displace the surface, does it?

Are there any known demos of using geometry shaders to achieve this effect? Is it a technique which can be used uniformly, or are there glitches that arise with certain geometries?

Alfonse Reinheart
10-17-2009, 04:23 PM
The ATI extension doesn't actually displace the surface, does it?

It doesn't do the displacement, but it gives the vertex shader the information to do it itself.

I don't know of any geometry shader demos, but it really shouldn't be very difficult. The starting point is a "null" geometry shader: one that just outputs the primitive as is. From there, tessellating the triangle into several should be easy, as long as you want uniform tessellation. Adding displacement on top of the tessellation would be the next part.

It should also be noted that geometry shaders aren't the fastest thing in the world. If you're going to do this, it should be because you want the improved visual quality, not improved performance over a mesh with that built-in quality.