Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

kill

DOT3 Normals

This topic is 5867 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''m using NVidia''s filters to generate normals for bumpmaps. I have the following question. If I would like to extract the normals from the texture how would I go about doing that? (Don''t ask why ) The RGB colors contain the xyz components of the normal. They''re supposed to be signed. So if BYTE R == a certain R component in the texture, how do I extract the x? Just subtract 123 from all components and then normalize? Thanks in advance.

Share this post


Link to post
Share on other sites
Advertisement
If you are useing dot3 then read if not forget my post.

the R G B channels represent light from certain directions, and you then set the brightness of each channel to make that channel create the light on your final object.

If you don't get it from me don't think to hard on my reply. Its not wrttin very well. Just know that the normal map is not NORMALS. its just a strange way of minipulating colors to brighten the final image in certain areas to creat a BUMP feel to it.

Well Im tired!

[edited by - Xero-X2 on June 30, 2002 1:11:54 AM]

Share this post


Link to post
Share on other sites
Xero-X2 > are you sure?

For me, the normal map holds the normal but they''re translated and scaled to fit in [0; 1].

Thus, if you want to extract normal:

nx = (r - 0.5) * 2
ny = (g - 0.5) * 2
nz = (b - 0.5) * 2

Share this post


Link to post
Share on other sites
hmm...
Perhapes we are speaking of diffrent ways of implimenting dot3, I am refering to the ARB_DOT3 extention's use, and I am rather sure that what I said earlyer is true to this. or maybe it depends on how you use it, DOT3 is a pretty tricky subject.

although I am pretty sure that this is true because he asked about NVidias Filters to make dot3 bumps, it uses the diffrent channels to represent lightning from diffrent angles. At least that is the way it appears every time I look at it! : )

hmm...
The confusion sets in...

anyone else who can answer this?

[edited by - Xero-X2 on June 30, 2002 4:10:18 AM]

Share this post


Link to post
Share on other sites
Alload is right. The RGB channels in a normal map are simply encoding the (approximate) normal differentiated over your bump heightmap. This is exactly how the ARB_DOT3 extension works: you have a lightvector encoded in your interpolated colour (N.x = R, N.y = G, N.z = B). Then, the dotproduct between this lightvector and the normalmap is taken:

result = Light.x * NormalMap.x + Light.y * NormalMap.y + Light.z * NormalMap.z

The normalmap is direction independend (the lightdirection is not taken into account, when it is computed). It sometimes looks like if the channels were encoding different light directions, but that's an optical illusion due to the normal distribution along bumps (and our brain trying to interprete that as 'lighting', when in fact it just is a mathematical distribution).

/ Yann

[edited by - Yann L on June 30, 2002 7:56:25 AM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!