BasicEffect Class (Microsoft.Xna.Framework.Graphics)

Built-in effect that supports optional texturing, vertex coloring, fog, and lighting.

Namespace: Microsoft.Xna.Framework.Graphics
Assembly: MonoGame.Framework (MonoGame.Framework.dll
  • C#
  • VB
  • F#
public class BasicEffect : Effect, IEffectMatrices, IEffectLights, IEffectFog

Syntax for VB is not yet implemented.

Syntax for F# is not yet implemented.

The BasicEffect type exposes the following members.

  Platforms Name Description
BasicEffect(GraphicsDevice) Creates a new BasicEffect with default parameter settings. 
BasicEffect(BasicEffect) Creates a new BasicEffect by cloning parameter settings from an existing instance. 
  Platforms Name Description
Alpha Gets or sets the material alpha. 
AmbientLightColor The floating point ambient light color. (Implements IEffectLights.AmbientLightColor().)
CurrentTechnique  (Inherited from Effect.)
DiffuseColor Gets or sets the material diffuse color (range 0 to 1). 
DirectionalLight0 Returns the first directional light. (Implements IEffectLights.DirectionalLight0().)
DirectionalLight1 Returns the second directional light. (Implements IEffectLights.DirectionalLight1().)
DirectionalLight2 Returns the third directional light. (Implements IEffectLights.DirectionalLight2().)
EmissiveColor Gets or sets the material emissive color (range 0 to 1). 
FogColor The floating point fog color. (Implements IEffectFog.FogColor().)
FogEnabled Used to toggle the rendering of fog. (Implements IEffectFog.FogEnabled().)
FogEnd The world space distance from the camera at which fogging is fully applied. (Implements IEffectFog.FogEnd().)
FogStart The world space distance from the camera at which fogging begins. (Implements IEffectFog.FogStart().)
GraphicsDevice  (Inherited from GraphicsResource.)
IsDisposed  (Inherited from GraphicsResource.)
LightingEnabled Toggles the rendering of lighting. (Implements IEffectLights.LightingEnabled().)
Name  (Inherited from GraphicsResource.)
Parameters  (Inherited from Effect.)
PreferPerPixelLighting Gets or sets the per-pixel lighting prefer flag. 
Projection Gets or sets the projection matrix. (Implements IEffectMatrices.Projection().)
SpecularColor Gets or sets the material specular color (range 0 to 1). 
SpecularPower Gets or sets the material specular power. 
Tag  (Inherited from GraphicsResource.)
Techniques  (Inherited from Effect.)
Texture Gets or sets the current texture. 
TextureEnabled Gets or sets whether texturing is enabled. 
VertexColorEnabled Gets or sets whether vertex color is enabled. 
View Gets or sets the view matrix. (Implements IEffectMatrices.View().)
World Gets or sets the world matrix. (Implements IEffectMatrices.World().)
  Platforms Name Description
Clone Creates a clone of the current BasicEffect instance. (Overrides Effect.Clone().)
Dispose(bool) The method that derived classes should override to implement disposing of managed and native resources. (Inherited from Effect.)
Dispose()  (Inherited from GraphicsResource.)
EnableDefaultLighting Initializes the lights to the standard key/fill/back lighting rig. (Implements IEffectLights.EnableDefaultLighting().)
Finalize  (Inherited from GraphicsResource.)
GraphicsDeviceResetting Called before the device is reset. Allows graphics resources to invalidate their state so they can be recreated after the device reset. Warning: This may be called after a call to Dispose() up until the resource is garbage collected. (Inherited from Effect.)
OnApply Lazily computes derived parameter values immediately before applying the effect. (Overrides Effect.OnApply().)
ToString  (Inherited from GraphicsResource.)
  Platforms Name Description
Disposing  (Inherited from GraphicsResource.)
Supported in:

 Windows DirectX Desktop
 Linux Desktop
 Windows OpenGL Desktop