Loading video...

Video Failed to Load

Go Home

o++;vec3 p,c=vec3(8,6,7)/6e2;for(float q=2.,e,i,a,g,h,k;i++<2e2;g+=a=min(e,h-q)/3.,o-=mix(c.ggbr,c.rgrr+h/7e2,h-q)/exp(a*a*1e7)/h)for(p=vec3((FC.xy-r/q)/r.y*g,g),e=p.y-g*.7+q,p.z+=t,h=e+p.x*.4,a=q;a<5e2;a/=.8)p.xz*=rotate2D(q),h-=exp(sin(k=p.z*a)/a-1.)-.44,e-=exp(sin(k+t+t)-q)/a;

287,341 views • 2 years ago •via X (Twitter)

10 Comments

yonatan's profile picture
yonatan2 years ago

live version (heavy):

Learn AI's profile picture
Learn AI2 years ago

I asked #ChatGPT about this code and this is its response The code snippet you provided appears to be a fragment of a shader, possibly written in GLSL (OpenGL Shading Language) or a similar language used for creating visual effects on graphics hardware. This code seems to be part of a procedural generation algorithm, possibly for rendering fractal-like structures or complex visual patterns in real-time. Here's a breakdown of its components and a high-level explanation of what it does: - **Variable Initialization and Loop Structure**: - `o++`: This is likely incrementing a global variable or a parameter used to control some aspect of the rendering, possibly related to time or iteration count. - The outer loop `for(float q=3.,e,i,a,g,h,k;i++<1e2;...)` initializes several floating-point variables and iterates 100 times (`1e2` is scientific notation for 100). The purpose of this loop seems to involve calculating cumulative effects over multiple iterations to generate complex patterns. - `g+=a=min(e,h-q)/4.`: This line is computing a value `a` as the minimum of `e` and `h-q`, divided by 4, and then adding it to `g`. It's manipulating variables that likely influence the visual output's geometry or color. - **Nested Loop for Detailed Calculations**: - The nested loop contains complex mathematical operations that manipulate `p` (a vector, possibly representing a position in 3D space), `e`, `h`, `a`, and other variables to iteratively modify the visual effect. - `rotate2D(q+t)`: This function call suggests that the code applies a 2D rotation to part of the vector `p.xz`, where `q+t` is likely the rotation angle. This is part of the iterative calculations that produce dynamic, possibly animated, visual patterns. - The use of exponential and trigonometric functions (`exp`, `sin`) indicates that the visual output might involve smooth transitions and oscillations, common in fractal or wave-like patterns. - **Color and Opacity Calculations**: - `o-=mix(c.ggbr,c.bgrg+h/8e2,h-q)/exp(a*a*9e6)/h`: This line is particularly complex, involving a mix function that likely blends colors or values based on the variable `h`, `q`, and other factors. The expression adjusts `o` by subtracting a calculated value, which could influence the opacity, color, or another visual aspect of the output. The mix function's inputs (`c.ggbr`, `c.bgrg+h/8e2`) suggest manipulation of color channels or gradients. - **Mathematical Expressions for Visual Effect**: - The expressions involving `exp`, `sin`, and division by `a` or `a*a` indicate the use of mathematical functions to create complex, smooth patterns or transitions in the visual effect. This code snippet is designed to run within the GPU's shader pipeline, executing very rapidly to produce intricate

Pablo Andrioli (Kali)'s profile picture
Pablo Andrioli (Kali)2 years ago

Ok that's it. I'm retiring from shader art.

wahndo's profile picture
wahndo2 years ago

Beautiful

M Isa's profile picture
M Isa2 years ago

I tried making the code more human-readable. I'm not too sure if the variable names are correct, I gave my unminified code to ChatGPT and asked it to give the variables proper names lol

Michael Jordan's profile picture
Michael Jordan2 years ago

Oooo, changed the color codes... nice.

goldenhat's profile picture
goldenhat2 years ago

you got a typo

Eiko's profile picture
Eiko2 years ago

people in the replies really thinking this is a prompt for AI generation

King Tut AI's profile picture
King Tut AI2 years ago

Where are you putting this code to get the results?

neosborin.eth🤍🕊's profile picture
neosborin.eth🤍🕊2 years ago

does it come in purple

Related Videos