Projective Texture Mapping

Started by
2 comments, last by semler 6 years, 1 month ago

Hi guys,

I am having a hard time understanding projective texture mapping. I understand shadow mapping but just don't get what I'm supposed to do to project a texture (like light coming through a grill.) What do I actually draw, quads with the light textures? Maybe someone can tell me the basics. I'm talking about the projective texture mapping that looks like it's coming from a slide projector. Thanks a lot.

Advertisement

Projective textures are basically just cubemaps projected out from the light source.  You can create a line from the current point you are lighting back to the light (which you'll already have for your lighting equation), and you can use that vector as a cubemap texture coordinate.  This lets you do a simple cubemap lookup using that coordinate to get your projected textures color.  The idea is that the cubemap adds a color filter over the area, but isn't affected by distance.  Anything along that vector, away from the light source, will wind up with the same color.

You can also do the same thing with just a simple 2D texture, as opposed to the cubemap.  This lets you have a texture projected on just one side, such as with a spot light.  The math behind that gets a little more complicated, but a quick search shows that there are quite a few examples of this online.

When you perform the lighting calculation you will at the same time sample from your projected texture and multiply it with the resulting light. The resulting light might be masked by the usual shadow map so you only have your projected texture where the light can actually reach it.

Henning

This topic is closed to new replies.

Advertisement