Blending - Addidtive - Advanced Rendering - Shader Learning

Advanced Rendering

Blending - Addidtive

Task

Given a program that draws a candle with a halo effect. The halo is rendered using several alpha blended overlaid planes. Modify the program so that the halos from the rectangles accumulate to create a glow effect.

Theory

Additive blending is often used for effects like fire, explosions, and other light-emitting objects. In additive blending, the colors are added together, which can create a bright, glowing effect.


The blending equation for additive blending is:

FinalColor = (SrcColor * SrcAlpha) + (DstColor * 1)