Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

this is really great: https://mastodon.social/@ianthehenry/113223607547344491

How did you do it? Whats the shading factor?



Thanks! Here's the source:

    (color r2 (vec3
      (fbm 8 :f (fn [q] (rotate (q * 2) (pi * sin (t / 100)) + [t 0]))
        (fn [q] (cos q.x + sin q.y /)) q (osc t 30 30 10) | remap+)))
Basically taking the function (1 / (cos(x) + sin(y))) and adding it to itself 8 times, each time scaling and rotating the input a little more (:f).

I'm curious if it looks the same on all GPUs because it kinda relies on floating point precision errors to give it that film-grainy textured effect. And it definitely divides by zero sometimes.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: