Jump to content

  • Log In with Google      Sign In   
  • Create Account


Occluding Light in a Deferred Shader


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 D.V.D   Members   -  Reputation: 425

Like
0Likes
Like

Posted 02 April 2014 - 08:02 AM

Hi guys, I have a noob question. Since direct light in a deferred pipeline is represented as geometry, I was wondering what to do in the case were you have two objects in front of a spot light. The first object closer to the spot light is larger and completely covers object two but both objects are still inside the geometry of the light. If you shade it, won't you have the issue were the second object, which is completely hidden from the perspective of the light, be shaded as if it wasn't hidden since it still is inside the lighting geometry? How would you go about solving this and leave it in shadow unlit since its not affected by the light? You could have cases like these with point lights as well. I was thinking maybe you could apply a shadow from object 1 but wouldn't you still have the shadow overlapped with the light applied on the surface? Thanks in advance.



Sponsor:

#2 Promit   Moderators   -  Reputation: 6329

Like
2Likes
Like

Posted 02 April 2014 - 12:12 PM

Deferred shading/lighting has no impact on the problem of computing shadows. You need to compute your shadows in the traditional way, by building shadow maps from the lights and doing depth tests when rendering the lighting. The pass that renders the light geometry will be the one to sample the shadow map and depth test.


Edited by Promit, 02 April 2014 - 12:13 PM.


#3 D.V.D   Members   -  Reputation: 425

Like
0Likes
Like

Posted 03 April 2014 - 04:44 PM

Oh okay that makes more sense. So if I have lets say a point light, do I have a circle model for it and each point light has a specified radius or do I generate one on the GPU based on its properties (attenuation)?



#4 phil_t   Crossbones+   -  Reputation: 3222

Like
1Likes
Like

Posted 04 April 2014 - 09:43 AM

Yes, you can draw a point light with a sphere model. Using geometry like this is just an optimization so you only draw the pixels you know could affected by the light (as opposed to doing a full screen rendering pass).






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS