Skip to content

Instantly share code, notes, and snippets.

@AndrewRayCode
Created December 19, 2018 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AndrewRayCode/d285ad9392133280507aa650fb144945 to your computer and use it in GitHub Desktop.
Save AndrewRayCode/d285ad9392133280507aa650fb144945 to your computer and use it in GitHub Desktop.
# ----- Given this shader
vec4 some_noise_fn() {
return vec4(1.0, 2.0, 3.0, 4.0);
}
void main() {
return some_noise_fn();
}
# ---- I want to replace some_noise_fn() with another function, so my shader author can
experiment generating different types of visual noise. Let's say it's:
vec4 other_noise_fn() {
return vec4(5.0, 5.0, 5.0, 5.0);
}
# ---- Here's what the final progam looks like with the function replaced (the hole filled)
vec4 some_noise_fn() {
return vec4(5.0, 5.0, 5.0, 5.0);
}
void main() {
return some_noise_fn();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment