Last active
October 23, 2021 17:07
-
-
Save KrabCode/a596cf697e514276ad19e8400fd88d74 to your computer and use it in GitHub Desktop.
This file contains 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
uniform sampler2D texture; | |
uniform vec2 resolution; | |
void main(void){ | |
vec2 uv = gl_FragCoord.xy / resolution.xy; | |
vec3 tex = texture2D(texture, uv).rgb; | |
vec3 offset = vec3(-0.01, -0.01, -0.005); | |
tex += offset; | |
gl_FragColor = vec4(tex, 1.); | |
} |
This file contains 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
PShader feedbackShader; | |
float t; | |
void setup() { | |
size(1000, 1000, P2D); | |
background(0); | |
feedbackShader = loadShader("feedback.frag"); | |
} | |
void draw() { | |
t = radians(frameCount); | |
translate(width / 2, height / 2); | |
drawRotatingRectangle(0); | |
filter(feedbackShader); | |
if (frameCount > 360 && frameCount < 720) { | |
//saveFrame("out2/###.jpg"); | |
} | |
} | |
void drawRotatingRectangle(int level) { | |
noFill(); | |
stroke(255); | |
strokeWeight(10); | |
rotate(t * 0.05); | |
rectMode(CENTER); | |
float size = 800; | |
rect(0, 0, size, size); | |
scale(0.889); | |
if (level < 30) { | |
drawRotatingRectangle(level + 1); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://i.imgur.com/ltez9Hg.mp4