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

One more crazy thing you can do with raymarching - smoothly twine any shape into any other shape. Take any two signed distance fields, say they're defined by the functions dist0(p) and dist1(p). Then you can do

    dist(p, t) = (1-t)*dist0(p) + t*dist1(p)
T doesn't have to be time-based, it can be space-based, so you have a shape that's a cylinder on the bottom and a large sphere on top and here's a mushroom https://www.shadertoy.com/view/lsSXWc

Edit: I have a very strong feeling that in most cases the resulting function isn't a "proper" distance field, but you can still raymarch through it normally.



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

Search: