OverviewFilesCommitsIssuesDocsReleasesPeers

proc-nodes commits / efaea46

proc-nodes: 3D simplex in the emitted library, and erosion becomes subaerial
proc_simplex.inc was on disk but never reached the GPU: no codegen rule, no include in the noise library. A seabed that can hold a cave is volumetric and needs a noise in three dimensions, which none of the other .inc files provide. Eighth codegen rule, same pattern as the rest. EROSION IS A SUBAERIAL PROCESS. Rain and rivers carve land; a seabed is shaped by the base topology and by deposition, not by gullies -- and the filter was running everywhere, so every drowned valley below the waterline was carved as though it were dry. ErosionNoiseNode now scales its strength by pn_erosion_mask, a new wrapper->node ingress alongside the pn_out_* egress globals. At strength 0 erosion_filter returns its input UNCHANGED -- delta and magnitude both vanish, so `eroded = n.x` exactly -- which means the mask needs no special case: the seabed is simply the mountain layer and the hypso curve, and the submarine term supplies its own relief. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
efaea4636114cda1b9864c77c35f2b56f0ee953e
by plankatron <fleeky@gmail.com> · 2026-09-07T20:01:27.000Z

Changed files (3) +18 -1

SConstruct +8 -0
……@@ -140,6 +140,14 @@ glsl_inc_gen = [
140140 "src/shared/hypso_curve.inc",
141141 "python3 tools/gen_glsl_inc.py $SOURCE $TARGET HYPSO_CURVE_GLSL",
142142 ),
143 # 3D simplex + fBm. The seabed below the coastal buffer is VOLUMETRIC --
144 # a heightfield cannot have a sea cave in it -- and that needs a noise in
145 # three dimensions, which none of the other .inc files provide.
146 env.Command(
147 "src/gpu/proc_simplex_glsl.gen.h",
148 "src/shared/proc_simplex.inc",
149 "python3 tools/gen_glsl_inc.py $SOURCE $TARGET PROC_SIMPLEX_GLSL",
150 ),
143151 # Ashima simplex, sixth .inc. NOT Blender's -- it is proc-nodes' own
144152 # Simplex Noise node, which blender-bridge mirrors as a node group.
145153 env.Command(
src/gpu/gpu_compiler.cpp +9 -0
……@@ -1,6 +1,7 @@
11#include "gpu_compiler.h"
22#include "erosion_filter_glsl.gen.h"
33#include "hypso_curve_glsl.gen.h"
4#include "proc_simplex_glsl.gen.h"
45#include <godot_cpp/classes/rd_shader_source.hpp>
56#include <godot_cpp/classes/rd_shader_spirv.hpp>
67#include "../graph/proc_node_graph.h"
……@@ -43,6 +44,7 @@ String GpuCompiler::get_erosion_library_glsl() {
4344 // the wrapper is its only caller. Free when unused -- an uncalled GLSL
4445 // function costs nothing after dead-code elimination.
4546 + String(HYPSO_CURVE_GLSL)
47 + String(PROC_SIMPLEX_GLSL)
4648 // Wrapper-supplied inputs to ErosionNoiseNode, declared here so a shader
4749 // that never sets them still compiles and still behaves exactly as before
4850 // (zero offset, runevision's 0.6 divisor). Same pattern as pn_max_octaves.
……@@ -70,6 +72,13 @@ String GpuCompiler::get_erosion_library_glsl() {
7072 // test_erosion_parity stays bit-identical.
7173 + String("float pn_out_ridge = 0.0;\n")
7274 + String("vec2 pn_out_grad = vec2(0.0);\n")
75 // EROSION IS A SUBAERIAL PROCESS. Rain and rivers carve land; a seabed
76 // is shaped by the base topology and deposition, not by gullies. The
77 // wrapper sets this from the column's depth and the erosion node scales
78 // its strength by it -- at 0 erosion_filter returns its input unchanged
79 // (delta and magnitude both vanish), so the seabed is the mountain and
80 // hypso curve alone, with the submarine term supplying its own relief.
81 + String("float pn_erosion_mask = 1.0;\n")
7382 // EVERY REMAINING FILTER KNOB, as a wrapper-settable global.
7483 //
7584 // These were baked literals inside erosion_node_eval because
src/nodes/noise_nodes.cpp +1 -1
……@@ -1390,7 +1390,7 @@ String ErosionNoiseNode::compile_glsl(const GlslEmitContext &p_ctx, int p_node_i
13901390 vec4 en_result = erosion_node_eval_grad(
13911391 vec2(pos.x, pos.z),
13921392 vec3(gn_height, gn_slope.x, gn_slope.z) + pn_terrain_offset,
1393 pc.param1, pc.param2, pc.param4, int(pc.param5), pc.param6,
1393 pc.param1, pc.param2 * pn_erosion_mask, pc.param4, int(pc.param5), pc.param6,
13941394 pn_fade_div, pn_erosion_scale,
13951395 pn_ero_input_height_amplitude, pn_ero_octave_lacunarity,
13961396 pn_ero_gully_depth, pn_ero_fine_gully_slope_restriction,