Jump to content
  • Advertisement
Sign in to follow this  
CastorX

DOT3 problem

This topic is 4812 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
Advertisement
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
Sign in to follow this  

  • 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!