Color scaling can be used to inexpensively modify the brightness of all the pixels output by the compositor. It is commonly used for effects like fade-in or fade-to-black.
The “Set Color Scale and Offset” blueprint node performs the color scaling operation. In our compositor, once a frame is rendered, warped, and ready to be displayed, you can then multiply each pixel by the Color Scale, and add it to the Color Offset. Thus, newPixel = oldPixel * colorScale + colorOffset. Note that for mobile devices (Quest, Go, etc.), Color Offset is not supported, so Color Scale is all that can be used.
The “Set Color Scale and Offset” blueprint node is shown below:
The Color Scale is a multiplier that is applied against every channel: red, green, blue, and alpha. It is a floating point value between 0 and an arbitrarily defined number.
You can call this blueprint function on every frame. For example, you can perform a very inexpensive fade-to-black by decreasing the Color Scale at each frame. If you did this in the renderer, it would be a much more expensive operation.
The LayerSample, available from our Unreal GitHub repository, illustrates the use of VR Compositor Layers to display a UMG UI. For more information, see Unreal Samples.