Page MenuHome

Fix Map Range node Clamp functionality
Closed, ResolvedPublicTO DO

Description

The clamp functionality of the map range node is currently not behaving as both what the shader node version does and what the tooltip says.
It should clamp the output to the set To range. Currently it is clamping to [0,1].

Event Timeline

Simon Thommes (simonthommes) changed the task status from Needs Triage to Confirmed.Thu, Feb 4, 12:48 PM
Simon Thommes (simonthommes) created this task.

I'd like to help with this, but I'm a little confused. Is this for the composite Map Range node? I can't find a Map Range node in the Geometry nodes source code, although it's in the manual.

@Sam Miller (samuelmiller) Some of the nodes are shared between geometry nodes and the shader nodes. Maybe take a look at node_shader_map_range.cc.

can you tell where are we supposed to look at.
and where is it not functioning?

I added a video showcasing that it's not working correctly to the description.

I'm not a developer myself, so I'm not sure where to look in the code.
@Jacques Lucke (JacquesLucke) @Hans Goudey (HooglyBoogly) could one of you guys help out?

The bug is in the MapRangeFunction class in node_shader_map_range.cc.

I think I found the offending line of code and have submitted a patch. I did a limited test of the functionality and it worked for me.