Class LightSource
- Namespace
- OmegaEngine.Graphics.LightSources
- Assembly
- OmegaEngine.dll
A light source that illuminates PositionableRenderables in a Scene.
public abstract class LightSource
- Inheritance
-
objectLightSource
- Derived
Properties
Ambient
The ambient color this light source emits
public Color Ambient { get; set; }
Property Value
Diffuse
The diffuse color this light source emits
public Color Diffuse { get; set; }
Property Value
Enabled
Shall the light source affect its surroundings?
public bool Enabled { get; set; }
Property Value
MaxShadowRange
The maximum distance between shadow casters and receivers to consider.
public float MaxShadowRange { get; set; }
Property Value
Remarks
Lower values can improve performance by excluding distant shadow casters.
Name
Text value to make it easier to identify a particular camera
public string? Name { get; set; }
Property Value
SourceRadius
The radius of the body emitting the light.
public float SourceRadius { get; set; }
Property Value
Remarks
Used to taper shadow volumes into umbra cones surrounded by penumbras. 0 for an idealized point source, whose shadow volumes never converge.
Specular
The specular color this light source emits
public Color Specular { get; set; }
Property Value
Methods
GetShadowFactor(BoundingSphere, Ray, float)
Calculates the shadow intensity.
protected static float GetShadowFactor(BoundingSphere receiverSphere, Ray shadowRay, float shadowRadius)
Parameters
receiverSphereBoundingSphereBounding sphere of the shadow receiver in floating world space.
shadowRayRayRay pointing from the light source to the shadow caster in floating world space.
shadowRadiusfloatThe radius of the shadow at the shadow receiver.
Returns
- float
A value from 0 (fully lit) to 1 (fully shadowed).
GetShadowFactor(BoundingSphere, Ray, float, float, float)
Calculates the shadow intensity, tapering the shadow volume into an umbra cone surrounded by a penumbra.
protected float GetShadowFactor(BoundingSphere receiverSphere, Ray shadowRay, float casterRadius, float sourceDistance, float projectionDistance)
Parameters
receiverSphereBoundingSphereBounding sphere of the shadow receiver in floating world space.
shadowRayRayRay pointing from the light source to the shadow caster in floating world space.
casterRadiusfloatThe radius of the shadow caster.
sourceDistancefloatThe distance from the light source to the shadow caster; PositiveInfinity for an idealized parallel source.
projectionDistancefloatThe distance from the shadow caster to the shadow receiver, projected onto the light direction.
Returns
- float
A value from 0 (fully lit) to 1 (fully shadowed).
Remarks
The penumbra is applied as a linear blend rather than an occlusion area computation, so it darkens uniformly instead of fading towards its outer edge.
GetShadowed(BoundingSphere, BoundingSphere)
Creates a copy of this light source with simple shadowing applied.
[Pure]
public abstract LightSource GetShadowed(BoundingSphere receiverSphere, BoundingSphere casterSphere)
Parameters
receiverSphereBoundingSphereThe bounding sphere of the shadow receiver in world space.
casterSphereBoundingSphereThe bounding sphere of the shadow caster in world space.
Returns
ToString()
Returns a string that represents the current object.
public override string ToString()
Returns
- string
A string that represents the current object.