Jump to content
  • Advertisement
Sign in to follow this  
mikfig

DX9 Displacement mapping

This topic is 3374 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have read all the documentation on tessellation and displacement mapping in the DX Docs, but I still don't fully understand how you would implement it. I am assuming that Pre-sampled/normal displacement mapping is part of the fixed-function pipeline, specifically the tessellator. So if I'm correct on that, then how/what can you customize with the tessellation process? I'm also under the impression that you have to set UV coordinates for the displacement map in the vertex buffer somewhere. Also do you supply tessellation factors in the vertex buffer too? Basically though, I want to tessellate meshes while supporting early SM2.0 cards. One more question is, do pre-sampled displacement mapping do adaptive tessellation? So can someone better explain how this better, Thanks, Mikfig

Share this post


Link to post
Share on other sites
Advertisement
Take a look at Frank Luna's "Intro. Direct3D 9.0c: A Shader Approach" book. There's a nice explanation about Displacement Mapping. You can find the demo code on book's website as well.

Share this post


Link to post
Share on other sites
Yes I have read this portion of his book, but it only explains using the displacement map as a height map. But does DX9c not support using the displacement map to tessellate meshes? I am referring to this part of the DX docs:
DX Graphics -> Direct3D9 -> Programming Guide -> Advanced Topics -> Vertex Pipeline -> Displacement Mapping

Share this post


Link to post
Share on other sites
No DX9 does not tesselate meshes for you.

The way to do displacement mapping is by using a vertex texture fetch...you must have a mesh already tesselated the desired vertex density.

To be honest vertex textures are more useful for things like terrains and special effects.

Share this post


Link to post
Share on other sites
It should be noted that VTF is only supported by SM3.0 cards and higher.

Share this post


Link to post
Share on other sites
So just to get this completely straight, there is NO WAY AT ALL to tessellate meshes on the GPU using DX9.

Share this post


Link to post
Share on other sites
K, thx for responding to all my questions. Now I just have to find a good discrete LOD algorithm for general meshes. Time to read more into that LOD book.

Share this post


Link to post
Share on other sites
I just found this page in the DirectX docs that specifically mentions tessellation in DirectX 9, and I quote,
"The tessellator unit has been enhanced. You can now use it to:

* Perform adaptive tessellation of all higher-order primitives."

So now I just have to figure out how to use the tessellator unit.

Share this post


Link to post
Share on other sites
Quote:
Original post by mikfig
I just found this page in the DirectX docs that specifically mentions tessellation in DirectX 9, and I quote,
"The tessellator unit has been enhanced. You can now use it to:

* Perform adaptive tessellation of all higher-order primitives."

So now I just have to figure out how to use the tessellator unit.


i think it is restricted to caps thought, which means not all cards have this features as default.

New hardware caps:

D3DDEVCAPS2_ADAPTIVETESSRTPATCH // Can adaptively tessellate RT-patches
D3DDEVCAPS2_ADAPTIVETESSNPATCH // Can adaptively tessellate N-patches

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!