Paint the universe with geometry, smoothstep, and noise
March 29, 2022 6:28 AM   Subscribe

Inigo Quilez uses a single (extremely complex) math equation to draw an animated "Selfie Girl" in a graphics card shader program, and explains it all in a 25 minute video.

Inigo (IQ) is co-creator of the Shadertoy website, and a legend in creating shader code and modelling geometry. He maintains iquilezles.org with countless detailed articles on how to use math and shaders to create beautiful images, as well as useful tools and utilities and links to his works from the demo scene.

You can look at the actual shader code for Selfie Girl running real-time in a web browser, but I warn you that if your graphics card isn't reasonably high-spec it may seem more a slide-show than smooth animation.
posted by seanmpuckett (5 comments total) 24 users marked this as a favorite
 
A post that's right up my alley! Writing pixel shaders is a great way to kill an hour or two, often just by combining some basic functions to make hypnotic intersecting patterns, and you don't have to be as incredibly talented as Quilez is to enjoy it. If you're interested, besides Shadertoy, some great resources are:
  • The Book of Shaders will walk you through a lot of the basic math and how it gets turned into images.
  • Shader Editor is a live wallpaper and coding environment for Android, so you can write up a quick effect and then set it as your background.
  • Shadertab is a browser extension I created that lets you do the same thing but in your new tab page (tested only in Firefox, but should probably work with some tweaks in Chrome)
posted by Four String Riot at 7:29 AM on March 29, 2022 [10 favorites]


"You can paint virtually anything you want just by stacking mathematical formulas, none of which is really complicated to be honest."

Then why is my head spinning? I'll stick to A = 1/2*b*h in mspaint thank you very much.
posted by Increase at 3:08 PM on March 29, 2022


What if Bob Ross but math?
posted by biogeo at 6:18 PM on March 29, 2022 [1 favorite]


Increase, it's college level math, not high school. There was some linear algebra and calculus on three variables there. Admittedly easy linear algebra and calculus, but if you don't know tangents and dot products, some of that is going to be lost.
posted by Hactar at 6:36 AM on March 30, 2022


Makes me really jealous of the modern age where people have screens with such high resolution in x,y and in color space, and the gpu is faster than a couple or more Crays. The mathy bit is old news, it's just presto! quick now.

I got recommended his "paint an eye" video which is only like 12 minutes, but it's actually live coding. And yeah, it's just a couple dozen lines of code.

Now if you could just add a few finger holes and a place to blow it could be a holophonor.
posted by zengargoyle at 9:09 AM on March 30, 2022


« Older My Horse Says I'm a Bad Kisser   |   The Sound of Beauty (Eurovision 2022 Preview) Newer »


This thread has been archived and is closed to new comments