Grain Function This node has been entirely rewritten for 2.32, giving you complete per-channel control over size, density, softness, etc. The controls are explained below, with visual examples after the parameter list. One thing to note is that if you have a RGB channel image, there will be no grain if you hit obeyAlpha, as there is an alpha value of 0. In general, when there is a parameter, followed by the same parameter on a per-channel basis, the first one acts as a multiplier on the channel parameters. For example, a density of .5 will multiply r,g,bDensity by .5.
Example:In these illustrations, we have placed a Ramp, the Grain node, and a PlotScanline to analyze the image. Since we have a black-to-white Ramp, we get a linear line from left to right when there is no grain applied.
filmResponse, Gain: Adding the Grain node introduces noise, disturbing the line. Notice that there is more noise (grain) near the lower, dark area of the plotscanline. This is due to the filmResponse of -1, which concentrates grain on the lower areas. The second image is a result of increasing the lGain (or r,g,bGain on a per-channel basis), increasing both the overall range of the grain, making it both lighter and darker simultaneously:
Bias, Offset. The following two images show the result of modifying the Bias and Gain. In the first image, I have moved the rBias (I am only looking at the Red channel) down to -.5. This shifts the grain downwards from the diagonal line, making it darker. This will effect both the lighter grain (the dots above the original diagonal line) and the darker grain (the dots below the original diagonal line). To adjust only the lighter or darker grains, use the offset sliders. The second image shows a rLowOffset of .5, squeezing just the darker grains, leaving only lighter grains.
softness: The first image is the standard softness. The second image has a softness of 10. The third image has a softness of -10.
image Grain( image In, float size, float density, float seed, float filmResponse, float lGain, float rGain, float gGain, float bGain, float rSize, float gSize, float bSize, float rDensity, float gDensity, float bDensity, float aspect, float rBias, float rLowOffset, float rHighOffset, float gBias, float gLowOffset, float gHighOffset, float bBias, float bLowOffset, float bHighOffset, float softness, float rSoftness, float gSoftness, float bSoftness, int obeyAlpha );
image = Grain( image, size, density, seed, filmResponse, lGain, rGain, gGain, bGain, rSize, gSize, bSize, rDensity, gDensity, bDensity, aspect, rBias, rLowOffset, rHighOffset, gBias, gLowOffset, gHighOffset, bBias, bLowOffset, bHighOffset, softness, rSoftness, gSoftness, bSoftness, obeyAlpha ); Command Line shake -grain size density seed etc... |