Sign in to follow this  
lomateron

importing blender normal maps object space

Recommended Posts

lomateron    491

I dont understand how normal maps in object space are defined, when i see a normal maps in object space of a sphere i see it colored in rainbow,If the normals are in object space there should be a place in the normal map image were the colors are black because the normal vectors are pointing in the (-x,-y,-z) direction so negative values means black colors but i dont see the black parts in the normal maps of a sphere, why?

Can someone explain me how are normals in object space defined?

Share this post


Link to post
Share on other sites
MJP    19788

If you store a normal map in an image format that doesn't have a sign bit, then you range compress the values so that they fit in the [0, 1] range. Then you'll typically reverse this process in the shader to get the normal value to use.

Share this post


Link to post
Share on other sites
lomateron    491

So the sign is the only thing that gets out in the normals map? nothing else changes?(that doesn't fit the colors of the normal map of a sphere in object space)

Edited by lomateron

Share this post


Link to post
Share on other sites
FLeBlanc    3141

You're not ever going to get pure black because (-1,-1,-1) isn't unit length. The darkest you would get would be about (54,54,54).

 

Edit: To clarify, the values are multiplied by 0.5 then add to 0.5 to do the range compression MJP talked about. So a normal of (-1,-1,-1) would normalize to (-0.57735, 0.57735, -0.57735), and after range compression would be (0.211325, 0.211325, 0.211325). In RGB colorspace, that equals (54,54,54). Similarly, the vector (1,1,1) normalized and compressed results in the color (201,201,201) so that would be the brightest shade of gray you would find in the normal map, and full white would not occur.

Edited by FLeBlanc

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