sdfsdfs
This commit is contained in:
50
node_modules/pixi.js/lib/advanced-blend-modes/NegationBlend.mjs
generated
vendored
Normal file
50
node_modules/pixi.js/lib/advanced-blend-modes/NegationBlend.mjs
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
import { ExtensionType } from '../extensions/Extensions.mjs';
|
||||
import { BlendModeFilter } from '../filters/blend-modes/BlendModeFilter.mjs';
|
||||
|
||||
"use strict";
|
||||
class NegationBlend extends BlendModeFilter {
|
||||
constructor() {
|
||||
super({
|
||||
gl: {
|
||||
functions: `
|
||||
vec3 negation(vec3 base, vec3 blend)
|
||||
{
|
||||
return 1.0-abs(1.0-base-blend);
|
||||
}
|
||||
|
||||
vec3 blendNegation(vec3 base, vec3 blend, float opacity)
|
||||
{
|
||||
return (negation(base, blend) * opacity + base * (1.0 - opacity));
|
||||
}
|
||||
`,
|
||||
main: `
|
||||
finalColor = vec4(blendNegation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
|
||||
`
|
||||
},
|
||||
gpu: {
|
||||
functions: `
|
||||
fn blendNegation(base: vec3<f32>, blend: vec3<f32>) -> vec3<f32>
|
||||
{
|
||||
return 1.0-abs(1.0-base-blend);
|
||||
}
|
||||
|
||||
fn blendNegationOpacity(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
|
||||
{
|
||||
return (blendNegation(base, blend) * opacity + base * (1.0 - opacity));
|
||||
}
|
||||
`,
|
||||
main: `
|
||||
out = vec4<f32>(blendNegationOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
|
||||
`
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/** @ignore */
|
||||
NegationBlend.extension = {
|
||||
name: "negation",
|
||||
type: ExtensionType.BlendMode
|
||||
};
|
||||
|
||||
export { NegationBlend };
|
||||
//# sourceMappingURL=NegationBlend.mjs.map
|
Reference in New Issue
Block a user