Table of Contents

Class TerrainShader

Namespace
OmegaEngine.Graphics.Shaders
Assembly
OmegaEngine.dll

A shader that blends multiple textures together

public class TerrainShader : LightingShader, IDisposable
Inheritance
object
TerrainShader
Implements
Inherited Members

Constructors

TerrainShader(bool, int)

Creates a specialized instance of the shader

public TerrainShader(bool lighting, int textureMask)

Parameters

lighting bool

Shall this shader apply lighting to the terrain?

textureMask int

A 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

float

BlendWidth

The distance from BlendDistance where to show the pure far texture

public float BlendWidth { get; set; }

Property Value

float

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

render Action

The render delegate (is called once for every shader pass).

material XMaterial

The material to be used by this shader; null for device texture.

camera Camera

The camera for transformation information.

lights IReadOnlyList<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()

See Also