Unit CastleGLShaders
Description
OpenGL shaders (GLSL through the TGLSLProgram, ARB assembly through TARBProgram descendants).
Some common notes for all classes defined here:
Creating/destroying the class instance immediately creates/destroys appropriate program. So be sure to create/destroy these classes only when you have OpenGL context available (for example, create in TCastleWindowBase.OnInit and destroy in TCastleWindowBase.OnClose).
Upon creation, these classes check current OpenGL context abilities. Currently three support levels are possible for all programs: no support at all (old OpenGL), support through ARB extensions, or support built-in (newer OpenGL versions, >= 2.0).
All three cases are automatically handled inside, so usually you do not have to care about these details. Note that "none" support (on older OpenGL version with no appropriate ARB extensions) means that shaders are not really initialized at all.
Uses
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Variables
Description
Functions and Procedures
Types
TUniformNotFoundAction = (...); |
What to do when GLSL uniform variable is set (TGLSLProgram.SetUniform) but doesn't exist in the shader.
Values
-
uaWarning: Report that uniform variable not found to OnWarning.
-
uaException: Report that uniform variable not found by raising EGLSLUniformNotFound.
-
uaIgnore: Ignore the fact that uniform variable doesn't exist in the GLSL shader. Do not warn anywhere.
|
TUniformTypeMismatchAction = (...); |
What to do when GLSL uniform variable is set (by TGLSLProgram.SetUniform) to the type that doesn't match type declared in GLSL shader.
Values
|
Variables
property CurrentProgram: TGLSLProgram
read GetCurrentProgram write SetCurrentProgram; |
Currently enabled GLSL program. Nil if fixed-function pipeline should be used. Setting this property encapsulates the OpenGL glUseProgram (or equivalent ARB extension), additionally preventing redundant glUseProgram calls.
|
Generated by PasDoc 0.12.1 on 2013-02-04 20:26:50
|