Unit CastleScreenEffects

Description

Screen effects (post-processing) using shaders (TCastleScreenEffects).

Uses

Overview

Classes, Interfaces, Objects and Records

Name Description
Class TGLSLScreenEffect GLSL shader program specialized for rendering screen effects.
Class TCastleScreenEffects Control that applies shader screen effects (post-processing) on the rendering done by children and (when this class is used as an ancestor) it's descendants.

Functions and Procedures

function ScreenEffectVertex: string; deprecated 'this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there';
function ScreenEffectFragment(const Depth: boolean): string; deprecated 'this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there';

Description

Functions and Procedures

function ScreenEffectVertex: string; deprecated 'this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there';

Warning: this symbol is deprecated: this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there

Standard GLSL vertex shader for screen effect. In your own programs, it's usually easier to use TGLSLScreenEffect, and then this function is not necessary.

function ScreenEffectFragment(const Depth: boolean): string; deprecated 'this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there';

Warning: this symbol is deprecated: this will be internal function soon, instead use TCastleScreenEffects or TCastleViewport and add screen effects there

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.

In your own programs, it's usually easier to use TGLSLScreenEffect, and then this function is not necessary.

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 { or true if you use depth }) +
  '... my custom screen effect GLSL code ...');
Shader.Link;
{ uaIgnore is a good idea here, in case some uniform variable
  from ScreenEffectFragment code may be left unused. }
Shader.UniformNotFoundAction := uaIgnore;


Generated by PasDoc 0.16.0.