X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;f=Render.lua;h=f690ab77d33630cd8822f9b542b45d470ded8bd7;hb=HEAD;hp=57cb407f894ab2b14401f4087cfab4919196eab7;hpb=13e125dc80612c40964a06888ac750095752dbac;p=raymarcher.git diff --git a/Render.lua b/Render.lua index 57cb407..f690ab7 100644 --- a/Render.lua +++ b/Render.lua @@ -12,12 +12,12 @@ local O = Operations require "Textures" local T = Textures -local eps = 0.01 +local eps = 0.001 local max_dist2 = 30^2 local bg_col = {0.1,0.1,0.1} local function calculate_normal(sdf, l) - local delta = 1e-3; + local delta = eps/10 return V.new{sdf(l+V.x*delta).dist-sdf(l-V.x*delta).dist, sdf(l+V.y*delta).dist-sdf(l-V.y*delta).dist, sdf(l+V.z*delta).dist-sdf(l-V.z*delta).dist}/(2*delta) @@ -54,7 +54,6 @@ local function render(scene, width, height, filename) local normalize = V.normalize -- optimization for y=1,height do - if y % math.floor(height/10) == 0 then print(y/math.floor(height/10) * 10 .. "%") end