Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


Choose a lens flare type in URP

Understand the differences between lens flares and screen space lens flares.
Read time 2 minutesLast updated a month ago

You can add the following types of lens flares:
  • Lens flares - use a Lens Flare (SRP) component to create lens flares for lights that have specific locations in your scene, for example the sun or bright bulbs.
  • Screen space lens flares - use a Screen Space Lens Flare override to create lens flares for emissive surfaces, bright spots, and onscreen lights.
You can use both types in the same scene.
Use the following table to help you choose a lens flare type:

Feature

Lens Flare (SRP) component

Screen Space Lens Flare override

Typical usesLens flares from the sun and specific lights, custom flare shapes, and cinematicsLens flares on vehicles and water, first-person games, and science-fiction environments
Supported platformsAll platformsAll platforms
CPU and GPU useCPU and GPUGPU
Types of lightAll Light objects, except Area LightsAll bright spots and visible lights
PlacementAttach to individual lights. Place lens flares manuallyGenerate inside a volume. Place all lens flares automatically with a single setting
Lens flares from offscreen lightsYesNo
Light streaksNo, unless you create them manuallyYes
Configure flaresConfigure per lens flare or per elementConfigure for all lens flares together
Configure flare elementsConfigure many settings for each element, per lens flareConfigure several settings for elements, for all lens flares together
Configure attenuationYesNo
Affected by the environmentYesYes
Preserve aspect ratioYesNo
Chromatic aberrationNoYes
Blend modesAdditive, Lerp, Premultiplied and ScreenAdditive only
OcclusionScreen space occlusion, and geometric occlusion for offscreen lights. Configurable. Occlusion might not always work at the edge of the screen.Screen space occlusion, generated from the color buffer. Not configurable
Examples in package samplesYesNo

Additional resources