Sign in to follow this  

DOT3 problem

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

Hello! I used THREE tutorial (DOT3 bump mapping) to create my game bump mapping effect. But I have a problem. I have one point light and one model is flying in the space. The effect don't work correctly. (I tried to use environment bump effect, thata works (sum: 4 sites of source code), but i dont need environment mapping, just simple bumpy effect) Anything is OK, when i use DOT3 with a plane (one face), but in case of LOW- or HI polygonal 3D models the dark side of the model will be also bump-mapped, and if I rotate the model, nothing will be changed. Why is it working wrong, and is there other methodes, to create Bumpy surfaces, without DOT3, and Pixel/Wertex Shaders? I couldn't find other (not DOT3, and Environment mapped) bump mapping tutorials, where they are? Can anybody send me source code? That would be the best (of course in C++)? HY!

Share this post


Link to post
Share on other sites
You are not lighting in the correct space, and you are not clamping your lighting.

You need to rotate your light from world space, into model space, and then into tangent space. Then, be sure you are clamping your dot3 term to [0..1]. Don't use abs(), or that will create the effect you are describing.

Here is a prezo I did on tangent/texture space.

http://developer.nvidia.com/object/gdc_tspacereal.html

Share this post


Link to post
Share on other sites

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