Fix Map Range node Clamp functionality #85368

Closed
opened 2021-02-04 12:48:16 +01:00 by Simon Thommes · 14 comments
Member

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].

is_viewport_map_range-2021-02-04_12.34.32.mp4

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]. [is_viewport_map_range-2021-02-04_12.34.32.mp4](https://archive.blender.org/developer/F9649986/is_viewport_map_range-2021-02-04_12.34.32.mp4)
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @SimonThommes

Added subscriber: @SimonThommes

Added subscriber: @samuelmiller

Added subscriber: @samuelmiller

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.

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.
Member

Added subscriber: @lone_noel

Added subscriber: @lone_noel
Member

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

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

Added subscriber: @woolllff

Added subscriber: @woolllff

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

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

Added subscribers: @HooglyBoogly, @JacquesLucke

Added subscribers: @HooglyBoogly, @JacquesLucke
Author
Member

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.
@JacquesLucke @HooglyBoogly could one of you guys help out?

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. @JacquesLucke @HooglyBoogly could one of you guys help out?
Member

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

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.

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.

This issue was referenced by bb0b250cbd

This issue was referenced by bb0b250cbded8bb89d89e67cc2b39826bf3f7fa6
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Jacques Lucke self-assigned this 2021-02-08 13:34:27 +01:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#85368
No description provided.