🔒 Locked
Bump mapping?
Advertisement
Original Post
I thought a bump map was a map of deviations of the normal in a texture to the normal of the polygon, so when lit per-pixel the poly appears to have varying normal and hence seems rough. However, D3D says it''s actually a map of deviations of the texture coordinates from where you''d expect them to be. This seems like a big fake, so which is right and why isn''t my method (courtesy of ''Computer Graphics: Principles and Practice'') used?
Also, how do you make a bump map?
The definition in Foley is the right one, but *and this is a big but* doing it like that on a old 3D card is going to be very slow since the bumps should look different depending on your viewing angle. This old 3D cards cannot do without swapping the texture at every frame (=slow), so you just make a "fake" bump map that can be viewed from all sides the same way. This is not anything near as cool as a real bump map but better than nothing.
I am no hardware shader expert, but I believe that real bump maps is possible to make with hardware pixel shaders.
I am no hardware shader expert, but I believe that real bump maps is possible to make with hardware pixel shaders.
You''re talking about EMBM - Environment Mapped Bump Mapping, which is a perfectly valid form of bump mapping which looks particularly good with specular stuff. It as you describe peturbs the environment map texture based on a peturbation map.
D3D can also do DOT3 bump mapping which evaluates a dot product of two vectors each encoded as colours **PER PIXEL**. If one of those vectors is the light vector and one is the normal, you can do what you consider to be "proper" bump mapping. The normal can be put into a texture, thus per-pixel normal. For a directional light, the light can be put into the TFACTOR constant.
Many computer graphics techniques are no more than "hacks" which look about right (read some of Jim Blinn''s stuff, such as the half vector approximation for specular to see what I mean. BTW Jim Blinn invented bump mapping). It''s wrong to say one is "a cheat" and another is "correct". BOTH methods of bump mapping are cheats/fakes - why? - silhouette edges - if you see the silhouette of a bumpy object using either technique, you won''t see the bumps...
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
D3D can also do DOT3 bump mapping which evaluates a dot product of two vectors each encoded as colours **PER PIXEL**. If one of those vectors is the light vector and one is the normal, you can do what you consider to be "proper" bump mapping. The normal can be put into a texture, thus per-pixel normal. For a directional light, the light can be put into the TFACTOR constant.
Many computer graphics techniques are no more than "hacks" which look about right (read some of Jim Blinn''s stuff, such as the half vector approximation for specular to see what I mean. BTW Jim Blinn invented bump mapping). It''s wrong to say one is "a cheat" and another is "correct". BOTH methods of bump mapping are cheats/fakes - why? - silhouette edges - if you see the silhouette of a bumpy object using either technique, you won''t see the bumps...
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
>> You''re talking about EMBM - Environment Mapped Bump Mapping,
My bad. I thought he was talking about making bump maps by embossing as discussed here:
http://www.gamasutra.com/features/19990604/bump_01.htm
And that can certainly not be called bump mapping.
I tried the EMBM demo from nVidia and that looks quite good.
In relation to the terms "cheat" and "fake". I think we can all agree that everything in computer graphics is a cheat - heck the world isn''t built of triangles.
But with regard to saying that something is fake version of bump mapping I think this can be done rightly if the result that one achieves is not identical to the original definition by Blinn (from 1978) in the article "Simulation of Wrinkled Surfaces". If I understand how EMBM correctly its effect is similar but not identical to the original bump map definition - so we might call it a good approximation of bump mapping (I am pretty amazed with the result).
My bad. I thought he was talking about making bump maps by embossing as discussed here:
http://www.gamasutra.com/features/19990604/bump_01.htm
And that can certainly not be called bump mapping.
I tried the EMBM demo from nVidia and that looks quite good.
In relation to the terms "cheat" and "fake". I think we can all agree that everything in computer graphics is a cheat - heck the world isn''t built of triangles.
But with regard to saying that something is fake version of bump mapping I think this can be done rightly if the result that one achieves is not identical to the original definition by Blinn (from 1978) in the article "Simulation of Wrinkled Surfaces". If I understand how EMBM correctly its effect is similar but not identical to the original bump map definition - so we might call it a good approximation of bump mapping (I am pretty amazed with the result).
quote:
You''re talking about EMBM - Environment Mapped Bump Mapping, which is a perfectly valid form of bump mapping which looks particularly good with specular stuff. It as you describe peturbs the environment map texture based on a peturbation map.
While we are already discussing terminology
Yes, that''s EMBM: the perpixel perturbation of the normal by an offset map. But it''s not true reflective bumpmapping: just as emboss, it''s a dirty hack. True reflective bumpmapping requires the evaluation of the *full* reflection vector equation perpixel. You need a 3x3 matrix transform to be done on a perpixel level for that. GF3+ can do it in realtime, and AFAIK the nVidia EMBM demo uses that method.
For a discussion about the subtile differences between those two EMBM techniques, have a look at this nVidia presentation.
/ Yann
quote:
Yann, what do you mean. Do you mean that the nVidia EMBM demo uses perpixel calculations?!?
Don''t know, if we are talking about the same demo.
Which one do you mean ? The 2 pass one, or the 1 pass ?
Both do calculations perpixel, but the first one uses a readback trick, the second one however, does everything in one pass through GF3 texture shaders (''real'' reflection bumpmapping, as described in the presentation mentioned above).
/ Yann
I seems like to do all this stuff I need to use shaders. Is that correct or is there a way/many ways to do bump mapping through the standard rendering pipeline?
And does the standard pipeline ever do per-pixel lighting and stuff, or would I have to use a custom shading routine (In DX)?
And does the standard pipeline ever do per-pixel lighting and stuff, or would I have to use a custom shading routine (In DX)?
quote:
I seems like to do all this stuff I need to use shaders. Is that correct or is there a way/many ways to do bump mapping through the standard rendering pipeline?
You don''t need to use shaders. Though they do simplify things a hell of a lot. In D3D, the D3DTOP_DOTPRODUCT3 texture stage blending operation can be used to get "almost true Blinn style bump mapping". On most chips, the fixed function pipeline will require a few passes to get full diffuse and specular with base maps, ambient and attenuation (depending on how you achieve each and how many ''hacks''/''approximations'' you use). Take a look on the nVidia website for sample code using both D3D and OpenGL which shows this style of bump mapping with both fixed function and shader implementation.
quote:
And does the standard pipeline ever do per-pixel lighting and stuff, or would I have to use a custom shading routine (In DX)?
As above. Or do you mean when you turn on D3DRS_LIGHTING ? - in that case no. D3D lighting is purely per-vertex which is interpolated in 3D hardware with Gouraud shading. If you want per-pixel you must do it yourself using the texture blending stages. [Often Gouraud shading is useful for interpolating vector values with DOT3 lighting, particularly when lighting in texture space]
--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement