Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It might help if you understood that multiple programs can share the same shader. If the mere act of detaching it from a program caused it to become deleted then things like <em>Separate Shader Objects</em> in OpenGL 4.1 would have been implemented much sooner.</p> <p>You should also be aware that what linking really refers to is more or less validation. When shaders are linked together to create a program, the in/out variables are all connected and used uniforms are assigned identifiers. When the program runs, it populates each stage of the graphics pipeline with a shader. So in effect, all that a program does is encapsulate multiple shader stages.</p> <p>This is much clearer if you investigate the <a href="http://www.opengl.org/registry/specs/ARB/separate_shader_objects.txt" rel="nofollow"><code>ARB_separate_shader_objects</code></a> extension specification, which introduces the concept of program pipeline objects. Instead of having one program with a shader for each stage, you can have one program for each stage. The whole GLSL program scheme has always been a little bit obtuse, in most other APIs you have separate shaders per-stage and there is none of this program linking non-sense.</p> <p>To use your executable program analogy. GLSL shaders are the actual executables, GLSL programs are effectively job control scripts. Your program is responsible for getting each of your shaders to run in their respective pipeline stage, and serves as the interface for passing them variables (uniforms).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload