OverviewFilesCommitsIssuesDocsReleasesPeers

dc-terrain commits / 144d932

procnodes: the emitted sampler named a buffer that no longer exists
Two sites emitted float h00 = hblk_data[j0*HBLK_N + i0]; ... for a buffer renamed to custom_data when dc-terrain moved to opaque transport. #55 section 2.3 records this as fixed. It was not — the comment beside it said so plainly ("still names the buffer hblk_data ... Left in place for the pre-node path") and it was left. It is not dormant. map_dc_diffusion's isolation oracle drives the heightfield_only path on every load, and every load produced DCCompute: Custom shader compile error: 'hblk_data' : undeclared identifier DCGpuThread: Custom shader failed, falling back so the step that exists to prove the buffer is readable never ran, and the map's GPU/CPU oracle reported a disagreement that was really a fallback. After: "BUFFER-READ ISOLATION (heightfield_only, 2.4 km): GPU spread 608.0 m", i.e. the isolation step runs for the first time. ⚠ The 9.1 m GPU-vs-CPU disagreement is STILL there and this did not cause it. I predicted it would clear. It is unchanged at 9.091 max / 9.066 rms, and 9.1 m is close to the erosion's measured mean displacement (world Y = field metres - 8.93 m), which suggests the oracle compares an erosion-on field against an erosion-off one. Unproven, and separate from this.
144d932afee06a0e2aac2ff3a261a198f816761c
by plankatron <fleeky@gmail.com> · 2026-09-02T14:58:35.000Z

Changed files (1) +9 -6

src/dc_terrain_generator_procnodes.cpp +9 -6
……@@ -744,8 +744,8 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() {
744744 " int i0 = int(floor(u)); int j0 = int(floor(v));\n"
745745 " int i1 = min(i0 + 1, HBLK_N - 1); int j1 = min(j0 + 1, HBLK_N - 1);\n"
746746 " float fu = u - float(i0); float fv = v - float(j0);\n"
747 " float h00 = hblk_data[j0*HBLK_N + i0]; float h10 = hblk_data[j0*HBLK_N + i1];\n"
748 " float h01 = hblk_data[j1*HBLK_N + i0]; float h11 = hblk_data[j1*HBLK_N + i1];\n"
747 " float h00 = custom_data[j0*HBLK_N + i0]; float h10 = custom_data[j0*HBLK_N + i1];\n"
748 " float h01 = custom_data[j1*HBLK_N + i0]; float h11 = custom_data[j1*HBLK_N + i1];\n"
749749 " return mix(mix(h00, h10, fu), mix(h01, h11, fu), fv);\n"
750750 "}\n"
751751 "float evaluate_density(float x, float y, float z) {\n"
……@@ -848,8 +848,11 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() {
848848 // ONLY for the generator's OWN heightfield_path. When the data came from a
849849 // NODE, that node emits its own sampler in its prelude -- emitting a second
850850 // one here is a redefinition, and this older copy still names the buffer
851 // hblk_data, which no longer exists now that dc-terrain transports opaque
852 // custom_data. Left in place for the pre-node path rather than deleted.
851 // custom_data. FIXED: it named the buffer hblk_data, which stopped existing
852 // when dc-terrain moved to opaque custom_data. #55 section 2.3 recorded this
853 // as fixed; it was not, and the heightfield_only isolation oracle failed to
854 // compile on EVERY run -- "Custom shader failed, falling back" -- which is
855 // what made the map's own GPU/CPU oracle report a 9.1 m disagreement.
853856 if (hblk_n_ > 0 && !heightfield_path_.is_empty()) {
854857 // The sampler alone — HBLK_* consts plus hblk_height_m. Split out because
855858 // the lookdev path needs ONLY this: erosion_wrapper_glsl emits its own
……@@ -869,8 +872,8 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() {
869872 " int i0 = int(floor(u)); int j0 = int(floor(v));\n"
870873 " int i1 = min(i0 + 1, HBLK_N - 1); int j1 = min(j0 + 1, HBLK_N - 1);\n"
871874 " float fu = u - float(i0); float fv = v - float(j0);\n"
872 " float h00 = hblk_data[j0*HBLK_N + i0]; float h10 = hblk_data[j0*HBLK_N + i1];\n"
873 " float h01 = hblk_data[j1*HBLK_N + i0]; float h11 = hblk_data[j1*HBLK_N + i1];\n"
875 " float h00 = custom_data[j0*HBLK_N + i0]; float h10 = custom_data[j0*HBLK_N + i1];\n"
876 " float h01 = custom_data[j1*HBLK_N + i0]; float h11 = custom_data[j1*HBLK_N + i1];\n"
874877 " return mix(mix(h00, h10, fu), mix(h01, h11, fu), fv);\n"
875878 "}\n"
876879 // The five names erosion_heightmap_gn_glsl() reads. EN_HAMP is the