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

Provides access to the properties of shader-programm executing on the GPU. More...

Inheritance diagram for OmegaEngine.Graphics.Shaders.Shader:
OmegaEngine.EngineElement OmegaEngine.Graphics.Shaders.PostShader OmegaEngine.Graphics.Shaders.SurfaceShader OmegaEngine.Graphics.Shaders.PostBleachShader OmegaEngine.Graphics.Shaders.PostBlurShader OmegaEngine.Graphics.Shaders.PostCameraShakeShader OmegaEngine.Graphics.Shaders.PostColorCorrectionShader OmegaEngine.Graphics.Shaders.PostHaloShader OmegaEngine.Graphics.Shaders.PostRadialBlurShader OmegaEngine.Graphics.Shaders.PostScratchedFilmShader OmegaEngine.Graphics.Shaders.PostSepiaShader OmegaEngine.Graphics.Shaders.LightingShader OmegaEngine.Graphics.Shaders.ParticleShader OmegaEngine.Graphics.Shaders.WaterShader

Public Member Functions

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

Protected Member Functions

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...
 
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.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...
 

Protected Attributes

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...
 

Properties

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...
 

Detailed Description

Provides access to the properties of shader-programm executing on the GPU.

Member Function Documentation

◆ ExecuteScript() [1/2]

void OmegaEngine.Graphics.Shaders.Shader.ExecuteScript ( IEnumerable< SasScriptCommand script,
Action  render,
Size  sceneSize,
RenderTarget  sceneMap,
bool  passScipt 
)
inlineprotected

Executes a SAS script block

Parameters
scriptA list of script commands
renderThe render delegate (is called once for every shader pass); null for global script
sceneSizeThe size of the scene on the screen - leave empty for fullscreen
sceneMapA texture containing the rendered scene for PostShader), null if the shader doesn't need it
passSciptIs this a pass script?

◆ ExecuteScript() [2/2]

void OmegaEngine.Graphics.Shaders.Shader.ExecuteScript ( IEnumerable< SasScriptCommand script,
Action  render = null,
Size  sceneSize = new Size(),
RenderTarget  sceneMap = null 
)
inlineprotected

Executes a SAS post-screen shader technique script block

Parameters
scriptA list of script commands
renderThe render delegate (is called once for every shader pass); null for global script
sceneSizeThe size of the scene on the screen - leave empty for fullscreen
sceneMapA texture containing the rendered scene for PostShader), null if the shader doesn't need it

◆ Inject()

void OmegaEngine.Graphics.Shaders.Shader.Inject ( string  path)
inline

Replaces the loaded shader with a new one loaded from a file at run time.

Parameters
pathThe shader file path relative to the shader directory or as an absolute path

This should only be used for debugging!

◆ LoadShaderFile()

void OmegaEngine.Graphics.Shaders.Shader.LoadShaderFile ( string  path)
inline

Loads an Effect from an

.fx or .fxo file.

Parameters
pathThe shader file path relative to the shader directory or as an absolute path

◆ OnLostDevice()

void OmegaEngine.Graphics.Shaders.Shader.OnLostDevice ( )

Called when the device has been lost.

◆ OnResetDevice()

void OmegaEngine.Graphics.Shaders.Shader.OnResetDevice ( )

Called when the device has been reset.

◆ SetShaderParameter()

void OmegaEngine.Graphics.Shaders.Shader.SetShaderParameter ( string  name,
Color  value 
)
inlineprotected

Sets a specific shader parameter. Automatically defers the action if Effect has not been set yet.

Parameters
nameThe name of the shader parameter to set.
valueThe value to set.

◆ SetShaderParameter< T >()

void OmegaEngine.Graphics.Shaders.Shader.SetShaderParameter< T > ( string  name,
value 
)
inlineprotected

Sets a specific shader parameter. Automatically defers the action if Effect has not been set yet.

Parameters
nameThe name of the shader parameter to set.
valueThe value to set.
Type Constraints
T :struct 

Member Data Documentation

◆ GlobalScript

IList<SasScriptCommand> OmegaEngine.Graphics.Shaders.Shader.GlobalScript
protected

A list of commands composing the global SAS script

◆ ParameterInfos

ParameterInfo [] OmegaEngine.Graphics.Shaders.Shader.ParameterInfos
protected

A list of annotated shader parameters

◆ Passes

readonly Dictionary<EffectHandle, IList<SasScriptCommand> > OmegaEngine.Graphics.Shaders.Shader.Passes = new Dictionary<EffectHandle, IList<SasScriptCommand>>()
protected

A list of passes and their SAS scripts

◆ ScriptType

ScriptEffectType OmegaEngine.Graphics.Shaders.Shader.ScriptType
protected

The type of shader the SAS scripts were written for

◆ Techniques

readonly Dictionary<EffectHandle, IList<SasScriptCommand> > OmegaEngine.Graphics.Shaders.Shader.Techniques = new Dictionary<EffectHandle, IList<SasScriptCommand>>()
protected

A list of techniques and their SAS scripts

Property Documentation

◆ Effect

Effect OmegaEngine.Graphics.Shaders.Shader.Effect
getsetprotected

The Direct3D effect for this shader


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