Namespace OmegaEngine.Graphics.Shaders
Shaders are small pieces of code executed directly on the graphics card. They govern how vertexes are transformed and how each individual pixel color is calculated.
Surface shaders
SurfaceShaders control the appearance of individual renderable objects' surfaces. They determine how materials, textures, and lighting interact to produce the final look of a model or terrain.
Surface shaders are assigned via the PositionableRenderable.SurfaceShader property. They receive per-object data like world transformation matrices, material properties, and effective light sources for the object's position.
Examples
GeneralShader provides standard Phong lighting with diffuse, specular, and ambient components. Supports multiple light sources. normal maps, specular maps and emissive maps.
This is the default shader used if no other shader is specified.
WaterShader renders an animated water surface with reflections and refractions.
This is used automatically by Water.
Post-screen shaders
PostShaders are applied to the entire rendered scene after all objects have been drawn. They perform screen-space effects that affect the complete image.
Post-screen shaders are added to the View.PostShaders collection. Adding multiple shaders to the collection allows you to chain effects, with each shader processing the output of the previous one.
Examples
PostBlurShader blurs the entire scene.
view.PostShaders.Add(new PostBlurShader
{
BlurStrength = 2.0
});
PostColorCorrectionShader adjusts brightness, contrast, and saturation of the rendered scene.
view.PostShaders.Add(new PostColorCorrectionShader
{
Brightness = 1.1,
Contrast = 1.2,
Saturation = 0.9
});
PostSepiaShader applies a sepia tone effect to create an old photograph look.
view.PostShaders.Add(new PostSepiaShader());
API
Classes
- DynamicShader
Helper class for dynamically generating Shader code
- GeneralShader
A general-purpose surface shader with optional support for normal and specular maps
- LightingShader
A SurfaceShader that properly reacts to LightSources
- PostBleachShader
A post-screen shader that bleaches out the colors.
- PostBlurShader
A post-screen shader that blurs the view using a Gaussian blur filter.
- PostCameraShakeShader
A post-screen shader that simulates a "shaking camera" effect.
- PostColorCorrectionShader
A post-screen shader for applying TV-like settings like brightness, contrast, hue, etc.
- PostGlowShader
A post-screen shader that adds a bloom-like glow-effect around objects in the scene.
- PostHaloShader
A post-screen shader that adds shining halos around objects in the scene.
- PostRadialBlurShader
A post-screen shader that blurs the view radially.
- PostScratchedFilmShader
A post-screen shader that creates "scratched film" effect.
- PostSepiaShader
A post-screen shader that creates an "old paper" look.
- PostShader
A shader that is applied to the complete scene after rendering.
- Shader
Provides access to the properties of shader-programm executing on the GPU.
- ShaderCompileException
Exception thrown when DynamicShader fails to compile FX code
- SurfaceShader
A shader that controls the look of a PositionableRenderable's surface
- TerrainShader
A shader that blends multiple textures together
- WaterShader
A water surface shader