Last active
August 2, 2023 18:53
-
-
Save kfahn22/84ded9666e6037fdb62376ccffb6582e to your computer and use it in GitHub Desktop.
gearSDF example
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
| #ifdef GL_ES | |
| precision highp float; | |
| #endif | |
| uniform vec2 u_resolution; | |
| #include "lygia/draw/fill.glsl" | |
| #include "lygia/sdf/gearSDF.glsl" | |
| void main() | |
| { | |
| vec2 uv = (gl_FragCoord.xy-0.5*u_resolution.xy) / u_resolution.y; | |
| vec4 color = vec4(vec3(0.0), 1.0); | |
| float sdf = gearSDF(uv, 12.0, 10); | |
| color.rgb += fill(sdf, 0.01); | |
| gl_FragColor = color; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Create an example for use of gearSDF.