3 ms·
https://bauble.studio/ https://bauble.studio/ is a programmatic 3D art playground that I've been working on for a while now, and I'm pretty excited about it! It
by ianthehenry 2y ago
https://bauble.studio/ https://bauble.studio/ is a programmatic 3D art playground that I've been working on for a while now, and I'm pretty excited about it! It's based around signed distance functions, which are a way to represent 3D shapes as, well, functions, and you can do a lot of like weird mathematical distortions and operations that give you cool new shapes. Like average two shapes together, or take the modulo of space to infinitely repeat something... it's a really fun and powerful way to make certain kinds of shapes.
SDFs are very cool in general, and widely used in the generative art communities, but kinda hard to wrangle when you're writing shader code directly. They really are functions, but GLSL doesn't support first-class functions, so if you want to compose shapes you have to manually plumb a bunch of arguments around. So Bauble is essentially a high-level GLSL compiler that lets you model SDFs as first-class values, and as a result you can make a pretty cool 3D shape in just a few lines of code. And then 3D print them!
I need to do some actual work to promote and publicize it once I'm done with the documentation and implement a few more primitives, but it's very close!
The docs have lots of examples of the sorts of things you can do with SDFs: https://bauble.studio/help/ https://bauble.studio/help/
And for examples of some "art" that I've made with it recently:
https://x.com/ianthehenry/status/1839061056301445451 https://x.com/ianthehenry/status/1839061056301445451
https://x.com/ianthehenry/status/1839649510597013592 https://x.com/ianthehenry/status/1839649510597013592
https://x.com/ianthehenry/status/1827461714524434883 https://x.com/ianthehenry/status/1827461714524434883
- bwhaley 2y agoI really want to look at your art but it’s on twitter so I can’t!
- ianthehenry 2y agooh yeah good point. i probably shouldn't link to that anymore. it's all on mastodon too! https://mastodon.social/@ianthehenry https://mastodon.social/@ianthehenry
- jamilton 2y agoFYI, the default file errors out!
- ianthehenry 2y agoSo if you've ever loaded Bauble before you might have a stale and no-longer-working version of the tutorial cached in localStorage -- if you just clear out the script and refresh it will restore the default one. If that's still erroring, please let me know!
- DavidPiper 2y agoNot OP, but I've aso loaded Bauble before, and clearing localStorage didn't help (Firefox, macOS)... (torus :z 60 30 | twist :y 0.07 | rotate :pi :y t :z 0.05 | move :x 50 | mirror :r 10 :x | fresnel | slow 0.25) error: script:16:1: compile error: unknown symbol twist in evaluate [lib/evaluator.janet] on line 81, column 7 in bauble-evaluator/evaluate [lib/init.janet] on line 8, column 12
- ianthehenry 2y agoOh yeah if you clear localStorage like from dev tools, Bauble will re-save the script before refresh, putting it right back where it was. But if you like cmd-a backspace to empty the contents of the script and then refresh it’ll load the default.
- tomthe 2y agoThank you, I really like the default tutorial how one can play with it. Is it possible to visualize data with this?
- ianthehenry 2y agoDepending on the data, maybe? SDFs aren't great at rendering large numbers of enumerated objects -- something like a point cloud would be prohibitively expensive, so I wouldn't think to use them for like traditional graphing.
- Bloedcoins 2y agothis is really great: https://mastodon.social/@ianthehenry/113223607547344491 https://mastodon.social/@ianthehenry/113223607547344491 How did you do it? Whats the shading factor?
- ianthehenry 2y agoThanks! 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.
- andrewlevver 2y agoI think this is awesome and have already sent to a few people
- ianthehenry 2y agohey thanks!