Ray Tracing Shadows in deferred rendering

Posted by Grieverheart on Game Development See other posts from Game Development or by Grieverheart
Published on 2012-11-29T17:31:18Z Indexed on 2012/11/29 23:21 UTC
Read the original article Hit count: 381

Recently I have programmed a raytracer for fun and found it beutifully simple how shadows are created compared to a rasterizer. Now, I couldn't help but I think if it would be possible to implement somthing similar for ray tracing of shadows in a deferred renderer. The way I though this could work is after drawing to the gbuffer, in a separate pass and for each pixel to calculate rays to the lights and draw them as lines of unique color together with the geometry (with color 0). The lines will be cut-off if there is occlusion and this fact could be used in a fragment shader to calculate which rays are occluded.

I guess there must be something I'm missing, for example I'm not sure how the fragment shader could save the occlusion results for each ray so that they are available for pixel at the ray's origin. Has this method been tried before, is it possible to implement it as I described and if yes what would be the drawbacks in performance of calculating shadows this way?

© Game Development or respective owner

Related posts about shadows

Related posts about deferred-rendering