March 2013
Intermediate to advanced
984 pages
26h 18m
English
Previous to OpenGL Version 4.1 (and not considering extensions) only a single shader program could be bound at any one time in an application’s execution. This was inconvenient if your application used multiple fragment shaders for a collection of geometry that was all transformed using the same vertex shader. This caused you to need to have multiple programs around that duplicated the same vertex shader, wasting resources and duplicating code.
Separate shader objects allows shader stages (e.g., vertex shading) from various programs to be combined into a program pipeline.
The first step is to create a shader program that’s usable in a shader pipeline. This is done by calling glProgramParameteri() with the parameter GL_PROGRAM_SEPARABLE ...