Class BasicEffect
Built-in effect that supports optional texturing, vertex coloring, fog, and lighting.
public class BasicEffect : Effect, IDisposable, IEffectMatrices, IEffectLights, IEffectFog
- Inheritance
-
BasicEffect
- Implements
- Inherited Members
Constructors
BasicEffect(BasicEffect)
Creates a new BasicEffect by cloning parameter settings from an existing instance.
protected BasicEffect(BasicEffect cloneSource)
Parameters
cloneSource
BasicEffect
BasicEffect(GraphicsDevice)
Creates a new BasicEffect with default parameter settings.
public BasicEffect(GraphicsDevice device)
Parameters
device
GraphicsDevice
Properties
Alpha
Gets or sets the material alpha.
public float Alpha { get; set; }
Property Value
AmbientLightColor
The floating point ambient light color.
public Vector3 AmbientLightColor { get; set; }
Property Value
DiffuseColor
Gets or sets the material diffuse color (range 0 to 1).
public Vector3 DiffuseColor { get; set; }
Property Value
DirectionalLight0
Returns the first directional light.
public DirectionalLight DirectionalLight0 { get; }
Property Value
DirectionalLight1
Returns the second directional light.
public DirectionalLight DirectionalLight1 { get; }
Property Value
DirectionalLight2
Returns the third directional light.
public DirectionalLight DirectionalLight2 { get; }
Property Value
EmissiveColor
Gets or sets the material emissive color (range 0 to 1).
public Vector3 EmissiveColor { get; set; }
Property Value
FogColor
The floating point fog color.
public Vector3 FogColor { get; set; }
Property Value
FogEnabled
Used to toggle the rendering of fog.
public bool FogEnabled { get; set; }
Property Value
FogEnd
The world space distance from the camera at which fogging is fully applied.
public float FogEnd { get; set; }
Property Value
Remarks
FogEnd should be greater than FogStart. If FogEnd and FogStart are the same value everything is fully fogged.
FogStart
The world space distance from the camera at which fogging begins.
public float FogStart { get; set; }
Property Value
Remarks
FogStart should be less than FogEnd. If FogEnd and FogStart are the same value everything is fully fogged.
LightingEnabled
Toggles the rendering of lighting.
public bool LightingEnabled { get; set; }
Property Value
PreferPerPixelLighting
Gets or sets the per-pixel lighting prefer flag.
public bool PreferPerPixelLighting { get; set; }
Property Value
Projection
Gets or sets the projection matrix.
public Matrix Projection { get; set; }
Property Value
SpecularColor
Gets or sets the material specular color (range 0 to 1).
public Vector3 SpecularColor { get; set; }
Property Value
SpecularPower
Gets or sets the material specular power.
public float SpecularPower { get; set; }
Property Value
Texture
Gets or sets the current texture.
public Texture2D Texture { get; set; }
Property Value
TextureEnabled
Gets or sets whether texturing is enabled.
public bool TextureEnabled { get; set; }
Property Value
VertexColorEnabled
Gets or sets whether vertex color is enabled.
public bool VertexColorEnabled { get; set; }
Property Value
View
Gets or sets the view matrix.
public Matrix View { get; set; }
Property Value
World
Gets or sets the world matrix.
public Matrix World { get; set; }
Property Value
Methods
Clone()
Creates a clone of the current BasicEffect instance.
public override Effect Clone()
Returns
EnableDefaultLighting()
Initializes the lights to the standard key/fill/back lighting rig.
public void EnableDefaultLighting()
OnApply()
Lazily computes derived parameter values immediately before applying the effect.
protected override void OnApply()