Class LensFlareCommonSRP
Common code for all Data-Driven Lens Flare used
Inherited Members
Namespace: UnityEngine.Rendering
Assembly: Unity.RenderPipelines.Core.Runtime.dll
Syntax
public sealed class LensFlareCommonSRP
Fields
maxLensFlareWithOcclusion
Max lens-flares-with-occlusion supported
Declaration
public static int maxLensFlareWithOcclusion
Field Value
Type | Description |
---|---|
int |
maxLensFlareWithOcclusionTemporalSample
With TAA Occlusion jitter depth, thought frame on HDRP. So we do a "unanimity vote" for occlusion thought 'maxLensFlareWithOcclusionTemporalSample' frame Important to keep this value maximum of 8 If this value change that could implies an implementation modification on: com.unity.render-pipelines.high-definition/Runtime/PostProcessing/Shaders/LensFlareMergeOcclusionDataDriven.compute
Declaration
public static int maxLensFlareWithOcclusionTemporalSample
Field Value
Type | Description |
---|---|
int |
mergeNeeded
Set to 1 to enable temporal sample merge. Set to 0 to disable temporal sample merge (must support 16 bit textures, and the occlusion merge must be written in the last texel (vertical) of the lens flare texture.
Declaration
public static int mergeNeeded
Field Value
Type | Description |
---|---|
int |
occlusionRT
occlusion texture either provided or created automatically by the SRP for lens flare. Texture width is the max number of lens flares that have occlusion (x axis the lens flare index). y axis is the number of samples (maxLensFlareWithOcclusionTemporalSample) plus the number of merge results. Merge results must be done by the SRP and stored in the [(lens flareIndex), (maxLensFlareWithOcclusionTemporalSample + 1)] coordinate. Note: It's not supported on OpenGL3 and OpenGLCore
Declaration
public static RTHandle occlusionRT
Field Value
Type | Description |
---|---|
RTHandle |
Properties
Instance
Current unique instance
Declaration
public static LensFlareCommonSRP Instance { get; }
Property Value
Type | Description |
---|---|
LensFlareCommonSRP |
Methods
AddData(LensFlareComponentSRP)
Add a new lens flare component on the pool.
Declaration
public void AddData(LensFlareComponentSRP newData)
Parameters
Type | Name | Description |
---|---|---|
LensFlareComponentSRP | newData | The new data added |
ComputeOcclusion(Material, Camera, float, float, bool, float, float, bool, Vector3, Matrix4x4, LowLevelCommandBuffer, bool, bool, Texture, Texture, int, int, int, int, int, int, int, int, int, int, int)
Declaration
public static void ComputeOcclusion(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, bool usePanini, float paniniDistance, float paniniCropToFit, bool isCameraRelative, Vector3 cameraPositionWS, Matrix4x4 viewProjMatrix, LowLevelCommandBuffer cmd, bool taaEnabled, bool hasCloudLayer, Texture cloudOpacityTexture, Texture sunOcclusionTexture, int _FlareOcclusionTex, int _FlareCloudOpacity, int _FlareOcclusionIndex, int _FlareTex, int _FlareColorValue, int _FlareSunOcclusionTex, int _FlareData0, int _FlareData1, int _FlareData2, int _FlareData3, int _FlareData4)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | |
Camera | cam | |
float | actualWidth | |
float | actualHeight | |
bool | usePanini | |
float | paniniDistance | |
float | paniniCropToFit | |
bool | isCameraRelative | |
Vector3 | cameraPositionWS | |
Matrix4x4 | viewProjMatrix | |
LowLevelCommandBuffer | cmd | |
bool | taaEnabled | |
bool | hasCloudLayer | |
Texture | cloudOpacityTexture | |
Texture | sunOcclusionTexture | |
int | _FlareOcclusionTex | |
int | _FlareCloudOpacity | |
int | _FlareOcclusionIndex | |
int | _FlareTex | |
int | _FlareColorValue | |
int | _FlareSunOcclusionTex | |
int | _FlareData0 | |
int | _FlareData1 | |
int | _FlareData2 | |
int | _FlareData3 | |
int | _FlareData4 | ShaderID for the FlareData4 |
ComputeOcclusion(Material, Camera, float, float, bool, float, float, bool, Vector3, Matrix4x4, CommandBuffer, bool, bool, Texture, Texture, int, int, int, int, int, int, int, int, int, int, int)
Effective Job of drawing the set of Lens Flare registered
Declaration
public static void ComputeOcclusion(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, bool usePanini, float paniniDistance, float paniniCropToFit, bool isCameraRelative, Vector3 cameraPositionWS, Matrix4x4 viewProjMatrix, CommandBuffer cmd, bool taaEnabled, bool hasCloudLayer, Texture cloudOpacityTexture, Texture sunOcclusionTexture, int _FlareOcclusionTex, int _FlareCloudOpacity, int _FlareOcclusionIndex, int _FlareTex, int _FlareColorValue, int _FlareSunOcclusionTex, int _FlareData0, int _FlareData1, int _FlareData2, int _FlareData3, int _FlareData4)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | Lens Flare material (HDRP or URP shader) |
Camera | cam | Camera |
float | actualWidth | Width actually used for rendering after dynamic resolution and XR is applied. |
float | actualHeight | Height actually used for rendering after dynamic resolution and XR is applied. |
bool | usePanini | Set if use Panani Projection |
float | paniniDistance | Distance used for Panini projection |
float | paniniCropToFit | CropToFit parameter used for Panini projection |
bool | isCameraRelative | Set if camera is relative |
Vector3 | cameraPositionWS | Camera World Space position |
Matrix4x4 | viewProjMatrix | View Projection Matrix of the current camera |
CommandBuffer | cmd | Command Buffer |
bool | taaEnabled | Set if TAA is enabled |
bool | hasCloudLayer | Set if cloudLayerTexture is used |
Texture | cloudOpacityTexture | cloudOpacityTexture used for sky visibility fullscreen |
Texture | sunOcclusionTexture | Sun Occlusion Texture from VolumetricCloud on HDRP or null |
int | _FlareOcclusionTex | ShaderID for the FlareOcclusionTex |
int | _FlareCloudOpacity | ShaderID for the FlareCloudOpacity |
int | _FlareOcclusionIndex | ShaderID for the FlareOcclusionIndex |
int | _FlareTex | ShaderID for the FlareTex |
int | _FlareColorValue | ShaderID for the FlareColor |
int | _FlareSunOcclusionTex | ShaderID for the _FlareSunOcclusionTex |
int | _FlareData0 | ShaderID for the FlareData0 |
int | _FlareData1 | ShaderID for the FlareData1 |
int | _FlareData2 | ShaderID for the FlareData2 |
int | _FlareData3 | ShaderID for the FlareData3 |
int | _FlareData4 | ShaderID for the FlareData4 |
Dispose()
Disposal function, must be called by the SRP to release all internal textures.
Declaration
public static void Dispose()
DoLensFlareDataDrivenCommon(Material, Camera, float, float, bool, float, float, bool, Vector3, Matrix4x4, LowLevelCommandBuffer, bool, bool, Texture, Texture, RenderTargetIdentifier, Func<Light, Camera, Vector3, float>, int, int, int, int, int, int, int, int, int, int, int, int, bool)
Declaration
public static void DoLensFlareDataDrivenCommon(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, bool usePanini, float paniniDistance, float paniniCropToFit, bool isCameraRelative, Vector3 cameraPositionWS, Matrix4x4 viewProjMatrix, LowLevelCommandBuffer cmd, bool taaEnabled, bool hasCloudLayer, Texture cloudOpacityTexture, Texture sunOcclusionTexture, RenderTargetIdentifier colorBuffer, Func<Light, Camera, Vector3, float> GetLensFlareLightAttenuation, int _FlareOcclusionRemapTex, int _FlareOcclusionTex, int _FlareOcclusionIndex, int _FlareCloudOpacity, int _FlareSunOcclusionTex, int _FlareTex, int _FlareColorValue, int _FlareData0, int _FlareData1, int _FlareData2, int _FlareData3, int _FlareData4, bool debugView)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | |
Camera | cam | |
float | actualWidth | |
float | actualHeight | |
bool | usePanini | |
float | paniniDistance | |
float | paniniCropToFit | |
bool | isCameraRelative | |
Vector3 | cameraPositionWS | |
Matrix4x4 | viewProjMatrix | |
LowLevelCommandBuffer | cmd | |
bool | taaEnabled | |
bool | hasCloudLayer | |
Texture | cloudOpacityTexture | |
Texture | sunOcclusionTexture | |
RenderTargetIdentifier | colorBuffer | |
Func<Light, Camera, Vector3, float> | GetLensFlareLightAttenuation | |
int | _FlareOcclusionRemapTex | |
int | _FlareOcclusionTex | |
int | _FlareOcclusionIndex | |
int | _FlareCloudOpacity | |
int | _FlareSunOcclusionTex | |
int | _FlareTex | |
int | _FlareColorValue | |
int | _FlareData0 | |
int | _FlareData1 | |
int | _FlareData2 | |
int | _FlareData3 | |
int | _FlareData4 | |
bool | debugView |
DoLensFlareDataDrivenCommon(Material, Camera, float, float, bool, float, float, bool, Vector3, Matrix4x4, CommandBuffer, bool, bool, Texture, Texture, RenderTargetIdentifier, Func<Light, Camera, Vector3, float>, int, int, int, int, int, int, int, int, int, int, int, int, bool)
Effective Job of drawing the set of Lens Flare registered
Declaration
public static void DoLensFlareDataDrivenCommon(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, bool usePanini, float paniniDistance, float paniniCropToFit, bool isCameraRelative, Vector3 cameraPositionWS, Matrix4x4 viewProjMatrix, CommandBuffer cmd, bool taaEnabled, bool hasCloudLayer, Texture cloudOpacityTexture, Texture sunOcclusionTexture, RenderTargetIdentifier colorBuffer, Func<Light, Camera, Vector3, float> GetLensFlareLightAttenuation, int _FlareOcclusionRemapTex, int _FlareOcclusionTex, int _FlareOcclusionIndex, int _FlareCloudOpacity, int _FlareSunOcclusionTex, int _FlareTex, int _FlareColorValue, int _FlareData0, int _FlareData1, int _FlareData2, int _FlareData3, int _FlareData4, bool debugView)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | Lens Flare material (HDRP or URP shader) |
Camera | cam | Camera |
float | actualWidth | Width actually used for rendering after dynamic resolution and XR is applied. |
float | actualHeight | Height actually used for rendering after dynamic resolution and XR is applied. |
bool | usePanini | Set if use Panani Projection |
float | paniniDistance | Distance used for Panini projection |
float | paniniCropToFit | CropToFit parameter used for Panini projection |
bool | isCameraRelative | Set if camera is relative |
Vector3 | cameraPositionWS | Camera World Space position |
Matrix4x4 | viewProjMatrix | View Projection Matrix of the current camera |
CommandBuffer | cmd | Command Buffer |
bool | taaEnabled | Set if TAA is enabled |
bool | hasCloudLayer | Set if cloudLayerTexture is used |
Texture | cloudOpacityTexture | cloudOpacityTexture used for sky visibility fullscreen |
Texture | sunOcclusionTexture | Sun Occlusion Texture from VolumetricCloud on HDRP or null |
RenderTargetIdentifier | colorBuffer | Source Render Target which contains the Color Buffer |
Func<Light, Camera, Vector3, float> | GetLensFlareLightAttenuation | Delegate to which return return the Attenuation of the light based on their shape which uses the functions ShapeAttenuation...(...), must reimplemented per SRP |
int | _FlareOcclusionRemapTex | ShaderID for the OcclusionRemap |
int | _FlareOcclusionTex | ShaderID for the FlareOcclusionTex |
int | _FlareOcclusionIndex | ShaderID for the FlareOcclusionIndex |
int | _FlareCloudOpacity | ShaderID for the FlareCloudOpacity |
int | _FlareSunOcclusionTex | ShaderID for the _FlareSunOcclusionTex |
int | _FlareTex | ShaderID for the FlareTex |
int | _FlareColorValue | ShaderID for the FlareColor |
int | _FlareData0 | ShaderID for the FlareData0 |
int | _FlareData1 | ShaderID for the FlareData1 |
int | _FlareData2 | ShaderID for the FlareData2 |
int | _FlareData3 | ShaderID for the FlareData3 |
int | _FlareData4 | ShaderID for the FlareData4 |
bool | debugView | Debug View which setup black background to see only Lens Flare |
DoLensFlareScreenSpaceCommon(Material, Camera, float, float, Color, Texture, Texture, Texture, Texture, Texture, Vector4, Vector4, Vector4, Vector4, Vector4, LowLevelCommandBuffer, RTHandle, bool)
Effective Job of drawing Lens Flare Screen Space.
Declaration
public static void DoLensFlareScreenSpaceCommon(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, Color tintColor, Texture originalBloomTexture, Texture bloomMipTexture, Texture spectralLut, Texture streakTextureTmp, Texture streakTextureTmp2, Vector4 parameters1, Vector4 parameters2, Vector4 parameters3, Vector4 parameters4, Vector4 parameters5, LowLevelCommandBuffer cmd, RTHandle result, bool debugView)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | Lens Flare material (HDRP or URP shader) |
Camera | cam | Camera |
float | actualWidth | Width actually used for rendering after dynamic resolution and XR is applied. |
float | actualHeight | Height actually used for rendering after dynamic resolution and XR is applied. |
Color | tintColor | tintColor to multiply all the flare by |
Texture | originalBloomTexture | original Bloom texture used to write on at the end of compositing |
Texture | bloomMipTexture | Bloom mip texture used as data for the effect |
Texture | spectralLut | spectralLut used for chromatic aberration effect |
Texture | streakTextureTmp | Texture used for the multiple pass streaks effect |
Texture | streakTextureTmp2 | Texture used for the multiple pass streaks effect |
Vector4 | parameters1 | globalIntensity, regularIntensity, reverseIntensity, warpedIntensity |
Vector4 | parameters2 | vignetteEffect, startingPosition, scale, freeSlot |
Vector4 | parameters3 | samples, sampleDimmer, chromaticAbberationIntensity, chromaticAbberationSamples |
Vector4 | parameters4 | streaksIntensity, streaksLength, streaksOrientation, streaksThreshold |
Vector4 | parameters5 | downsampleStreak, warpedFlareScaleX, warpedFlareScaleY, freeSlot |
LowLevelCommandBuffer | cmd | LowLevelCommandBuffer |
RTHandle | result | Result RT for the Lens Flare Screen Space |
bool | debugView | Information if we are in debug mode or not |
DoLensFlareScreenSpaceCommon(Material, Camera, float, float, Color, Texture, Texture, Texture, Texture, Texture, Vector4, Vector4, Vector4, Vector4, Vector4, CommandBuffer, RTHandle, bool)
Effective Job of drawing Lens Flare Screen Space.
Declaration
public static void DoLensFlareScreenSpaceCommon(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, Color tintColor, Texture originalBloomTexture, Texture bloomMipTexture, Texture spectralLut, Texture streakTextureTmp, Texture streakTextureTmp2, Vector4 parameters1, Vector4 parameters2, Vector4 parameters3, Vector4 parameters4, Vector4 parameters5, CommandBuffer cmd, RTHandle result, bool debugView)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | Lens Flare material (HDRP or URP shader) |
Camera | cam | Camera |
float | actualWidth | Width actually used for rendering after dynamic resolution and XR is applied. |
float | actualHeight | Height actually used for rendering after dynamic resolution and XR is applied. |
Color | tintColor | tintColor to multiply all the flare by |
Texture | originalBloomTexture | original Bloom texture used to write on at the end of compositing |
Texture | bloomMipTexture | Bloom mip texture used as data for the effect |
Texture | spectralLut | spectralLut used for chromatic aberration effect |
Texture | streakTextureTmp | Texture used for the multiple pass streaks effect |
Texture | streakTextureTmp2 | Texture used for the multiple pass streaks effect |
Vector4 | parameters1 | globalIntensity, regularIntensity, reverseIntensity, warpedIntensity |
Vector4 | parameters2 | vignetteEffect, startingPosition, scale, freeSlot |
Vector4 | parameters3 | samples, sampleDimmer, chromaticAbberationIntensity, chromaticAbberationSamples |
Vector4 | parameters4 | streaksIntensity, streaksLength, streaksOrientation, streaksThreshold |
Vector4 | parameters5 | downsampleStreak, warpedFlareScaleX, warpedFlareScaleY, freeSlot |
CommandBuffer | cmd | Command Buffer |
RTHandle | result | Result RT for the Lens Flare Screen Space |
bool | debugView | Information if we are in debug mode or not |
DoLensFlareScreenSpaceCommon(Material, Camera, float, float, Color, Texture, Texture, Texture, Texture, Texture, Vector4, Vector4, Vector4, Vector4, Vector4, CommandBuffer, RTHandle, int, int, int, int, int, int, int, int, int, int, int, bool)
Effective Job of drawing Lens Flare Screen Space.
Declaration
[Obsolete("Use DoLensFlareScreenSpaceCommon without _Shader IDs parameters.")]
public static void DoLensFlareScreenSpaceCommon(Material lensFlareShader, Camera cam, float actualWidth, float actualHeight, Color tintColor, Texture originalBloomTexture, Texture bloomMipTexture, Texture spectralLut, Texture streakTextureTmp, Texture streakTextureTmp2, Vector4 parameters1, Vector4 parameters2, Vector4 parameters3, Vector4 parameters4, Vector4 parameters5, CommandBuffer cmd, RTHandle result, int _LensFlareScreenSpaceBloomMipTexture, int _LensFlareScreenSpaceResultTexture, int _LensFlareScreenSpaceSpectralLut, int _LensFlareScreenSpaceStreakTex, int _LensFlareScreenSpaceMipLevel, int _LensFlareScreenSpaceTintColor, int _LensFlareScreenSpaceParams1, int _LensFlareScreenSpaceParams2, int _LensFlareScreenSpaceParams3, int _LensFlareScreenSpaceParams4, int _LensFlareScreenSpaceParams5, bool debugView)
Parameters
Type | Name | Description |
---|---|---|
Material | lensFlareShader | Lens Flare material (HDRP or URP shader) |
Camera | cam | Camera |
float | actualWidth | Width actually used for rendering after dynamic resolution and XR is applied. |
float | actualHeight | Height actually used for rendering after dynamic resolution and XR is applied. |
Color | tintColor | tintColor to multiply all the flare by |
Texture | originalBloomTexture | original Bloom texture used to write on at the end of compositing |
Texture | bloomMipTexture | Bloom mip texture used as data for the effect |
Texture | spectralLut | spectralLut used for chromatic aberration effect |
Texture | streakTextureTmp | Texture used for the multiple pass streaks effect |
Texture | streakTextureTmp2 | Texture used for the multiple pass streaks effect |
Vector4 | parameters1 | globalIntensity, regularIntensity, reverseIntensity, warpedIntensity |
Vector4 | parameters2 | vignetteEffect, startingPosition, scale, freeSlot |
Vector4 | parameters3 | samples, sampleDimmer, chromaticAbberationIntensity, chromaticAbberationSamples |
Vector4 | parameters4 | streaksIntensity, streaksLength, streaksOrientation, streaksThreshold |
Vector4 | parameters5 | downsampleStreak, warpedFlareScaleX, warpedFlareScaleY, freeSlot |
CommandBuffer | cmd | Command Buffer |
RTHandle | result | Result RT for the Lens Flare Screen Space |
int | _LensFlareScreenSpaceBloomMipTexture | ShaderID for the original bloom texture |
int | _LensFlareScreenSpaceResultTexture | ShaderID for the result texture |
int | _LensFlareScreenSpaceSpectralLut | ShaderID for the LensFlareScreenSpaceSpectralLut texture |
int | _LensFlareScreenSpaceStreakTex | ShaderID for the LensFlareScreenSpaceStreakTex streak temp texture |
int | _LensFlareScreenSpaceMipLevel | ShaderID for the LensFlareScreenSpaceMipLevel parameter |
int | _LensFlareScreenSpaceTintColor | ShaderID for the LensFlareScreenSpaceTintColor color |
int | _LensFlareScreenSpaceParams1 | ShaderID for the LensFlareScreenSpaceParams1 |
int | _LensFlareScreenSpaceParams2 | ShaderID for the LensFlareScreenSpaceParams2 |
int | _LensFlareScreenSpaceParams3 | ShaderID for the LensFlareScreenSpaceParams3 |
int | _LensFlareScreenSpaceParams4 | ShaderID for the LensFlareScreenSpaceParams4 |
int | _LensFlareScreenSpaceParams5 | ShaderID for the LensFlareScreenSpaceParams5 |
bool | debugView | Information if we are in debug mode or not |
GetFlareData0(Vector2, Vector2, Vector2, Vector2, float, float, float, Vector2, bool)
Compute internal parameters needed to render single flare
Declaration
public static Vector4 GetFlareData0(Vector2 screenPos, Vector2 translationScale, Vector2 rayOff0, Vector2 vLocalScreenRatio, float angleDeg, float position, float angularOffset, Vector2 positionOffset, bool autoRotate)
Parameters
Type | Name | Description |
---|---|---|
Vector2 | screenPos | |
Vector2 | translationScale | |
Vector2 | rayOff0 | |
Vector2 | vLocalScreenRatio | |
float | angleDeg | |
float | position | |
float | angularOffset | |
Vector2 | positionOffset | |
bool | autoRotate |
Returns
Type | Description |
---|---|
Vector4 | Parameter used on the shader for _FlareData0 |
Initialize()
Initialization function which must be called by the SRP.
Declaration
public static void Initialize()
IsCloudLayerOpacityNeeded(Camera)
Check if at least one LensFlareComponentSRP request CloudLayer opacity
Declaration
public static bool IsCloudLayerOpacityNeeded(Camera cam)
Parameters
Type | Name | Description |
---|---|---|
Camera | cam | Camera |
Returns
Type | Description |
---|---|
bool | true if a cloudLayerOpacity is requested |
IsEmpty()
Check if we have at least one Lens Flare added on the pool
Declaration
public bool IsEmpty()
Returns
Type | Description |
---|---|
bool | true if no Lens Flare were added |
IsOcclusionRTCompatible()
Check if we can use an OcclusionRT
Declaration
public static bool IsOcclusionRTCompatible()
Returns
Type | Description |
---|---|
bool | return true if we can have the OcclusionRT |
RemoveData(LensFlareComponentSRP)
Remove a lens flare data which exist in the pool.
Declaration
public void RemoveData(LensFlareComponentSRP data)
Parameters
Type | Name | Description |
---|---|---|
LensFlareComponentSRP | data | The data which exist in the pool |
ShapeAttenuationAreaDiscLight(Vector3, Vector3)
Attenuation by Light Shape for Area Light with Disc Shape
Declaration
public static float ShapeAttenuationAreaDiscLight(Vector3 forward, Vector3 wo)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationAreaRectangleLight(Vector3, Vector3)
Attenuation by Light Shape for Area Light with Rectangular Shape
Declaration
public static float ShapeAttenuationAreaRectangleLight(Vector3 forward, Vector3 wo)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationAreaTubeLight(Vector3, Vector3, float, Camera)
Attenuation by Light Shape for Area Light with Tube Shape
Declaration
public static float ShapeAttenuationAreaTubeLight(Vector3 lightPositionWS, Vector3 lightSide, float lightWidth, Camera cam)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | lightPositionWS | World Space position of the Light |
Vector3 | lightSide | Vector pointing to the side (right or left) or the light |
float | lightWidth | Width (half extent) of the tube light |
Camera | cam | Camera rendering the Tube Light |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationDirLight(Vector3, Vector3)
Attenuation by Light Shape for Directional Light
Declaration
public static float ShapeAttenuationDirLight(Vector3 forward, Vector3 wo)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationPointLight()
Attenuation by Light Shape for Point Light
Declaration
public static float ShapeAttenuationPointLight()
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationSpotBoxLight(Vector3, Vector3)
Attenuation by Light Shape for Spot Light with Box Shape
Declaration
public static float ShapeAttenuationSpotBoxLight(Vector3 forward, Vector3 wo)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationSpotConeLight(Vector3, Vector3, float, float)
Attenuation by Light Shape for Spot Light with Cone Shape
Declaration
public static float ShapeAttenuationSpotConeLight(Vector3 forward, Vector3 wo, float spotAngle, float innerSpotPercent01)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
float | spotAngle | The angle of the light's spotlight cone in degrees. |
float | innerSpotPercent01 | Get the inner spot radius between 0 and 1. |
Returns
Type | Description |
---|---|
float | Attenuation Factor |
ShapeAttenuationSpotPyramidLight(Vector3, Vector3)
Attenuation by Light Shape for Spot Light with Pyramid Shape
Declaration
public static float ShapeAttenuationSpotPyramidLight(Vector3 forward, Vector3 wo)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | forward | Forward Vector of Directional Light |
Vector3 | wo | Vector pointing to the eye |
Returns
Type | Description |
---|---|
float | Attenuation Factor |