Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 1 of 1

Thread: Deferred Shading versus Deferred Lighting

  1. #1
    Intern Newbie
    Join Date
    Jan 2018
    Posts
    42

    Deferred Shading versus Deferred Lighting

    I know how deferred lighting works. It makes perfect sense. Seperate diffuse and specular radiance

    G-buffer pass (Stores screenspace position, normals, diffuse albedo/specular albedo, per-pixel PHONG properties, and cubemap reflect)

    Diffuse | Specular additive blending passes (for each light calculate the diffuse and specular multipliers from that light and add them to the diffuse and specular color buffers, using the screenspace position calculated in the G-buffer pass converted to world coords)

    Combination pass (takes the G-buffer pass info and the diffuse | specular buffer, blends them and does cubemap reflections)

    (I actually thought until about a week ago that it was my own invention... silly me)

    But now I find that many say it's "slow" and "shouldn't be used"

    That's all well and good, I understand there is an extra pass involved which slows things down

    BUT

    How exactly does deferred SHADING work?

    All I know is that somehow you don't have a specular | diffuse split in lighting and the combination pass is the only pass other than the g-buffer pass... which absolutely blows my mind

    How do you take the multiple passes (1 per light) and additively blend them without saving the radiance as diffuse | specular? How do you perform multiple light passes and write them to a final target directly instead of writing them to a diffuse | specular split buffer?

    If you actually took the G-buffer color value and calculated the net color on that pixel due to that light and wrote that over what was there, you'd obviously end up adding the texture to itself which would not be good, and if you apply lighting multipliers to already lit pixels, you are not going to get the correct lighting

    so basically I don't understand how deferred shading would even work? It seems like it would only support one light per pixel which would look horrible



    It is worth noting that i've never done lighting in GLSL WITHOUT deferred lighting, mostly because I don't understand how it would work if you didn't calculate seperate diffuse and specular radiance

    so you could also say I don't understand how forward rendering works
    Last edited by Geklmin; 04-27-2018 at 06:51 AM.

Tags for this Thread

Posting Permissions

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