Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vec3 sphere2cube(const in vec3 sphere)
- {
- vec3 f = abs(sphere);
- bool a = f.y >= f.x && f.y >= f.z;
- bool b = f.x >= f.z;
- return a ? cubify(sphere.xzy).xzy : b ? cubify(sphere.yzx).zxy : cubify(sphere);
- }
Advertisement
Add Comment
Please, Sign In to add comment