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
TextureViewA render target storing the refraction of the current view;
null
for no refraction or reflectionreflectionView
TextureViewA 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
DullColor
The basic color of the water (usually blueish)
public Color DullColor { get; set; }
Property Value
MinShaderModel
The minimum shader model version required to use this shader
public static Version MinShaderModel { get; }
Property Value
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
WaveLength
The length of waves on the water surface - values between 0 and 1
public float WaveLength { get; set; }
Property Value
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
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
ActionThe render delegate (is called once for every shader pass).
material
XMaterialThe material to be used by this shader;
null
for device texture.camera
CameraThe 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()