Skip to main content
GameDev.net gamedev.net
🔒 Locked

GPU Tessellation

Started by ZealousEngine Dec 7, 2007 at 3:14 PM 18 replies 12.8k views
Original Post
ZealousEngine
ZealousEngine
Incase you missed the siggraph video, the slides are still available... *because of the () you need to cut and paste the link it seems... http://ati.amd.com/developer/Eurographics/2007/Tatarchuk-Tessellation(EG2007).pdf The theory is pretty simple. Take a low res control mesh, and subdivide it at runtime on the gpu (based on distance form the camera, ect..). So if you wanted to render a patch of terrian, you would start with a low resolution control mesh, and 'add detail' by tessellating a similar 'simple' quad patch over and over. You then interpolate the heights/uvs to fillin the space between the control mesh points. This is how the xbox 360 game 'viva pinata' did their terrain. However, the paper doesnt give many detials on the actual implementation. Lets assume I have a simple quad, and I want to tessellate it as I move the camera closer. Heres what I dont get... 1.) How do I pass the control mesh 'info' to the 'tessellation' vertex shader? 2.) Assuming I can get the control mesh info to the tessellation shader, how does the tessellation shader itself work? How does it render multiple instances of a mesh in a single draw call? If anyone has a link to an actual implementation of GPU tessellation I would love to see it! Thanks for any help!
Zipster
Zipster
A classmate of mine wrote a nice paper on GPU tessellation last semester. It looks pretty good, and has implementation details. There are references to actual project and solution files, but unfortunately those aren't available.
sebastiansylvan
sebastiansylvan
Viva Pinata uses per-edge tessellation factors and the built-in Xbox 360 tessellator hardware. You basically get the barycentrics and vertices in the shader, and you just fetch whatever you need there (the 360 gives you full control over fetching, so you're not restricted to declaring up front what you need as input, just fetch away). Compute the vertex based on the barycentrics (computed by tessellation hardware) and offset it by a heightmap and that's it.

The edge factors are computed in a separate pass using memory export to write from the shader to the a vertex buffer containing the per-edge factors. This is just a shader so you can do any math you want. For example you would fetch the control mesh edge vertices in question and compute the screen space length and then set the tessellation factor based on that.
ZealousEngine
ZealousEngine
Thanks for the links to those papers I will check them out now.

Quote:

Viva Pinata uses per-edge tessellation factors and the built-in Xbox 360 tessellator hardware


Youre not saying such a technique isnt possible WITHOUT such built in tessellator hardware are you? *That one atricle is talking about geometry shaders. Arent geometry shaders Dx10? Im trying to target Dx9 sm3.

*Btw, im a little fuzzy on the subject, but couldnt geometric instancing be used for tessellation instead of relying on geometry shaders?

[Edited by - ZealousEngine on December 8, 2007 9:45:35 AM]
sebastiansylvan
sebastiansylvan
As far as I can tell that presentation IS talking about specialized tessellator hardware, and indeed it looks like this will be required for DX11 (or 10.1 or whatever it will be called).
sciquaker
sciquaker
It can be done without the tessellator, but it might have better performance when you are rendering a curved surface(like NURBS, subdivision surface). The tessellator takes on some tasks thought to be done on CPU(tessellation) and relieves the CPU/GPU bus overhead.
ZealousEngine
ZealousEngine
So does anyone have any dx9, no tessellater hardware implementation details?
sciquaker
sciquaker
If terrain rendering, this article might be helpful: "terrain geomorphing in the vertex shader" from ShaderX 2 :)
ZealousEngine
ZealousEngine
Yeah but with terrain patch rendering you really seem to be doing 100% of 'what patches go where' calculations on the cpu. Im still curious to see how tesselation works with dx9 on say a character model.
ZealousEngine
ZealousEngine
There have to be some implementation details floating around.. Im surprised more people arent excited about this technique (it really is the future imo).
wolf
wolf
N-Patches were already the future five years ago :-) ... I even used them on DX8.1 hardware. All depends on how well this stuff is supported in hardware :-) ... the geometry shader support comes here to mind :-)
ZealousEngine
ZealousEngine
But if it was the future five years ago why are there ZERO articles on it? Well maybe there are a couple, but I cant seem to find them...

Yes geometry shaders will make it 'faster' and im sure more popular, but everyone says it is possible to do NOW, but nobody seems to know how...
S1CA
S1CA
There were plenty of presentations at developer conferences that talked about N patches back then and quite a lot of talk in the specialist media as a result of the marketing. I think I first heard about them at one of the Meltdown conferences (2000 or 2001 if memory serves).

ATI had them in consumer hardware first so were the ones making the most noise about them. ISTR the ATI marketing name for N-patches was TruForm.

The fact that none of the other hardware vendors had support for them and some artwork authoring headaches (tesselate uniformly and some edges you wanted to always stay sharp can end up smooth) meant that use oustide of demos and OEM releases, the use of N-patches in games was thin on the ground (if any shipped using them at all for that matter).

Having an ATI GPU in a popular games console (and a set of powerful co-processors in its nearest competitor that are perfect for implementing things like N-patches) have changed all that.


Quote:
But if it was the future five years ago why are there ZERO articles on it?


Hmmmm, your Google-Fu must be weak [wink]

SIGGRAPH 2001: http://alex.vlachos.com/graphics/CurvedPNTriangles.pdf

ATI 2001: http://www.graphicshardware.org/previous/www_2001/presentations/Hot3D_Mark_Fowler.pdf

Gamasutra 2002: http://www.gamasutra.com/features/20020715/mollerhaines_01.htm
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
ZealousEngine
ZealousEngine
Perhaps I need to take a closer look, but non of those articles have implementation details. They are 90% 'how bezier curves work'. They then suggest you magically 'do the tessellation' after primitive assembly and before vertex shading. How?

Im working with Ogre. Call me oldschool, but all I understand is drawcall->vertex shader->pixel shader. How do I 'insert' gpu tesselation into this equation?
Sc4Freak
Sc4Freak
Typically they utilise undocumented render state calls, and the like. I'm sure the ATI Developer SDK would have more information and samples. I believe only the HD2x00 series and above has a hardware tesselator, so don't expect it to run on Nvidia hardware.
Shockwave
Shockwave
Maybe that's what you are looking for: GS-NPatch-Tessellation
"This sample shows how to smoothen a low-polygon mesh by n-patch tessellating the input triangles in the geometry shader."
http://ati.amd.com/developer/SDK/AMD_SDK_Samples_May2007/D3D_10/GS-NPatch-Tessellation.zip
ZealousEngine
ZealousEngine
Gah! Another d3d10 implementation :(.. Does this technique just suck unless you dont have dx10/geometry shaders? Is that why nobody seems to use it?
S1CA
S1CA
Quote:
Original post by ZealousEngine
Gah! Another d3d10 implementation :(.. Does this technique just suck unless you dont have dx10/geometry shaders? Is that why nobody seems to use it?


IDirect3DDevice9::SetNPatchMode(), D3DDEVCAPS_NPATCHES, ...

Only being supported by ATI (and XGI but I wouldn't trust their caps one little bit...) is the reason not many people use them on PC. On console it's a different story.
Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site
ZealousEngine
ZealousEngine
Quote:
Only being supported by ATI


Ok so are you saying there is no way to do gpu tessellation with dx9 unless you have specific ATI brand hardware?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.