Unit CastleScreenEffects
Description
Utilities for creating custom screen effects.
Overview
Functions and Procedures
Description
Functions and Procedures
function ScreenEffectVertex: string; |
Standard GLSL vertex shader for screen effect.
|
function ScreenEffectFragment(const Depth: boolean): string; |
Library of GLSL fragment shader functions useful for screen effects. This looks at current OpenGL context multi-sampling capabilities to return the correct shader code.
Note that to work with OpenGLES, we have to glue all fragment shaders, and ScreenEffectFragment must be before the actual shader code. The string returned by this function is guaranteed to end with a newline, to make it easy.
So you usually want to create screen effect shaders like this:
Shader := TGLSLProgram.Create;
Shader.AttachVertexShader(ScreenEffectVertex);
Shader.AttachFragmentShader(
ScreenEffectFragment(false ) +
'... my custom screen effect GLSL code ...');
Shader.Link(true);
Shader.UniformNotFoundAction := uaIgnore;
|
|