Mewa Web Store
Have you
created a Mewa tool
? Publish your Mewa tool here to make it available inside Mewa.
How to install and use Mewa Tools
Create your Mewa Tool
OverlayBlend
by
Mewatools
Blends 2 images using the
overlay
blend method.
Source Code
// Brief: Blends 2 images using overlay blend method shaderSource = " vec3 blend(vec3 a, vec3 b) { float threashold = 0.5; float light = (a.x + a.y + a.z) / 3.0; if( light < threashold ){ return 2. * a * b; } return 1. - 2.*(1.-a)*(1. - b); } void mainImage( out vec4 fragColor, in vec2 fragCoordA, in vec2 fragCoordB ){ vec3 a = texture2D(iChannel0, fragCoordA).rgb; vec3 b = texture2D(iChannel1, fragCoordB).rgb; fragColor = vec4( blend(a,b), 1.0 ); }"; node = addShaderNode("OverlayBlend", shaderSource); node.setRenderArea( "iChannel0+iChannel1" );
Copyright © 2021
Mewatools
. All rights reserved.