Table of Contents

Class DirectionalLight

Namespace
Microsoft.Xna.Framework.Graphics
Assembly
MonoGame.Framework.dll

Represents a directional light. This class cannot be inherited.

public sealed class DirectionalLight
Inheritance
DirectionalLight
Inherited Members

Constructors

DirectionalLight(EffectParameter, EffectParameter, EffectParameter, DirectionalLight)

Creates a new instance of the DirectionalLight class with or without a copy of a DirectionalLight instance.

public DirectionalLight(EffectParameter directionParameter, EffectParameter diffuseColorParameter, EffectParameter specularColorParameter, DirectionalLight cloneSource)

Parameters

directionParameter EffectParameter

The light direction.

diffuseColorParameter EffectParameter

The diffuse color.

specularColorParameter EffectParameter

The specular color.

cloneSource DirectionalLight

The cloned source to copy from.

Remarks

The initial parameter values are either copied from the cloned object or set to default values (if the coned object is null). The three Effect Parameters are updated whenever the direction, diffuse color, or specular color properties are changed; or you can set these to null if you are using the cloned object.

Properties

DiffuseColor

Gets or Sets the diffuse color of the light.

public Vector3 DiffuseColor { get; set; }

Property Value

Vector3

Direction

Gets or Sets the light direction.

public Vector3 Direction { get; set; }

Property Value

Vector3

Remarks

This value must be a unit vector.

Enabled

Gets or Sets a value indicating whether light is enabled.

public bool Enabled { get; set; }

Property Value

bool

SpecularColor

Gets or Sets the specular color of the light.

public Vector3 SpecularColor { get; set; }

Property Value

Vector3