Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is it possible to supply a shadow map to a light?

Discussion in 'General Graphics' started by LightStriker, Nov 1, 2016.

  1. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    Let's say I want a good quality spot light, but I don't want the overhead of baking lightmap for the whole scene.

    I've noticed CommandBuffer now exist for lights.

    Is it possible to bake the shadow map of a spotlight, and reuse it at runtime so that spot light wouldn't to refresh it every frame? (Assuming I don't have anything dynamic in front of it)
     
  2. Deleted User

    Deleted User

    Guest

    what you can do is to create a light cookie for the light/lights and use that. I don't think there is a way to cache shadows yet. Maybe if enough people suggest it to unity they will implement that.
     
  3. LightStriker

    LightStriker

    Joined:
    Aug 3, 2013
    Posts:
    2,716
    The issue with a light cookie is that if something come in front - even if you want that thing to not cast shadow - it will appear black as if something was in front of it. The shadow map also have a depth map to know if an object is in front or behind the shadow caster.