Lighting Set Up for Interior Environments#

This document will describe how to set up lighting for environments that do not receive exterior lighting.

Getting Started top#

Light Layers: What are they ?#

Unity provides us with tools that allow us to set up lights that only affect meshes specified to receive light from those light sources. This opens up the possibility to exclude exterior lighting from interiors and bake Mixed Lighting for higher quality visuals when running the simulator. This is especially useful when creating interior environments.

Light Layers: How do we use them ?#

The SVL simulator is already setup to employ Light Layers but you will need to do some extra preparation to use them. This includes proper setup of the interior post-processing volume, lights, meshes and then baking the lighting. To do this, you must be in Developer Mode.

Interior Environment Setup top#

  1. Create an empty game object and name it LightingSetup (Right click in Hierarchy > Create Empty) then zero out the transforms (Click the 3 dots on the right of the Transform section > Reset). This is where you will place your rendering volumes, light probes and reflection probes and will help keep the hierarchy organized.

    )

  2. Create a Box Volume (Right click in Hierarchy > Volume > Box Volume) and zero out the transforms. Adjust the position and size of the volume to contain your interior environment. Multiple volumes can be used. Place this inside your LightingSetup game object in the Hierarchy. Be sure to name it so that it is defined as an interior lighting post processing volume. Example: NameOfEnvironmentPostProcessingVolumeInterior.

    )

  3. Create a new Volume Profile (Assets > Create > Volume Profile). This Post-Processing Volume Profile will override the Simulator profile that is used at runtime for exterior lighting. Be sure to name it so that it is defined as an interior lighting post processing volume ex: NameOfEnvironmentPostProcessingProfileInterior.

    )

  4. Add your profile overrides for the interior (Select your NameOfEnvironmentPostProcessingProfileInterior in the project view > Add Override > Select and adjust desired override).

    )

  5. Add a Reflection Proxy Volume (Right click in Hierarchy > Volume > Select desired volume shape) and zero out the transforms. Be sure to name it so that it is defined as your interior environment reflection proxy volume. Example: NameOfEnvironmentReflectionProxyVolume.

  6. Add the Reflection Proxy Volume Script (Select your NameOfEnvironmentReflectionProxyVolume in the project view > Add Component > Search for and select Reflection Proxy Volume).

  7. Remove Box Collider and Volume components from the Reflection Proxy Volume asset. (Select your NameOfEnvironmentReflectionProxyVolume in the project view > click the 3 dots on the right for each section > Remove Component) Do not remove the Reflection Proxy Volume component.

  8. Move and adjust the size of the Reflection Proxy Volume asset to envelope the desired space in your interior.

    )

  9. Add Reflection Probes to the scene (Right click in Hierarchy > Light > Reflection Probe). This is vital to proper lighting for interior spaces. For environments requiring multiple reflection probes create an empty game object inside of the LightingSetUp game object, reset transforms and place your probes inside. Naming for reflection probes and reflection probe group should be descriptive ex: NameOfEnvironmentReflectionProbe.

  10. Add the Reflection Proxy Volume asset to your Reflection Probes (Select your Reflection Probe > Projection Settings Section > Proxy Volume field > add your Proxy Volume).

    )

  11. Adjust the size of each Reflection Probe to the desired size for your interior space.

  12. Add Light Probes to the scene (Right click in Hierarchy > Light > Light Probe Group). This step is optional but can improve the lighting fidelity for dynamic objects as they move through the environment. Place this inside your LightingSetup game object in the Hierarchy. Naming for the group should be descriptive ex: NameOfEnvironmentLightProbeGroup.

    )

Setting Up the Lights top#

  1. Add lights to your scene if none already exist and adjust settings for the desired visuals (Right click in Hierarchy > Light > choose the desired light)

  2. Select the light in the inspector and in the General dropdown change Mode to Mixed.

  3. Next set the Light Layer to Light Layer 7 (Expand More Options in General drop down by clicking the gear icon).

  4. If Shadows are enabled make sure that Link Light Layer is also enabled (Expand More Options in General drop down by clicking the gear icon).

    )

Static Mesh Setup top#

  1. Set all meshes to Reflection Probe Static (Select mesh > Top right "Static" drop down > Reflection Probe Static).

  2. Set Rendering Layer Mask to Light Layer 7 (Select mesh > Expand Mesh Renderer > Expand Additional Settings > Rendering Layer Mask).

)

Dynamic Mesh Setup top {: #dynamic-mesh-setup data-toc-label='Dynamic Mesh Setup'}}#

  1. Set Rendering Layer Mask to Light Layer 7 (See above).
  2. If you have a vehicle that includes lights, those lights will need to be set to Light Layer 7 and Link Light Layer enabled (See above).

Bake Reflections and Lighting top {: #baking-the-lighting data-toc-label='Baking the Lighting'}}#

  1. Open the Lighting tab to access Unity's lighting options (Window > Rendering > Lighting).

  2. In the Scene section select your Lighting Settings asset. If you don't already have a Lighting Settings asset then create a new one using the button under the input field.

    )

  3. Be sure that the Mixed Lighting Section has Baked Global Illumination checked and Lighting Mode is set to Baked Indirect.

  4. Adjust settings to match the quality expectations. For development purposes it's useful to have a draft version with lower quality settings and then a high quality version for final rendering.

  5. In the Environment section add the PostProcessingProfileInterior that you made earlier.

    )

  6. Finally click the Generate Lighting. Once the lighting has finished processing click the Generate Lighting drop down and click Bake Reflection Probes.

    )

  7. If you need to make changes to the lighting or the environment you will need to re-bake all lighting data.