3 ms·
Signed distance fields _are not that bad_ (thank you Inigo Quilez) Once you have your primitives, it becomes basic math and union, subtraction, intersection fo
by MrLeap 4y ago
Signed distance fields _are not that bad_ (thank you Inigo Quilez)
Once you have your primitives, it becomes basic math and union, subtraction, intersection for the most part.
I made this shader a few days after learning the basics -> https://twitter.com/LeapJosh/status/1494417750395179012 https://twitter.com/LeapJosh/status/1494417750395179012
If glsl ever got function pointers or similar, you'd see simple SDF DSLs and frameworks bloom overnight and many of them would be easy and awesome.
- bluescrn 4y agoRaymarching ever-more-complex mathematical functions is neat if you're creating a demo out of curiosity or for art's sake. But it's a very expensive and not-very-scalable method of rendering things, certainly not a replacement for meshes of triangles.
- wwwtyro 4y agoShameless plug - I wrote sdf-csg[1] as an attempt to have that cake and eat it too. Basically, build things out of SDFs, then create meshes out of them for efficient rendering. [1] https://github.com/wwwtyro/sdf-csg https://github.com/wwwtyro/sdf-csg
- MrLeap 4y agoThis is very cool. I wish I could use it in unity! Going to take a few minutes to scope out what a port would take...
- bj-rn 4y agoCheck out Fuse[1][2], it also has a SDF to mesh feature and since it is based on Stride[3] (C#) it might be easier to port. [1] https://github.com/TheFuseLab/VL.Fuse https://github.com/TheFuseLab/VL.Fuse [2] https://www.thefuselab.io https://www.thefuselab.io [3] https://www.stride3d.net https://www.stride3d.net
- dakom 4y agoFair point.. and the response is also right on. I'd edit my original comment to say "...creating full interactive scenes of geometry and textures..." if I could :)