New Blending with pre-multiplied alpha

Finally found how to improve blending modes by pre-multiplying color by alpha in the shader, so that the blending equations can be applied on top of the apha manipulation.
This commit is contained in:
Bruno
2021-02-18 23:36:01 +01:00
parent 64071a4a55
commit f51bc1f1f4
7 changed files with 61 additions and 25 deletions

View File

@@ -274,7 +274,7 @@ void SessionGroupSource::init()
{
if ( resolution_.x > 0.f && resolution_.y > 0.f ) {
session_->setResolution( resolution_ );
session_->setResolution( resolution_, true );
// update to draw framebuffer
session_->update( dt_ );
@@ -283,7 +283,7 @@ void SessionGroupSource::init()
texturesurface_->setTextureIndex( session_->frame()->texture() );
// create Frame buffer matching size of session
FrameBuffer *renderbuffer = new FrameBuffer( session_->frame()->resolution() );
FrameBuffer *renderbuffer = new FrameBuffer( session_->frame()->resolution(), true );
// set the renderbuffer of the source and attach rendering nodes
attach(renderbuffer);