Lighting and Shadows - WEKIT-ECS/MIRAGE-XR GitHub Wiki

Lighting

There are two lights in the scene:

  • Directional Light: This is the above the scene hovering light facing downwards
  • UserTorchLight: This is a directional light attached to the camera, so it always points where the user looks

Rendering time is reduced, if non-point lights are used, as only the set direction of the light needs to be evaluated.

Shadows

  • PlaneManager: the PlaneManager has an ARFeatheredPlane prefab with an ARFoundationPlaneBehaviour component script. This script has now a new shadow material, set to AdditionalDirectionalShadowReceiver, which uses the shader graph for receiving shadows from the DevDunkStudio package.

  • ARFeatheredPlane prefab: The prefab additionally has a second mesh renderer material AdditionalDirectionalShadowReceiver:

image

  • Light settings: Shadows are configured in the directional light GameObject settings of UserTorchLight, setting shadows to hard.

  • URP settings: The Universal Render Pipeline Asset prefab has been configured to set the Max Distance to 7, the smallest value that had a reasonable amount of shadows for the given lighting conditions, with shadow cascades activated.