Page MenuHome

Fix T96132: RGB/Vector/Float Curve shaders ignore extrapolation setting
ClosedPublic

Authored by Hallam Roberts (MysteryPancake) on Mar 20 2022, 9:43 AM.

Details

Summary

This fixes T96132, a bug which means the "Extend Horizontal" curve extrapolation setting is ignored.

The bug only occurs for non-GLSL shaders. This is because GLSL shaders manually clamp the graph in node_shader_curves.cc.

However, the other shaders always extrapolate. This seems to be an oversight by the developer.
The easiest solution is adding shader bindings for the existing extrapolation argument of the rgb_ramp_lookup function.

The only reason the original shaders sometimes produce correct results is because colortools.c sometimes generates identical adjacent table values:

When this doesn't occur, the difference is clear:

BeforeAfter

Demo file:

Diff Detail

Repository
rB Blender

Event Timeline

Hallam Roberts (MysteryPancake) requested review of this revision.Mar 20 2022, 9:43 AM
Hallam Roberts (MysteryPancake) created this revision.
Hallam Roberts (MysteryPancake) retitled this revision from Fix RGB/Vector/Float Curve shaders ignoring extrapolation setting to Fix T96132: RGB/Vector/Float Curve shaders ignoring extrapolation setting.Mar 20 2022, 9:50 AM
Hallam Roberts (MysteryPancake) edited the summary of this revision. (Show Details)
Hallam Roberts (MysteryPancake) edited the summary of this revision. (Show Details)
Hallam Roberts (MysteryPancake) retitled this revision from Fix T96132: RGB/Vector/Float Curve shaders ignoring extrapolation setting to Fix T96132: RGB/Vector/Float Curve shaders ignore extrapolation setting.Mar 20 2022, 9:53 AM
Hallam Roberts (MysteryPancake) edited the summary of this revision. (Show Details)
Hallam Roberts (MysteryPancake) edited the summary of this revision. (Show Details)
Hallam Roberts (MysteryPancake) edited the summary of this revision. (Show Details)
  • Default OSL extrapolation to enabled
This revision is now accepted and ready to land.Mar 21 2022, 5:49 PM