MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Typo in specification of 'range' node?

Open pablode opened this issue 3 years ago • 2 comments
trafficstars

The spec says:

range: remap incoming values from one range of float/color/vector values to another, optionally applying a gamma correction "in the middle". Input values below inlow or above outhigh are extrapolated unless doclamp is true.

I think it should say that input values below outlow are extrapolated.

pablode avatar May 08 '22 08:05 pablode

@pablode Agreed that we should use one convention consistently here, and I believe another way of stating this would be:

Input values below inlow or above inhigh are extrapolated unless doclamp is true.

CC'ing @dbsmythe for his thoughts as well.

jstone-lucasfilm avatar May 12 '22 04:05 jstone-lucasfilm

I think the intended wording should be "Input values below inlow or above inhigh are extrapolated unless doclamp is true." E.g. if an input value is between inlow and inhigh, no clamping will take place, while if it's less than inlow or greater than inhigh, then the remapped output would be less than outlow or greater than outhigh, but the doclamp would clamp the output to stay within the outlow..outhigh range. I will update the spec to say that; I'm pretty sure the nodegraph implementation is correct but we should verify.

dbsmythe avatar May 19 '22 19:05 dbsmythe

@pablode @dbsmythe Here's the latest language proposed for the MaterialX 1.39 specification, and feel free to suggest any additional improvements here:

range: remap incoming values from one range of float/color/vector values to another, optionally applying a gamma correction "in the middle".  Input values below inlow or above inhigh are extrapolated unless doclamp is true, in which case the output values will be clamped to the outlow..outhigh range.
- in (float or colorN or vectorN): the input value or nodename
- inlow (same type as in or float): low value for input range.  Default is 0.0 in all channels.
- inhigh (same type as in or float): high value for input range.  Default is 1.0 in all channels.
- gamma (same type as in or float): inverse exponent applied to input value after first transforming from inlow..inhigh to 0..1; gamma values greater than 1.0 make midtones brighter.  Default is 1.0 in all channels.
- outlow (same type as in or float): low value for output range.  Default is 0.0 in all channels.
- outhigh (same type as in or float): high value for output range.  Default is 1.0 in all channels.
- doclamp (boolean): If true, the output is clamped to the range outlow..outhigh.  Default is false.

jstone-lucasfilm avatar Sep 29 '22 18:09 jstone-lucasfilm

@pablode @dbsmythe Now that the 1.39 specification is maintained directly in the MaterialX repository, I'll close out this original issue, since improvements can be proposed directly to the text.

jstone-lucasfilm avatar Jul 16 '23 19:07 jstone-lucasfilm