Sign in to follow this  
JamesProctor

Finding the Slope of a giving Vertex in HLSL

Recommended Posts

I am working on developing a Game Engine. A big part of the Engine will be Procedural Content. Well the first Procedural thing I am working on are Planets based on ROAM. I've got the planets being generated and the terrain is created using the code for the Complex Planet example for Libnoise. I am now trying to set up texturing in a HLSL vertex and Pixel Shader. I'm able to texture it based on Height but I now want to texture the slopes a different texture. How can I go about getting the slope of the vertex? Thanks!

Share this post


Link to post
Share on other sites
Is there a particual reason to use ROAM? I mean, it was good lod-technique 10 years ago, but nowadays may be too CPU intensive or may not map well to the graphics accelerator architecture.

you may calculate the vertex normal by looking at the neighbouring height values. From the normal you may calculate the slope.

Cheers!

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