| … | … | @@ -16,9 +16,7 @@ |
| 16 | 16 | // comment still stands. It is a shared math header and nothing more. |
| 17 | 17 | #include "erosion_cpp_shim.h" |
| 18 | 18 | #include "erosion_wrapper_glsl.h" |
| 19 | | #include "dc_compute.h" |
| 20 | 19 | #include <godot_cpp/classes/file_access.hpp> |
| 21 | | #include <godot_cpp/classes/os.hpp> |
| 22 | 20 | |
| 23 | 21 | namespace godot { |
| 24 | 22 | |
| … | … | @@ -528,21 +526,6 @@ void DCTerrainGeneratorProcNodes::set_graph(const Ref<Resource> &p_graph) { |
| 528 | 526 | // |
| 529 | 527 | // One producer for now, which matches one bound buffer. More than one wants an |
| 530 | 528 | // offset table emitted alongside, which is the same change a grid of tiles needs. |
| 531 | | // Read the SAME floats through binding 14 (the atlas image) instead of binding |
| 532 | | // 13 (the SSBO). Both hold identical values at identical indices, so this is a |
| 533 | | // pure TRANSPORT swap and gate_dc_vs_lookdev must agree to 0.001 m either way. |
| 534 | | // |
| 535 | | // An ENV VAR rather than a property, deliberately: the point is to run the gate |
| 536 | | // BOTH ways over one unchanged scene, and a property would have to be authored |
| 537 | | // into the map to be flipped. |
| 538 | | // |
| 539 | | // HBLK_USE_ATLAS=1 godot4 --path . --script res://scenes/test/... |
| 540 | | static bool _use_atlas() { |
| 541 | | String v = OS::get_singleton()->get_environment("HBLK_USE_ATLAS"); |
| 542 | | return v == "1" || v.to_lower() == "true"; |
| 543 | | } |
| 544 | | |
| 545 | | |
| 546 | 529 | void DCTerrainGeneratorProcNodes::_collect_node_data() { |
| 547 | 530 | if (graph_.is_null()) return; |
| 548 | 531 | Variant nc_var = graph_->call("get_node_count"); |
| … | … | @@ -750,8 +733,6 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() { |
| 750 | 733 | if (heightfield_only_ && hblk_n_ > 0) { |
| 751 | 734 | String hb = |
| 752 | 735 | String("const int HBLK_N = ") + itos(hblk_n_) + ";\n" |
| 753 | | "const int HBLK_ATLAS_W = " + itos(DCCompute::ATLAS_W) + ";\n" |
| 754 | | "const bool HBLK_USE_ATLAS = " + String(_use_atlas() ? "true" : "false") + ";\n" |
| 755 | 736 | "const float HBLK_OX = " + String::num(hblk_ox_, 4) + ";\n" |
| 756 | 737 | "const float HBLK_OZ = " + String::num(hblk_oz_, 4) + ";\n" |
| 757 | 738 | "const float HBLK_MPP = " + String::num(hblk_mpp_, 6) + ";\n" |
| … | … | @@ -880,8 +861,6 @@ void DCTerrainGeneratorProcNodes::_recompile_glsl() { |
| 880 | 861 | // that never compiled and a world with no terrain. |
| 881 | 862 | hblk_glsl_sampler = |
| 882 | 863 | String("const int HBLK_N = ") + itos(hblk_n_) + ";\n" |
| 883 | | "const int HBLK_ATLAS_W = " + itos(DCCompute::ATLAS_W) + ";\n" |
| 884 | | "const bool HBLK_USE_ATLAS = " + String(_use_atlas() ? "true" : "false") + ";\n" |
| 885 | 864 | "const float HBLK_OX = " + String::num(hblk_ox_, 4) + ";\n" |
| 886 | 865 | "const float HBLK_OZ = " + String::num(hblk_oz_, 4) + ";\n" |
| 887 | 866 | "const float HBLK_MPP = " + String::num(hblk_mpp_, 6) + ";\n" |