O'Reilly logo

openFrameworks Essentials by Denis Perevalov, Igor Tatarnikov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Mixing layers using additive blending

At this point, we draw four graphical layers:

  • Image file
  • Video file
  • Video from camera
  • Geometric pattern generator (developed in two previous chapters)

The first three layers are simply drawn occluding each other. Only the fourth layer has control of its transparency (color a slider), so we can hide and show it back smoothly.

To control the visibility of the first three layers, let's create a video mixer. It will be a new GUI group, Mixer, consisting of three sliders, adjusting layers' transparencies. Additionally, we will draw the layers using a special mixing mode called additive blending. It's a mixing mode where drawing colors at each pixel are summed up to obtain the resultant picture.

Note

Additive blending models ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required