Additive Alpha-Blending in an FBO?

The below code does what I want when drawing directly without an FBO, but when uncommenting the code to do it within an FBO, the result is that the colors quickly accumulate and turn the screen solid white:

	for (int i = 0; i < webCams.size(); ++i)
		webCams[i].draw(0, 0, senderWidth, senderHeight);
	//fbo.draw(0, 0);

I had a look where @zach points to the fboTrails example. The fading method there involves using ofClear and rectangles, but Iā€™m not sure how to apply it for this specific use case of additive-blending camera images.

hi, you need to call ofClear() right after fbo.begin(). ofClear receives RGBA values with which it clears the fbo. Think of it like it aplies that color to all the pixels of the fbo. As you are using additive blending, I think that calling ofClear(0,0,0,0) should work

1 Like

That worked; thank you, Roy!

1 Like