Search Unity

GI on a scene created from script

Discussion in 'Scripting' started by Bicyclette, May 31, 2019.

  1. Bicyclette

    Bicyclette

    Joined:
    May 21, 2019
    Posts:
    1
    Hello,

    I'm quite new to Unity, and I've recently started a project in which I'm creating whole scene from a C# script (geometry, materials, light position and settings...).

    The thing is that I want to have some global illumination in my scene, and, as far as I know, area lights must generate some lightmaps.
    Now I want to know how is it possible to bake a lightmap from light sources and GameObjects generated from a script at runtime.

    If someone have an idea, I'd be glad to know what's the trick to achieve such a thing.

    Thanks.
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    I think you're limited to run time lighting if you're building your scene at run time. Area lights aren't supported without baking is my understanding, but ambient light, point lights, and spotlights are. Use deferred rendering if you're using the legacy renderer and have more than a couple point lights.

    You'll probably get more helpful answers asking in the correct forum though.
    https://forum.unity.com/forums/global-illumination.85/