Class EffectParameter
Represents an Effect parameter.
public class EffectParameter
- Inheritance
-
EffectParameter
- Inherited Members
Examples
- Create a EffectParameter for each parameter in your Effect that you will be setting in Draw(GameTime) or Update(GameTime).
public EffectParameter mWorld;
public EffectParameter mCameraView;
public EffectParameter CameraPos;
public EffectParameter mCameraProj;
- Assign an Effect parameter to your EffectParameter.
mWorld = effect.Parameters["g_mWorld"];
mCameraView = effect.Parameters["g_mCameraView"];
CameraPos = effect.Parameters["g_CameraPos"];
mCameraProj = effect.Parameters["g_mCameraProj"];
- Call SetValue() on your EffectParameter to change the parameter value.
Remarks
Creating and assigning a EffectParameter instance for each technique in your Effect is significantly faster than using the Parameters indexed property on Effect.
Properties
Annotations
Gets the collection of EffectAnnotation objects for this parameter.
public EffectAnnotationCollection Annotations { get; }
Property Value
ColumnCount
Gets the number of columns in the parameter description.
public int ColumnCount { get; }
Property Value
Elements
Gets the collection of effect parameters.
public EffectParameterCollection Elements { get; }
Property Value
Name
Gets the name of the parameter.
public string Name { get; }
Property Value
ParameterClass
Gets the class of the parameter.
public EffectParameterClass ParameterClass { get; }
Property Value
ParameterType
Gets the type of the parameter.
public EffectParameterType ParameterType { get; }
Property Value
RowCount
Gets the number of rows in the parameter description.
public int RowCount { get; }
Property Value
Semantic
Gets the semantic meaning, or usage, of the parameter.
public string Semantic { get; }
Property Value
StructureMembers
Gets the collection of structure members.
public EffectParameterCollection StructureMembers { get; }
Property Value
Methods
GetValueBoolean()
Gets the value of the EffectParameter as a bool.
public bool GetValueBoolean()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type bool.
GetValueInt32()
Gets the value of the EffectParameter as an int.
public int GetValueInt32()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type int.
GetValueInt32Array()
Gets the value of the EffectParameter as an array of int.
public int[] GetValueInt32Array()
Returns
- int[]
GetValueMatrix()
Gets the value of the EffectParameter as an Matrix.
public Matrix GetValueMatrix()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Matrix.
GetValueMatrixArray(int)
Gets the value of the EffectParameter as an array of Matrix.
public Matrix[] GetValueMatrixArray(int count)
Parameters
count
intThe number of elements in the array.
Returns
- Matrix[]
GetValueQuaternion()
Gets the value of the EffectParameter as an Quaternion.
public Quaternion GetValueQuaternion()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Quaternion.
GetValueSingle()
Gets the value of the EffectParameter as an float.
public float GetValueSingle()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type float.
GetValueSingleArray()
Gets the value of the EffectParameter as an array of float.
public float[] GetValueSingleArray()
Returns
- float[]
GetValueString()
Gets the value of the EffectParameter as an string.
public string GetValueString()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type string.
GetValueTexture2D()
Gets the value of the EffectParameter as an Texture2D.
public Texture2D GetValueTexture2D()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Texture2D.
GetValueTexture3D()
Gets the value of the EffectParameter as an Texture3D.
public Texture3D GetValueTexture3D()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Texture3D.
GetValueTextureCube()
Gets the value of the EffectParameter as an TextureCube.
public TextureCube GetValueTextureCube()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type TextureCube.
GetValueVector2()
Gets the value of the EffectParameter as an Vector2.
public Vector2 GetValueVector2()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector2.
GetValueVector2Array()
Gets the value of the EffectParameter as an array of Vector2.
public Vector2[] GetValueVector2Array()
Returns
- Vector2[]
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector2.
GetValueVector3()
Gets the value of the EffectParameter as an Vector3.
public Vector3 GetValueVector3()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector3.
GetValueVector3Array()
Gets the value of the EffectParameter as an array of Vector3.
public Vector3[] GetValueVector3Array()
Returns
- Vector3[]
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector3.
GetValueVector4()
Gets the value of the EffectParameter as an Vector4.
public Vector4 GetValueVector4()
Returns
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector4.
GetValueVector4Array()
Gets the value of the EffectParameter as an array of Vector4.
public Vector4[] GetValueVector4Array()
Returns
- Vector4[]
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to type Vector4.
SetValue(Texture)
Sets the value of the EffectParameter.
public void SetValue(Texture value)
Parameters
value
TextureThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Matrix)
Sets the value of the EffectParameter.
public void SetValue(Matrix value)
Parameters
value
MatrixThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Matrix[])
Sets the value of the EffectParameter.
public void SetValue(Matrix[] value)
Parameters
value
Matrix[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Quaternion)
Sets the value of the EffectParameter.
public void SetValue(Quaternion value)
Parameters
value
QuaternionThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector2)
Sets the value of the EffectParameter.
public void SetValue(Vector2 value)
Parameters
value
Vector2The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector2[])
Sets the value of the EffectParameter.
public void SetValue(Vector2[] value)
Parameters
value
Vector2[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector3)
Sets the value of the EffectParameter.
public void SetValue(Vector3 value)
Parameters
value
Vector3The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector3[])
Sets the value of the EffectParameter.
public void SetValue(Vector3[] value)
Parameters
value
Vector3[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector4)
Sets the value of the EffectParameter.
public void SetValue(Vector4 value)
Parameters
value
Vector4The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(Vector4[])
Sets the value of the EffectParameter.
public void SetValue(Vector4[] value)
Parameters
value
Vector4[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(bool)
Sets the value of the EffectParameter.
public void SetValue(bool value)
Parameters
value
boolThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(int)
Sets the value of the EffectParameter.
public void SetValue(int value)
Parameters
value
intThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(int[])
Sets the value of the EffectParameter.
public void SetValue(int[] value)
Parameters
value
int[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(float)
Sets the value of the EffectParameter.
public void SetValue(float value)
Parameters
value
floatThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValue(float[])
Sets the value of the EffectParameter.
public void SetValue(float[] value)
Parameters
value
float[]The value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.
SetValueTranspose(Matrix)
Sets the value of the EffectParameter to the transpose of a Matrix.
public void SetValueTranspose(Matrix value)
Parameters
value
MatrixThe value to assign to the EffectParameter.
Remarks
Setting the value of an effect parameter is a slow operation. Avoid high-frequency calls.
Exceptions
- InvalidCastException
Unable to cast this EffectParameter to target type.