title: How to implement multiple features in one opengl program?
body: <p>I have to implement multiple features in one opengl program. For example, to deal with one whole image file, we have 3 features:</p>
  
  <p>(1). YUV->RGB</p>
  
  <p>(2). image filter</p>
  
  <p>(3). RGB->YUV</p>
  
  <p>then just one vertex shader and 3 fragment shaders will be OK. I have implemented these 3 shaders one by one, and the function work for each, but I don't know how to link them like a pipe together? Can somebody help, thanks. </p>
  
  <p>I have googled 2 ways may work for my case:</p>
  
  <pre><code>1. Use glUseProgram() to switch between shaders, but it will only make effect for the last fragment shader. 
  
  2. Write a complicated fragment shader to embody all these features. But I don't know how, seems impossible.
  </code></pre>