top | item 41343357

(no title)

ianthehenry | 1 year ago

https://bauble.studio/ is a lisp-based procedural 3D art playground that I hacked together a while ago. It's fun to play with, but it's a very limiting tool: you can do a lot to compose signed distance functions, but there's no way to control the rendering or do anything "custom" that the tool doesn't explicitly allow.

So lately I've been working on a "v2" that exposes a full superset of GLSL, so you can write arbitrary shaders -- even foregoing SDFs altogether -- in a high-level lisp language. The core "default" raymarcher is still there, but you can choose to ignore it and implement, say, volumetric rendering, while still using the provided SDF combinators if you want.

The new implementation is much more general and flexible, and it now supports things like 2D extrusions, mesh export for 3D printing, user-defined procedural noise functions... anything you can do in Shadertoy, you can now do in Bauble. One upcoming feature that I'm very excited about is custom uniforms and embedding in other webpages -- so you can write a blog post with interactive 3D visualizations, for example.

(Also as a fun coincidence: my first cast bronze Bauble arrived today! https://x.com/ianthehenry/status/1827461714524434883)

discuss

order

turtledragonfly|1 year ago

Am I right that the output of the lisp code is ultimately a plain GLSL shader (like one might find on shadertoy.com)?

I built a SDF-based rendering system (2D) for my game, and one of the big hurdles was how to have them be data-driven, rather than needing a new shader for each scene or object.

Would be curious if/how you tackled that problem (:

ianthehenry|1 year ago

Yep! It just outputs GLSL. It doesn't do anything smart -- it's a single giant shader that gets recompiled whenever you change anything, so it wouldn't really work for something like a game. I mean, it could handle like basic instancing of the form "union these N models, where N<256" but there's no way to change the scene graph dynamically.

jkcxn|1 year ago

I've done this for a project where the SDF functions are basically instructions, and you can build up instrictions on the CPU to send to the shader. and then the fragment shader runs them like a mini bytecode interpreter. You can tile up the screen to avoid having too many instructions per fragment. Kinda wild idea and performance may vary depend on what you're doing

kinow|1 year ago

Looks amazing, I was having fun with cssdoodle, and now I have two cool sites to do some programming+arts.

techno_tsar|1 year ago

This is completely nuts. Well done.

holden_nelson|1 year ago

This is phenomenal. Thanks for sharing.

samstave|1 year ago

Stunning.

That site needs to be seen. Thats great.