Skip to main content
2 of 2
Expand abbreviation in case anyone else, like me, needed to look up what it means...

Sharing calculation result between shader programs in OpenGL

Question

Is there a way to compute something in a first shader program (eg. screen-space coordinates from word-space ones) and access those results in an another shader program?

Possible solutions

  1. Give up multiple-shader-programs architecture and create one combined shader program
  2. Save somehow results to a buffer objects (I couldn't find out if this is possible except computation shaders)
  3. Render to texture and read the texture

Is there a nicer solution?

BPiek
  • 307
  • 1
  • 8