# Difference between revisions of "Portal:OpenGL Shading Language/Data Types"

Jump to navigation
Jump to search

m (Bot: Moving links from GLSL Type to Data Type (GLSL).) |
m (Bot: Updating section links to use redirects.) |
||

Line 1: | Line 1: | ||

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. | 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 [[ | + | Vectors have a [[Swizzle (GLSL)|powerful swizzling mechanism]] that allows one to arbitrarily order their components. This works on both reading and writing, allowing for constructs like, {{code|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). | Variables can be aggregated into arrays and structs more or less arbitrarily (though having arrays that contain arrays requires GLSL v4.30). |

## Latest revision as of 16:38, 6 May 2015

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