@clypra-studio/engine 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/index.cjs +15 -132
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +15 -132
- package/dist/index.js.map +1 -1
- package/package.json +13 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Clypra Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.cjs
CHANGED
|
@@ -11275,27 +11275,7 @@ function renderDolly(ctx, params, intensity, time) {
|
|
|
11275
11275
|
|
|
11276
11276
|
// src/effects/light/GlowEffect.ts
|
|
11277
11277
|
var import_pixi3 = require("pixi.js");
|
|
11278
|
-
var
|
|
11279
|
-
in vec2 aPosition;
|
|
11280
|
-
out vec2 vTextureCoord;
|
|
11281
|
-
|
|
11282
|
-
uniform vec4 uInputSize;
|
|
11283
|
-
uniform vec4 uOutputFrame;
|
|
11284
|
-
|
|
11285
|
-
vec4 filterVertexPosition(void) {
|
|
11286
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
11287
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
11288
|
-
}
|
|
11289
|
-
|
|
11290
|
-
vec2 filterTextureCoord(void) {
|
|
11291
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
11292
|
-
}
|
|
11293
|
-
|
|
11294
|
-
void main(void) {
|
|
11295
|
-
gl_Position = filterVertexPosition();
|
|
11296
|
-
vTextureCoord = filterTextureCoord();
|
|
11297
|
-
}
|
|
11298
|
-
`;
|
|
11278
|
+
var import_shaders = require("@clypra-studio/shaders");
|
|
11299
11279
|
var FRAGMENT_SHADER = `
|
|
11300
11280
|
in vec2 vTextureCoord;
|
|
11301
11281
|
out vec4 finalColor;
|
|
@@ -11362,7 +11342,7 @@ var GlowEffect = {
|
|
|
11362
11342
|
parseInt(hex.slice(5, 7), 16) / 255
|
|
11363
11343
|
];
|
|
11364
11344
|
return import_pixi3.Filter.from({
|
|
11365
|
-
gl: { vertex:
|
|
11345
|
+
gl: { vertex: import_shaders.pixiVertexShader, fragment: FRAGMENT_SHADER },
|
|
11366
11346
|
resources: {
|
|
11367
11347
|
effectUniforms: {
|
|
11368
11348
|
uRadius: { value: params.radius, type: "f32" },
|
|
@@ -11440,27 +11420,7 @@ var LightLeakEffect = {
|
|
|
11440
11420
|
|
|
11441
11421
|
// src/effects/light/VignetteEffect.ts
|
|
11442
11422
|
var import_pixi4 = require("pixi.js");
|
|
11443
|
-
var
|
|
11444
|
-
in vec2 aPosition;
|
|
11445
|
-
out vec2 vTextureCoord;
|
|
11446
|
-
|
|
11447
|
-
uniform vec4 uInputSize;
|
|
11448
|
-
uniform vec4 uOutputFrame;
|
|
11449
|
-
|
|
11450
|
-
vec4 filterVertexPosition(void) {
|
|
11451
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
11452
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
11453
|
-
}
|
|
11454
|
-
|
|
11455
|
-
vec2 filterTextureCoord(void) {
|
|
11456
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
11457
|
-
}
|
|
11458
|
-
|
|
11459
|
-
void main(void) {
|
|
11460
|
-
gl_Position = filterVertexPosition();
|
|
11461
|
-
vTextureCoord = filterTextureCoord();
|
|
11462
|
-
}
|
|
11463
|
-
`;
|
|
11423
|
+
var import_shaders2 = require("@clypra-studio/shaders");
|
|
11464
11424
|
var FRAGMENT_SHADER2 = `
|
|
11465
11425
|
in vec2 vTextureCoord;
|
|
11466
11426
|
out vec4 finalColor;
|
|
@@ -11513,7 +11473,10 @@ var VignetteEffect = {
|
|
|
11513
11473
|
filterSpec: {
|
|
11514
11474
|
create(params) {
|
|
11515
11475
|
return import_pixi4.Filter.from({
|
|
11516
|
-
gl: {
|
|
11476
|
+
gl: {
|
|
11477
|
+
vertex: import_shaders2.pixiVertexShader,
|
|
11478
|
+
fragment: FRAGMENT_SHADER2
|
|
11479
|
+
},
|
|
11517
11480
|
resources: {
|
|
11518
11481
|
effectUniforms: {
|
|
11519
11482
|
uSize: { value: params.size, type: "f32" },
|
|
@@ -11538,27 +11501,7 @@ var VignetteEffect = {
|
|
|
11538
11501
|
// src/effects/light/LensFlareEffect.ts
|
|
11539
11502
|
var import_pixi5 = require("pixi.js");
|
|
11540
11503
|
var import_pixi_filters2 = require("pixi-filters");
|
|
11541
|
-
var
|
|
11542
|
-
in vec2 aPosition;
|
|
11543
|
-
out vec2 vTextureCoord;
|
|
11544
|
-
|
|
11545
|
-
uniform vec4 uInputSize;
|
|
11546
|
-
uniform vec4 uOutputFrame;
|
|
11547
|
-
|
|
11548
|
-
vec4 filterVertexPosition(void) {
|
|
11549
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
11550
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
11551
|
-
}
|
|
11552
|
-
|
|
11553
|
-
vec2 filterTextureCoord(void) {
|
|
11554
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
11555
|
-
}
|
|
11556
|
-
|
|
11557
|
-
void main(void) {
|
|
11558
|
-
gl_Position = filterVertexPosition();
|
|
11559
|
-
vTextureCoord = filterTextureCoord();
|
|
11560
|
-
}
|
|
11561
|
-
`;
|
|
11504
|
+
var import_shaders3 = require("@clypra-studio/shaders");
|
|
11562
11505
|
var STARBURST_FRAGMENT = `
|
|
11563
11506
|
in vec2 vTextureCoord;
|
|
11564
11507
|
out vec4 finalColor;
|
|
@@ -11627,7 +11570,7 @@ var LensFlareEffect = {
|
|
|
11627
11570
|
time: 0
|
|
11628
11571
|
});
|
|
11629
11572
|
const starburst = import_pixi5.Filter.from({
|
|
11630
|
-
gl: { vertex:
|
|
11573
|
+
gl: { vertex: import_shaders3.pixiVertexShader, fragment: STARBURST_FRAGMENT },
|
|
11631
11574
|
resources: {
|
|
11632
11575
|
flareUniforms: {
|
|
11633
11576
|
uFlareIntensity: { value: params.flareIntensity, type: "f32" },
|
|
@@ -12437,27 +12380,7 @@ var RGBSplitEffect = {
|
|
|
12437
12380
|
|
|
12438
12381
|
// src/effects/glitch/VHSEffect.ts
|
|
12439
12382
|
var import_pixi10 = require("pixi.js");
|
|
12440
|
-
var
|
|
12441
|
-
in vec2 aPosition;
|
|
12442
|
-
out vec2 vTextureCoord;
|
|
12443
|
-
|
|
12444
|
-
uniform vec4 uInputSize;
|
|
12445
|
-
uniform vec4 uOutputFrame;
|
|
12446
|
-
|
|
12447
|
-
vec4 filterVertexPosition(void) {
|
|
12448
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
12449
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
12450
|
-
}
|
|
12451
|
-
|
|
12452
|
-
vec2 filterTextureCoord(void) {
|
|
12453
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
12454
|
-
}
|
|
12455
|
-
|
|
12456
|
-
void main(void) {
|
|
12457
|
-
gl_Position = filterVertexPosition();
|
|
12458
|
-
vTextureCoord = filterTextureCoord();
|
|
12459
|
-
}
|
|
12460
|
-
`;
|
|
12383
|
+
var import_shaders4 = require("@clypra-studio/shaders");
|
|
12461
12384
|
var FRAGMENT_SHADER3 = `
|
|
12462
12385
|
in vec2 vTextureCoord;
|
|
12463
12386
|
out vec4 finalColor;
|
|
@@ -12520,7 +12443,7 @@ var VHSEffect = {
|
|
|
12520
12443
|
filterSpec: {
|
|
12521
12444
|
create(params) {
|
|
12522
12445
|
return import_pixi10.Filter.from({
|
|
12523
|
-
gl: { vertex:
|
|
12446
|
+
gl: { vertex: import_shaders4.pixiVertexShader, fragment: FRAGMENT_SHADER3 },
|
|
12524
12447
|
resources: {
|
|
12525
12448
|
uniforms: {
|
|
12526
12449
|
uNoise: { value: params.noise, type: "f32" },
|
|
@@ -12701,27 +12624,7 @@ var StaticNoiseEffect = {
|
|
|
12701
12624
|
|
|
12702
12625
|
// src/effects/cinematic/FilmGrainEffect.ts
|
|
12703
12626
|
var import_pixi12 = require("pixi.js");
|
|
12704
|
-
var
|
|
12705
|
-
in vec2 aPosition;
|
|
12706
|
-
out vec2 vTextureCoord;
|
|
12707
|
-
|
|
12708
|
-
uniform vec4 uInputSize;
|
|
12709
|
-
uniform vec4 uOutputFrame;
|
|
12710
|
-
|
|
12711
|
-
vec4 filterVertexPosition(void) {
|
|
12712
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
12713
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
12714
|
-
}
|
|
12715
|
-
|
|
12716
|
-
vec2 filterTextureCoord(void) {
|
|
12717
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
12718
|
-
}
|
|
12719
|
-
|
|
12720
|
-
void main(void) {
|
|
12721
|
-
gl_Position = filterVertexPosition();
|
|
12722
|
-
vTextureCoord = filterTextureCoord();
|
|
12723
|
-
}
|
|
12724
|
-
`;
|
|
12627
|
+
var import_shaders5 = require("@clypra-studio/shaders");
|
|
12725
12628
|
var FRAGMENT_SHADER4 = `
|
|
12726
12629
|
in vec2 vTextureCoord;
|
|
12727
12630
|
out vec4 finalColor;
|
|
@@ -12769,7 +12672,7 @@ var FilmGrainEffect = {
|
|
|
12769
12672
|
filterSpec: {
|
|
12770
12673
|
create(params) {
|
|
12771
12674
|
return import_pixi12.Filter.from({
|
|
12772
|
-
gl: { vertex:
|
|
12675
|
+
gl: { vertex: import_shaders5.pixiVertexShader, fragment: FRAGMENT_SHADER4 },
|
|
12773
12676
|
resources: {
|
|
12774
12677
|
effectUniforms: {
|
|
12775
12678
|
uIntensity: { value: params.intensity, type: "f32" },
|
|
@@ -12835,27 +12738,7 @@ var TiltShiftEffect = {
|
|
|
12835
12738
|
|
|
12836
12739
|
// src/effects/cinematic/CinematicLUTEffect.ts
|
|
12837
12740
|
var import_pixi13 = require("pixi.js");
|
|
12838
|
-
var
|
|
12839
|
-
in vec2 aPosition;
|
|
12840
|
-
out vec2 vTextureCoord;
|
|
12841
|
-
|
|
12842
|
-
uniform vec4 uInputSize;
|
|
12843
|
-
uniform vec4 uOutputFrame;
|
|
12844
|
-
|
|
12845
|
-
vec4 filterVertexPosition(void) {
|
|
12846
|
-
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
12847
|
-
return vec4(position * uInputSize.zw * 2.0 - 1.0, 0.0, 1.0);
|
|
12848
|
-
}
|
|
12849
|
-
|
|
12850
|
-
vec2 filterTextureCoord(void) {
|
|
12851
|
-
return aPosition * (uOutputFrame.zw * uInputSize.xy);
|
|
12852
|
-
}
|
|
12853
|
-
|
|
12854
|
-
void main(void) {
|
|
12855
|
-
gl_Position = filterVertexPosition();
|
|
12856
|
-
vTextureCoord = filterTextureCoord();
|
|
12857
|
-
}
|
|
12858
|
-
`;
|
|
12741
|
+
var import_shaders6 = require("@clypra-studio/shaders");
|
|
12859
12742
|
var LUT_FRAGMENT_SHADER = `
|
|
12860
12743
|
in vec2 vTextureCoord;
|
|
12861
12744
|
out vec4 finalColor;
|
|
@@ -12946,7 +12829,7 @@ var CinematicLUTEffect = {
|
|
|
12946
12829
|
matrixFilter.saturate(params.saturation, false);
|
|
12947
12830
|
const lutTexture = createCinematicLUTTexture();
|
|
12948
12831
|
const lutFilter = import_pixi13.Filter.from({
|
|
12949
|
-
gl: { vertex:
|
|
12832
|
+
gl: { vertex: import_shaders6.pixiVertexShader, fragment: LUT_FRAGMENT_SHADER },
|
|
12950
12833
|
resources: {
|
|
12951
12834
|
uLUT: lutTexture.source,
|
|
12952
12835
|
lutUniforms: {
|