summaryrefslogtreecommitdiffstats
path: root/ray_marching_maps.slang
diff options
context:
space:
mode:
Diffstat (limited to 'ray_marching_maps.slang')
-rw-r--r--ray_marching_maps.slang9
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,