Table of Contents

Class LightSource

Namespace
OmegaEngine.Graphics.LightSources
Assembly
OmegaEngine.dll

A light source that illuminates PositionableRenderables in a Scene.

public abstract class LightSource
Inheritance
object
LightSource
Derived

Properties

Ambient

The ambient color this light source emits

public Color Ambient { get; set; }

Property Value

Color

Diffuse

The diffuse color this light source emits

public Color Diffuse { get; set; }

Property Value

Color

Enabled

Shall the light source affect its surroundings?

public bool Enabled { get; set; }

Property Value

bool

MaxShadowRange

The maximum distance between shadow casters and receivers to consider.

public float MaxShadowRange { get; set; }

Property Value

float

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

string

Specular

The specular color this light source emits

public Color Specular { get; set; }

Property Value

Color

Methods

GetShadowFactor(BoundingSphere, Ray, float)

Calculates the shadow intensity.

protected static float GetShadowFactor(BoundingSphere receiverSphere, Ray shadowRay, float shadowRadius)

Parameters

receiverSphere BoundingSphere

Bounding sphere of the shadow receiver in floating world space.

shadowRay Ray

Ray pointing from the light source to the shadow caster in floating world space.

shadowRadius float

The radius of the shadow at the shadow receiver.

Returns

float

A value from 0 (fully lit) to 1 (fully shadowed).

GetShadowed(BoundingSphere, BoundingSphere)

Creates a copy of this light source with simple shadowing applied.

[Pure]
public abstract LightSource GetShadowed(BoundingSphere receiverSphere, BoundingSphere casterSphere)

Parameters

receiverSphere BoundingSphere

The bounding sphere of the shadow receiver in world space.

casterSphere BoundingSphere

The bounding sphere of the shadow caster in world space.

Returns

LightSource

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

See Also