Advertisement Jump to content
Sign in to follow this  
D.V.D

Occluding Light in a Deferred Shader

This topic is 1749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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)?

Share this post


Link to post
Share on other sites

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).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!