| … | … | @@ -560,9 +560,26 @@ void DCTerrainGeneratorProcNodes::_collect_node_data() { |
| 560 | 560 | hgrid_.table = (int)gi.get("table", 0); |
| 561 | 561 | hgrid_.mpp = (float)(double)gi.get("mpp", 30.0); |
| 562 | 562 | hgrid_.stub = (float)(double)gi.get("stub", 0.0); |
| 563 | // ⛔ AND THE GEOMETRY, WHICH IS THE WHOLE POINT. |
| 564 | // |
| 565 | // hblk_n_/ox_/oz_ were taken from get_tile_size()/get_tile_origin() |
| 566 | // above -- the SINGLE tile's, i.e. the node's n_, which is 0 when |
| 567 | // only the grid is loaded because set_tile_path() was never called. |
| 568 | // |
| 569 | // And `hblk_n_ > 0` gates BOTH the four CPU heightfield sites AND |
| 570 | // the emission at :1117 that substitutes heightmap_gn(x,z) for the |
| 571 | // mountain-noise layer. Left at 0, 213 MiB of tiles upload |
| 572 | // successfully and NOTHING EVER SAMPLES THEM: the CPU meshes the |
| 573 | // base noise, the GLSL emits the noise branch, and the only symptom |
| 574 | // is a CPU/GPU spawn-height disagreement. |
| 575 | hblk_n_ = (int)gi.get("side", 0); |
| 576 | hblk_ox_ = (float)(double)gi.get("ox", 0.0); |
| 577 | hblk_oz_ = (float)(double)gi.get("oz", 0.0); |
| 578 | hblk_mpp_ = hgrid_.mpp; |
| 563 | 579 | UtilityFunctions::print("[DCTerrainGeneratorProcNodes] tile grid ", |
| 564 | 580 | hgrid_.nx, "x", hgrid_.ny, " cells, ", (int)gi.get("tiles", 0), |
| 565 | | " tiles resident"); |
| 581 | " tiles resident, ", hblk_n_, " texels/side from (", |
| 582 | hblk_ox_, ",", hblk_oz_, ")"); |
| 566 | 583 | } |
| 567 | 584 | } |
| 568 | 585 | // ASK THE NODE FOR THE SIDE LENGTH; DO NOT DERIVE IT FROM THE ARRAY. |
| … | … | @@ -776,7 +793,11 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() { |
| 776 | 793 | // density IS the field. If this does not show the block, nothing downstream |
| 777 | 794 | // of it can, and the fault is in getting the bytes to the GPU rather than in |
| 778 | 795 | // anything about terrain. |
| 779 | | if (heightfield_only_ && hblk_n_ > 0) { |
| 796 | // NOT over a packed grid: the sampler emitted below is single-tile |
| 797 | // addressing, custom_data[j*HBLK_N + i], and with HBLK_N = the grid's texel |
| 798 | // extent that indexes 928M entries into a 55.8M buffer. The node's own |
| 799 | // prelude already emits the PAGED sampler. |
| 800 | if (heightfield_only_ && hblk_n_ > 0 && !hgrid_.active()) { |
| 780 | 801 | String hb = |
| 781 | 802 | String("const int HBLK_N = ") + itos(hblk_n_) + ";\n" |
| 782 | 803 | "const float HBLK_OX = " + String::num(hblk_ox_, 4) + ";\n" |
| … | … | @@ -899,7 +920,7 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() { |
| 899 | 920 | // as fixed; it was not, and the heightfield_only isolation oracle failed to |
| 900 | 921 | // compile on EVERY run -- "Custom shader failed, falling back" -- which is |
| 901 | 922 | // what made the map's own GPU/CPU oracle report a 9.1 m disagreement. |
| 902 | | if (hblk_n_ > 0 && !heightfield_path_.is_empty()) { |
| 923 | if (hblk_n_ > 0 && !heightfield_path_.is_empty() && !hgrid_.active()) { |
| 903 | 924 | // The sampler alone — HBLK_* consts plus hblk_height_m. Split out because |
| 904 | 925 | // the lookdev path needs ONLY this: erosion_wrapper_glsl emits its own |
| 905 | 926 | // M_* consts and its own heightmap_gn, and emitting ours as well would be |