Created
June 22, 2020 02:09
-
-
Save danbee/ab8c1e91fc4e3568fa1ecbd1594da5eb to your computer and use it in GitHub Desktop.
Some GLSL shader functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vec3 square(vec2 st,vec2 bli,vec2 tri,vec3 color) { | |
// bottom-left | |
vec2 bl = step(bli,st); | |
// top-right | |
vec2 tr = step(1.0-tri,1.0-st); | |
float pct = bl.x * bl.y * tr.x * tr.y; | |
vec3 c = vec3(pct * color); | |
return c; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment