Page MenuHome

BrightContrast not working correctly with negative contrast
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Thu, Aug 1, 7:15 PM.

Details

Summary

followup to rB8dd95abb2ff9 (which fixed this for the Compositor node),
turns out this was also wrong for the VSE modifier and in vertex color
operator.

  • also adjust min/max for VSE modifier
  • also guard against division by zero

Diff Detail

Repository
rB Blender

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Fri, Aug 2, 4:07 AM
Brecht Van Lommel (brecht) added inline comments.
source/blender/blenkernel/intern/seqmodifier.c
555

Better would be to do this.

a = 1.0f / max_ff(a, FLT_EPSILON);

Otherwise contrast values > 100 would start reducing the contrast, and values of 0 < a < FLT_EPSILON would give more contrast then a == 0.

560–561

If we're changing code here anyway, this should be changed too since the formulas don't make sense for contrast < -100.

a = max_ff(1.0f - delta * 2.0f, 0.0f);
This revision now requires changes to proceed.Fri, Aug 2, 4:07 AM
source/blender/blenkernel/intern/seqmodifier.c
555

Otherwise contrast values > 100 would start reducing the contrast

Thats why I tweaked the valid range with RNA_def_property_range, but yeah, makes sense, will update...

560–561

this should be changed too since the formulas don't make sense for contrast < -100

Thats why I tweaked the valid range with RNA_def_property_range, but yeah, still makes sense, will update...

This revision is now accepted and ready to land.Fri, Aug 2, 10:05 AM