Is there such a thing as screen-space shadows? I know that most shadow projection comes from rendering the world from the viewpoint of the light source, projecting the shadows onto a large square texture laying on the ground, and then rendering the scene again using data from that texture to shade things.

But what if that texture wasn't square? Ultimately, the scene is going to be projected into the screen, and using the viewport you can calculate the trapezoid-shaped block of the world that you know is going to be visible.

What if you then did all of your light projection onto that shape instead? Is there a way to make the math work? Seems to me that the end result would allow everything on the screen to always be shadowed (rather than shadows disappearing when too far from the camera), and would automatically give more shadow detail closer to the camera.

Seems like someone would have already tried this, so what am I missing?

  • \$\begingroup\$ This does not sound like "ScreenSpace" at all to me. What you are talking about, it seems, is just a way of calculating light frustum to encompass view frustum (which is already a thing in proper shadowmap algorithms). \$\endgroup\$ – Kromster May 13 '18 at 19:06
  • \$\begingroup\$ Well, ambient occlusion is a type of shadow and SSAO does it in screen space, so there's definitely one \$\endgroup\$ – Bálint May 13 '18 at 22:25
  • \$\begingroup\$ Stencil shadow volumes also operate in screen space by marking the area that is to be shadowed in the stencil buffer. \$\endgroup\$ – Maximus Minimus May 14 '18 at 5:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.