Forked from CharStiles/GLSL_BoilerPlateTheForce.glsl
Last active
March 12, 2023 16:34
-
-
Save cassieevans/cfcbeda11d1c06c65ac12d3a8c99184f to your computer and use it in GitHub Desktop.
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
float circ(vec2 p){ | |
return length(p) - 0.5; | |
} | |
// http://www.iquilezles.org/www/articles/palettes/palettes.htm | |
// As t runs from 0 to 1 (our normalized palette index or domain), | |
//the cosine oscilates c times with a phase of d. | |
//The result is scaled and biased by a and b to meet the desired constrast and brightness. | |
vec3 cosPalette( float t, vec3 a, vec3 b, vec3 c, vec3 d ) | |
{ | |
return a + b*cos( 6.28318*(c*t+d) ); | |
} | |
void main() | |
{ | |
gl_FragColor = vec4(black,1.); | |
// distance metric | |
//float shape = circ(uv() * vec2(3.0)); | |
//vec3 col = cosPalette(0.5,vec3(0.5),vec3(0.5),vec3(1),vec3(time*0.01,time*0.1,time*.2)); | |
// lighting: darken at the center | |
//col = vec3(shape) * col; | |
// output: pixel color | |
//gl_FragColor = min(vec4( col.rgb, 1.0 ), vec4(0.8)); | |
// we take the min of the output color and a very light grey color because The Force makes | |
// all of their controls white at the bottom all white without any sort of outline, which is | |
// silly, so you can make it vec4(col.rgb,1.0) in other softwares or if you dont care | |
// about seeing the controls | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment