Table of Contents

Class SkinnedEffect

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

Built-in effect for rendering skinned character models.

public class SkinnedEffect : Effect, IDisposable, IEffectMatrices, IEffectLights, IEffectFog, IEffectBones
Inheritance
SkinnedEffect
Implements
Inherited Members

Constructors

SkinnedEffect(GraphicsDevice)

Creates a new SkinnedEffect with default parameter settings.

public SkinnedEffect(GraphicsDevice device)

Parameters

device GraphicsDevice

SkinnedEffect(SkinnedEffect)

Creates a new SkinnedEffect by cloning parameter settings from an existing instance.

protected SkinnedEffect(SkinnedEffect cloneSource)

Parameters

cloneSource SkinnedEffect

Fields

MaxBones

The maximum number of bones.

public const int MaxBones = 72

Field Value

int

Properties

Alpha

Gets or sets the material alpha.

public float Alpha { get; set; }

Property Value

float

AmbientLightColor

Gets or sets the ambient light color (range 0 to 1).

public Vector3 AmbientLightColor { get; set; }

Property Value

Vector3

DiffuseColor

Gets or sets the material diffuse color (range 0 to 1).

public Vector3 DiffuseColor { get; set; }

Property Value

Vector3

DirectionalLight0

Gets the first directional light.

public DirectionalLight DirectionalLight0 { get; }

Property Value

DirectionalLight

DirectionalLight1

Gets the second directional light.

public DirectionalLight DirectionalLight1 { get; }

Property Value

DirectionalLight

DirectionalLight2

Gets the third directional light.

public DirectionalLight DirectionalLight2 { get; }

Property Value

DirectionalLight

EmissiveColor

Gets or sets the material emissive color (range 0 to 1).

public Vector3 EmissiveColor { get; set; }

Property Value

Vector3

FogColor

Gets or sets the fog color.

public Vector3 FogColor { get; set; }

Property Value

Vector3

FogEnabled

Gets or sets the fog enable flag.

public bool FogEnabled { get; set; }

Property Value

bool

FogEnd

Gets or sets the fog end distance.

public float FogEnd { get; set; }

Property Value

float

FogStart

Gets or sets the fog start distance.

public float FogStart { get; set; }

Property Value

float

PreferPerPixelLighting

Gets or sets the per-pixel lighting prefer flag.

public bool PreferPerPixelLighting { get; set; }

Property Value

bool

Projection

Gets or sets the projection matrix.

public Matrix Projection { get; set; }

Property Value

Matrix

SpecularColor

Gets or sets the material specular color (range 0 to 1).

public Vector3 SpecularColor { get; set; }

Property Value

Vector3

SpecularPower

Gets or sets the material specular power.

public float SpecularPower { get; set; }

Property Value

float

Texture

Gets or sets the current texture.

public Texture2D Texture { get; set; }

Property Value

Texture2D

View

Gets or sets the view matrix.

public Matrix View { get; set; }

Property Value

Matrix

WeightsPerVertex

Gets or sets the number of skinning weights to evaluate for each vertex (1, 2, or 4).

public int WeightsPerVertex { get; set; }

Property Value

int

World

Gets or sets the world matrix.

public Matrix World { get; set; }

Property Value

Matrix

Methods

Clone()

Creates a clone of the current SkinnedEffect instance.

public override Effect Clone()

Returns

Effect

EnableDefaultLighting()

Sets up the standard key/fill/back lighting rig.

public void EnableDefaultLighting()

GetBoneTransforms(int)

Gets a copy of the current skinning bone transform matrices.

public Matrix[] GetBoneTransforms(int count)

Parameters

count int

Returns

Matrix[]

OnApply()

Lazily computes derived parameter values immediately before applying the effect.

protected override void OnApply()

SetBoneTransforms(Matrix[])

Sets an array of skinning bone transform matrices.

public void SetBoneTransforms(Matrix[] boneTransforms)

Parameters

boneTransforms Matrix[]