Effect.CurrentTechnique Property

Gets or sets the active technique.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: Microsoft.Xna.Framework (in microsoft.xna.framework.dll)

public EffectTechnique CurrentTechnique { get; set; }

Property Value

The current technique.

Exception typeCondition

CurrentTechnique is null. CurrentTechnique cannot be null.

If there are multiple techiques in an effect and you want to use a new technique in the next pass, you must set CurrentTechnique to the new technique before making the rendering pass. It is not enough to call the EffectPass.Begin method of the next technique.

The BasicEffect class, which is derived from Effect and inherits the Techniques collection, contains only one available technique to set as the active technique. The active technique applies the settings that have been set as the properties of the BasicEffect.

effect.CurrentTechnique = effect.Techniques["TransformTechnique"];

Xbox 360, Windows XP SP2, Windows Vista

Community Additions