Portal:OpenGL Shading Language/Data Types

From OpenGL Wiki
< Portal:OpenGL Shading Language
Revision as of 16:38, 6 May 2015 by AlfonsesRenamerBot (talk | contribs) (Bot: Updating section links to use redirects.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

GLSL has a large number of Data Types. It has scalar boolean, floating point, double-precision float (for GLSL v4.00+), integer, and unsigned integer types. These can be aggregated into vectors and matrices up to 4 dimensions in size.

Vectors have a powerful swizzling mechanism that allows one to arbitrarily order their components. This works on both reading and writing, allowing for constructs like, output.zyx = input.xxy.

Variables can be aggregated into arrays and structs more or less arbitrarily (though having arrays that contain arrays requires GLSL v4.30).