Jump to content
  • Advertisement
Sign in to follow this  
KaiserJohan

DX11 Smooth normals and Tessellation

Recommended Posts

Hello,

I'm doing tessellation and while I got the positions setup correctly using quads I am at a loss how to generate smooth normals from them. I suppose this should be done in the Domain shader but how would this process look like?

I am using a heightmap for tessellation but I would rather generate the normals from the geometry than use a normal map, if possible.

Cheers

Share this post


Link to post
Share on other sites
Advertisement
18 hours ago, KaiserJohan said:

Hello,

I'm doing tessellation and while I got the positions setup correctly using quads I am at a loss how to generate smooth normals from them. I suppose this should be done in the Domain shader but how would this process look like?

I am using a heightmap for tessellation but I would rather generate the normals from the geometry than use a normal map, if possible.

Cheers

You should have access to "node" vertex normals, right (eg "pixel normals" on your heightmap, that you've precomputed)? If not, you might sample the heightmap in the vertex shader and calculate the normals in realtime.

Assuming quads, interpolating them in the tessellator should be as simple as bilerping the node normals. You can pass this information to the GPU as adjacency data and access it in the geometry shader*. Remember that since you're dealing with normals, the resulting vectors need to be renormalized after interpolation. 

 

* I don't have any experience with D3D, but searching for "vertex array adjacency" turns up this and this.

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  

  • 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!