Skybox lights

BeginnerDesignerProgrammer skybox light is an ambient light emitted by a skybox. Xenko analyzes the skybox texture and generates lighting using image-based lighting (Wikipedia). Skybox lights are good for exterior scenes, where the skybox is visible. They’re less useful for interior scenes, such as in rooms where the skybox is only visible through windows; as the skybox light nonetheless lights the entire room, this creates an unnatural effect.

How skyboxes light the scene

materials: These images show the effect of skybox lighting on a material with different metal and gloss properties: Notice how the skybox texture colors are reflected.

Set up a skybox light

Light component.

  • Asset View, click
  • Miscellaneous > Skybox. Select an asset window opens.
  • OK. Game Studio adds the skybox asset with the texture you specified.
  • Select the entity you want to be the skybox light.
  • Property Grid (on the right by default), click Add component and select Light.
  • Light component properties, under Light, select Skybox.
  • (Select an asset):
  • OK. Light component uses the skybox asset to light the scene.

    Skybox asset properties

    spherical harmonics (Wikipedia)) and as a texture to light different kinds of material. You can control the detail of both in the skybox asset properties.

    Skybox light properties

    Example code

    The following code changes the skybox light and its intensity:
    1. public Skybox skybox;public void ChangeSkyboxParameters(){ // Get the light component from an entity var light = Entity.Get<LightComponent>(); // Get the Skybox Light settings from the light component var skyboxLight = light.Type as LightSkybox; // Replace the existing skybox skyboxLight.Skybox = skybox; // Change the skybox light intensity light.Intensity = 1.5f;}

    See also

  • Skyboxes and backgrounds