X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=holy_sphere.lua;h=588c82607d5e235b9794871a11994dcedff4c3c1;hb=16d14ce7ffc1e70269fda8d375f1da11c3907af8;hp=b26f67e45572059d2ed5dca85206100501301495;hpb=ef4dde6203d251741131f06824200c3d7f01f56d;p=raymarcher.git diff --git a/holy_sphere.lua b/holy_sphere.lua index b26f67e..588c826 100644 --- a/holy_sphere.lua +++ b/holy_sphere.lua @@ -16,22 +16,24 @@ local lights = {V.new{3,-3,1}} local scene = { sdf = - O.union( - O.diff( - O.diff( - O.diff( - P.make_sphere(V.new{0,0,0}, 1, - T.make_phong_texture(lights, - T.make_solid_pigment({0,1,0}), - 0.2, 0.7, 1.0, 100)), - P.make_sphere(V.new{0,0,0}, 0.8)), - P.make_pipe(V.new{0,0,0}, 0.5, V.new{0,1,0})), - P.make_pipe(V.new{0,0,0}, 0.5, V.new{1,0,0})), + O.union{ + O.diff{ + P.make_sphere(V.new{0,0,0}, 1, + T.make_phong_texture(lights, + T.map_spherical( + T.make_solid_pigment({0,1,0}), + V.origin, 1, 1), + 0.2, 0.7, 1.0, 100)), + P.make_sphere(V.new{0,0,0}, 0.8), + P.make_pipe(V.new{0,0,0}, 0.5, V.new{0,1,0}), + P.make_pipe(V.new{0,0,0}, 0.5, V.new{1,0,0})}, P.make_plane(V.new{0,0,-1.0}, V.new{0,0,1}, T.make_phong_texture(lights, - T.make_checkered_pigment({0.5,0,0.2}, {1,1,1}), - 0.2, 1.0, 0, 1))), + T.map_rectangular( + T.make_checkered_pigment({0.5,0,0.2}, {1,1,1}), + V.x, V.y), + 0.2, 1.0, 0, 1))}, camera = {location = V.new{2,-5,1}, point_at = V.new{0,0,0},