lygia
/v1.1.6
/color
/blend
/hardMix
)Photoshop Hard Mix blend mode mplementations sourced from this article on https://mouaif.wordpress.com/2009/01/05/photoshop-math-with-glsl-shaders/
Dependencies:
lygia
/v1.1.6
/color
/blend
/vividLight
.glsl
Use:
blendHardMix(<float|vec3> base, <float|vec3> blend [, <float> opacity])
#ifndef FNC_BLENDHARDMIX
#define FNC_BLENDHARDMIX
float blendHardMix(in float base, in float blend) {
return (blendVividLight(base, blend) < .5)? 0.: 1.;
}
vec3 blendHardMix(in vec3 base, in vec3 blend) {
return vec3(blendHardMix(base.r, blend.r),
blendHardMix(base.g, blend.g),
blendHardMix(base.b, blend.b));
}
vec3 blendHardMix(in vec3 base, in vec3 blend, in float opacity) {
return (blendHardMix(base, blend) * opacity + base * (1. - opacity));
}
#endif
Dependencies:
lygia
/v1.1.6
/color
/blend
/vividLight
.glsl
Use:
blendHardMix(<float|float3> base, <float|float3> blend [, <float> opacity])
#ifndef FNC_BLENDHARDMIX
#define FNC_BLENDHARDMIX
float blendHardMix(in float base, in float blend) {
return (blendVividLight(base, blend) < .5)? 0.: 1.;
}
float3 blendHardMix(in float3 base, in float3 blend) {
return float3( blendHardMix(base.r, blend.r),
blendHardMix(base.g, blend.g),
blendHardMix(base.b, blend.b) );
}
float3 blendHardMix(in float3 base, in float3 blend, in float opacity) {
return (blendHardMix(base, blend) * opacity + base * (1. - opacity));
}
#endif
LYGIA is dual-licensed under the Prosperity License and the Patron License for sponsors and contributors.
Sponsors and contributors are automatically added to the Patron License and they can ignore the any non-commercial rule of the Prosperity Licensed software (please take a look to the exception).
It's also possible to get a permanent comercial license hook to a single and specific version of LYGIA.
Sign up for the news letter bellow, joing the LYGIA's channel on Discord or follow the Github repository