Unit CastleGLShaders
Description
OpenGL shaders in GLSL language.
Creating/destroying the TGLSLProgram instance immediately creates/destroys appropriate program on GPU. So be sure to create/destroy it only when you have OpenGL context available (for example, create in TCastleWindow.OnOpen and destroy in TCastleWindow.OnClose).
Upon creation, we check current OpenGL context abilities. Currently three support levels are possible: 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
- SysUtils
- Classes
- Generics.Collections
- GL
- GLExt
- CastleGLUtils
- CastleUtils
- CastleVectors
- CastleRenderOptions
Overview
Classes, Interfaces, Objects and Records
Name | Description |
---|---|
Class EGLSLError |
Common class for exceptions related to GLSL programs. |
Class EGLSLShaderCompileError |
|
Class EGLSLProgramLinkError |
|
Class EGLSLAttributeNotFound |
|
Class EGLSLTransformFeedbackError |
|
Class EGLSLUniformInvalid |
|
Class EGLSLUniformNotFound |
|
Class EGLSLUniformTypeMismatch |
|
Record TGLSLUniform |
|
Record TGLSLAttribute |
|
Class TGLSLProgram |
Easily handle program in GLSL (OpenGL Shading Language). |
Functions and Procedures
function GetCurrentProgram: TGLSLProgram; deprecated 'use RenderContext.CurrentProgram'; |
procedure SetCurrentProgram(const Value: TGLSLProgram); deprecated 'use RenderContext.CurrentProgram'; |
Types
TGLuintList = TCardinalList; |
TUniformNotFoundAction = (...); |
TUniformTypeMismatchAction = (...); |
TGLSLAttributeList = specialize TList<TGLSLAttribute>; |
TLocationCache = specialize TDictionary<String, TGLint>; |
TGLSLProgramList = specialize TObjectList<TGLSLProgram>; |
Variables
LogShaders: boolean; |
property CurrentProgram: TGLSLProgram
read GetCurrentProgram write SetCurrentProgram; |
Description
Functions and Procedures
function GetCurrentProgram: TGLSLProgram; deprecated 'use RenderContext.CurrentProgram'; |
Warning: this symbol is deprecated: use RenderContext.CurrentProgram |
procedure SetCurrentProgram(const Value: TGLSLProgram); deprecated 'use RenderContext.CurrentProgram'; |
Warning: this symbol is deprecated: use RenderContext.CurrentProgram |
Types
TGLuintList = TCardinalList; |
TUniformNotFoundAction = (...); |
What to do when GLSL uniform variable is set (TGLSLProgram.SetUniform) but doesn't exist in the shader. Values
|
TUniformTypeMismatchAction = (...); |
Warning: this symbol is deprecated. What to do when GLSL uniform variable is set (by TGLSLProgram.SetUniform) to the type that doesn't match type declared in GLSL shader. Do not use this. It has no effect anymore. Checking the GLSL uniform types requires doing glGetError after every uniform set, which is prohibitively slow. One day we may implement a better way to do this (using the info we get about uniforms in TGLSLProgram.DebugInfo) and then this will be useful again. Values
|
TGLSLAttributeList = specialize TList<TGLSLAttribute>; |
TLocationCache = specialize TDictionary<String, TGLint>; |
TGLSLProgramList = specialize TObjectList<TGLSLProgram>; |
Variables
LogShaders: boolean; |
property CurrentProgram: TGLSLProgram
read GetCurrentProgram write SetCurrentProgram; |
Warning: this symbol is deprecated.
Currently enabled GLSL program. Use RenderContext.CurrentProgram |
Generated by PasDoc 0.16.0.