mirror of
https://github.com/bvanroll/shaders.git
synced 2025-08-30 04:22:47 +00:00
hmmm
This commit is contained in:
@@ -31,6 +31,11 @@ float fill(float x, float size) {
|
||||
return 1.-step(size, 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);
|
||||
@@ -41,6 +46,10 @@ void main() {
|
||||
//i don't understand what happens here
|
||||
//it has to be fract causing this to look like that
|
||||
color *= step(.5,fract(cross*4.));
|
||||
color *= step(1.,cross);
|
||||
color += fill(cross,.5);
|
||||
color += stroke(rect,.65,.05);
|
||||
color += stroke(rect,.75,.025);
|
||||
|
||||
gl_FragColor = vec4(color, alpha);
|
||||
}
|
||||
|
Reference in New Issue
Block a user