PDA

View Full Version : Shiny bumpmaps



halo
12-03-2006, 08:25 PM
I want to implement the effect shown in the shot below. I have bumpmaps and cubemaps implemented already, but I am not sure what is going on in this shot:
http://www.leadwerks.com/post/spec5.jpg

CaseMillennium
12-03-2006, 10:51 PM
MMhhh, simply do your light-calculations with the perturbed normale?!

k_szczech
12-04-2006, 01:36 AM
What you see here is the specular lighting.
I assume you have diffuse lighting working allready with normal maps.
So simply:

Diffuse = max(0.0, dot(normal, lightVector));
Specular = max(0.0, dot(reflect(normal, eyeVector), lightVector));As you see the difference is that instead of using normal vector you use eyeVector reflected by that normal. I did not include light attenuation for simplicity, but of course it should be included.
FinalColor = diffuseTexture * diffuse + specularTexture * specular;

You can get nice results without specularTexture and I believe there is no such texture in the screenshot above.

BoSoft
12-04-2006, 07:21 AM
It looks like the per-pixel normal is used to do the cube map lookup, then the resulting cube map sample is simply modulated with the rest of the lighting.

halo
12-04-2006, 08:01 AM
Yeah, I am thinking the cubemap is based on the bumpmap final color, and added. I'll try it out.

mogumbo
12-05-2006, 10:39 AM
It's called Environment-Mapped Bump Mapping (EMBM).