Skip to content

Commit

Permalink
Update transform mode for Abs
Browse files Browse the repository at this point in the history
  • Loading branch information
otto-link committed Jan 14, 2025
1 parent 7067d39 commit 5301982
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions Hesiod/src/model/nodes/nodes_function/abs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ void compute_abs_node(BaseNode *p_node)
{
hmap::Heightmap *p_out = p_node->get_value_ref<hmap::Heightmap>("output");

hmap::transform(*p_out,
*p_in,
[p_node](hmap::Array &out, hmap::Array &in)
{ out = hmap::abs(in - GET("vshift", FloatAttribute)); });
hmap::transform(
{p_out, p_in},
[p_node](std::vector<hmap::Array *> p_arrays, hmap::Vec2<int>, hmap::Vec4<float>)
{
hmap::Array *pa_out = p_arrays[0];
hmap::Array *pa_in = p_arrays[1];
*pa_out = hmap::abs(*pa_in - GET("vshift", FloatAttribute));
},
p_node->get_config_ref()->hmap_transform_mode_cpu);
}

Q_EMIT p_node->compute_finished(p_node->get_id());
Expand Down

0 comments on commit 5301982

Please sign in to comment.