Record TGLSLAttribute
Unit
Declaration
type TGLSLAttribute = record
Description
GLSL attribute provides per-vertex information to the shader.
Overview
Nested Types
TLocationOffset = 0..3; |
Fields
var Owner: TGLSLProgram; |
|
Name: string; |
|
Location: TGLint; |
|
LocationOffsetsToDisable: array [TLocationOffset] of boolean; |
Methods
procedure EnableArray(const Vao: TVertexArrayObject; const LocationOffset: TLocationOffset; const Size: TGLint; const AType: TGLenum; const Normalized: TGLboolean; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArraySingle(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArrayVector2(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArrayVector3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArrayVector4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArrayMatrix3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure EnableArrayMatrix4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
procedure DisableArray; |
|
procedure SetValue(const Value: TGLfloat); overload; |
|
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: TVector4Integer); overload; |
|
procedure SetValue(const Value: TVector4Byte); overload; |
|
procedure SetValue(const Value: TGLdouble); overload; |
Description
Nested Types
TLocationOffset = 0..3; |
|
This item has no description. |
Fields
var Owner: TGLSLProgram; |
|
This item has no description. |
Name: string; |
|
This item has no description. |
Location: TGLint; |
|
This item has no description. |
LocationOffsetsToDisable: array [TLocationOffset] of boolean; |
|
This item has no description. |
Methods
procedure EnableArray(const Vao: TVertexArrayObject; const LocationOffset: TLocationOffset; const Size: TGLint; const AType: TGLenum; const Normalized: TGLboolean; const Stride: TGLsizei; const 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). You have to provide VertexArrayObject where the array is bound. |
procedure EnableArraySingle(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of floats (Single in Pascal). |
procedure EnableArrayVector2(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of TVector2. |
procedure EnableArrayVector3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of TVector3. |
procedure EnableArrayVector4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of TVector4. |
procedure EnableArrayMatrix3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of TMatrix3. |
procedure EnableArrayMatrix4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt); |
|
Shortcut to enable an array of TMatrix4. |
procedure DisableArray; |
|
This item has no description. |
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; |
|
This item has no description. |
procedure SetValue(const Value: TVector3); overload; |
|
This item has no description. |
procedure SetValue(const Value: TVector4); overload; |
|
This item has no description. |
procedure SetValue(const Value: TMatrix3); overload; |
|
This item has no description. |
procedure SetValue(const Value: TMatrix4); overload; |
|
This item has no description. |
procedure SetValue(const Value: TVector4Integer); overload; |
|
This item has no description. |
procedure SetValue(const Value: TVector4Byte); overload; |
|
This item has no description. |
procedure SetValue(const Value: TGLdouble); overload; |
|
This item has no description. |
Generated by PasDoc 0.16.0-snapshot.