Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is posible to use this technique with deferred lighting?

share|improve this question
up vote 3 down vote accepted

What does the projected texture represent? Projective texturing is a means of generating texture coordinates from vertex positions, to make it appear that the texture is projected over the scene like a film projector.

Can you still do these computations in deferred rendering? Yes. But when and how you do it depends on what the values in the texture represent?

Projective textures are often used to represent things like flashlights. In which case, the texel values are light intensities. And that means you need to do the projection during the lighting pass. Once you reconstruct the position of the particular screen pixel, just do the usual projection computation.

If the projective texture alters the albedo (diffuse reflectance, or diffuse color) of the object, then this must be done in the G-buffer pass. There, you can do the projection computations per-fragment or per-vertex, but you'll get better results per-fragment.

share|improve this answer

Yes, you just have to perform regular projective texturing in the GBuffer pass and add to the the albedo.

If wnat you want to do is shadow mapping, do it in the lighting pass when you reconstruct the pixel postion

share|improve this answer
I haven't "standard" deferred lighting, in first pass I render geometry to two render targets (deph and normal) then I apply lighting and finally render geometry with added lights. – Vodáček Jul 17 '11 at 19:19
That is called Light Pre-pass a.k.a Deferred Lighting. So do the GBuffer and Lighting pass normally, and in the second geometry pass do the projective texturing and blend it with the value you sampled from the diffuse texture – Tiago Costa Jul 17 '11 at 23:29
But this means when I want to have 3 projectors I have to render geometry 3 times ? – Vodáček Jul 20 '11 at 12:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.