Page MenuHome

Compositing: New Contrast Node
Needs RevisionPublic

Authored by Aaron Carlisle (Blendify) on Wed, Jan 8, 2:43 AM.
Subscribers
None
Tokens
"Like" token, awarded by Jk."Love" token, awarded by miclack."Like" token, awarded by amonpaike."Love" token, awarded by Schamph."Like" token, awarded by RC12.

Details

Summary

The old contrast factor of the bright/contrast node is limited/broken in a couple ways:

  • The node only increases contrast between lowlights mid lights (values from 0-0.5)
  • The node does not allow to choose a pivot point

The pivot point acts as the point where values are pushed/pulled to.

This new node adds pivot control and affects both highlights and lowlights

Below is an example comparing the results. I tried to match the contrast of the lowlights and mid lights between the examples.

Old node:

New Node:

Diff Detail

Event Timeline

source/blender/compositor/nodes/COM_ColorContrastNode.h
19

I would suggest to use more strict naming.
Eg Pivoted Contrast vs Color Contrast vs Contrast. Using the same naming would allow better code searching.

This then goes for Compile units, class names, defines, etc.

source/blender/compositor/operations/COM_ColorContrastOperation.cpp
46

Most likely the inputSample is constant. I would suggest to create two operations one when a socket is connected, the other one when it is not connected. When not connected the color can be stored in the operation and no readSample is needed. This saves memory and processing.

Jeroen Bakker (jbakker) requested changes to this revision.Wed, Jan 8, 4:12 PM
This revision now requires changes to proceed.Wed, Jan 8, 4:12 PM