Archived

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

Hobbiticus

DOT3 Bump mapping anyone?

Recommended Posts

Hobbiticus    122
I''d like to learn how to do some better bump mapping than emboss. I got emboss bump mapping working on the terrain of my group''s upcoming game, but now the interiors look a little...bland. So, would someone be able to: A: Write a lesson 39 - DOT3 Bump Mapping B: Give me an idea of how to go about doing it C: Point me to somewhere were I could learn how to do it Please get back to me soon before I lose the bump-mapping-inspiration

Share this post


Link to post
Share on other sites
vincoof    514
Bump-mapping is a pretty complex case which has been discussed many times in opengl.org (advanced) forums.
A DOT3 bump-mapping tut would be cool, though.

What kind of bump-mapping do you look for ? normal perturbation maps or normal maps ? specular of diffuse or both ? on a static mesh or dynamic mesh (animated) ?

Share this post


Link to post
Share on other sites
vincoof    514
flegmato: that link is not bad at all. Though it has the not deadly yet annoying problem to use non-normalized color-defined normals. Apart from that the demo is very cool, especially because source code is included.

Share this post


Link to post
Share on other sites
Hobbiticus    122
Alright, I''ll check that out.

And, I''d be doing this on "interiors," like buildings/flag stands/anything else inanimate and not terrain. Basically, non-terrain objects that don''t move. It took my a long to to get emboss bump mapping working on the terrain, so idk if it would be a good idea to try dot3 bump mapping since I havn''t even taking linear algebra yet. Thanks for the help, but also keep the posts coming!

Share this post


Link to post
Share on other sites
vincoof    514
For static or dynamic lights ?

If lights don''t move and your objects don''t move either, you should use lightmapping (for the diffuse component) which is much easier and faster both for programming and executing. And for specular component, some good cubemaps would be even better.

If lights move, well you''re definately going to realtime bumpmapping.

Share this post


Link to post
Share on other sites
Hobbiticus    122
Well, there is only one true OpenGL based light, and it doens''t move. However, can be lots of dynamic lights (explosions, flares, projectiles), but I do not think that they are done through OpenGL lighting. However, it would be nice to have some sort of bump mapping on the structures (and preferably players too, but that is just WAY too hard for me). There are already light maps on the terrains and structures as well, but it''s just that the textures are, well, flat. It just doesn''t look as good as our bump mapped, light mapped, detail mapped, multitextured terrain. The structures are only multitextured and light mapped (no need for detail maps).

Share this post


Link to post
Share on other sites
vincoof    514
What I mean by ''light'' is the light(s) that affect bump-mapping. Because you can''t just say ''I want bumps''. You have to know what object are going to be "bumped" and which lights will product bumps. You already wrote which objects are going to be bumped, but I think you also have to tell us which light(s) will affect bumps. Only the ''true OpenGL based light'' ? Everything from explosions to headlights ?

Share this post


Link to post
Share on other sites
vincoof    514
Ok, but you have to know that each light which produces bumps uses at the very least one texture unit. If you have a textured object and you want to apply bumpmapping with one light, then you need at least 2 texture units (1 unit for the ''decal'' texture of the object and 1 unit for bumpmapping)... not really a problem. But if you have 2 lights for this textured object, you will need at least 3 texture units (1 unit for decal, 2 units because 2 lights produce 2 different bumps) ... not really a problem for GeForce3+ or Radeon7000+ cards, but definately a problem for GeForce2- cards ! And in that case it is still possible but it means multipass.

There are a few solutions though.

First solution : render as many bumps as you can in one pass, and no more. If the user owns a GeForce3 (4 texture units) then he will have up to 4 bumps simultaneously but no more. If the user owns a GeForce2 (2 texture units) then he will have up to 2 bumps but no more.

Second solution : render all bumps even if it means multipass. Users that have a low number of texture units will have a significant framerate drop, but no quality is lost.

Third solution : render only the "most important" bumpmap. For each object, you have to rate the "light importance" of each light and you only render bumpmapping with the light that gets the best score with this object.

Share this post


Link to post
Share on other sites