Class SurfaceShader
- Namespace
- OmegaEngine.Graphics.Shaders
- Assembly
- OmegaEngine.dll
A shader that controls the look of a PositionableRenderable's surface
public abstract class SurfaceShader : Shader, IDisposable
- Inheritance
-
objectSurfaceShader
- Implements
- Derived
- Inherited Members
Methods
Apply(Action, XMaterial, Camera, params IReadOnlyList<LightSource>)
Applies the shader to the content in the render delegate
public virtual void Apply(Action render, XMaterial material, Camera camera, params IReadOnlyList<LightSource> lights)
Parameters
renderActionThe render delegate (is called once for every shader pass)
materialXMaterialThe material to be used by this shader;
nullfor device texturecameraCameraThe camera for transformation information
lightsIReadOnlyList<LightSource>An array of all lights this shader should consider
RunPasses(Action, XMaterial, params IReadOnlyList<LightSource>)
Runs the actual shader passes
protected virtual void RunPasses(Action render, XMaterial material, params IReadOnlyList<LightSource> lights)
Parameters
renderActionThe render delegate (is called once for every shader pass)
materialXMaterialThe material to be used by this shader;
nullfor device texturelightsIReadOnlyList<LightSource>An array of all lights this shader should consider;
nullfor no lighting
SetupLight(DirectionalLight, int, XMaterial)
Transfer lighting data from a DirectionalLight to the shader
protected void SetupLight(DirectionalLight light, int index, XMaterial material)
Parameters
lightDirectionalLightThe DirectionalLight to get the information from
indexintThe light index in the shader to set
materialXMaterialThe currently active material
SetupLight(PointLight, int, XMaterial)
Transfer lighting data from a PointLight to the shader
protected void SetupLight(PointLight light, int index, XMaterial material)
Parameters
lightPointLightThe PointLight to get the information from
indexintThe light index in the shader to set
materialXMaterialThe currently active material