Appendix C. Built-in GLSL Variables and Functions

The OpenGL Shading Language has a small number of built-in variables, a set of constants, and a large collection of built-in functions. This appendix describes each of these, in the following major sections:

• “Built-in Variables” lists the variables, first showing the declarations for all stages, followed by a description of each stage.

• “Built-in Constants” lists all the built-in constants.

• “Built-in Functions” describes all GLSL built-in functions. You’ll need to refer to the table at the beginning of the section to decode the types.

Built-in Variables

Each programmable stage has a different set of built-in variables, though there is some overlap. We show all the built-in variable declarations ...

Get OpenGL® Programming Guide: The Official Guide to Learning OpenGL®, Version 4.5 with SPIR-V, Ninth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.