Sign in to follow this  

Combining normal maps in a shader

This topic is 3846 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 2 or more normal maps that I want to combine in pixel shader. Obviously just lerping them or multiplying them doesn't work correctly...there ought to be some "correct" way to do it. Assume that the actual vertex normal is always facing up, and that the normal maps and lighting are in tangent space.

Share this post


Link to post
Share on other sites
The mathematically correct way to do this is very simple. Don't normalize the normals when creating the normal maps. Then in the shader, add them together and then normalize. This will give identical results to what adding the two height maps together first, and then creating a normal map from the result, would have done.

Share this post


Link to post
Share on other sites

This topic is 3846 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