PDA

View Full Version : EMBM in OpenGL



Macinkross
06-02-2003, 12:49 PM
I've been interested lately in environment mapped bump mapping. I can't seem to wrap my head around the technique however.

In Real-Time Rendering (Moeller & Haines) EMBM is described somewhat like this. A certain pixel is read from texture Coords u,v from a given bumpmap. This results in a new 2 dimensional vector that is transformed by a matrix and used to access a third environment map texture.

What I'm not understanding is how this is enough to generate any kind of effect. Because texture coordinates are provided on a per-vertex basis no real warboling (new word?) will occur within a given triangle. Rather, only at the verts themselves.

I'm obviously missing something here. Can someone please help?

Coriolis
06-02-2003, 01:37 PM
Texture coordinates are interpolated across a triangle, and a texture lookup is done for each fragment of the triangle using the interpolated coordinates.

Spurkey
06-02-2003, 04:04 PM
With EMBM, the texture coordinates are interpolated across a given triangle and used as a lookup into a 3-dimensional normal map (a 2-D bump map must be first converted to a 3-D normal map) to obtain the normal for that pixel. This new normal, in conjunction with the vector from the eye to the pixel, is used to calculate a reflection vector which is in turn used as a lookup into the envmap.

Macinkross
06-02-2003, 05:10 PM
>>Texture coordinates are interpolated across a triangle, and a texture lookup is done for each fragment of the triangle using the interpolated coordinates.

>>With EMBM, the texture coordinates are interpolated across a given triangle and used as a lookup

Ohhh. I see how its done.

That makes a lot more sense. I'm still not used to thinking about things at the fragment level. Is it possible to implement this without pixel shader hardware?

JustHanging
06-02-2003, 08:30 PM
Not all hardware can perturb texture coordinates the way that's required for EMBM. If you want to use bump mapping on older hadrware it's better to use dot3 bump mapping.

-Ilkka