July 2013
Intermediate to advanced
600 pages
15h 15m
English
This chapter takes a break from examining WebGL sample programs and explains the essential features of the OpenGL ES Shading Language (GLSL ES) in detail.
As you have seen, shaders are the core mechanism within WebGL for constructing 3DCG programs, and GLSL ES is the dedicated programming language for writing those shader programs. This chapter covers:
• Data, variables, and variable types
• Vector, matrix, structure, array, and sampler types
• Operators, control flow, and functions
• Attributes, uniform, and varying variables
• Precision qualifiers
• Preprocessor and directives
By the end of this chapter, you will have a good understanding of GLSL ES and how to use it to write a variety of ...