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

From OpenGL Wiki
Jump to navigation Jump to search
(Basic opaque type definition.)
 
m (Better description.)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
GLSL has a number of special types called '''Opaque Types'''. These are types that represent some construct of OpenGL that the shader is allowed to access. For example, variables that represent textures use a [[Sampler (GLSL)|sampler opaque type]].
+
Among the types for GLSL variables are certain types that are designated '''Opaque Types'''. These are types that represent some construct of OpenGL that the shader is allowed to access. For example, variables that represent textures use a [[Sampler (GLSL)|sampler opaque type]].
  
Opaque types are treated specially by GLSL. They cannot be placed in structs, and their use in arrays is limited. They do not have a "value" in any real sense to GLSL; it is merely an interface to an OpenGL construct. The only way to use them, besides declaring them, is to pass them to other functions. And all opaque types have a number of built-in GLSL functions to read from or write to them.
+
Opaque types are treated specially by GLSL. They cannot be placed in structs, and their use in arrays is limited. They do not have a "value" in any real sense to GLSL; it is merely an interface to an OpenGL resource. The only way to use them, besides declaring them, is to pass them to other functions. And all opaque types have a number of built-in GLSL functions to read from or write to them.

Latest revision as of 04:44, 24 July 2017

Among the types for GLSL variables are certain types that are designated Opaque Types. These are types that represent some construct of OpenGL that the shader is allowed to access. For example, variables that represent textures use a sampler opaque type.

Opaque types are treated specially by GLSL. They cannot be placed in structs, and their use in arrays is limited. They do not have a "value" in any real sense to GLSL; it is merely an interface to an OpenGL resource. The only way to use them, besides declaring them, is to pass them to other functions. And all opaque types have a number of built-in GLSL functions to read from or write to them.