diff options
| author | yum <yum.food.vr@gmail.com> | 2025-11-01 12:07:18 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2025-11-01 12:07:18 -0700 |
| commit | 74b584ac77384613226854fe368cdce2a5612939 (patch) | |
| tree | a6e3bfdfc41b44b28e0897c1a10c50332f7bdca8 /ray_marching_maps.slang | |
| parent | 04c1976f17cb766961ed4dc0ad3ef26848188c00 (diff) | |
Adjust deform/undeform jacobian determinant factors
Diffstat (limited to 'ray_marching_maps.slang')
| -rw-r--r-- | ray_marching_maps.slang | 9 |
1 files changed, 5 insertions, 4 deletions
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, |
