From 74b584ac77384613226854fe368cdce2a5612939 Mon Sep 17 00:00:00 2001 From: yum Date: Sat, 1 Nov 2025 12:07:18 -0700 Subject: Adjust deform/undeform jacobian determinant factors --- ray_marching_maps.slang | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ray_marching_maps.slang') diff --git a/ray_marching_maps.slang b/ray_marching_maps.slang index 649a557..87481a0 100644 --- a/ray_marching_maps.slang +++ b/ray_marching_maps.slang @@ -1,6 +1,7 @@ #ifndef __RAY_MARCHING_MAPS_INC #define __RAY_MARCHING_MAPS_INC + #include "math.cginc" #include "pema99.cginc" @@ -34,8 +35,8 @@ // Just trace a sphere of radius 0.1 for now. [Differentiable] public float map(float3 p) { - float3 count = float3(5,5,1); - float3 period = 0.2f; + float3 count = float3(20,20,1); + float3 period = 0.05f; float3 half_period = period*0.5f; float3 which = abs(floor((p + half_period) / period)); if (any(abs(which) >= count)) { @@ -44,8 +45,8 @@ public float map(float3 p) { p = glsl_mod(p + half_period, period) - half_period; } - p.z += 0.1f; - return length(p) - 0.1f; + p.z += half_period.x; + return length(p) - half_period.x; } public void map_normal(inout float3 xyz, inout float3 normal, -- cgit v1.2.3