Managing variable attributes with qualifiers

GLSL 3.0 has introduced two new qualifiers: storage and layout. Let's take a look at them in detail:

  • Storage qualifier: This is a special keyword that specifies the storage or the behavior of a global or local variable. It is used in shader programming. It enables the communication bridge between the application and shaders. It is also used to share information from one shader stage to another. For example, a 3D light illumination technique requires an object's geometry information in order to create realistic light shading. This geometry information is calculated in the vertex shader and passed to the fragment shader, where this input is used to color the fragments of the geometric primitives.

    There ...

Get OpenGL ES 3.0 Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.