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