Skip to content

Instantly share code, notes, and snippets.

@v3c70r
Created December 2, 2016 21:30
Show Gist options
  • Save v3c70r/b548d173a4957c468e2f825a71e86aab to your computer and use it in GitHub Desktop.
Save v3c70r/b548d173a4957c468e2f825a71e86aab to your computer and use it in GitHub Desktop.
Plot f(x) or f(y) on screen.
float plotX(vec2 st, float pct){
return smoothstep( pct-0.01, pct, st.y) -
smoothstep( pct, pct+0.01, st.y);
}
float plotY(vec2 st, float pct){
return smoothstep( pct - 0.01, pct, st.x) -
smoothstep(pct, pct + 0.01, st.x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment