EffectInstance
An effect instance that controls the appearance of geometry.
Inheritance Hierarchy
System.Object
Autodesk.Revit.DB.DirectContext3D.EffectInstance
Namespace: Autodesk.Revit.DB.DirectContext3D
Assembly: RevitAPI (in RevitAPI.dll) Version: 25.0.0.0 (25.0.0.0)
Syntax
public class EffectInstance : IDisposable
The EffectInstance type exposes the following members.
Constructors
Name
Description
Public Method
EffectInstance
Constructs the effect instance for geometry having the specified vertex format.
Properties
Name
Description
Public Property
IsValidObject
Specifies whether the .NET object represents a valid Revit entity.
Methods
Name
Description
Public Method
Dispose
Releases all resources used by the EffectInstance
Public Method
Equals
Determines whether the specified object is equal to the current object.
(Inherited from Object)
Public Method
GetHashCode
Serves as the default hash function.
(Inherited from Object)
Public Method
GetType
Gets the Type of the current instance.
(Inherited from Object)
Public Method
IsValid
Tests whether the effect instance is valid for rendering.
Public Method
MatchesFormat
Tests whether the effect instance is appropriate for the given vertex format.
Public Method
SetAmbientColor
Sets the ambient color parameter of the effect instance.
Public Method
SetColor
Sets the color parameter of the effect instance.
Public Method
SetDiffuseColor
Sets the diffuse color parameter of the effect instance.
Public Method
SetEmissiveColor
Sets the emissive color parameter of the effect instance.
Public Method
SetGlossiness
Sets the glossiness parameter of the effect instance.
Public Method
SetSpecularColor
Sets the specular color parameter of the effect instance.
Public Method
SetTransparency
Sets the transparency parameter of the effect instance.
Public Method
ToString
Returns a string that represents the current object.
(Inherited from Object)
Remarks
Each effect instance should be used with geometry of a matching vertex format. Only a subset of effect instance parameters is relevant to geometry of a particular vertex format. If the vertex format does not specify vertex color ( VertexPosition or VertexPositionNormal) the following parameters should be set:
-
Color
-
Transparency
If the vertex format specifies vertex normals ( VertexPositionNormal or VertexPositionNormalColored) the following parameters should be set:
-
Ambient Color
-
Diffuse Color
-
Specular Color
-
Glossiness (specular exponent)
-
EmissiveColor
-
Transparency
If the vertex format specifies a color, then the geometry will be colored according to the color of each vertex. Otherwise, the geometry’s color will come from the effect instance parameters. Similarly, the transparency parameter affects all of the geometry associated with the effect, while the transparency of the individual vertices can also be controlled via the transparency component of their colors.