Class EnvironmentMapEffect
Built-in effect that supports environment mapping.
public class EnvironmentMapEffect : Effect, IDisposable, IEffectMatrices, IEffectLights, IEffectFog
- Inheritance
-
EnvironmentMapEffect
- Implements
- Inherited Members
Constructors
EnvironmentMapEffect(EnvironmentMapEffect)
Creates a new EnvironmentMapEffect by cloning parameter settings from an existing instance.
protected EnvironmentMapEffect(EnvironmentMapEffect cloneSource)
Parameters
cloneSource
EnvironmentMapEffect
EnvironmentMapEffect(GraphicsDevice)
Creates a new EnvironmentMapEffect with default parameter settings.
public EnvironmentMapEffect(GraphicsDevice device)
Parameters
device
GraphicsDevice
Properties
Alpha
Gets or sets the material alpha.
public float Alpha { get; set; }
Property Value
AmbientLightColor
Gets or sets the ambient light color (range 0 to 1).
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
Gets the first directional light.
public DirectionalLight DirectionalLight0 { get; }
Property Value
DirectionalLight1
Gets the second directional light.
public DirectionalLight DirectionalLight1 { get; }
Property Value
DirectionalLight2
Gets 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
EnvironmentMap
Gets or sets the current environment map texture.
public TextureCube EnvironmentMap { get; set; }
Property Value
EnvironmentMapAmount
Gets or sets the amount of the environment map RGB that will be blended over the base texture. Range 0 to 1, default 1. If set to zero, the RGB channels of the environment map will completely ignored (but the environment map alpha may still be visible if EnvironmentMapSpecular is greater than zero).
public float EnvironmentMapAmount { get; set; }
Property Value
EnvironmentMapSpecular
Gets or sets the amount of the environment map alpha channel that will be added to the base texture. Range 0 to 1, default 0. This can be used to implement cheap specular lighting, by encoding one or more specular highlight patterns into the environment map alpha channel, then setting EnvironmentMapSpecular to the desired specular light color.
public Vector3 EnvironmentMapSpecular { get; set; }
Property Value
FogColor
Gets or sets the fog color.
public Vector3 FogColor { get; set; }
Property Value
FogEnabled
Gets or sets the fog enable flag.
public bool FogEnabled { get; set; }
Property Value
FogEnd
Gets or sets the fog end distance.
public float FogEnd { get; set; }
Property Value
FogStart
Gets or sets the fog start distance.
public float FogStart { get; set; }
Property Value
FresnelFactor
Gets or sets the Fresnel factor used for the environment map blending. Higher values make the environment map only visible around the silhouette edges of the object, while lower values make it visible everywhere. Setting this property to 0 disables Fresnel entirely, making the environment map equally visible regardless of view angle. The default is 1. Fresnel only affects the environment map RGB (the intensity of which is controlled by EnvironmentMapAmount). The alpha contribution (controlled by EnvironmentMapSpecular) is not affected by the Fresnel setting.
public float FresnelFactor { get; set; }
Property Value
Projection
Gets or sets the projection matrix.
public Matrix Projection { get; set; }
Property Value
Texture
Gets or sets the current texture.
public Texture2D Texture { 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 EnvironmentMapEffect instance.
public override Effect Clone()
Returns
EnableDefaultLighting()
Sets up 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()