Table of Contents

Class WaterShader

Namespace
OmegaEngine.Graphics.Shaders
Assembly
OmegaEngine.dll

A water surface shader

public class WaterShader : SurfaceShader, IDisposable
Inheritance
WaterShader
Implements
Inherited Members
Extension Methods

Constructors

WaterShader(TextureView?, TextureView?)

Creates a new instance of the water shader

public WaterShader(TextureView? refractionView = null, TextureView? reflectionView = null)

Parameters

refractionView TextureView

A render target storing the refraction of the current view; null for no refraction or reflection

reflectionView TextureView

A render target storing the reflection of the current view; null for no reflection

Properties

DullBlendFactor

How strongly to factor in DullColor - values between 0 and 1

public float DullBlendFactor { get; set; }

Property Value

float

DullColor

The basic color of the water (usually blueish)

public Color DullColor { get; set; }

Property Value

Color

MinShaderModel

The minimum shader model version required to use this shader

public static Version MinShaderModel { get; }

Property Value

Version

ReflectionViewProjection

The reflected view-projection from the Camera

[Browsable(false)]
public Matrix ReflectionViewProjection { get; set; }

Property Value

Matrix

WaveHeight

The height of waves on the water surface - values between 0 and 0.2

public float WaveHeight { get; set; }

Property Value

float

WaveLength

The length of waves on the water surface - values between 0 and 1

public float WaveLength { get; set; }

Property Value

float

WindDirection

The direction of the wind moving the waves

public Matrix WindDirection { get; set; }

Property Value

Matrix

WindForce

The strength of the wind moving the waves - values between 0 and 1

public float WindForce { get; set; }

Property Value

float

Methods

Apply(Action, XMaterial, Camera, params LightSource[])

Applies the shader to the content in the render delegate.

public override void Apply(Action render, XMaterial material, Camera camera, params 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 LightSource[]

An array of all lights this shader should consider; should be null.

OnDispose()

Hook that is called when the object needs to dispose its internal resources.

protected override void OnDispose()

OnEngineSet()

Hook that is called when Engine is set for the first time.

protected override void OnEngineSet()

See Also