Jump to content

Using Image::blend() function


photo

Recommended Posts

Posted

How I can change blending type for blending images? See post with example blending. Thanks

Posted

How I can change blending type for blending images? See post with example blending. Thanks

 

Read the documentation for Image::blend(). Implemented blending type is described there and there is no other way to change blending behaviour of Image::blend() at the monment. If you need special blending behaviour than you can always implement it on a per-pixel level on your own via provided pixel data getter/setter via UNIGINE script

Posted

Is it possible to blend (create, composite) images (layers) to get destination image with some weights of this images (layers) alphas?

Posted

Is it possible to blend (create, composite) images (layers) to get destination image with some weights of this images (layers) alphas?

 

Everything is possible when doing per-pixel blending via UNIGINE script

 

pseudo-code

// create same-sized images
create sourceImageA;
create sourceImageB;
create destImage;

// per-pixel-blending
foreach( row )
{
  foreach( column )
  {
     vec4 pixelA = sourceImageA.get2D( row, column)
     vec4 pixelB = sourceImageB.get2D( row, column)

     // some wired per-pixel blending
     vec4 pixelDest = blendFunction( pixelA, pixelB )

     destImage.set2D( row, column, pixelDest )
  }
} 

Posted

Ok, thanks. It's decision for pre-created resources. Per-pixel manipulations in main loop "eat" to much FPS :rolleyes:

×
×
  • Create New...