Skip to content

Commit 09ba9fb

Browse files
committed
Update shift_elevation_node
1 parent 5dcdaad commit 09ba9fb

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

Hesiod/data/node_documentation.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7840,7 +7840,7 @@
78407840
"output": {
78417841
"caption": "output",
78427842
"data_type": "Heightmap",
7843-
"description": "Output heightmap.",
7843+
"description": "Resulting heightmap after applying the shift.",
78447844
"type": "output"
78457845
}
78467846
}

Hesiod/src/model/nodes/nodes_function/shift_elevation.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,16 @@ void compute_shift_elevation_node(BaseNode *p_node)
3636
{
3737
hmap::Heightmap *p_out = p_node->get_value_ref<hmap::Heightmap>("output");
3838

39-
// copy the input heightmap
40-
*p_out = *p_in;
41-
42-
hmap::transform(*p_out,
43-
[p_node](hmap::Array &x) { x += GET("shift", FloatAttribute); });
39+
hmap::transform(
40+
{p_out, p_in},
41+
[p_node](std::vector<hmap::Array *> p_arrays, hmap::Vec2<int>, hmap::Vec4<float>)
42+
{
43+
hmap::Array *pa_out = p_arrays[0];
44+
hmap::Array *pa_in = p_arrays[1];
45+
46+
*pa_out = *pa_in + GET("shift", FloatAttribute);
47+
},
48+
p_node->get_config_ref()->hmap_transform_mode_cpu);
4449
}
4550

4651
Q_EMIT p_node->compute_finished(p_node->get_id());

0 commit comments

Comments
 (0)