Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created November 18, 2015 20:31
Show Gist options
  • Select an option

  • Save AndrewRayCode/1d167052a6d84b4cbf57 to your computer and use it in GitHub Desktop.

Select an option

Save AndrewRayCode/1d167052a6d84b4cbf57 to your computer and use it in GitHub Desktop.
// Shader 1
uniform float a;
void main() {
float b;
gl_FragColor = a + b;
}
// Shader 2
uniform float b;
void main() {
float a;
gl_FragColor = a + b;
}
// Composed shader (desired output):
uniform float a;
uniform float b;
void main() {
float a_avoid_conflict;
float b_avoid_conflict;
gl_FragColor = (a + b_avoid_conflict) + (a_avoid_conflict + b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment