Class TerrainShader
- Namespace
- OmegaEngine.Graphics.Shaders
- Assembly
- OmegaEngine.dll
A shader that blends multiple textures together
public class TerrainShader : LightingShader, IDisposable
- Inheritance
-
objectTerrainShader
- Implements
- Inherited Members
Constructors
TerrainShader(bool, int)
Creates a specialized instance of the shader
public TerrainShader(bool lighting, int textureMask)
Parameters
lightingboolShall this shader apply lighting to the terrain?
textureMaskintA bitmask that indicates which textures are enabled (bit 0 = first texture)
Exceptions
- ShaderCompileException
The shader code could not be compiled.
Properties
BlendDistance
The distance at which to show the pure near texture
public float BlendDistance { get; set; }
Property Value
BlendWidth
The distance from BlendDistance where to show the pure far texture
public float BlendWidth { get; set; }
Property Value
Methods
Apply(Action, XMaterial, Camera, params IReadOnlyList<LightSource>)
Applies the shader to the content in the render delegate.
public override void Apply(Action render, XMaterial material, Camera camera, params IReadOnlyList<LightSource> lights)
Parameters
renderActionThe render delegate (is called once for every shader pass).
materialXMaterialThe material to be used by this shader;
nullfor device texture.cameraCameraThe camera for transformation information.
lightsIReadOnlyList<LightSource>An array of all lights this shader should consider. Mustn't be
null!
OnEngineSet()
Hook that is called when Engine is set for the first time.
protected override void OnEngineSet()