Search Unity

Screen Space Shadow Tracing

Discussion in 'Made With Unity' started by brianasu, Mar 12, 2013.

  1. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369
    While reading through the Crysis tech paper I noticed that they actually used ray traced shadows for the characters. Similar to screen space reflections.

    The basic algorithm is to reconstruct the position in the shader. Then trace a ray from that position in the direction of the light. If it hits a point (z of your ray is less than the depth buffer) then shadow the pixel.

    Screen space shadows are similar to SSR except they don't use a light direction but use a reflection vector. One disadvantage is that once any object goes off screen it won't cast a shadow. It's best for really small detailed shadows like faces.

    Webplayer later when I tweak it a bit more.



    If you haven't seen them yet my channel has a lot of Unity graphic demos:)
     
    Last edited: Mar 12, 2013
  2. I am da bawss

    I am da bawss

    Joined:
    Jun 2, 2011
    Posts:
    2,574
    Wow amazing work! I am wondering how costly this is though? What kind of system are you running? Is it even possible to do it on mobile?
     
  3. brianasu

    brianasu

    Joined:
    Mar 9, 2010
    Posts:
    369
    Yeah I wouldn't try it on a mobile. Maybe iphone 5+:) Should give it a try though. It's similar performance to ssao I think. I run a macbook 2010.