Record TGLSLAttribute

Unit

Declaration

type TGLSLAttribute = record

Description

GLSL attribute provides per-vertex information to the shader.

Overview

Nested Types

Public TLocationOffset = 0..3;

Fields

Public var Owner: TGLSLProgram;
Public Name: string;
Public Location: TGLint;
Public LocationOffsetsToDisable: array [TLocationOffset] of boolean;

Methods

Public procedure EnableArray(const Vao: TVertexArrayObject; const LocationOffset: TLocationOffset; const Size: TGLint; const AType: TGLenum; const Normalized: TGLboolean; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArraySingle(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArrayVector2(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArrayVector3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArrayVector4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArrayMatrix3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure EnableArrayMatrix4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);
Public procedure DisableArray;
Public procedure SetValue(const Value: TGLfloat); overload;
Public procedure SetValue(const Value: TVector2); overload;
Public procedure SetValue(const Value: TVector3); overload;
Public procedure SetValue(const Value: TVector4); overload;
Public procedure SetValue(const Value: TMatrix3); overload;
Public procedure SetValue(const Value: TMatrix4); overload;
Public procedure SetValue(const Value: TVector4Integer); overload;
Public procedure SetValue(const Value: TVector4Byte); overload;
Public procedure SetValue(const Value: TGLdouble); overload;

Description

Nested Types

Public TLocationOffset = 0..3;

This item has no description.

Fields

Public var Owner: TGLSLProgram;

This item has no description.

Public Name: string;

This item has no description.

Public Location: TGLint;

This item has no description.

Public LocationOffsetsToDisable: array [TLocationOffset] of boolean;

This item has no description.

Methods

Public 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.

Public procedure EnableArraySingle(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of floats (Single in Pascal).

Public procedure EnableArrayVector2(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of TVector2.

Public procedure EnableArrayVector3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of TVector3.

Public procedure EnableArrayVector4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of TVector4.

Public procedure EnableArrayMatrix3(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of TMatrix3.

Public procedure EnableArrayMatrix4(const Vao: TVertexArrayObject; const Stride: TGLsizei; const Ptr: PtrUInt);

Shortcut to enable an array of TMatrix4.

Public procedure DisableArray;

This item has no description.

Public 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.

Public procedure SetValue(const Value: TVector2); overload;

This item has no description.

Public procedure SetValue(const Value: TVector3); overload;

This item has no description.

Public procedure SetValue(const Value: TVector4); overload;

This item has no description.

Public procedure SetValue(const Value: TMatrix3); overload;

This item has no description.

Public procedure SetValue(const Value: TMatrix4); overload;

This item has no description.

Public procedure SetValue(const Value: TVector4Integer); overload;

This item has no description.

Public procedure SetValue(const Value: TVector4Byte); overload;

This item has no description.

Public procedure SetValue(const Value: TGLdouble); overload;

This item has no description.


Generated by PasDoc 0.16.0-snapshot.