Unity’s Scriptable Render Pipeline (SRP) includes the Lens Flare Data asset. You can use this asset to control the appearance of Lens FlaresA component that simulates the effect of lights refracting inside a camera lens. Use a Lens Flare to represent very bright lights or add atmosphere to your scene. More info
See in Glossary in your sceneA Scene contains the environments and menus of your game. Think of each unique Scene file as a unique level. In each Scene, you place your environments, obstacles, and decorations, essentially designing and building your game in pieces. More info
See in Glossary. This is the SRP equivalent of the Built-in Render PipelineA series of operations that take the contents of a Scene, and displays them on a screen. Unity lets you choose from pre-built render pipelines, or write your own. More info
See in Glossary’s Flare asset, which is incompatible with SRPs.
For examples of how to use Lens Flares, refer to the Lens Flare samples in URP Package Samples.
To create a Lens Flare Data asset, select Assets > Create > Lens Flare (SRP). To use this asset, assign it to the Lens Flare Data property of a Lens Flare (SRP) component.
The Lens Flare Element asset has the following properties:
Property | Description |
---|---|
Type | Select the type of Lens Flare Element this asset creates: |
Property | Description |
---|---|
Flare Texture | The Texture this lens flare element uses. |
Preserve Aspect RatioThe relationship of an image’s proportional dimensions, such as its width and height. See in Glossary |
Fixes the width and height (aspect ratio) of the Flare Texture. You can use Distortion to change this property. |
Property | Description |
---|---|
Gradient | Controls the offset of the circular flare’s gradient. This value ranges from 0 to 1. |
Falloff | Controls the falloff of the circular flare’s gradient. This value ranges from 0 to 1, where 0 has no falloff between the tones and 1 creates a falloff that is spread evenly across the circle. |
Inverse | Enable this property to reverse the direction of the gradient. |
Property | Description |
---|---|
Gradient | Controls the offset of the polygon flare’s gradient. This value ranges from 0 to 1. |
Falloff | Controls the falloff of the polygon flare’s gradient. This value ranges from 0 to 1, where 0 has no falloff between the tones and 1 creates a falloff that is spread evenly across the polygon. |
Side Count | Determines how many sides the polygon flare has. |
Roundness | Defines how smooth the edges of the polygon flare are. This value ranges from 0 to 1, where 0 is a sharp polygon and 1 is a circle. |
Inverse | Enable this property to reverse the direction of the gradient |
Property | Description |
---|---|
Gradient | Controls the offset of the circular flare’s gradient. This value ranges from 0 to 1. |
Falloff | Controls the falloff of the circular flare’s gradient. This value ranges from 0 to 1, where 0 has no falloff between the tones and 1 creates a falloff that is spread evenly across the circle. |
Inverse | Enable this property to reverse the direction of the gradient. |
Amplitude | Amplitude of the sampling of the noise. |
Repeat | Frequency of the sampling for the noise. |
Speed | Scale the speed of the animation. |
Ring Thickness | Ring Thickness. |
Property | Description |
---|---|
Asset | Lens Flare Data SRP asset as an element. |
Unity support an Lens Flare Data SRP recursive, but with a hard cutoff after 16 recursions call. For instance asset A constains asset B which constains asset A (infinite recursion). That will trigger a warning and execution 16 recursions: ~~~~~~ “LensFlareSRPAsset contains too deep recursive asset (> 16). Be careful to not have recursive aggregation, A contains B, B contains A, … which will produce an infinite loop.” ~~~~~~
Property | Description |
---|---|
Color Type | Select the color type of Lens Flare Element this asset creates: |
Tint | Changes the tint of the lens flare. If this asset is attached to the light, this property is based on the light tint. |
Modulate By Light Color | Allows light color to affect this Lens Flare Element. This only applies when the asset is used in a SRP Lens Flare Override Component that is attached to a point, spot, or area light. |
Intensity | Controls the intensity of this element. |
Blend Mode | Select the blend mode of the Lens Flare Element this asset creates:
|
Property | Description |
---|---|
Tint | Changes the tint of the lens flare. If this asset is attached to the light, this property is based on the light tint. |
Property | Description |
---|---|
Tint Radial | Specifies the radial gradient tint of the element. If the element type is set to Image, the Flare Texture is multiplied by this color. |
Property | Description |
---|---|
Tint Angular | Specifies the angular gradient tint of the element. If the element type is set to Image, the Flare Texture is multiplied by this color. |
Property | Description |
---|---|
Cutoff Speed | Sets the speed at which the radius occludes the element. A value of zero (with a large radius) does not occlude anything. The higher this value, the faster the element is occluded on the side of the screen. The effect of this value is more noticeable with multiple elements. |
Cutoff Radius | Sets the normalized radius of the lens shape used to occlude the lens flare element. A radius of one is equivalent to the scale of the element. |
Property | Description |
---|---|
Position Offset | Defines the offset of the lens flare’s position in screen space, relative to its source. |
Auto Rotate | Enable this property to automatically rotate the Lens Flare Texture relative to its angle on the screen. Unity uses the Auto Rotate angle to override the Rotation parameter. To ensure the Lens Flare can rotate, assign a value greater than 0 to the Starting Position property. |
Rotation | Rotates the lens flare. This value operates in degrees of rotation. |
Size | Use this to adjust the scale of this lens flare element. This property is not available when the Type is set to Image and Preserve Aspect Ratio is enabled. |
Scale | The size of this lens flare element in world space. |
Property | Description |
---|---|
Starting Position | Defines the starting position of the lens flare relative to its source. This value operates in screen space. |
Angular Offset | Controls the angular offset of the lens flare, relative to its current position. This value operates in degrees of rotation. |
Translation Scale | Limits the size of the lens flare offset. For example, values of (1, 0) create a horizontal lens flare, and (0, 1) create a vertical lens flare. You can also use this property to control how quickly the lens flare appears to move. For example, values of (0.5, 0.5) make the lens flare element appear to move at half the speed. |
Property | Description |
---|---|
Enable | Set this property to True to enable distortion. |
Radial Edge Size | Controls the size of the distortion effectAn audio effect that modifies the sound by squashing and clipping the waveform to produce a rough, harsh result. More info See in Glossary from the edge of the screen. |
Radial Edge Curve | Blends the distortion effect along a curve from the center of the screen to the edges of the screen. |
Relative To Center | Set this value to True to make distortion relative to the center of the screen. Otherwise, distortion is relative to the screen position of the lens flare. |
Property | Description |
---|---|
Enable | Enable this to allow multiple lens flare elements in your scene. |
Count | Determines the number of identical lens flare elements Unity generates. A value of 1 appears the same as a single lens flare element. |
Distribution | Select the method that Unity uses to generate multiple lens flare elements: |
Length Spread | Controls how spread out multiple lens flare elements appear. |
Relative To Center | If true the distortion is relative to center of the screen otherwise relative to lensFlare source screen position. |
Property | Description |
---|---|
Colors | The range of colors that this asset applies to the lens flares. |
Rotation | The angle of rotation (in degrees) applied to each element incrementally. |
Property | Description |
---|---|
Colors | The range of colors that this asset applies to the lens flares. You can use the Position Spacing curve to determine how this range affects each lens flare. |
Position Variation | Adjust this curve to change the placement of the lens flare elements in the Lens Spread. |
Rotation | The uniform angle of rotation (in degrees) applied to each element distributed along the curve. This value ranges from –180° to 180°. |
Scale | Adjust this curve to control the size range of the lens flare elements. |
Property | Description |
---|---|
Seed | The base value that this asset uses to generate randomness. |
Intensity Variation | Controls the variation of brightness across the lens flare elements. A high value can make some elements might invisible. |
Colors | The range of colors that this asset applies to the lens flares. This property is based on the Seed value. |
Position Variation | Controls the position of the lens flares. The X value is spread along the same axis as Length Spread. A value of 0 means there is no change in the lens flare position. The Y value is spread along the vertical screen space axis based on the Seed value. |
Rotation Variation | Controls the rotation variation of the lens flares, based on the Seed value. The Rotation and Auto Rotate parameters inherit from this property. |
Scale Variation | Controls the scale of the lens flares based on the Seed value. |
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.
When you visit any website, it may store or retrieve information on your browser, mostly in the form of cookies. This information might be about you, your preferences or your device and is mostly used to make the site work as you expect it to. The information does not usually directly identify you, but it can give you a more personalized web experience. Because we respect your right to privacy, you can choose not to allow some types of cookies. Click on the different category headings to find out more and change our default settings. However, blocking some types of cookies may impact your experience of the site and the services we are able to offer.
More information
These cookies enable the website to provide enhanced functionality and personalisation. They may be set by us or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited our site, and will not be able to monitor its performance.
These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising. Some 3rd party video providers do not allow video views without targeting cookies. If you are experiencing difficulty viewing a video, you will need to set your cookie preferences for targeting to yes if you wish to view videos from these providers. Unity does not control this.
These cookies are necessary for the website to function and cannot be switched off in our systems. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms. You can set your browser to block or alert you about these cookies, but some parts of the site will not then work. These cookies do not store any personally identifiable information.