@playcanvas/supersplat-viewer 1.17.4 → 1.18.1
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/dist/index.js +1 -1
- package/dist/settings.d.ts +83 -0
- package/dist/settings.js +308 -0
- package/dist/settings.js.map +1 -0
- package/package.json +10 -6
- package/public/index.js +22 -33
- package/public/index.js.map +1 -1
package/public/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const TRACEID_GPU_TIMINGS = 'GpuTimings';
|
|
2
2
|
|
|
3
|
-
const version$1 = '2.17.
|
|
4
|
-
const revision = '
|
|
3
|
+
const version$1 = '2.17.1';
|
|
4
|
+
const revision = 'b60756b';
|
|
5
5
|
function extend(target, ex) {
|
|
6
6
|
for(const prop in ex){
|
|
7
7
|
const copy = ex[prop];
|
|
@@ -34609,6 +34609,8 @@ class FrameGraph {
|
|
|
34609
34609
|
const renderPasses = this.renderPasses;
|
|
34610
34610
|
for(let i = 0; i < renderPasses.length; i++){
|
|
34611
34611
|
const renderPass = renderPasses[i];
|
|
34612
|
+
renderPass._skipStart = false;
|
|
34613
|
+
renderPass._skipEnd = false;
|
|
34612
34614
|
const renderTarget = renderPass.renderTarget;
|
|
34613
34615
|
if (renderTarget !== undefined) {
|
|
34614
34616
|
const prevPass = renderTargetMap.get(renderTarget);
|
|
@@ -67534,11 +67536,6 @@ var composePS$1 = `
|
|
|
67534
67536
|
void main() {
|
|
67535
67537
|
#include "composeMainStartPS"
|
|
67536
67538
|
vec2 uv = uv0;
|
|
67537
|
-
#ifdef TAA
|
|
67538
|
-
#ifdef WEBGPU
|
|
67539
|
-
uv.y = 1.0 - uv.y;
|
|
67540
|
-
#endif
|
|
67541
|
-
#endif
|
|
67542
67539
|
vec4 scene = texture2DLod(sceneTexture, uv, 0.0);
|
|
67543
67540
|
vec3 result = scene.rgb;
|
|
67544
67541
|
#ifdef CAS
|
|
@@ -67782,7 +67779,7 @@ var composeCasPS$1 = `
|
|
|
67782
67779
|
#ifdef CAS_HDR
|
|
67783
67780
|
float maxComponent(float x, float y, float z) { return max(x, max(y, z)); }
|
|
67784
67781
|
vec3 toSDR(vec3 c) { return c / (1.0 + maxComponent(c.r, c.g, c.b)); }
|
|
67785
|
-
vec3 toHDR(vec3 c) { return c / (1.0 - maxComponent(c.r, c.g, c.b)); }
|
|
67782
|
+
vec3 toHDR(vec3 c) { return c / max(1.0 - maxComponent(c.r, c.g, c.b), 1e-4); }
|
|
67786
67783
|
#else
|
|
67787
67784
|
vec3 toSDR(vec3 c) { return c; }
|
|
67788
67785
|
vec3 toHDR(vec3 c) { return c; }
|
|
@@ -67797,7 +67794,7 @@ var composeCasPS$1 = `
|
|
|
67797
67794
|
vec3 e = toSDR(texture2DLod(sceneTexture, uv + vec2(0.0, y), 0.0).rgb);
|
|
67798
67795
|
float min_g = min(a.g, min(b.g, min(c.g, min(d.g, e.g))));
|
|
67799
67796
|
float max_g = max(a.g, max(b.g, max(c.g, max(d.g, e.g))));
|
|
67800
|
-
float sharpening_amount = sqrt(min(1.0 - max_g, min_g) / max_g);
|
|
67797
|
+
float sharpening_amount = sqrt(min(1.0 - max_g, min_g) / max(max_g, 1e-4));
|
|
67801
67798
|
float w = sharpening_amount * sharpness;
|
|
67802
67799
|
vec3 res = (w * (a + b + d + e) + c) / (4.0 * w + 1.0);
|
|
67803
67800
|
res = max(res, 0.0);
|
|
@@ -67870,9 +67867,6 @@ var composePS = `
|
|
|
67870
67867
|
#include "composeMainStartPS"
|
|
67871
67868
|
var output: FragmentOutput;
|
|
67872
67869
|
var uv = uv0;
|
|
67873
|
-
#ifdef TAA
|
|
67874
|
-
uv.y = 1.0 - uv.y;
|
|
67875
|
-
#endif
|
|
67876
67870
|
let scene = textureSampleLevel(sceneTexture, sceneTextureSampler, uv, 0.0);
|
|
67877
67871
|
var result = scene.rgb;
|
|
67878
67872
|
#ifdef CAS
|
|
@@ -68123,7 +68117,7 @@ var composeCasPS = `
|
|
|
68123
68117
|
#ifdef CAS_HDR
|
|
68124
68118
|
fn maxComponent(x: f32, y: f32, z: f32) -> f32 { return max(x, max(y, z)); }
|
|
68125
68119
|
fn toSDR(c: vec3f) -> vec3f { return c / (1.0 + maxComponent(c.r, c.g, c.b)); }
|
|
68126
|
-
fn toHDR(c: vec3f) -> vec3f { return c / (1.0 - maxComponent(c.r, c.g, c.b)); }
|
|
68120
|
+
fn toHDR(c: vec3f) -> vec3f { return c / max(1.0 - maxComponent(c.r, c.g, c.b), 1e-4); }
|
|
68127
68121
|
#else
|
|
68128
68122
|
fn toSDR(c: vec3f) -> vec3f { return c; }
|
|
68129
68123
|
fn toHDR(c: vec3f) -> vec3f { return c; }
|
|
@@ -68138,8 +68132,8 @@ var composeCasPS = `
|
|
|
68138
68132
|
let e: half3 = half3(toSDR(textureSampleLevel(sceneTexture, sceneTextureSampler, uv + vec2f(0.0, y), 0.0).rgb));
|
|
68139
68133
|
let min_g = min(a.g, min(b.g, min(c.g, min(d.g, e.g))));
|
|
68140
68134
|
let max_g = max(a.g, max(b.g, max(c.g, max(d.g, e.g))));
|
|
68141
|
-
let sharpening_amount = sqrt(min(half(1.0) - max_g, min_g) / max_g);
|
|
68142
|
-
let w = sharpening_amount * half(
|
|
68135
|
+
let sharpening_amount = sqrt(min(half(1.0) - max_g, min_g) / max(max_g, half(1e-4)));
|
|
68136
|
+
let w = sharpening_amount * half(sharpness);
|
|
68143
68137
|
var res = (w * (a + b + d + e) + c) / (half(4.0) * w + half(1.0));
|
|
68144
68138
|
res = max(res, half3(0.0));
|
|
68145
68139
|
return toHDR(vec3f(res));
|
|
@@ -68549,9 +68543,7 @@ var glsltaaResolvePS = `
|
|
|
68549
68543
|
uniform vec2 textureSize;
|
|
68550
68544
|
varying vec2 uv0;
|
|
68551
68545
|
vec2 reproject(vec2 uv, float depth) {
|
|
68552
|
-
|
|
68553
|
-
depth = depth * 2.0 - 1.0;
|
|
68554
|
-
#endif
|
|
68546
|
+
depth = depth * 2.0 - 1.0;
|
|
68555
68547
|
vec4 ndc = vec4(uv * 2.0 - 1.0, depth, 1.0);
|
|
68556
68548
|
ndc.xy -= jitters.xy;
|
|
68557
68549
|
vec4 worldPosition = matrix_viewProjectionInverse * ndc;
|
|
@@ -68574,11 +68566,7 @@ var glsltaaResolvePS = `
|
|
|
68574
68566
|
}
|
|
68575
68567
|
void main()
|
|
68576
68568
|
{
|
|
68577
|
-
|
|
68578
|
-
#ifdef WEBGPU
|
|
68579
|
-
uv.y = 1.0 - uv.y;
|
|
68580
|
-
#endif
|
|
68581
|
-
vec4 srcColor = texture2D(sourceTexture, uv);
|
|
68569
|
+
vec4 srcColor = texture2D(sourceTexture, uv0);
|
|
68582
68570
|
float linearDepth = getLinearScreenDepth(uv0);
|
|
68583
68571
|
float depth = delinearizeDepth(linearDepth);
|
|
68584
68572
|
vec2 historyUv = reproject(uv0, depth);
|
|
@@ -68587,7 +68575,7 @@ var glsltaaResolvePS = `
|
|
|
68587
68575
|
#else
|
|
68588
68576
|
vec4 historyColor = texture2D(historyTexture, historyUv);
|
|
68589
68577
|
#endif
|
|
68590
|
-
vec4 historyColorClamped = colorClamp(
|
|
68578
|
+
vec4 historyColorClamped = colorClamp(uv0, historyColor);
|
|
68591
68579
|
float mixFactor = (historyUv.x < 0.0 || historyUv.x > 1.0 || historyUv.y < 0.0 || historyUv.y > 1.0) ?
|
|
68592
68580
|
1.0 : 0.05;
|
|
68593
68581
|
gl_FragColor = mix(historyColorClamped, srcColor, mixFactor);
|
|
@@ -68606,13 +68594,16 @@ var wgsltaaResolvePS = `
|
|
|
68606
68594
|
uniform jitters: vec4f;
|
|
68607
68595
|
uniform textureSize: vec2f;
|
|
68608
68596
|
varying uv0: vec2f;
|
|
68609
|
-
fn reproject(
|
|
68597
|
+
fn reproject(uv_in: vec2f, depth: f32) -> vec2f {
|
|
68598
|
+
var uv = vec2f(uv_in.x, 1.0 - uv_in.y);
|
|
68610
68599
|
var ndc = vec4f(uv * 2.0 - 1.0, depth, 1.0);
|
|
68611
68600
|
ndc = vec4f(ndc.xy - uniform.jitters.xy, ndc.zw);
|
|
68612
68601
|
var worldPosition = uniform.matrix_viewProjectionInverse * ndc;
|
|
68613
68602
|
worldPosition = worldPosition / worldPosition.w;
|
|
68614
68603
|
let screenPrevious = uniform.matrix_viewProjectionPrevious * worldPosition;
|
|
68615
|
-
|
|
68604
|
+
var result = (screenPrevious.xy / screenPrevious.w) * 0.5 + 0.5;
|
|
68605
|
+
result.y = 1.0 - result.y;
|
|
68606
|
+
return result;
|
|
68616
68607
|
}
|
|
68617
68608
|
fn colorClamp(uv: vec2f, historyColor: vec4f) -> vec4f {
|
|
68618
68609
|
var minColor = vec3f(9999.0);
|
|
@@ -68630,9 +68621,7 @@ var wgsltaaResolvePS = `
|
|
|
68630
68621
|
@fragment
|
|
68631
68622
|
fn fragmentMain(input: FragmentInput) -> FragmentOutput {
|
|
68632
68623
|
var output: FragmentOutput;
|
|
68633
|
-
|
|
68634
|
-
uv.y = 1.0 - uv.y;
|
|
68635
|
-
let srcColor = textureSample(sourceTexture, sourceTextureSampler, uv);
|
|
68624
|
+
let srcColor = textureSample(sourceTexture, sourceTextureSampler, uv0);
|
|
68636
68625
|
let linearDepth = getLinearScreenDepth(uv0);
|
|
68637
68626
|
let depth = delinearizeDepth(linearDepth);
|
|
68638
68627
|
let historyUv = reproject(uv0, depth);
|
|
@@ -68641,7 +68630,7 @@ var wgsltaaResolvePS = `
|
|
|
68641
68630
|
#else
|
|
68642
68631
|
var historyColor: vec4f = textureSample(historyTexture, historyTextureSampler, historyUv);
|
|
68643
68632
|
#endif
|
|
68644
|
-
let historyColorClamped = colorClamp(
|
|
68633
|
+
let historyColorClamped = colorClamp(uv0, historyColor);
|
|
68645
68634
|
let mixFactor_condition = historyUv.x < 0.0 || historyUv.x > 1.0 || historyUv.y < 0.0 || historyUv.y > 1.0;
|
|
68646
68635
|
let mixFactor = select(0.05, 1.0, mixFactor_condition);
|
|
68647
68636
|
output.color = mix(historyColorClamped, srcColor, mixFactor);
|
|
@@ -72044,7 +72033,7 @@ const migrateV2 = (v1) => {
|
|
|
72044
72033
|
startMode: v1.camera.startAnim === 'animTrack' ? 'animTrack' : 'default'
|
|
72045
72034
|
};
|
|
72046
72035
|
};
|
|
72047
|
-
//
|
|
72036
|
+
// migrate a JSON object to the latest settings schema (assumes valid input)
|
|
72048
72037
|
const importSettings = (settings) => {
|
|
72049
72038
|
let result;
|
|
72050
72039
|
const version = settings.version;
|
|
@@ -73550,7 +73539,7 @@ class AnimCursor {
|
|
|
73550
73539
|
this.cursor = mod(value, this.duration);
|
|
73551
73540
|
}
|
|
73552
73541
|
get value() {
|
|
73553
|
-
return this.cursor > this.duration ? this.duration - this.cursor : this.cursor;
|
|
73542
|
+
return this.cursor > this.duration ? 2 * this.duration - this.cursor : this.cursor;
|
|
73554
73543
|
}
|
|
73555
73544
|
}
|
|
73556
73545
|
|
|
@@ -78144,7 +78133,7 @@ const initXr = (global) => {
|
|
|
78144
78133
|
});
|
|
78145
78134
|
};
|
|
78146
78135
|
|
|
78147
|
-
var version = "1.
|
|
78136
|
+
var version = "1.18.1";
|
|
78148
78137
|
|
|
78149
78138
|
const loadGsplat = async (app, config, progressCallback) => {
|
|
78150
78139
|
const { contents, contentUrl, unified, aa } = config;
|