UNPKG

pixi.js

Version:

<p align="center"> <a href="https://pixijs.com" target="_blank" rel="noopener noreferrer"> <img height="150" src="https://files.pixijs.download/branding/pixijs-logo-transparent-dark.svg?v=1" alt="PixiJS logo"> </a> </p> <br/> <p align="center">

43 lines (39 loc) 1.25 kB
'use strict'; var Extensions = require('../extensions/Extensions.js'); var BlendModeFilter = require('../filters/blend-modes/BlendModeFilter.js'); "use strict"; class LightenBlend extends BlendModeFilter.BlendModeFilter { constructor() { super({ gl: { functions: ` vec3 blendLighten(vec3 base, vec3 blend, float opacity) { return (max(base, blend) * opacity + base * (1.0 - opacity)); } `, main: ` finalColor = vec4(blendLighten(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend; ` }, gpu: { functions: ` fn blendLighten(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32> { return (max(base, blend) * opacity + base * (1.0 - opacity)); } `, main: ` out = vec4<f32>(blendLighten(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend; ` } }); } } /** @ignore */ LightenBlend.extension = { name: "lighten", type: Extensions.ExtensionType.BlendMode }; exports.LightenBlend = LightenBlend; //# sourceMappingURL=LightenBlend.js.map