Operating system: Windows 10
Graphics card: GeForce GTX 1080 8K
Broken: 2.83.4, a322b43e3d08, 2020-02-24
Short description of error
In the Cycles implementation of the ColorRamp node, marker positions seem to be rounded to the next higher multiple of 1/255, leading to unexpected output, especially when set to 'Constant' interpolation.
EDIT: Happens in EEVEE too, but only when there are two or more markers set on the ColorRamp, and with multiples of 1/256.
Exact steps for others to reproduce the error
- Open the attached .blend file and switch the 3D View to Rendered mode
- See ColorRamp node in the Shader Editor
- Set yellow marker to a position just slightly above a multiple of 1/255, e.g. 0.2197 (> 56/255)
- Set 'Fac' input to just slightly below the next higher multiple, e.g. 0.2235 (< 57/255)
- The node will output the red color from the left of the spectrum, even though the input value is greater than the yellow marker's position.
This only occurs in Cycles, EEVEE correctly outputs yellow.
As a side note, 0.2335 should be rounded up to 0.234 when displayed with three decimals, but isn't.
EDIT: To reproduce in EEVEE:
- Steps 1 & 2 from above
- Add a third marker to the ColorRamp and slide it to 1.0, where it shouldn't affect the other markers
- Set yellow marker to a position just slightly above a multiple of 1/256, e.g. 0.5001
- Set 'Fac' input to just slightly below the next higher multiple, e.g. 0.5039
- (As with Cycles)