Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 10 of 14

Thread: Deferred shading and light volumes

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Intern Contributor
    Join Date
    Jun 2001

    Question Deferred shading and light volumes

    currently I'm trying to optimize my deferred shading by using lightvolumes to process only those fragments that are affected by the lightsource. I've read many tutorials and I'm very confused about how to do that.
    First of all I've created a crude sphere around my pointlightsource and rendered it for testing porposes in the first(geometry) pass (see screenshot). But this doesn't do any good since the determination of pixels to lit up actually happens during the second(light) pass? Right now I draw a 2D fullscreen quad in the range [-1,1], supply the VS with the quad vertex coordinates (gl_Position = vec4(, 1) * 2.0 - 1.0) and apply the light fragmentshader. Fine so far. But how do I do that with a 3D sphere around the lightsource during the second light pass? I guess this has to be done somehow in screenspace for every pixel? If I draw the sphere in 3D space in the light pass and apply the FS, I see only the sphere and it seems that the FS tries to draw the textures on the sphere. I simply don't understand how to do exactly this step - using this sphere to determine the pixels the FS has to cover for the lighting pass.

    Any comprehensive input is very much apprechiated

    Thanks and regards
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Screenshot - 013013 - 20:58:36.jpg 
Views:	1391 
Size:	4.7 KB 
ID:	965  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts