Sign in to follow this  

Terrain Normal Mapping

This topic is 2853 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 am about trying to make normalmapped heightmap terrain.Is it just enough to pass "Terrain's world transform" to the shader for tangent space calculations in it?

Share this post


Link to post
Share on other sites
If your terrain do not rotate I believe you do not need tangent space, tangents and binormals to normal-map your terrain. Normals would be in object/world space, so keep your light in that space and you are good.

Share this post


Link to post
Share on other sites
you are suggesting a world space normalmap approach.fast but less preferable. so ı already calculated vertex normals successfuly. now which steps should i follow when you said keep your light in this space. the light already in worldspace. ı already have vertex normals and then ?

Share this post


Link to post
Share on other sites
Calculate the dot between the light direction and the normal in the vertex shader and pass that float to the pixel shader. In pixel shader, sample your bump-map texture sampler extract a normal from it, add it to the "float dot" passed from the vertex shader and use that "float dot" for your final color calculation of the pixel. That works for "detail normal mapping" with conjunction with vertex normals being present and used to calculate the "overall" lighting.
That is simply one of the ways of doing it.
For example for normal maps in object space as those exported from L3DT for example, you don't need vertex normals i think.

Share this post


Link to post
Share on other sites

This topic is 2853 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.

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