March 2013
Intermediate to advanced
984 pages
26h 18m
English
Types can also have modifiers that affect their behavior. There are four modifiers defined in GLSL, as shown in Table 2.5, with their behaviors at global scope.
Table 2.5. GLSL Type Modifiers
const Storage Qualifier
Just as with “C”, const type modifier indicates that the variable is read-only. For example, the statement
const float Pi = 3.141529;
sets the variable Pi to an approximation of π. With the addition of the const modifier, it becomes an error to write to a variable after its declaration, so they must be initialized when declared.
in Storage Qualifier
The in modifier is used to qualify inputs into a shader stage. ...
Read now
Unlock full access