diff --git a/learning/PixelSpirit/branch.frag b/learning/PixelSpirit/branch.frag new file mode 100644 index 0000000..0560e56 --- /dev/null +++ b/learning/PixelSpirit/branch.frag @@ -0,0 +1,23 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + float dev = .25; + // the card itself has another way to do this, instead of 1.0-st.x+st.y it uses .5+(st.x-st.y)*.5 + // which i like more + color += step(.45, (1.0-st.x+st.y)*.5)-step(.55, (1.0-st.x+st.y)*.5); + + + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/death.frag b/learning/PixelSpirit/death.frag new file mode 100644 index 0000000..0696e39 --- /dev/null +++ b/learning/PixelSpirit/death.frag @@ -0,0 +1,21 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + // simple enough, basically adding together both coors and dividing by 2 (aka multing by .5) + color += step(.5,(st.x+st.y)*.5); + + + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/high_priestess.frag b/learning/PixelSpirit/high_priestess.frag new file mode 100644 index 0000000..4d6ece2 --- /dev/null +++ b/learning/PixelSpirit/high_priestess.frag @@ -0,0 +1,25 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +float stroke(in float x_coor, float s, float width){ + float d = step(s,x_coor+width*.5)-step(s,x_coor-width*.5); + return clamp(d, 0.,1.); +} + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + vec2 centre = vec2(.5); + // this was my original solution, going to look over the stroke version on the card now + //color += step(.25, distance(centre, st))-step(.27, distance(centre, st)); +color += stroke(length(st-.5)*2.,.5,.05); + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/justice.frag b/learning/PixelSpirit/justice.frag new file mode 100644 index 0000000..2b18ae8 --- /dev/null +++ b/learning/PixelSpirit/justice.frag @@ -0,0 +1,18 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + color += step(.5, st.x); + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/strength.frag b/learning/PixelSpirit/strength.frag new file mode 100644 index 0000000..50b7fb9 --- /dev/null +++ b/learning/PixelSpirit/strength.frag @@ -0,0 +1,20 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + float deviation = .25; + //idk why but i've never considered using cos or sin on anything else then u_time, but this is really interesting and something i definetly overlooked + color += step(.5+(cos(st.y*PI)*deviation),st.x); + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/temperance.frag b/learning/PixelSpirit/temperance.frag new file mode 100644 index 0000000..82db09e --- /dev/null +++ b/learning/PixelSpirit/temperance.frag @@ -0,0 +1,34 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +float squigly_line(in float midpoint, in float deviation, in vec2 st) { + return step(midpoint+(cos(st.y*PI)*deviation),st.x)-step(midpoint+deviation+(cos(st.y*PI)*deviation),st.x); +} + +float stroke(in float x_coor, float s, float width){ + float d = step(s,x_coor+width*.5)-step(s,x_coor-width*.5); + return clamp(d, 0.,1.); +} + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + float dev = .1; + // stagger for .3 .5 and .7, since we don't want any chance of deviation overlap + //color += squigly_line(.3, dev, st) + squigly_line(.5,dev,st)+squigly_line(.7,dev,st); + + // after finishing the high priestess decided to come back to this one and try using the stroke function again. + float c = cos(st.y*PI)*dev; + color += stroke(st.x,.35+c,.1)+stroke(st.x,.5+c,.1)+stroke(st.x,.65+c,.1);; + + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/the_hanged_man.frag b/learning/PixelSpirit/the_hanged_man.frag new file mode 100644 index 0000000..3458a71 --- /dev/null +++ b/learning/PixelSpirit/the_hanged_man.frag @@ -0,0 +1,24 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +float stroke(in float x_coor, float s, float width){ + float d = step(s,x_coor+width*.5)-step(s,x_coor-width*.5); + return clamp(d, 0.,1.); +} + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + color += stroke((st.x+st.y)*.5, .5, .1)+stroke(.5+(st.x-st.y)*.5,.5,.1); + + + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/the_wall.frag b/learning/PixelSpirit/the_wall.frag new file mode 100644 index 0000000..2de5802 --- /dev/null +++ b/learning/PixelSpirit/the_wall.frag @@ -0,0 +1,18 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + + color += step(.45, st.x)-step(.55, st.x); + + gl_FragColor = vec4(color, alpha); +} diff --git a/learning/PixelSpirit/void.frag b/learning/PixelSpirit/void.frag new file mode 100644 index 0000000..676b077 --- /dev/null +++ b/learning/PixelSpirit/void.frag @@ -0,0 +1,18 @@ +#ifdef GL_ES +precision mediump float; +#endif +uniform vec2 u_resolution; +uniform vec2 u_mouse; +uniform float u_time; + +#define PI 3.14159265359 + +void main() { + vec2 st = gl_FragCoord.xy/u_resolution; + vec3 color = vec3(0.0,0.0,0.0); + float alpha = 1.0; + + + + gl_FragColor = vec4(color, alpha); +}