This commit is contained in:
Akko
2025-08-04 18:57:35 +02:00
parent 8cf6e78a79
commit 9495868c2e
5030 changed files with 518594 additions and 17609 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,653 @@
/*!
* PixiJS - v8.4.1
* Compiled Thu, 19 Sep 2024 10:28:58 UTC
*
* PixiJS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/this.PIXI=this.PIXI||{};var advanced_blend_modes_js=function(e){"use strict";"use strict";class l extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
${PIXI.hslgl}
vec3 blendColor(vec3 base, vec3 blend, float opacity)
{
return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendColor(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
${PIXI.hslgpu}
fn blendColorOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
return (setLuminosity(blend, getLuminosity(base)) * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendColorOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}l.extension={name:"color",type:PIXI.ExtensionType.BlendMode};class b extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float colorBurn(float base, float blend)
{
return max((1.0 - ((1.0 - base) / blend)), 0.0);
}
vec3 blendColorBurn(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
colorBurn(base.r, blend.r),
colorBurn(base.g, blend.g),
colorBurn(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendColorBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn colorBurn(base:f32, blend:f32) -> f32
{
return max((1.0-((1.0-base)/blend)),0.0);
}
fn blendColorBurn(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
let blended = vec3<f32>(
colorBurn(base.r, blend.r),
colorBurn(base.g, blend.g),
colorBurn(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendColorBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}b.extension={name:"color-burn",type:PIXI.ExtensionType.BlendMode};class a extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float colorDodge(float base, float blend)
{
return base / (1.0 - blend);
}
vec3 blendColorDodge(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
colorDodge(base.r, blend.r),
colorDodge(base.g, blend.g),
colorDodge(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendColorDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn colorDodge(base: f32, blend: f32) -> f32
{
return base / (1.0 - blend);
}
fn blendColorDodge(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
let blended = vec3<f32>(
colorDodge(base.r, blend.r),
colorDodge(base.g, blend.g),
colorDodge(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendColorDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}a.extension={name:"color-dodge",type:PIXI.ExtensionType.BlendMode};class d extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
vec3 blendDarken(vec3 base, vec3 blend, float opacity)
{
return (min(base, blend) * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendDarken(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn blendDarken(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
return (min(blend,base) * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendDarken(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}d.extension={name:"darken",type:PIXI.ExtensionType.BlendMode};class t extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
vec3 blendDifference(vec3 base, vec3 blend, float opacity)
{
return (abs(blend - base) * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendDifference(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn blendDifference(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
return (abs(blend - base) * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendDifference(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}t.extension={name:"difference",type:PIXI.ExtensionType.BlendMode};class r extends PIXI.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;
`}})}}r.extension={name:"divide",type:PIXI.ExtensionType.BlendMode};class o extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
vec3 exclusion(vec3 base, vec3 blend)
{
return base + blend - 2.0 * base * blend;
}
vec3 blendExclusion(vec3 base, vec3 blend, float opacity)
{
return (exclusion(base, blend) * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendExclusion(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn exclusion(base: vec3<f32>, blend: vec3<f32>) -> vec3<f32>
{
return base+blend-2.0*base*blend;
}
fn blendExclusion(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
return (exclusion(base, blend) * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendExclusion(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}o.extension={name:"exclusion",type:PIXI.ExtensionType.BlendMode};class i extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float hardLight(float base, float blend)
{
return (blend < 0.5) ? 2.0 * base * blend : 1.0 - 2.0 * (1.0 - base) * (1.0 - blend);
}
vec3 blendHardLight(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
hardLight(base.r, blend.r),
hardLight(base.g, blend.g),
hardLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendHardLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn hardLight(base: f32, blend: f32) -> f32
{
return select(1.0 - 2.0 * (1.0 - base) * (1.0 - blend), 2.0 * base * blend, blend < 0.5);
}
fn blendHardLight(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
let blended = vec3<f32>(
hardLight(base.r, blend.r),
hardLight(base.g, blend.g),
hardLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendHardLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}i.extension={name:"hard-light",type:PIXI.ExtensionType.BlendMode};class s extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float hardMix(float base, float blend)
{
return (base + blend >= 1.0) ? 1.0 : 0.0;
}
vec3 blendHardMix(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
hardMix(base.r, blend.r),
hardMix(base.g, blend.g),
hardMix(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendHardMix(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn hardMix(base: f32, blend: f32) -> f32
{
return select(0.0, 1.0, base + blend >= 1.0);
}
fn blendHardMix(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended: vec3<f32> = vec3<f32>(
hardMix(base.r, blend.r),
hardMix(base.g, blend.g),
hardMix(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendHardMix(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}s.extension={name:"hard-mix",type:PIXI.ExtensionType.BlendMode};class c extends PIXI.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;
`}})}}c.extension={name:"lighten",type:PIXI.ExtensionType.BlendMode};class f extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float linearBurn(float base, float blend)
{
return max(0.0, base + blend - 1.0);
}
vec3 blendLinearBurn(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
linearBurn(base.r, blend.r),
linearBurn(base.g, blend.g),
linearBurn(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendLinearBurn(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn linearBurn(base: f32, blend: f32) -> f32
{
return max(0.0, base + blend - 1.0);
}
fn blendLinearBurn(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended = vec3<f32>(
linearBurn(base.r, blend.r),
linearBurn(base.g, blend.g),
linearBurn(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendLinearBurn(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}f.extension={name:"linear-burn",type:PIXI.ExtensionType.BlendMode};class u extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float linearDodge(float base, float blend) {
return min(1.0, base + blend);
}
vec3 blendLinearDodge(vec3 base, vec3 blend, float opacity) {
vec3 blended = vec3(
linearDodge(base.r, blend.r),
linearDodge(base.g, blend.g),
linearDodge(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendLinearDodge(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn linearDodge(base: f32, blend: f32) -> f32
{
return min(1, base + blend);
}
fn blendLinearDodge(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended = vec3<f32>(
linearDodge(base.r, blend.r),
linearDodge(base.g, blend.g),
linearDodge(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendLinearDodge(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}u.extension={name:"linear-dodge",type:PIXI.ExtensionType.BlendMode};class g extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float linearBurn(float base, float blend) {
return max(0.0, base + blend - 1.0);
}
float linearDodge(float base, float blend) {
return min(1.0, base + blend);
}
float linearLight(float base, float blend) {
return (blend <= 0.5) ? linearBurn(base,2.0*blend) : linearBurn(base,2.0*(blend-0.5));
}
vec3 blendLinearLight(vec3 base, vec3 blend, float opacity) {
vec3 blended = vec3(
linearLight(base.r, blend.r),
linearLight(base.g, blend.g),
linearLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendLinearLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn linearBurn(base: f32, blend: f32) -> f32
{
return max(0.0, base + blend - 1.0);
}
fn linearDodge(base: f32, blend: f32) -> f32
{
return min(1.0, base + blend);
}
fn linearLight(base: f32, blend: f32) -> f32
{
return select(linearBurn(base,2.0*(blend-0.5)), linearBurn(base,2.0*blend), blend <= 0.5);
}
fn blendLinearLightOpacity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended = vec3<f32>(
linearLight(base.r, blend.r),
linearLight(base.g, blend.g),
linearLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendLinearLightOpacity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}g.extension={name:"linear-light",type:PIXI.ExtensionType.BlendMode};class v extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
${PIXI.hslgl}
vec3 blendLuminosity(vec3 base, vec3 blend, float opacity)
{
vec3 blendLuminosity = setLuminosity(base, getLuminosity(blend));
return (blendLuminosity * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendLuminosity(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
${PIXI.hslgpu}
fn blendLuminosity(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blendLuminosity: vec3<f32> = setLuminosity(base, getLuminosity(blend));
return (blendLuminosity * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendLuminosity(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}v.extension={name:"luminosity",type:PIXI.ExtensionType.BlendMode};class p extends PIXI.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;
`}})}}p.extension={name:"negation",type:PIXI.ExtensionType.BlendMode};class y extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float overlay(float base, float blend)
{
return (base < 0.5) ? (2.0*base*blend) : (1.0-2.0*(1.0-base)*(1.0-blend));
}
vec3 blendOverlay(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
overlay(base.r, blend.r),
overlay(base.g, blend.g),
overlay(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendOverlay(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn overlay(base: f32, blend: f32) -> f32
{
return select((1.0-2.0*(1.0-base)*(1.0-blend)), (2.0*base*blend), base < 0.5);
}
fn blendOverlay(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
let blended = vec3<f32>(
overlay(base.r, blend.r),
overlay(base.g, blend.g),
overlay(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendOverlay(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}y.extension={name:"overlay",type:PIXI.ExtensionType.BlendMode};class B extends PIXI.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;
`}})}}B.extension={name:"pin-light",type:PIXI.ExtensionType.BlendMode};class h extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
${PIXI.hslgl}
vec3 blendSaturation(vec3 base, vec3 blend, float opacity)
{
vec3 blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));
return (blendSaturation * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
${PIXI.hslgpu}
fn blendSaturation(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blendSaturation = setLuminosity(setSaturation(base, getSaturation(blend)), getLuminosity(base));
return (blendSaturation * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendSaturation(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}h.extension={name:"saturation",type:PIXI.ExtensionType.BlendMode};class m extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float softLight(float base, float blend)
{
return (blend < 0.5) ? (2.0 * base * blend + base * base * (1.0 - 2.0 * blend)) : (sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend));
}
vec3 blendSoftLight(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
softLight(base.r, blend.r),
softLight(base.g, blend.g),
softLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn softLight(base: f32, blend: f32) -> f32
{
return select(2.0 * base * blend + base * base * (1.0 - 2.0 * blend), sqrt(base) * (2.0 * blend - 1.0) + 2.0 * base * (1.0 - blend), blend < 0.5);
}
fn blendSoftLight(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended: vec3<f32> = vec3<f32>(
softLight(base.r, blend.r),
softLight(base.g, blend.g),
softLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendSoftLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}m.extension={name:"soft-light",type:PIXI.ExtensionType.BlendMode};class L extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float subtract(float base, float blend)
{
return max(0.0, base - blend);
}
vec3 blendSubtract(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
subtract(base.r, blend.r),
subtract(base.g, blend.g),
subtract(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn subtract(base: f32, blend: f32) -> f32
{
return max(0, base - blend);
}
fn blendSubtract(base:vec3<f32>, blend:vec3<f32>, opacity:f32) -> vec3<f32>
{
let blended = vec3<f32>(
subtract(base.r, blend.r),
subtract(base.g, blend.g),
subtract(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendSubtract(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}L.extension={name:"subtract",type:PIXI.ExtensionType.BlendMode};class I extends PIXI.BlendModeFilter{constructor(){super({gl:{functions:`
float colorBurn(float base, float blend)
{
return max((1.0-((1.0-base)/blend)),0.0);
}
float colorDodge(float base, float blend)
{
return min(1.0, base / (1.0-blend));
}
float vividLight(float base, float blend)
{
return (blend < 0.5) ? colorBurn(base,(2.0*blend)) : colorDodge(base,(2.0*(blend-0.5)));
}
vec3 blendVividLight(vec3 base, vec3 blend, float opacity)
{
vec3 blended = vec3(
vividLight(base.r, blend.r),
vividLight(base.g, blend.g),
vividLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
finalColor = vec4(blendVividLight(back.rgb, front.rgb,front.a), blendedAlpha) * uBlend;
`},gpu:{functions:`
fn colorBurn(base:f32, blend:f32) -> f32
{
return max((1.0-((1.0-base)/blend)),0.0);
}
fn colorDodge(base: f32, blend: f32) -> f32
{
return min(1.0, base / (1.0-blend));
}
fn vividLight(base: f32, blend: f32) -> f32
{
return select(colorDodge(base,(2.0*(blend-0.5))), colorBurn(base,(2.0*blend)), blend<0.5);
}
fn blendVividLight(base: vec3<f32>, blend: vec3<f32>, opacity: f32) -> vec3<f32>
{
let blended: vec3<f32> = vec3<f32>(
vividLight(base.r, blend.r),
vividLight(base.g, blend.g),
vividLight(base.b, blend.b)
);
return (blended * opacity + base * (1.0 - opacity));
}
`,main:`
out = vec4<f32>(blendVividLight(back.rgb, front.rgb, front.a), blendedAlpha) * blendUniforms.uBlend;
`}})}}return I.extension={name:"vivid-light",type:PIXI.ExtensionType.BlendMode},PIXI.extensions.add(l,b,a,d,t,r,o,i,s,c,f,g,u,v,p,y,B,h,m,L,I),e.ColorBlend=l,e.ColorBurnBlend=b,e.ColorDodgeBlend=a,e.DarkenBlend=d,e.DifferenceBlend=t,e.DivideBlend=r,e.ExclusionBlend=o,e.HardLightBlend=i,e.HardMixBlend=s,e.LightenBlend=c,e.LinearBurnBlend=f,e.LinearDodgeBlend=u,e.LinearLightBlend=g,e.LuminosityBlend=v,e.NegationBlend=p,e.OverlayBlend=y,e.PinLightBlend=B,e.SaturationBlend=h,e.SoftLightBlend=m,e.SubtractBlend=L,e.VividLightBlend=I,e}({});Object.assign(this.PIXI,advanced_blend_modes_js);
//# sourceMappingURL=advanced-blend-modes.min.js.map

File diff suppressed because one or more lines are too long

516
node_modules/pixi.js/dist/packages/math-extras.js generated vendored Normal file
View File

@@ -0,0 +1,516 @@
/*!
* PixiJS - v8.4.1
* Compiled Thu, 19 Sep 2024 10:28:58 UTC
*
* PixiJS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
this.PIXI = this.PIXI || {};
var math_extras_js = (function (exports) {
'use strict';
"use strict";
const pointExtraMixins = {
/**
* Adds `other` to `this` point and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method add
* @memberof maths.Point#
* @param {maths.PointData} other - The point to add to `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the result of the addition.
*/
/**
* Adds `other` to `this` point and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method add
* @memberof maths.ObservablePoint#
* @param {maths.PointData} other - The point to add to `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the result of the addition.
*/
add(other, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
outPoint.x = this.x + other.x;
outPoint.y = this.y + other.y;
return outPoint;
},
/**
* Subtracts `other` from `this` point and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method subtract
* @memberof maths.Point#
* @param {maths.PointData} other - The point to subtract to `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the result of the subtraction.
*/
/**
* Subtracts `other` from `this` point and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method subtract
* @memberof maths.ObservablePoint#
* @param {maths.PointData} other - The point to subtract to `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the result of the subtraction.
*/
subtract(other, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
outPoint.x = this.x - other.x;
outPoint.y = this.y - other.y;
return outPoint;
},
/**
* Multiplies component-wise `other` and `this` points and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method multiply
* @memberof maths.Point#
* @param {maths.PointData} other - The point to multiply with `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the component-wise multiplication.
*/
/**
* Multiplies component-wise `other` and `this` points and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method multiply
* @memberof maths.ObservablePoint#
* @param {maths.PointData} other - The point to multiply with `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the component-wise multiplication.
*/
multiply(other, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
outPoint.x = this.x * other.x;
outPoint.y = this.y * other.y;
return outPoint;
},
/**
* Multiplies each component of `this` point with the number `scalar` and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method multiplyScalar
* @memberof maths.Point#
* @param {number} scalar - The number to multiply both components of `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the multiplication.
*/
/**
* Multiplies each component of `this` point with the number `scalar` and outputs into `outPoint` or a new Point.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method multiplyScalar
* @memberof maths.ObservablePoint#
* @param {number} scalar - The number to multiply both components of `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `outPoint` reference or a new Point, with the multiplication.
*/
multiplyScalar(scalar, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
outPoint.x = this.x * scalar;
outPoint.y = this.y * scalar;
return outPoint;
},
/**
* Computes the dot product of `other` with `this` point.
* The dot product is the sum of the products of the corresponding components of two vectors.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method dot
* @memberof maths.Point#
* @param {maths.PointData} other - The other point to calculate the dot product with `this`.
* @returns {number} The result of the dot product. This is an scalar value.
*/
/**
* Computes the dot product of `other` with `this` point.
* The dot product is the sum of the products of the corresponding components of two vectors.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method dot
* @memberof maths.ObservablePoint#
* @param {maths.PointData} other - The other point to calculate the dot product with `this`.
* @returns {number} The result of the dot product. This is an scalar value.
*/
dot(other) {
return this.x * other.x + this.y * other.y;
},
/**
* Computes the cross product of `other` with `this` point.
* Given two linearly independent R3 vectors a and b, the cross product, a × b (read "a cross b"),
* is a vector that is perpendicular to both a and b, and thus normal to the plane containing them.
* While cross product only exists on 3D space, we can assume the z component of 2D to be zero and
* the result becomes a vector that will only have magnitude on the z axis.
*
* This function returns the z component of the cross product of the two points.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method cross
* @memberof maths.Point#
* @param {maths.PointData} other - The other point to calculate the cross product with `this`.
* @returns {number} The z component of the result of the cross product.
*/
/**
* Computes the cross product of `other` with `this` point.
* Given two linearly independent R3 vectors a and b, the cross product, a × b (read "a cross b"),
* is a vector that is perpendicular to both a and b, and thus normal to the plane containing them.
* While cross product only exists on 3D space, we can assume the z component of 2D to be zero and
* the result becomes a vector that will only have magnitude on the z axis.
*
* This function returns the z component of the cross product of the two points.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method cross
* @memberof maths.ObservablePoint#
* @param {maths.PointData} other - The other point to calculate the cross product with `this`.
* @returns {number} The z component of the result of the cross product.
*/
cross(other) {
return this.x * other.y - this.y * other.x;
},
/**
* Computes a normalized version of `this` point.
*
* A normalized vector is a vector of magnitude (length) 1
*
* _Note: Only available with **pixi.js/math-extras**._
* @method normalize
* @memberof maths.Point#
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The normalized point.
*/
/**
* Computes a normalized version of `this` point.
*
* A normalized vector is a vector of magnitude (length) 1
*
* _Note: Only available with **pixi.js/math-extras**._
* @method normalize
* @memberof maths.ObservablePoint#
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The normalized point.
*/
normalize(outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
const magnitude = Math.sqrt(this.x * this.x + this.y * this.y);
outPoint.x = this.x / magnitude;
outPoint.y = this.y / magnitude;
return outPoint;
},
/**
* Computes the magnitude of this point (Euclidean distance from 0, 0).
*
* Defined as the square root of the sum of the squares of each component.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method magnitude
* @memberof maths.Point#
* @returns {number} The magnitude (length) of the vector.
*/
/**
* Computes the magnitude of this point (Euclidean distance from 0, 0).
*
* Defined as the square root of the sum of the squares of each component.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method magnitude
* @memberof maths.ObservablePoint#
* @returns {number} The magnitude (length) of the vector.
*/
magnitude() {
return Math.sqrt(this.x * this.x + this.y * this.y);
},
/**
* Computes the square magnitude of this point.
* If you are comparing the lengths of vectors, you should compare the length squared instead
* as it is slightly more efficient to calculate.
*
* Defined as the sum of the squares of each component.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method magnitudeSquared
* @memberof maths.Point#
* @returns {number} The magnitude squared (length squared) of the vector.
*/
/**
* Computes the square magnitude of this point.
* If you are comparing the lengths of vectors, you should compare the length squared instead
* as it is slightly more efficient to calculate.
*
* Defined as the sum of the squares of each component.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method magnitudeSquared
* @memberof maths.ObservablePoint#
* @returns {number} The magnitude squared (length squared) of the vector.
*/
magnitudeSquared() {
return this.x * this.x + this.y * this.y;
},
/**
* Computes vector projection of `this` on `onto`.
*
* Imagine a light source, parallel to `onto`, above `this`.
* The light would cast rays perpendicular to `onto`.
* `this.project(onto)` is the shadow cast by `this` on the line defined by `onto` .
*
* _Note: Only available with **pixi.js/math-extras**._
* @method project
* @memberof maths.Point#
* @param {maths.PointData} onto - A non zero vector describing a line on which to project `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `this` on `onto` projection.
*/
/**
* Computes vector projection of `this` on `onto`.
*
* Imagine a light source, parallel to `onto`, above `this`.
* The light would cast rays perpendicular to `onto`.
* `this.project(onto)` is the shadow cast by `this` on the line defined by `onto` .
*
* _Note: Only available with **pixi.js/math-extras**._
* @method project
* @memberof maths.ObservablePoint#
* @param {maths.PointData} onto - A non zero vector describing a line on which to project `this`.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The `this` on `onto` projection.
*/
project(onto, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
const normalizedScalarProjection = (this.x * onto.x + this.y * onto.y) / (onto.x * onto.x + onto.y * onto.y);
outPoint.x = onto.x * normalizedScalarProjection;
outPoint.y = onto.y * normalizedScalarProjection;
return outPoint;
},
/**
* Reflects `this` vector off of a plane orthogonal to `normal`.
* `normal` is not normalized during this process. Consider normalizing your `normal` before use.
*
* Imagine a light source bouncing onto a mirror.
* `this` vector is the light and `normal` is a vector perpendicular to the mirror.
* `this.reflect(normal)` is the reflection of `this` on that mirror.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method reflect
* @memberof maths.Point#
* @param {maths.PointData} normal - The normal vector of your reflecting plane.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The reflection of `this` on your reflecting plane.
*/
/**
* Reflects `this` vector off of a plane orthogonal to `normal`.
* `normal` is not normalized during this process. Consider normalizing your `normal` before use.
*
* Imagine a light source bouncing onto a mirror.
* `this` vector is the light and `normal` is a vector perpendicular to the mirror.
* `this.reflect(normal)` is the reflection of `this` on that mirror.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method reflect
* @memberof maths.ObservablePoint#
* @param {maths.PointData} normal - The normal vector of your reflecting plane.
* @param {maths.PointData} [outPoint] - A Point-like object in which to store the value,
* optional (otherwise will create a new Point).
* @returns {PointData} The reflection of `this` on your reflecting plane.
*/
reflect(normal, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
const dotProduct = this.x * normal.x + this.y * normal.y;
outPoint.x = this.x - 2 * dotProduct * normal.x;
outPoint.y = this.y - 2 * dotProduct * normal.y;
return outPoint;
}
};
"use strict";
const rectangleExtraMixins = {
/**
* Determines whether the `other` Rectangle is contained within `this` Rectangle object.
* Rectangles that occupy the same space are considered to be containing each other.
* Rectangles without area (width or height equal to zero) can't contain anything,
* not even other arealess rectangles.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method containsRect
* @memberof maths.Rectangle#
* @param {Rectangle} other - The Rectangle to fit inside `this`.
* @returns {boolean} A value of `true` if `this` Rectangle contains `other`; otherwise `false`.
*/
containsRect(other) {
if (other.width <= 0 || other.height <= 0) {
return other.x > this.x && other.y > this.y && other.right < this.right && other.bottom < this.bottom;
}
return other.x >= this.x && other.y >= this.y && other.right <= this.right && other.bottom <= this.bottom;
},
/**
* Accepts `other` Rectangle and returns true if the given Rectangle is equal to `this` Rectangle.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method equals
* @memberof maths.Rectangle#
* @param {Rectangle} other - The Rectangle to compare with `this`
* @returns {boolean} Returns true if all `x`, `y`, `width`, and `height` are equal.
*/
equals(other) {
if (other === this) {
return true;
}
return other && this.x === other.x && this.y === other.y && this.width === other.width && this.height === other.height;
},
/**
* If the area of the intersection between the Rectangles `other` and `this` is not zero,
* returns the area of intersection as a Rectangle object. Otherwise, return an empty Rectangle
* with its properties set to zero.
* Rectangles without area (width or height equal to zero) can't intersect or be intersected
* and will always return an empty rectangle with its properties set to zero.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method intersection
* @memberof maths.Rectangle#
* @param {Rectangle} other - The Rectangle to intersect with `this`.
* @param {Rectangle} [outRect] - A Rectangle object in which to store the value,
* optional (otherwise will create a new Rectangle).
* @returns {Rectangle} The intersection of `this` and `other`.
*/
intersection(other, outRect) {
if (!outRect) {
outRect = new PIXI.Rectangle();
}
const x0 = this.x < other.x ? other.x : this.x;
const x1 = this.right > other.right ? other.right : this.right;
if (x1 <= x0) {
outRect.x = outRect.y = outRect.width = outRect.height = 0;
return outRect;
}
const y0 = this.y < other.y ? other.y : this.y;
const y1 = this.bottom > other.bottom ? other.bottom : this.bottom;
if (y1 <= y0) {
outRect.x = outRect.y = outRect.width = outRect.height = 0;
return outRect;
}
outRect.x = x0;
outRect.y = y0;
outRect.width = x1 - x0;
outRect.height = y1 - y0;
return outRect;
},
/**
* Adds `this` and `other` Rectangles together to create a new Rectangle object filling
* the horizontal and vertical space between the two rectangles.
*
* _Note: Only available with **pixi.js/math-extras**._
* @method union
* @memberof maths.Rectangle#
* @param {Rectangle} other - The Rectangle to unite with `this`.
* @param {Rectangle} [outRect] - A Rectangle object in which to store the value,
* optional (otherwise will create a new Rectangle).
* @returns {Rectangle} The union of `this` and `other`.
*/
union(other, outRect) {
if (!outRect) {
outRect = new PIXI.Rectangle();
}
const x1 = Math.min(this.x, other.x);
const x2 = Math.max(this.x + this.width, other.x + other.width);
const y1 = Math.min(this.y, other.y);
const y2 = Math.max(this.y + this.height, other.y + other.height);
outRect.x = x1;
outRect.y = y1;
outRect.width = x2 - x1;
outRect.height = y2 - y1;
return outRect;
}
};
"use strict";
Object.assign(PIXI.Point.prototype, pointExtraMixins);
Object.assign(PIXI.ObservablePoint.prototype, pointExtraMixins);
Object.assign(PIXI.Rectangle.prototype, rectangleExtraMixins);
"use strict";
function floatEqual(a, b, epsilon = Number.EPSILON) {
if (a === b) {
return true;
}
const diff = Math.abs(a - b);
return diff < epsilon;
}
function genericLineIntersection(aStart, aEnd, bStart, bEnd, isLine, outPoint) {
if (!outPoint) {
outPoint = new PIXI.Point();
}
const dxa = aEnd.x - aStart.x;
const dya = aEnd.y - aStart.y;
const dxb = bEnd.x - bStart.x;
const dyb = bEnd.y - bStart.y;
const denominator = dyb * dxa - dxb * dya;
if (floatEqual(denominator, 0)) {
outPoint.x = NaN;
outPoint.y = NaN;
return outPoint;
}
const ua = (dxb * (aStart.y - bStart.y) - dyb * (aStart.x - bStart.x)) / denominator;
const ub = (dxa * (aStart.y - bStart.y) - dya * (aStart.x - bStart.x)) / denominator;
if (!isLine && (ua < 0 || ua > 1 || ub < 0 || ub > 1)) {
outPoint.x = NaN;
outPoint.y = NaN;
return outPoint;
}
outPoint.x = aStart.x + ua * dxa;
outPoint.y = bStart.y + ub * dyb;
return outPoint;
}
function lineIntersection(aStart, aEnd, bStart, bEnd, outPoint) {
return genericLineIntersection(aStart, aEnd, bStart, bEnd, true, outPoint);
}
function segmentIntersection(aStart, aEnd, bStart, bEnd, outPoint) {
return genericLineIntersection(aStart, aEnd, bStart, bEnd, false, outPoint);
}
"use strict";
"use strict";
exports.floatEqual = floatEqual;
exports.lineIntersection = lineIntersection;
exports.pointExtraMixins = pointExtraMixins;
exports.rectangleExtraMixins = rectangleExtraMixins;
exports.segmentIntersection = segmentIntersection;
return exports;
})({});
Object.assign(this.PIXI, math_extras_js);
//# sourceMappingURL=math-extras.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,8 @@
/*!
* PixiJS - v8.4.1
* Compiled Thu, 19 Sep 2024 10:28:58 UTC
*
* PixiJS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/this.PIXI=this.PIXI||{};var math_extras_js=function(x){"use strict";"use strict";const s={add(t,i){return i||(i=new PIXI.Point),i.x=this.x+t.x,i.y=this.y+t.y,i},subtract(t,i){return i||(i=new PIXI.Point),i.x=this.x-t.x,i.y=this.y-t.y,i},multiply(t,i){return i||(i=new PIXI.Point),i.x=this.x*t.x,i.y=this.y*t.y,i},multiplyScalar(t,i){return i||(i=new PIXI.Point),i.x=this.x*t,i.y=this.y*t,i},dot(t){return this.x*t.x+this.y*t.y},cross(t){return this.x*t.y-this.y*t.x},normalize(t){t||(t=new PIXI.Point);const i=Math.sqrt(this.x*this.x+this.y*this.y);return t.x=this.x/i,t.y=this.y/i,t},magnitude(){return Math.sqrt(this.x*this.x+this.y*this.y)},magnitudeSquared(){return this.x*this.x+this.y*this.y},project(t,i){i||(i=new PIXI.Point);const h=(this.x*t.x+this.y*t.y)/(t.x*t.x+t.y*t.y);return i.x=t.x*h,i.y=t.y*h,i},reflect(t,i){i||(i=new PIXI.Point);const h=this.x*t.x+this.y*t.y;return i.x=this.x-2*h*t.x,i.y=this.y-2*h*t.y,i}},g={containsRect(t){return t.width<=0||t.height<=0?t.x>this.x&&t.y>this.y&&t.right<this.right&&t.bottom<this.bottom:t.x>=this.x&&t.y>=this.y&&t.right<=this.right&&t.bottom<=this.bottom},equals(t){return t===this?!0:t&&this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height},intersection(t,i){i||(i=new PIXI.Rectangle);const h=this.x<t.x?t.x:this.x,r=this.right>t.right?t.right:this.right;if(r<=h)return i.x=i.y=i.width=i.height=0,i;const e=this.y<t.y?t.y:this.y,n=this.bottom>t.bottom?t.bottom:this.bottom;return n<=e?(i.x=i.y=i.width=i.height=0,i):(i.x=h,i.y=e,i.width=r-h,i.height=n-e,i)},union(t,i){i||(i=new PIXI.Rectangle);const h=Math.min(this.x,t.x),r=Math.max(this.x+this.width,t.x+t.width),e=Math.min(this.y,t.y),n=Math.max(this.y+this.height,t.y+t.height);return i.x=h,i.y=e,i.width=r-h,i.height=n-e,i}};Object.assign(PIXI.Point.prototype,s),Object.assign(PIXI.ObservablePoint.prototype,s),Object.assign(PIXI.Rectangle.prototype,g);function P(t,i,h=Number.EPSILON){return t===i?!0:Math.abs(t-i)<h}function m(t,i,h,r,e,n){n||(n=new PIXI.Point);const y=i.x-t.x,l=i.y-t.y,w=r.x-h.x,o=r.y-h.y,u=o*y-w*l;if(P(u,0))return n.x=NaN,n.y=NaN,n;const c=(w*(t.y-h.y)-o*(t.x-h.x))/u,I=(y*(t.y-h.y)-l*(t.x-h.x))/u;return!e&&(c<0||c>1||I<0||I>1)?(n.x=NaN,n.y=NaN,n):(n.x=t.x+c*y,n.y=h.y+I*o,n)}function b(t,i,h,r,e){return m(t,i,h,r,!0,e)}function X(t,i,h,r,e){return m(t,i,h,r,!1,e)}return x.floatEqual=P,x.lineIntersection=b,x.pointExtraMixins=s,x.rectangleExtraMixins=g,x.segmentIntersection=X,x}({});Object.assign(this.PIXI,math_extras_js);
//# sourceMappingURL=math-extras.min.js.map

File diff suppressed because one or more lines are too long

644
node_modules/pixi.js/dist/packages/unsafe-eval.js generated vendored Normal file
View File

@@ -0,0 +1,644 @@
/*!
* PixiJS - v8.4.1
* Compiled Thu, 19 Sep 2024 10:28:58 UTC
*
* PixiJS is licensed under the MIT License.
* http://www.opensource.org/licenses/mit-license
*/
this.PIXI = this.PIXI || {};
var unsafe_eval_js = (function (exports) {
'use strict';
"use strict";
function generateShaderSyncPolyfill() {
return syncShader;
}
function syncShader(renderer, shader, syncData) {
const gl = renderer.gl;
const shaderSystem = renderer.shader;
const programData = shaderSystem._getProgramData(shader.glProgram);
for (const i in shader.groups) {
const bindGroup = shader.groups[i];
for (const j in bindGroup.resources) {
const resource = bindGroup.resources[j];
if (resource instanceof PIXI.UniformGroup) {
if (resource.ubo) {
shaderSystem.bindUniformBlock(
resource,
shader._uniformBindMap[i][j],
syncData.blockIndex++
);
} else {
shaderSystem.updateUniformGroup(resource);
}
} else if (resource instanceof PIXI.BufferResource) {
shaderSystem.bindUniformBlock(
resource,
shader._uniformBindMap[i][j],
syncData.blockIndex++
);
} else if (resource instanceof PIXI.TextureSource) {
renderer.texture.bind(resource, syncData.textureCount);
const uniformName = shader._uniformBindMap[i][j];
const uniformData = programData.uniformData[uniformName];
if (uniformData) {
if (uniformData.value !== syncData.textureCount) {
gl.uniform1i(uniformData.location, syncData.textureCount);
}
syncData.textureCount++;
}
} else if (resource instanceof PIXI.TextureStyle) {
}
}
}
}
"use strict";
const uboParserFunctions = [
(name, data, offset, uv, _v) => {
const matrix = uv[name].toArray(true);
data[offset] = matrix[0];
data[offset + 1] = matrix[1];
data[offset + 2] = matrix[2];
data[offset + 4] = matrix[3];
data[offset + 5] = matrix[4];
data[offset + 6] = matrix[5];
data[offset + 8] = matrix[6];
data[offset + 9] = matrix[7];
data[offset + 10] = matrix[8];
},
(name, data, offset, uv, v) => {
v = uv[name];
data[offset] = v.x;
data[offset + 1] = v.y;
data[offset + 2] = v.width;
data[offset + 3] = v.height;
},
(name, data, offset, uv, v) => {
v = uv[name];
data[offset] = v.x;
data[offset + 1] = v.y;
},
(name, data, offset, uv, v) => {
v = uv[name];
data[offset] = v.red;
data[offset + 1] = v.green;
data[offset + 2] = v.blue;
data[offset + 3] = v.alpha;
},
(name, data, offset, uv, v) => {
v = uv[name];
data[offset] = v.red;
data[offset + 1] = v.green;
data[offset + 2] = v.blue;
}
];
const uboSingleFunctionsWGSL = {
f32: (_name, data, offset, _uv, v) => {
data[offset] = v;
},
i32: (_name, data, offset, _uv, v) => {
data[offset] = v;
},
"vec2<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
},
"vec3<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
},
"vec4<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
data[offset + 3] = v[3];
},
"mat2x2<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
data[offset + 3] = v[3];
},
"mat3x3<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
data[offset + 4] = v[3];
data[offset + 5] = v[4];
data[offset + 6] = v[5];
data[offset + 8] = v[6];
data[offset + 9] = v[7];
data[offset + 10] = v[8];
},
"mat4x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 16; i++) {
data[offset + i] = v[i];
}
},
"mat3x2<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 6; i++) {
data[offset + (i / 3 | 0) * 4 + i % 3] = v[i];
}
},
"mat4x2<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 8; i++) {
data[offset + (i / 4 | 0) * 4 + i % 4] = v[i];
}
},
"mat2x3<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 6; i++) {
data[offset + (i / 2 | 0) * 4 + i % 2] = v[i];
}
},
"mat4x3<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 12; i++) {
data[offset + (i / 4 | 0) * 4 + i % 4] = v[i];
}
},
"mat2x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 8; i++) {
data[offset + (i / 2 | 0) * 4 + i % 2] = v[i];
}
},
"mat3x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 12; i++) {
data[offset + (i / 3 | 0) * 4 + i % 3] = v[i];
}
}
};
const uboSingleFunctionsSTD40 = {
f32: (_name, data, offset, _uv, v) => {
data[offset] = v;
},
i32: (_name, data, offset, _uv, v) => {
data[offset] = v;
},
"vec2<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
},
"vec3<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
},
"vec4<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
data[offset + 3] = v[3];
},
"mat2x2<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 4] = v[2];
data[offset + 5] = v[3];
},
"mat3x3<f32>": (_name, data, offset, _uv, v) => {
data[offset] = v[0];
data[offset + 1] = v[1];
data[offset + 2] = v[2];
data[offset + 4] = v[3];
data[offset + 5] = v[4];
data[offset + 6] = v[5];
data[offset + 8] = v[6];
data[offset + 9] = v[7];
data[offset + 10] = v[8];
},
"mat4x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 16; i++) {
data[offset + i] = v[i];
}
},
"mat3x2<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 6; i++) {
data[offset + (i / 3 | 0) * 4 + i % 3] = v[i];
}
},
"mat4x2<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 8; i++) {
data[offset + (i / 4 | 0) * 4 + i % 4] = v[i];
}
},
"mat2x3<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 6; i++) {
data[offset + (i / 2 | 0) * 4 + i % 2] = v[i];
}
},
"mat4x3<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 12; i++) {
data[offset + (i / 4 | 0) * 4 + i % 4] = v[i];
}
},
"mat2x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 8; i++) {
data[offset + (i / 2 | 0) * 4 + i % 2] = v[i];
}
},
"mat3x4<f32>": (_name, data, offset, _uv, v) => {
for (let i = 0; i < 12; i++) {
data[offset + (i / 3 | 0) * 4 + i % 3] = v[i];
}
}
};
"use strict";
function generateUboSyncPolyfillSTD40(uboElements) {
return generateUboSyncPolyfill(
uboElements,
uboSingleFunctionsSTD40,
(uboElement) => {
const rowSize = Math.max(PIXI.WGSL_TO_STD40_SIZE[uboElement.data.type] / 16, 1);
const elementSize = uboElement.data.value.length / uboElement.data.size;
const remainder = (4 - elementSize % 4) % 4;
return (_name, data, offset, _uv, v) => {
let t = 0;
for (let i = 0; i < uboElement.data.size * rowSize; i++) {
for (let j = 0; j < elementSize; j++) {
data[offset++] = v[t++];
}
offset += remainder;
}
};
}
);
}
function generateUboSyncPolyfillWGSL(uboElements) {
return generateUboSyncPolyfill(
uboElements,
uboSingleFunctionsWGSL,
(uboElement) => {
const { size, align } = PIXI.WGSL_ALIGN_SIZE_DATA[uboElement.data.type];
const remainder = (size - align) / 4;
return (_name, data, offset, _uv, v) => {
let t = 0;
for (let i = 0; i < uboElement.data.size * (size / 4); i++) {
for (let j = 0; j < size / 4; j++) {
data[offset++] = v[t++];
}
offset += remainder;
}
};
}
);
}
function generateUboSyncPolyfill(uboElements, uboFunctions, arrayUploadFunction) {
const functionMap = {};
for (const i in uboElements) {
const uboElement = uboElements[i];
const uniform = uboElement.data;
let parsed = false;
functionMap[uniform.name] = {
offset: uboElement.offset / 4,
func: null
};
for (let j = 0; j < PIXI.uniformParsers.length; j++) {
const parser = PIXI.uniformParsers[j];
if (uniform.type === parser.type && parser.test(uniform)) {
functionMap[uniform.name].func = uboParserFunctions[j];
parsed = true;
break;
}
}
if (!parsed) {
if (uniform.size === 1) {
functionMap[uniform.name].func = uboFunctions[uniform.type];
} else {
functionMap[uniform.name].func = arrayUploadFunction(uboElement);
}
}
}
return (uniforms, data, offset) => {
for (const i in functionMap) {
functionMap[i].func(i, data, offset + functionMap[i].offset, uniforms, uniforms[i]);
}
};
}
"use strict";
const uniformSingleParserFunctions = {
f32(name, cu, cv, v, ud, _uv, gl) {
if (cv !== v) {
cu.value = v;
gl.uniform1f(ud[name].location, v);
}
},
"vec2<f32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1]) {
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2f(ud[name].location, v[0], v[1]);
}
},
"vec3<f32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3f(ud[name].location, v[0], v[1], v[2]);
}
},
"vec4<f32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4f(ud[name].location, v[0], v[1], v[2], v[3]);
}
},
i32(name, cu, cv, v, ud, _uv, gl) {
if (cv !== v) {
cu.value = v;
gl.uniform1i(ud[name].location, v);
}
},
"vec2<i32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1]) {
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(ud[name].location, v[0], v[1]);
}
},
"vec3<i32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(ud[name].location, v[0], v[1], v[2]);
}
},
"vec4<i32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(ud[name].location, v[0], v[1], v[2], v[3]);
}
},
u32(name, cu, cv, v, ud, _uv, gl) {
if (cv !== v) {
cu.value = v;
gl.uniform1ui(ud[name].location, v);
}
},
"vec2<u32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1]) {
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2ui(ud[name].location, v[0], v[1]);
}
},
"vec3<u32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3ui(ud[name].location, v[0], v[1], v[2]);
}
},
"vec4<u32>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4ui(ud[name].location, v[0], v[1], v[2], v[3]);
}
},
bool(name, cu, cv, v, ud, _uv, gl) {
if (cv !== v) {
cu.value = v;
gl.uniform1i(ud[name].location, v);
}
},
"vec2<bool>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1]) {
cv[0] = v[0];
cv[1] = v[1];
gl.uniform2i(ud[name].location, v[0], v[1]);
}
},
"vec3<bool>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
gl.uniform3i(ud[name].location, v[0], v[1], v[2]);
}
},
"vec4<bool>"(name, _cu, cv, v, ud, _uv, gl) {
if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
cv[0] = v[0];
cv[1] = v[1];
cv[2] = v[2];
cv[3] = v[3];
gl.uniform4i(ud[name].location, v[0], v[1], v[2], v[3]);
}
},
"mat2x2<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix2fv(ud[name].location, false, v);
},
"mat3x3<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix3fv(ud[name].location, false, v);
},
"mat4x4<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix4fv(ud[name].location, false, v);
}
};
const uniformArrayParserFunctions = {
f32(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform1fv(ud[name].location, v);
},
"vec2<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform2fv(ud[name].location, v);
},
"vec3<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform3fv(ud[name].location, v);
},
"vec4<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform4fv(ud[name].location, v);
},
"mat2x2<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix2fv(ud[name].location, false, v);
},
"mat3x3<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix3fv(ud[name].location, false, v);
},
"mat4x4<f32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniformMatrix4fv(ud[name].location, false, v);
},
i32(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform1iv(ud[name].location, v);
},
"vec2<i32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform2iv(ud[name].location, v);
},
"vec3<i32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform3iv(ud[name].location, v);
},
"vec4<i32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform4iv(ud[name].location, v);
},
u32(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform1iv(ud[name].location, v);
},
"vec2<u32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform2iv(ud[name].location, v);
},
"vec3<u32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform3iv(ud[name].location, v);
},
"vec4<u32>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform4iv(ud[name].location, v);
},
bool(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform1iv(ud[name].location, v);
},
"vec2<bool>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform2iv(ud[name].location, v);
},
"vec3<bool>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform3iv(ud[name].location, v);
},
"vec4<bool>"(name, _cu, _cv, v, ud, _uv, gl) {
gl.uniform4iv(ud[name].location, v);
}
};
const uniformParserFunctions = [
(name, _cu, _cv, _v, ud, uv, gl) => {
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
},
(name, _cu, cv, v, ud, uv, gl) => {
cv = ud[name].value;
v = uv[name];
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
cv[0] = v.x;
cv[1] = v.y;
cv[2] = v.width;
cv[3] = v.height;
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
}
},
(name, _cu, cv, v, ud, uv, gl) => {
cv = ud[name].value;
v = uv[name];
if (cv[0] !== v.x || cv[1] !== v.y) {
cv[0] = v.x;
cv[1] = v.y;
gl.uniform2f(ud[name].location, v.x, v.y);
}
},
(name, _cu, cv, v, ud, uv, gl) => {
cv = ud[name].value;
v = uv[name];
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
cv[0] = v.red;
cv[1] = v.green;
cv[2] = v.blue;
cv[3] = v.alpha;
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
}
},
(name, _cu, cv, v, ud, uv, gl) => {
cv = ud[name].value;
v = uv[name];
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
cv[0] = v.red;
cv[1] = v.green;
cv[2] = v.blue;
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
}
}
];
"use strict";
function generateUniformsSyncPolyfill(group, uniformData) {
const functionMap = {};
for (const i in group.uniformStructures) {
if (!uniformData[i])
continue;
const uniform = group.uniformStructures[i];
let parsed = false;
for (let j = 0; j < PIXI.uniformParsers.length; j++) {
const parser = PIXI.uniformParsers[j];
if (uniform.type === parser.type && parser.test(uniform)) {
functionMap[i] = uniformParserFunctions[j];
parsed = true;
break;
}
}
if (!parsed) {
const templateType = uniform.size === 1 ? uniformSingleParserFunctions : uniformArrayParserFunctions;
functionMap[i] = templateType[uniform.type];
}
}
return (ud, uv, renderer) => {
const gl = renderer.gl;
for (const i in functionMap) {
const v = uv[i];
const cu = ud[i];
const cv = ud[i].value;
functionMap[i](i, cu, cv, v, ud, uv, gl);
}
};
}
"use strict";
function selfInstall() {
Object.assign(PIXI.AbstractRenderer.prototype, {
// override unsafeEval check, as we don't need to use it
_unsafeEvalCheck() {
}
});
Object.assign(PIXI.UboSystem.prototype, {
// override unsafeEval check, as we don't need to use it
_systemCheck() {
}
});
Object.assign(PIXI.GlUniformGroupSystem.prototype, {
// use polyfill which avoids eval method
_generateUniformsSync: generateUniformsSyncPolyfill
});
Object.assign(PIXI.GlUboSystem.prototype, {
// use polyfill which avoids eval method
_generateUboSync: generateUboSyncPolyfillSTD40
});
Object.assign(PIXI.GpuUboSystem.prototype, {
// use polyfill which avoids eval method
_generateUboSync: generateUboSyncPolyfillWGSL
});
Object.assign(PIXI.GlShaderSystem.prototype, {
// use polyfill which avoids eval method
_generateShaderSync: generateShaderSyncPolyfill
});
}
selfInstall();
"use strict";
"use strict";
exports.generateShaderSyncPolyfill = generateShaderSyncPolyfill;
exports.generateUboSyncPolyfillSTD40 = generateUboSyncPolyfillSTD40;
exports.generateUboSyncPolyfillWGSL = generateUboSyncPolyfillWGSL;
exports.generateUniformsSyncPolyfill = generateUniformsSyncPolyfill;
exports.uboParserFunctions = uboParserFunctions;
exports.uboSingleFunctionsSTD40 = uboSingleFunctionsSTD40;
exports.uboSingleFunctionsWGSL = uboSingleFunctionsWGSL;
exports.uniformArrayParserFunctions = uniformArrayParserFunctions;
exports.uniformParserFunctions = uniformParserFunctions;
exports.uniformSingleParserFunctions = uniformSingleParserFunctions;
return exports;
})({});
Object.assign(this.PIXI, unsafe_eval_js);
//# sourceMappingURL=unsafe-eval.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long