Record TGLSLAttribute
Unit
CastleGLShaders
Declaration
type TGLSLAttribute = record
Description
Overview
Nested Types
Fields
Methods
Description
Nested Types
|
TLocationOffset = 0..3; |
|
Fields
|
Name: string; |
|
Methods
|
procedure EnableArray(LocationOffset: TLocationOffset; Size: TGLint; AType: TGLenum; Normalized: TGLboolean; Stride: TGLsizei; Ptr: PtrUInt); |
Enable an array of arbitary OpenGL type. See the OpenGL documentation of glVertexAttribPointer for meaning of the parameters.
Note that Ptr is usually an offset relative to the currently bound VBO (Vertex Buffer Object), not a regular pointer to a memory content. That is why is has a type PtrUInt (not Pointer), since usually you calculate it as an integer.
Note that the array size is not specified anywhere. The way you access the array (what indexes you use) determines the minimum count of the array you should have (and uploaded to VBO).
|
|
procedure EnableArraySingle(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of floats (Single in Pascal).
|
|
procedure EnableArrayVector2(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of TVector2.
|
|
procedure EnableArrayVector3(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of TVector3.
|
|
procedure EnableArrayVector4(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of TVector4.
|
|
procedure EnableArrayMatrix3(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of TMatrix3.
|
|
procedure EnableArrayMatrix4(Stride: TGLsizei; Ptr: PtrUInt); |
Shortcut to enable an array of TMatrix4.
|
|
procedure DisableArray; |
|
|
procedure SetValue(const Value: TGLfloat); overload; |
Set attribute variable value. The used type must match the type of this variable in GLSL program.
OpenGL forces some constraints on using this, see SetUniform. In short: use this only after linking the program. The program is automatically enabled (set as RenderContext.CurrentProgram) by this. And note that attributes declared but not actually used in shader code may be eliminated, use DebugInfo to see which attributes are actually used (active in OpenGL terminology).
These should not be often useful. Usually, you should rather load attribute arrays, by EnableArray.
|
|
procedure SetValue(const Value: TVector2); overload; |
|
|
procedure SetValue(const Value: TVector3); overload; |
|
|
procedure SetValue(const Value: TVector4); overload; |
|
|
procedure SetValue(const Value: TMatrix3); overload; |
|
|
procedure SetValue(const Value: TMatrix4); overload; |
|
|
procedure SetValue(const Value: TGLdouble); overload; |
|
Generated by PasDoc 0.16.0.