Jump to content
  • Advertisement

Archived

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

jmschust

Sphere Bump Map using Dot Product

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

Hi there all, I''m hoping that someone can help me out. I''m learning this stuff for the first time and I can''t find any material out there about this topic. I''m using some graphics from this site to create a planetary system simulation (earth, moon, sun). http://www.space-graphics.com I would like to give as much detail as possible, but I''ve run into a problem. I''d like to use the bump map given by this site to endow my globes with changes in elevation/shade lighting based upon the elevations in the bump map. I know there are a lot of different ways to do this. One is by using the stuff from Nehe''s lesson 22. But this uses embossing, and I''m lost on how to do this on a sphere. Another way that I understand is more ''correct'' is by changing the normals at all pixels based upon the normals generated by averaging the elevation differences from the bump map from pixel to pixel. But I''m lost on how I would do this on the sphere since really I''m only giving vertex normals. Is there anyone out there that has done real-time light activated bump mapping on a sphere? Please help.

Share this post


Link to post
Share on other sites
Advertisement
First of all, you should forget NeHe''s tutorial since emboss is rather obsolete.

Secondly, it''s normal that you give only "vertex normals". That''s the only thing you have. Actually, bump-mapping techniques are texture-based. That is, you have to encode the normal perturbations into a texture. The most popular way to do this is to start from a heightmap texture and then transform it into a normal map. This also means you need to know texture corrdinates. For a sphere I''m sorry to say that it also means distortion. Texturing a sphere is pretty hard.

If I were you I would search for articles describing bump mapping in theory and practice. You can find some of them at http://developer.nvidia.com or http://www.ati.com/developer. My favourite article being http://developer.nvidia.com/view.asp?IO=Practical_Bumpmapping_Tech (it''s optimized for register combiners, but all the theory is based for dot product in fact). Really good article, assuming you known a bit of math of course.

Share this post


Link to post
Share on other sites
Thanks for the reply.

I''ve found this: http://users.ox.ac.uk/~univ1234/tutorials/simplebump/simplebump.htm link in another part of this forum. This may help.

But I need to figure out how to change my 8bit gradient height map texture into a normal map. Any advice?

Share this post


Link to post
Share on other sites
I am the author of the tutorial at:

http://users.ox.ac.uk/~univ1234/tutorials/simplebump/simplebump.htm

To generate normal maps I usually use this tool, although the one in the tutorial was just one i found.

(500 x 2)

http://users.ox.ac.uk/~univ1234

Share this post


Link to post
Share on other sites
Source code for converting heightmap to normal map is included in the article pointed by the link I''ve written above.

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!