OverviewFilesCommitsIssuesDocsReleasesPeers

dc-terrain commits / fdb47b5

erosion: pass erosion_scale to the CPU twin, so collision matches the shader
erosion_heightmap_gn_cpu gained an erosion_scale parameter (proc-nodes 5a3f88a: the slope must be in the units of the gullies it steers, not in M_TH). Both ProcNodesBridge::evaluate call sites now pass owner_->erosion_scale_ — the same value that reaches the shader as EN_ESCALE via wp.en_erosion_scale. These two must move together. sample_density answers collision queries while the shader draws the surface, so a divergence is a player falling through ground that is visibly there. gate_dc_vs_lookdev demonstrated it concretely while only the GPU side had the fix: 7.921 m max disagreement, with the gate's own control still discriminating so it was not a false alarm. With both sides moved it is back to 0.002 m.
fdb47b50bd3af4c4f64f42721c375ee6a4fffc7c
by plankatron <fleeky@gmail.com> · 2026-09-02T14:13:29.000Z

Changed files (1) +4 -2

src/dc_terrain_generator_procnodes.cpp +4 -2
……@@ -1314,7 +1314,8 @@ float DCTerrainGeneratorProcNodes::ProcNodesBridge::evaluate(
13141314 };
13151315 float oh, odx, odz;
13161316 erosion_heightmap_gn_cpu(x, z, floor_y, ceiling_y, terrain_height,
1317 /* height_amp */ 0.25f, hmpp, sample, oh, odx, odz);
1317 /* height_amp */ 0.25f, owner_->erosion_scale_, hmpp, sample,
1318 oh, odx, odz);
13181319 terrain_offset = vec3(oh, odx, odz);
13191320 }
13201321 // THE SAME SUBSTITUTION THE GLSL MAKES, and it must stay the same one:
……@@ -1341,7 +1342,8 @@ float DCTerrainGeneratorProcNodes::ProcNodesBridge::evaluate(
13411342 };
13421343 float oh, odx, odz;
13431344 erosion_heightmap_gn_cpu(x, z, floor_y, ceiling_y, terrain_height,
1344 /* height_amp */ 0.25f, hmpp, sample, oh, odx, odz);
1345 /* height_amp */ 0.25f, owner_->erosion_scale_, hmpp, sample,
1346 oh, odx, odz);
13451347 terrain_offset = vec3(oh, odx, odz);
13461348 }
13471349 // Detail rides on TOP and is NOT folded in — MUST stay identical to the GLSL.