Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Is posible to use this technique with deferred lighting?

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.