OmegaEngine API  1.0.3
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
OmegaEngine.Graphics.Shaders.WaterShader Class Reference

A water surface shader More...

Inheritance diagram for OmegaEngine.Graphics.Shaders.WaterShader:
OmegaEngine.Graphics.Shaders.SurfaceShader OmegaEngine.Graphics.Shaders.Shader OmegaEngine.EngineElement

Public Member Functions

 WaterShader (TextureView refractionView=null, TextureView reflectionView=null)
 Creates a new instance of the water shader More...
 
override void Apply (Action render, XMaterial material, Camera camera, params LightSource[] lights)
 Applies the shader to the content in the render delegate. More...
 
- Public Member Functions inherited from OmegaEngine.Graphics.Shaders.Shader
void LoadShaderFile (string path)
 Loads an Effect from an More...
 
void Inject (string path)
 Replaces the loaded shader with a new one loaded from a file at run time. More...
 
override string ToString ()
 
void OnLostDevice ()
 Called when the device has been lost. More...
 
void OnResetDevice ()
 Called when the device has been reset. More...
 
- Public Member Functions inherited from OmegaEngine.EngineElement
void Dispose ()
 

Static Public Attributes

static Version MinShaderModel => new Version(1, 1)
 The minimum shader model version required to use this shader More...
 

Protected Member Functions

override void OnEngineSet ()
 Hook that is calld when Engine is set for the first time.
 
override void OnDispose ()
 Hook that is called when the object needs to dispose its internal resources.
 
- Protected Member Functions inherited from OmegaEngine.Graphics.Shaders.SurfaceShader
void SetupLight (PointLight light, int index, XMaterial material)
 Transfer lighting data from a PointLight to the shader More...
 
void SetupLight (DirectionalLight light, int index, XMaterial material)
 Transfer lighting data from a DirectionalLight to the shader More...
 
virtual void RunPasses (Action render, XMaterial material, params LightSource[] lights)
 Runs the actual shader passes More...
 
- Protected Member Functions inherited from OmegaEngine.Graphics.Shaders.Shader
void ExecuteScript (IEnumerable< SasScriptCommand > script, Action render, Size sceneSize, RenderTarget sceneMap, bool passScipt)
 Executes a SAS script block More...
 
void ExecuteScript (IEnumerable< SasScriptCommand > script, Action render=null, Size sceneSize=new Size(), RenderTarget sceneMap=null)
 Executes a SAS post-screen shader technique script block More...
 
void SetShaderParameter< T > (string name, T value)
 Sets a specific shader parameter. Automatically defers the action if Effect has not been set yet. More...
 
void SetShaderParameter (string name, Color value)
 Sets a specific shader parameter. Automatically defers the action if Effect has not been set yet. More...
 
- Protected Member Functions inherited from OmegaEngine.EngineElement
void RegisterChild (EngineElement element, bool autoDispose=true)
 Registers a child EngineElement for automatic Engine setting and Dispose calling. More...
 
void UnregisterChild (EngineElement element)
 Unregisters a child EngineElement (opposite of RegisterChild). More...
 

Properties

Color DullColor [get, set]
 The basic color of the water (usually blueish) More...
 
float DullBlendFactor [get, set]
 How strongly to factor in DullColor - values between 0 and 1 More...
 
float WaveLength [get, set]
 The length of waves on the water surface - values between 0 and 1 More...
 
float WaveHeight [get, set]
 The height of waves on the water surface - values between 0 and 0.2 More...
 
float WindForce [get, set]
 The strength of the wind moving the waves - values between 0 and 1 More...
 
Matrix WindDirection [get, set]
 The direction of the wind moving the waves More...
 
Matrix ReflectionViewProjection [get, set]
 The reflected view-projection from the Camera More...
 
- Properties inherited from OmegaEngine.Graphics.Shaders.Shader
Effect Effect [get, set]
 The Direct3D effect for this shader More...
 
- Properties inherited from OmegaEngine.EngineElement
Engine Engine [get, set]
 The Engine instance used by this object. Must be set before using the object. May not be changed once it has been set! More...
 
bool IsDisposed [get]
 Indicates whether this object has been disposed and can therefore no longer be used. More...
 

Additional Inherited Members

- Public Attributes inherited from OmegaEngine.EngineElement
bool IsEngineSet => _engine != null
 true if the Engine has been set. More...
 
- Protected Attributes inherited from OmegaEngine.Graphics.Shaders.Shader
ScriptEffectType ScriptType
 The type of shader the SAS scripts were written for More...
 
IList< SasScriptCommandGlobalScript
 A list of commands composing the global SAS script More...
 
readonly Dictionary< EffectHandle, IList< SasScriptCommand > > Techniques = new Dictionary<EffectHandle, IList<SasScriptCommand>>()
 A list of techniques and their SAS scripts More...
 
readonly Dictionary< EffectHandle, IList< SasScriptCommand > > Passes = new Dictionary<EffectHandle, IList<SasScriptCommand>>()
 A list of passes and their SAS scripts More...
 
ParameterInfo [] ParameterInfos
 A list of annotated shader parameters More...
 

Detailed Description

A water surface shader

See also
Water

Constructor & Destructor Documentation

◆ WaterShader()

OmegaEngine.Graphics.Shaders.WaterShader.WaterShader ( TextureView  refractionView = null,
TextureView  reflectionView = null 
)
inline

Creates a new instance of the water shader

Parameters
refractionViewA render target storing the refraction of the current view; null for no refraction or reflection
reflectionViewA render target storing the reflection of the current view; null for no reflection

Member Function Documentation

◆ Apply()

override void OmegaEngine.Graphics.Shaders.WaterShader.Apply ( Action  render,
XMaterial  material,
Camera  camera,
params LightSource []  lights 
)
inlinevirtual

Applies the shader to the content in the render delegate.

Parameters
renderThe render delegate (is called once for every shader pass).
materialThe material to be used by this shader; null for device texture.
cameraThe camera for transformation information.
lightsAn array of all lights this shader should consider; should be null.

Reimplemented from OmegaEngine.Graphics.Shaders.SurfaceShader.

Member Data Documentation

◆ MinShaderModel

Version OmegaEngine.Graphics.Shaders.WaterShader.MinShaderModel => new Version(1, 1)
static

The minimum shader model version required to use this shader

Property Documentation

◆ DullBlendFactor

float OmegaEngine.Graphics.Shaders.WaterShader.DullBlendFactor
getset

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

◆ DullColor

Color OmegaEngine.Graphics.Shaders.WaterShader.DullColor
getset

The basic color of the water (usually blueish)

◆ ReflectionViewProjection

Matrix OmegaEngine.Graphics.Shaders.WaterShader.ReflectionViewProjection
getset

The reflected view-projection from the Camera

◆ WaveHeight

float OmegaEngine.Graphics.Shaders.WaterShader.WaveHeight
getset

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

◆ WaveLength

float OmegaEngine.Graphics.Shaders.WaterShader.WaveLength
getset

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

◆ WindDirection

Matrix OmegaEngine.Graphics.Shaders.WaterShader.WindDirection
getset

The direction of the wind moving the waves

◆ WindForce

float OmegaEngine.Graphics.Shaders.WaterShader.WindForce
getset

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


The documentation for this class was generated from the following file: