Class LightWithShadow
Base class for all light types that can cast dynamic or static shadow. Contains more shared properties for point/spot/directional lights.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[Unmanaged]
public abstract class LightWithShadow : Light, ISerializable
Constructors
LightWithShadow()
Properties
ContactShadowsLength
The length of the rays for contact shadows computed via the screen-space tracing. Set this to values higher than 0 to enable screen-space shadows rendering for this light. This improves the shadowing details. Actual ray distance is based on the pixel distance from the camera.
Declaration
[EditorOrder(99)]
[EditorDisplay("Shadow", null)]
[Limit(0F, 0.1F, 0.001F)]
[Unmanaged]
public float ContactShadowsLength { get; set; }
Property Value
System.Single
|
MinRoughness
The minimum roughness value used to clamp material surface roughness during shading pixel.
Declaration
[EditorOrder(40)]
[EditorDisplay("Light", "Minimum Roughness")]
[Limit(0F, 1F, 0.01F)]
[Unmanaged]
public float MinRoughness { get; set; }
Property Value
System.Single
|
ShadowsDepthBias
The depth bias used for shadow map comparison.
Declaration
[EditorOrder(95)]
[EditorDisplay("Shadow", "Depth Bias")]
[Limit(0F, 10F, 0.0001F)]
[Unmanaged]
public float ShadowsDepthBias { get; set; }
Property Value
System.Single
|
ShadowsDistance
Shadows casting distance from view.
Declaration
[EditorOrder(80)]
[EditorDisplay("Shadow", "Distance")]
[Limit(0F, 1000000F, 1F)]
[Unmanaged]
public float ShadowsDistance { get; set; }
Property Value
System.Single
|
ShadowsFadeDistance
Shadows fade off distance.
Declaration
[EditorOrder(90)]
[EditorDisplay("Shadow", "Fade Distance")]
[Limit(0F, 10000F, 0.1F)]
[Unmanaged]
public float ShadowsFadeDistance { get; set; }
Property Value
System.Single
|
ShadowsMode
Describes how a visual element casts shadows.
Declaration
[EditorOrder(60)]
[EditorDisplay("Shadow", "Mode")]
[Unmanaged]
public ShadowsCastingMode ShadowsMode { get; set; }
Property Value
ShadowsCastingMode
|
ShadowsNormalOffsetScale
A factor specifying the offset to add to the calculated shadow map depth with respect to the surface normal.
Declaration
[EditorOrder(96)]
[EditorDisplay("Shadow", "Normal Offset Scale")]
[Limit(0F, 100F, 0.1F)]
[Unmanaged]
public float ShadowsNormalOffsetScale { get; set; }
Property Value
System.Single
|
ShadowsResolution
Defines the resolution of the shadow map texture used to draw objects projection from light-point-of-view. Higher values increase shadow quality at cost of performance.
Declaration
[EditorOrder(105)]
[EditorDisplay("Shadow", "Resolution")]
[Unmanaged]
public LightWithShadow.ShadowMapResolution ShadowsResolution { get; set; }
Property Value
LightWithShadow.ShadowMapResolution
|
ShadowsSharpness
TheShadows edges sharpness.
Declaration
[EditorOrder(70)]
[EditorDisplay("Shadow", "Sharpness")]
[Limit(1F, 10F, 0.001F)]
[Unmanaged]
public float ShadowsSharpness { get; set; }
Property Value
System.Single
|
ShadowsStrength
Dynamic shadows blending strength. Default is 1 for fully opaque shadows, value 0 disables shadows.
Declaration
[EditorOrder(75)]
[EditorDisplay("Shadow", "Strength")]
[Limit(0F, 1F, 0.001F)]
[Unmanaged]
public float ShadowsStrength { get; set; }
Property Value
System.Single
|
ShadowsUpdateRate
Frequency of shadow updates. 1 - every frame, 0.5 - every second frame, 0 - on start or change. It's the inverse value of how many frames should happen in-between shadow map updates (eg. inverse of 0.5 is 2 thus shadow will update every 2nd frame).
Declaration
[EditorOrder(100)]
[EditorDisplay("Shadow", "Update Rate")]
[Limit(0F, 1F, 1F)]
[Unmanaged]
public float ShadowsUpdateRate { get; set; }
Property Value
System.Single
|
ShadowsUpdateRateAtDistance
Frequency of shadow updates at the maximum distance from the view at which shadows are still rendered. This value is multiplied by ShadowsUpdateRate and allows scaling the update rate in-between the shadow range. For example, if light is near view, it will get normal shadow updates but will reduce this rate when far from view. See ShadowsUpdateRate to learn more.
Declaration
[EditorOrder(101)]
[EditorDisplay("Shadow", "Update Rate At Distance")]
[Limit(0F, 1F, 1F)]
[Unmanaged]
public float ShadowsUpdateRateAtDistance { get; set; }
Property Value
System.Single
|
Methods
InvalidateShadow()
Marks the light shadow to be refreshes during next drawing. Invalidates any cached shadow map and redraws static shadows of the object (if any in use).
Declaration
[Unmanaged]
public void InvalidateShadow()