Search Unity

Dynamically Shadowed Lightmaps

Discussion in 'Assets and Asset Store' started by RC-1290, Apr 4, 2014.

  1. RC-1290

    RC-1290

    Joined:
    Jul 2, 2012
    Posts:
    639
    This is a project I worked on about a year ago, it allows you to cast shadows from spotlights onto lightmaps without the lights themselves affecting the scene. It was used for the shadows in the game 'Stick it to the Man' by Zoink!.

    I received some questions about how it works, so I decided to make the prototype public.

    This is what it looks like in my basic test scene:
    $Shadowed Lightmaps 650w.jpg

    Of course, it looks a lot better in-game with pretty art. You can also find some screenshots on my site.

    The development of this prototype has been paid for, so you can access the source code over at bitbucket. But it's not necessarily suited for general use, and might require some more investments to fit your specific project.

    Keep in mind that it's quite a severe hack of the Internal PrePassLighting shader (the 4.2.2 version), and all surfaces intended to receive shadows this way, need to use a custom vertex+fragment shader. Furthermore it currently only works with non-directional lightmaps.

    [Edit] The original title of this post was "Lightmapped Shadows", which is obviously wrong, because this is about making dynamic shadows affect static lightmaps. Not the other way around.
     
    Last edited: Apr 14, 2014