Sphere Bump Map using Dot Product

Started by
3 comments, last by jmschust 21 years, 3 months ago
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.
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.
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?
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
Source code for converting heightmap to normal map is included in the article pointed by the link I''ve written above.

This topic is closed to new replies.

Advertisement