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