Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Rendering shadows correctly with a custom projection matrix

Discussion in 'Shaders' started by lobster42, Apr 30, 2016.

  1. lobster42

    lobster42

    Joined:
    Apr 5, 2016
    Posts:
    6
    Hi all,

    I'm a bit of a noob when it comes to shaders. I recently started using custom projection matrices that break shadows (which I understand to be a general issue) and I am wondering if writing my own shaders will solve this issue. What happens is that my shadows appear in weird places with weird shapes.

    I'm assuming my problem relates to this
    http://forum.unity3d.com/threads/un...me-view-with-custom-projection-matrix.307143/
    although my shadows look even more F***ed up that any shown in there. Given that this was a year ago, I'm hoping there's some new insight on this.

    How would I go about getting started solving this issue, perhaps through making a custom shader? Or is this not something that's feasible to attempt for a beginner? Does anyone know if buying an asset, as suggested in that other thread, would fix this?
    Grateful for any help!

    Cheers,
    Luise
     
  2. lobster42

    lobster42

    Joined:
    Apr 5, 2016
    Posts:
    6
    I haven't tried to fix this in a while, but I just went back to it and tried setting the directional light to mixed or baked and this works. Should probably have thought of that earlier. Still if anyone has a moment to explain to me why it doesn't work in real time I'd be super grateful!