Skip to main content
GameDev.net gamedev.net
🔒 Locked

importing blender normal maps object space

Started by lomateron Feb 26, 2013 at 9:44 PM 3 replies 1.5k views
Original Post
lomateron
lomateron

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?

MJP
MJP

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.

lomateron
lomateron

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)

FLeBlanc
FLeBlanc

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.

lomateron
lomateron

(normal+1)/2

that's what i needed. thanks

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.