PDA

View Full Version : projective texture mapping and shadow mapping



phoenix_gl
10-08-2012, 01:25 PM
I am trying to implement projective texture mapping in opengl. Suppose there is a projector ,which project a image onto the model. Hopfully,I need only front side can be painted by image and back side should be occluded. How to do that?


Could anyone help me about that?

Dark Photon
10-08-2012, 07:00 PM
Look at the diagram on this page under Projective Texturing:

* Shadow Mapping (http://www.paulsprojects.net/tutorials/smt/smt.html) (Paul's Projects)

Read the text for more details on how it works.

Of course nowadays you wouldn't use the fixed-function texture coordinate generation (GL_TEXTURE_GEN* stuff) ... you'd just pass the matrix into a shader uniform and use it directly in your shader math to generate the texture coordinates. Simpler.