Class LensFlareComponentSRP
Data-Driven Lens Flare can be added on any gameobject
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
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 |
---|---|
bool |
attenuationByLightShape
If component attached to a light, attenuation the lens flare per light type
Declaration
public bool attenuationByLightShape
Field Value
Type | Description |
---|---|
bool |
distanceAttenuationCurve
Attenuation by distance
Declaration
public AnimationCurve distanceAttenuationCurve
Field Value
Type | Description |
---|---|
AnimationCurve |
intensity
Intensity
Declaration
[Min(0)]
public float intensity
Field Value
Type | Description |
---|---|
float |
maxAttenuationDistance
Distance used to scale the Distance Attenuation Curve
Declaration
[Min(1E-05)]
public float maxAttenuationDistance
Field Value
Type | Description |
---|---|
float |
maxAttenuationScale
Distance used to scale the Scale Attenuation Curve
Declaration
[Min(1E-05)]
public float maxAttenuationScale
Field Value
Type | Description |
---|---|
float |
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 |
---|---|
float |
occlusionRadius
Radius around the light used to occlude the flare (value in world space)
Declaration
[Min(0)]
public float occlusionRadius
Field Value
Type | Description |
---|---|
float |
occlusionRemapCurve
OcclusionRemapCurve allow the occlusion [from 0 to 1] to be remap with any desired shape.
Declaration
public TextureCurve occlusionRemapCurve
Field Value
Type | Description |
---|---|
TextureCurve |
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(1, 64)]
public uint sampleCount
Field Value
Type | Description |
---|---|
uint |
scale
Global Scale
Declaration
[Min(0)]
public float scale
Field Value
Type | Description |
---|---|
float |
scaleByDistanceCurve
Scale by distance, use the same distance as distanceAttenuationCurve
Declaration
public AnimationCurve scaleByDistanceCurve
Field Value
Type | Description |
---|---|
AnimationCurve |
useBackgroundCloudOcclusion
Enable Occlusion using Background Cloud (for instance: CloudLayer)
Declaration
public bool useBackgroundCloudOcclusion
Field Value
Type | Description |
---|---|
bool |
useOcclusion
Enable Occlusion feature
Declaration
public bool useOcclusion
Field Value
Type | Description |
---|---|
bool |
volumetricCloudOcclusion
If volumetricCloudOcclusion is true then use the volumetric cloud (on HDRP only) for the occlusion
Declaration
public bool volumetricCloudOcclusion
Field Value
Type | Description |
---|---|
bool |
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.
Declaration
public float celestialProjectedOcclusionRadius(Camera mainCam)
Parameters
Type | Name | Description |
---|---|---|
Camera | mainCam | The camera utilized to calculate the occlusion radius |
Returns
Type | Description |
---|---|
float | The value, in world units, of the occlusion angular radius. |