MATHS: GAIN

MATHS: GAIN

This function is effectively the contrast node. Plug whatever node you want to alter into the Value_1 input. The Value_2 attribute controls the level of gain, or rather whether you increase or decrease the contrast. Increasing the contrast makes bright colours brighter and dark colours brighter, making highlights and shadows stand out more. Decreasing the contrast produces a more washed out picture, with every colour moving towards grey.

Gain Setting Result
less than zero Inverts the picture (dark becomes light, light becomes dark) and exaggerates (massively!)
0 Entirely grey
greater than 0, lower than 0.5 Reduces the contrast (all colours tend towards grey)
0.5 No change
greater than 0.5, lower than 1 Increases the contrast (dark colours become darker, light colours become lighter).
1 or more Mostly black or white with smooth edges

If you see a gain attribute on any other node (such as the turbulence node), this has the same effect as the maths function, although in some cases it is not entirely clear what result you will achieve (have a look at the weave node to see this).

The following figures show the results of different gain settings, with the results applied to a flat surface as a displacement map (see Figure 3). Figure 1 shows the results of a gain node set to 0.2. Here, both dark and light colours are moved towards gray, reducing the contrast between them.


Fig 1: Gain at 0.2

Figure 2 shows the same thing with a gain setting of 0.8. Here, the dark areas are getting darker, the bright areas brighter. This increases the difference (contrast) between them, often increasing the amount of detail visable in a picture.


Fig 2: Gain at 0.8

Figure 3 shows the node setup used to create these effects. The Displacement figure is set very high to produce the exaggerated visuals we need to see what is happening. Our unmodifed U node produces the simple slope, with black at the left and white at the right. The green curved surface shows how the brightness is modified by the gain.


Fig 3: The test nodes

Figure 4 shows the results of a gain node set to 0.8 acting on a greyscale photo. This has increased the contrast in the picture - the dark shades are dark, the light shades light, so they contrast more sharply with each other.


Fig 4: Example Contrast

Suggested Uses

Try setting value_2 to 1, and then plugging a V node into it. This will result in high contrast at the top of the output and the low contrast at the base.


PoserWorld