Skip to content

Instantly share code, notes, and snippets.

@kfahn22
Last active August 2, 2023 18:53
Show Gist options
  • Select an option

  • Save kfahn22/84ded9666e6037fdb62376ccffb6582e to your computer and use it in GitHub Desktop.

Select an option

Save kfahn22/84ded9666e6037fdb62376ccffb6582e to your computer and use it in GitHub Desktop.
gearSDF example
#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;
}
@kfahn22
Copy link
Author

kfahn22 commented Aug 2, 2023

Create an example for use of gearSDF.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment