Skip to main content

Lighting an Interior

Overview

The Sinespace platform provides virtual world creators with lighting tools that can create a wide variety of atmospheric spaces.

The Sinespace platform provides virtual world creators with lighting tools that can create a wide variety of atmospheric spaces. There is no single right way to light a region, and getting the right result can take a few attempts.

This guide uses the Mirage demo scene as an example of combining real-time and baked light types.

Download the Mirage scene

Baking and Lightmaps

Each light in a scene is either baked or real-time. Most light types, with the exception of area lights, can be either.

Real-time lighting affects in-world performance. Baked lighting increases upload size. In the Mirage demo scene, the creator used a combination of real-time and baked lighting.

Lightmap.jpg

Ambient and Directional Light

When you create a new scene in Unity, it has two light sources by default:

  • Directional light
  • Ambient light

Directional Light

A directional light is an object in the scene that you can rotate like any other object. It casts shadows in the direction you rotate it.

For the Mirage scene, the directional light has been deleted. Directional light is often used as sunlight in an exterior scene. In Mirage, shadows are cast by the point lights in each room.

Directionallight.jpg

Ambient Light

The ambient light has no source object in the scene. Modify it from Window > Lighting in Unity.

In this scene, the ambient source is the skybox. The skybox color range informs the ambient light in the scene. You can also use a flat color source or gradient options. The skybox option works well in Mirage, but it may not fit every region.

Ambientlight.jpg

Adding Lights to a Scene

You can add lights and light probes from Create > Light in the scene hierarchy. Keeping "light" in the names of your light objects makes them easier to find in the hierarchy.

Createalight.jpg

Area Lights

Area lights are used in this scene to project different tinted light from a plane into each room.

Area lights are efficient, but they do not cast shadows. They are baked only. The direction of the light from the plane is indicated by the yellow line.

Arealight.jpg

Point Lights

The hanging lights in the Mirage scene are mesh lamps on the walls and ceilings, with point lights attached.

Point lights emit light in all directions over an area visible as a wireframe sphere. In this scene, the point lights are set to real-time and create dynamic shadows on avatars and other non-static objects. The hanging lights also have a halo component to provide a simple visual indication that they are light sources.

The Mirage scene also contains one baked point light, called CenterLight. The creator used a wide-area baked point light because an area light on the ceiling would have weakened the shadows cast by the other ceiling and wall lights.

Pointlight.jpg

Spot Lights

Spot lights project light from a cone point. In the Mirage scene, they illuminate the NPCs showcasing clothing items. They are set to real-time and project NPC shadows onto the back wall.

Spotlight.jpg

Emissive Surfaces

The light circle in the center of the main room uses meshes where the Standard Shader is set as emissive, making the mesh appear to radiate light.

If the emission value is between 0 and 1, the mesh surface appears to be a light source but does not actually emit light. If one or more color channels are set above 1, the mesh surface emits faint HDR light. This can work well for LEDs and small light piping, and can contribute to light bounce off shiny surfaces.

Emissive surfaces are only applied to static objects and only for baked lighting.

note

Emissive surfaces may generate artifacts on materials with detail maps when viewed in WebGL.

Emissivesurfaces.jpg

Light Probes

Light probes sample the combined lighting in the scene and let moving objects, especially visiting avatars, be lit by baked light sources that would otherwise only affect static scene components through lightmap textures.

Place as many or as few light probes as your scene needs. Aim to place them where different light sources overlap. In this scene, the creator focused on light probes at head height, especially around the intense lighting in the fashion studio.

note

You can toggle light probe visibility from the Gizmos menu above the Scene view.

Lightprobes.jpg

Baking the Scene

Once your light sources and light probes are laid out, and all static objects that form the fabric of the scene are in place, bake the scene before submitting it to the server.

Baking is triggered from the Build button at the bottom of the Lighting window. It may take a while to complete, and it takes longer when the baked resolution is higher. Unity defaults to 50 texels per unit; this scene used 20 and could probably have gone down to 10 without a significant visual change.

After the bake completes, Unity creates lightmaps for your scene. These are uploaded automatically when you submit the scene to the server. The lightmaps are then blended with the scene textures to create the final look.

When you bake the scene, Unity also applies light information to light probes and reflection probes. You can also bake ambient occlusion and reflection probes as part of the same process.

Bakinglights.jpg