Class LensFlareComponentSRP
Data-Driven Lens Flare can be added on any gameobeject
Inherited Members
Namespace: UnityEngine.Rendering
Syntax
[ExecuteAlways]
[AddComponentMenu("Rendering/Lens Flare (SRP)")]
public sealed class LensFlareComponentSRP : MonoBehaviour
Fields
allowOffScreen
If allowOffScreen is true then If the lens flare is outside the screen we still emit the flare on screen
Declaration
public bool allowOffScreen
Field Value
| Type | Description | 
|---|---|
| Boolean | 
attenuationByLightShape
If component attached to a light, attenuation the lens flare per light type
Declaration
public bool attenuationByLightShape
Field Value
| Type | Description | 
|---|---|
| Boolean | 
distanceAttenuationCurve
Attenuation by distance
Declaration
public AnimationCurve distanceAttenuationCurve
Field Value
| Type | Description | 
|---|---|
| AnimationCurve | 
intensity
Intensity
Declaration
[Min(0F)]
public float intensity
Field Value
| Type | Description | 
|---|---|
| Single | 
maxAttenuationDistance
Distance used to scale the Distance Attenuation Curve
Declaration
[Min(1E-05F)]
public float maxAttenuationDistance
Field Value
| Type | Description | 
|---|---|
| Single | 
maxAttenuationScale
Distance used to scale the Scale Attenuation Curve
Declaration
[Min(1E-05F)]
public float maxAttenuationScale
Field Value
| Type | Description | 
|---|---|
| Single | 
occlusionOffset
Z Occlusion Offset allow us to offset the plane where the disc of occlusion is place (closer to camera), value on world space. Useful for instance to sample occlusion outside a light bulb if we place a flare inside the light bulb
Declaration
public float occlusionOffset
Field Value
| Type | Description | 
|---|---|
| Single | 
occlusionRadius
Radius around the light used to occlude the flare (value in world space)
Declaration
[Min(0F)]
public float occlusionRadius
Field Value
| Type | Description | 
|---|---|
| Single | 
radialScreenAttenuationCurve
Attenuation used radially, which allow for instance to enable flare only on the edge of the screen
Declaration
public AnimationCurve radialScreenAttenuationCurve
Field Value
| Type | Description | 
|---|---|
| AnimationCurve | 
sampleCount
Random Samples Count used inside the disk with 'occlusionRadius'
Declaration
[Range(1F, 64F)]
public uint sampleCount
Field Value
| Type | Description | 
|---|---|
| UInt32 | 
scale
Global Scale
Declaration
[Min(0F)]
public float scale
Field Value
| Type | Description | 
|---|---|
| Single | 
scaleByDistanceCurve
Scale by distance, use the same distance as distanceAttenuationCurve
Declaration
public AnimationCurve scaleByDistanceCurve
Field Value
| Type | Description | 
|---|---|
| AnimationCurve | 
useOcclusion
Enable Occlusion feature
Declaration
public bool useOcclusion
Field Value
| Type | Description | 
|---|---|
| Boolean | 
Properties
lensFlareData
Lens flare asset used on this component
Declaration
public LensFlareDataSRP lensFlareData { get; set; }
Property Value
| Type | Description | 
|---|---|
| LensFlareDataSRP | 
Methods
celestialProjectedOcclusionRadius(Camera)
Retrieves the projected occlusion radius from a particular celestial in the infinity plane with an angular radius.
This is used for directional lights which require to have consistent occlusion radius regardless of the near/farplane configuration.
The camera utilized to calculate the occlusion radius
Declaration
public float celestialProjectedOcclusionRadius(Camera mainCam)
Parameters
| Type | Name | Description | 
|---|---|---|
| Camera | mainCam | 
Returns
| Type | Description | 
|---|---|
| Single |