pacem 0.51.1 → 0.51.2-akkad
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/css/pacem-dark-content.min.css +1 -1
- package/dist/css/pacem-dark-shell.min.css +1 -1
- package/dist/css/pacem-dark.min.css +1 -1
- package/dist/css/pacem-light-content.min.css +1 -1
- package/dist/css/pacem-light-shell.min.css +1 -1
- package/dist/css/pacem-light.min.css +1 -1
- package/dist/css/pacem-phousys-content.min.css +1 -1
- package/dist/css/pacem-phousys-shell.min.css +1 -1
- package/dist/css/pacem-phousys.min.css +1 -1
- package/dist/js/azure-maps.d.ts +1 -1
- package/dist/js/pacem-2d.d.ts +1 -1
- package/dist/js/pacem-2d.js +1 -1
- package/dist/js/pacem-2d.min.js +1 -1
- package/dist/js/pacem-3d.d.ts +5 -3
- package/dist/js/pacem-3d.js +81 -29
- package/dist/js/pacem-3d.min.js +2 -2
- package/dist/js/pacem-charts.d.ts +1 -1
- package/dist/js/pacem-charts.js +1 -1
- package/dist/js/pacem-charts.min.js +1 -1
- package/dist/js/pacem-cms.d.ts +1 -1
- package/dist/js/pacem-cms.js +1 -1
- package/dist/js/pacem-cms.min.js +1 -1
- package/dist/js/pacem-core.d.ts +1 -1
- package/dist/js/pacem-core.js +1 -1
- package/dist/js/pacem-core.min.js +1 -1
- package/dist/js/pacem-foundation.d.ts +1 -1
- package/dist/js/pacem-foundation.js +1 -1
- package/dist/js/pacem-foundation.min.js +1 -1
- package/dist/js/pacem-fx.d.ts +1 -1
- package/dist/js/pacem-fx.js +1 -1
- package/dist/js/pacem-fx.min.js +1 -1
- package/dist/js/pacem-logging.d.ts +1 -1
- package/dist/js/pacem-logging.js +1 -1
- package/dist/js/pacem-logging.min.js +1 -1
- package/dist/js/pacem-maps.d.ts +1 -1
- package/dist/js/pacem-maps.js +1 -1
- package/dist/js/pacem-maps.min.js +1 -1
- package/dist/js/pacem-media.d.ts +1 -1
- package/dist/js/pacem-media.js +1 -1
- package/dist/js/pacem-media.min.js +1 -1
- package/dist/js/pacem-networking.d.ts +1 -1
- package/dist/js/pacem-networking.js +1 -1
- package/dist/js/pacem-networking.min.js +1 -1
- package/dist/js/pacem-numerical.d.ts +1 -1
- package/dist/js/pacem-numerical.js +1 -1
- package/dist/js/pacem-numerical.min.js +1 -1
- package/dist/js/pacem-plus.d.ts +1 -1
- package/dist/js/pacem-plus.js +1 -1
- package/dist/js/pacem-plus.min.js +1 -1
- package/dist/js/pacem-scaffolding.d.ts +1 -1
- package/dist/js/pacem-scaffolding.js +1 -1
- package/dist/js/pacem-scaffolding.min.js +1 -1
- package/dist/js/pacem-ui.d.ts +1 -1
- package/dist/js/pacem-ui.js +1 -1
- package/dist/js/pacem-ui.min.js +1 -1
- package/dist/js/swagger-types.d.ts +1 -1
- package/package.json +1 -1
package/dist/js/azure-maps.d.ts
CHANGED
package/dist/js/pacem-2d.d.ts
CHANGED
package/dist/js/pacem-2d.js
CHANGED
package/dist/js/pacem-2d.min.js
CHANGED
package/dist/js/pacem-3d.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.51.
|
|
2
|
+
* pacem v0.51.2-akkad (https://js.pacem.it)
|
|
3
3
|
* Copyright 2025 Pacem (https://pacem.it)
|
|
4
4
|
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
@@ -536,7 +536,7 @@ declare namespace Pacem.Drawing3D.WebGPU {
|
|
|
536
536
|
readonly format: GPUTextureFormat;
|
|
537
537
|
}
|
|
538
538
|
type RenderPassEncoderBindDelegate = (pass: GPURenderPassEncoder, ...buffers: RenderableBuffer[]) => void;
|
|
539
|
-
type RenderableBufferKey = 'u32id' | 'cameraViewTransform' | 'cameraViewProjectionTransform' | 'cameraInverseViewProjectionTransform' | 'objectWorldTransform' | 'geometryPositions' | 'light' | 'geometryNormals' | 'geometryTexCoords' | 'vertexColors';
|
|
539
|
+
type RenderableBufferKey = 'u32id' | 'cameraViewTransform' | 'cameraViewProjectionTransform' | 'cameraInverseViewProjectionTransform' | 'objectWorldTransform' | 'geometryPositions' | 'light' | 'geometryNormals' | 'geometryTexCoords' | 'vertexColors' | 'geometry';
|
|
540
540
|
type MaterialKey = 'texture' | 'sampler' | 'normalTexture' | '';
|
|
541
541
|
type Texture = {
|
|
542
542
|
texture?: GPUTexture;
|
|
@@ -649,7 +649,8 @@ declare namespace Pacem.Drawing3D.WebGPU {
|
|
|
649
649
|
static createIndexed(device: GPUDevice, data: Uint16Array, label?: string): GPUBuffer;
|
|
650
650
|
}
|
|
651
651
|
class BufferLayouts {
|
|
652
|
-
static createVertex(shaderLocation
|
|
652
|
+
static createVertex(shaderLocation: number, size?: number): GPUVertexBufferLayout;
|
|
653
|
+
static createVertex(shaderLocationStart: number, ...sizes: number[]): GPUVertexBufferLayout;
|
|
653
654
|
}
|
|
654
655
|
}
|
|
655
656
|
declare namespace Pacem.Drawing3D.WebGPU {
|
|
@@ -761,6 +762,7 @@ declare namespace Pacem.Drawing3D.WebGPU {
|
|
|
761
762
|
type PipelineOptions = {
|
|
762
763
|
primitive: GPUPrimitiveState;
|
|
763
764
|
multisample: boolean;
|
|
765
|
+
packedVertices: boolean;
|
|
764
766
|
};
|
|
765
767
|
class RenderPipeline {
|
|
766
768
|
private static _memoizer;
|
package/dist/js/pacem-3d.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* pacem v0.51.
|
|
2
|
+
* pacem v0.51.2-akkad (https://js.pacem.it)
|
|
3
3
|
* Copyright 2025 Pacem (https://pacem.it)
|
|
4
4
|
* Licensed under Apache-2.0
|
|
5
5
|
*/
|
|
@@ -1971,16 +1971,21 @@ var Pacem;
|
|
|
1971
1971
|
}
|
|
1972
1972
|
WebGPU.Buffers = Buffers;
|
|
1973
1973
|
class BufferLayouts {
|
|
1974
|
-
static createVertex(
|
|
1974
|
+
static createVertex(shaderLocationStart = 0, size = 3, ...sizes) {
|
|
1975
|
+
const attributes = [];
|
|
1976
|
+
let fullSize = 0, index = 0;
|
|
1977
|
+
for (let sz of [size].concat(sizes)) {
|
|
1978
|
+
attributes.push({
|
|
1979
|
+
shaderLocation: shaderLocationStart + index,
|
|
1980
|
+
offset: fullSize * Float32Array.BYTES_PER_ELEMENT,
|
|
1981
|
+
format: `float32x${sz}`,
|
|
1982
|
+
});
|
|
1983
|
+
fullSize += sz;
|
|
1984
|
+
index++;
|
|
1985
|
+
}
|
|
1975
1986
|
return {
|
|
1976
|
-
arrayStride:
|
|
1977
|
-
attributes
|
|
1978
|
-
{
|
|
1979
|
-
shaderLocation,
|
|
1980
|
-
offset: 0,
|
|
1981
|
-
format: `float32x${size}`,
|
|
1982
|
-
}
|
|
1983
|
-
],
|
|
1987
|
+
arrayStride: fullSize /* x, y, z */ * Float32Array.BYTES_PER_ELEMENT,
|
|
1988
|
+
attributes,
|
|
1984
1989
|
stepMode: 'vertex'
|
|
1985
1990
|
};
|
|
1986
1991
|
}
|
|
@@ -2306,6 +2311,7 @@ var Pacem;
|
|
|
2306
2311
|
const labelPrefix = WebGPU.LABEL_PREFIX;
|
|
2307
2312
|
const DefaultPipelineOptions = {
|
|
2308
2313
|
multisample: true,
|
|
2314
|
+
packedVertices: true,
|
|
2309
2315
|
primitive: {
|
|
2310
2316
|
topology: 'triangle-list',
|
|
2311
2317
|
frontFace: 'ccw',
|
|
@@ -2497,8 +2503,9 @@ var Pacem;
|
|
|
2497
2503
|
const meshPipeline = new MeshRenderPipelineClass(ctx, mesh, camera, ...lights);
|
|
2498
2504
|
// cache peek for sudden return
|
|
2499
2505
|
const key = meshPipeline.key;
|
|
2500
|
-
|
|
2501
|
-
|
|
2506
|
+
const found = cache.get(key);
|
|
2507
|
+
if (found) {
|
|
2508
|
+
return found;
|
|
2502
2509
|
}
|
|
2503
2510
|
// no cache -> build it
|
|
2504
2511
|
meshPipeline.build(pipelineOptions);
|
|
@@ -2684,16 +2691,23 @@ var Pacem;
|
|
|
2684
2691
|
lightBuffers.push(buffer);
|
|
2685
2692
|
}
|
|
2686
2693
|
}
|
|
2687
|
-
//
|
|
2688
|
-
pass
|
|
2694
|
+
// same pass
|
|
2695
|
+
const samePass = pass === this.#previousPass;
|
|
2696
|
+
if (!samePass) {
|
|
2697
|
+
this.#previousPass = pass;
|
|
2698
|
+
// set
|
|
2699
|
+
pass.setPipeline(this._pipeline);
|
|
2700
|
+
}
|
|
2689
2701
|
try {
|
|
2690
2702
|
// bind
|
|
2691
2703
|
this._bindVertex(pass, meshBuffer);
|
|
2692
2704
|
this._bindWorldTransform(pass, meshBuffer);
|
|
2693
|
-
this._bindCameraProjection(pass, cameraBuffer);
|
|
2694
2705
|
this._bindMaterial(pass, meshBuffer);
|
|
2695
2706
|
this._bindTextures(pass, meshBuffer);
|
|
2696
|
-
|
|
2707
|
+
if (!samePass) {
|
|
2708
|
+
this._bindCameraProjection(pass, cameraBuffer);
|
|
2709
|
+
this._bindLighting(pass, ...lightBuffers);
|
|
2710
|
+
}
|
|
2697
2711
|
// draw
|
|
2698
2712
|
const mesh = meshBuffer.item, geometry = mesh.geometry;
|
|
2699
2713
|
pass.draw(geometry.triangleIndices?.length || geometry.positions.length);
|
|
@@ -2749,14 +2763,19 @@ var Pacem;
|
|
|
2749
2763
|
// build vertex state
|
|
2750
2764
|
const vertex = {
|
|
2751
2765
|
module: device.createShaderModule({ code: wgsl.vertex }),
|
|
2752
|
-
buffers:
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2766
|
+
buffers: options.packedVertices ?
|
|
2767
|
+
[
|
|
2768
|
+
// packed
|
|
2769
|
+
WebGPU.BufferLayouts.createVertex(WebGPU.VERTEX_BUFFER_INDEX_MESH_POSITION, 3, 3, 2),
|
|
2770
|
+
]
|
|
2771
|
+
: [
|
|
2772
|
+
// position
|
|
2773
|
+
WebGPU.BufferLayouts.createVertex(WebGPU.VERTEX_BUFFER_INDEX_MESH_POSITION, 3),
|
|
2774
|
+
// normal
|
|
2775
|
+
WebGPU.BufferLayouts.createVertex(WebGPU.VERTEX_BUFFER_INDEX_MESH_NORMAL, 3),
|
|
2776
|
+
// uv
|
|
2777
|
+
WebGPU.BufferLayouts.createVertex(WebGPU.VERTEX_BUFFER_INDEX_MESH_UV, 2)
|
|
2778
|
+
]
|
|
2760
2779
|
};
|
|
2761
2780
|
// bind group layouts
|
|
2762
2781
|
const worldBindGroupLayout = device.createBindGroupLayout({
|
|
@@ -2919,7 +2938,7 @@ var Pacem;
|
|
|
2919
2938
|
this._materialBindGroups = new WeakMap();
|
|
2920
2939
|
this._lightingBindGroups.clear();
|
|
2921
2940
|
// vertex buffers
|
|
2922
|
-
|
|
2941
|
+
const bindVertexSplit = (pass, ...buffers) => {
|
|
2923
2942
|
const meshBuffer = buffers.at(0);
|
|
2924
2943
|
if (Pacem.Utils.isNull(meshBuffer)) {
|
|
2925
2944
|
throw new ReferenceError(`Null ${WebGPU.RenderableBuffer.name} bringing vertex buffers was provided.`);
|
|
@@ -2931,6 +2950,15 @@ var Pacem;
|
|
|
2931
2950
|
pass.setVertexBuffer(WebGPU.VERTEX_BUFFER_INDEX_MESH_NORMAL, normals);
|
|
2932
2951
|
pass.setVertexBuffer(WebGPU.VERTEX_BUFFER_INDEX_MESH_UV, uv);
|
|
2933
2952
|
};
|
|
2953
|
+
const bindVertexPacked = (pass, ...buffers) => {
|
|
2954
|
+
const meshBuffer = buffers.at(0);
|
|
2955
|
+
if (Pacem.Utils.isNull(meshBuffer)) {
|
|
2956
|
+
throw new ReferenceError(`Null ${WebGPU.RenderableBuffer.name} bringing vertex buffers was provided.`);
|
|
2957
|
+
}
|
|
2958
|
+
const { buffer } = meshBuffer.buffer(ctx, 'geometry');
|
|
2959
|
+
pass.setVertexBuffer(WebGPU.VERTEX_BUFFER_INDEX_MESH_POSITION, buffer);
|
|
2960
|
+
};
|
|
2961
|
+
this._bindVertex = options.packedVertices ? bindVertexPacked : bindVertexSplit;
|
|
2934
2962
|
// world transform
|
|
2935
2963
|
this._bindWorldTransform = (pass, ...buffers) => {
|
|
2936
2964
|
const meshBuffer = buffers.at(0);
|
|
@@ -2999,6 +3027,7 @@ var Pacem;
|
|
|
2999
3027
|
pass.setBindGroup(group, bindGroup);
|
|
3000
3028
|
};
|
|
3001
3029
|
}
|
|
3030
|
+
#previousPass;
|
|
3002
3031
|
}
|
|
3003
3032
|
})(WebGPU = Drawing3D.WebGPU || (Drawing3D.WebGPU = {}));
|
|
3004
3033
|
})(Drawing3D = Pacem.Drawing3D || (Pacem.Drawing3D = {}));
|
|
@@ -3432,7 +3461,7 @@ var Pacem;
|
|
|
3432
3461
|
// #endregion
|
|
3433
3462
|
// #region GEOMETRY
|
|
3434
3463
|
class GeometryBuffer {
|
|
3435
|
-
#freshness = { positions: true, normals: true, uv: true };
|
|
3464
|
+
#freshness = { positions: true, normals: true, uv: true, packed: true };
|
|
3436
3465
|
#geometry;
|
|
3437
3466
|
#geometryBuffers;
|
|
3438
3467
|
constructor(geometry) {
|
|
@@ -3471,6 +3500,11 @@ var Pacem;
|
|
|
3471
3500
|
const { uv } = geom, uvFresh = freshness.uv;
|
|
3472
3501
|
freshness.uv = false;
|
|
3473
3502
|
return Pacem.Utils.extend({ fresh: uvFresh }, uv);
|
|
3503
|
+
case 'geometry':
|
|
3504
|
+
// alltogether
|
|
3505
|
+
const { packed } = geom, geomFresh = freshness.packed;
|
|
3506
|
+
freshness.packed = false;
|
|
3507
|
+
return Pacem.Utils.extend({ fresh: geomFresh }, packed);
|
|
3474
3508
|
default:
|
|
3475
3509
|
throwBufferRequestError(key, GeometryBuffer);
|
|
3476
3510
|
}
|
|
@@ -3488,13 +3522,28 @@ var Pacem;
|
|
|
3488
3522
|
const flatPositions = hasTriangleIndices ?
|
|
3489
3523
|
meshGeometry.triangleIndices.map(index => meshGeometry.positions[index])
|
|
3490
3524
|
: meshGeometry.positions;
|
|
3491
|
-
const
|
|
3525
|
+
const length2 = flatPositions.length * 2, length3 = length2 + flatPositions.length;
|
|
3526
|
+
const positionsValue = new Float32Array(length3); //AdapterUtils.flattenVectorArray(flatPositions));
|
|
3527
|
+
const normalsValue = new Float32Array(length3); //AdapterUtils.flattenVectorArray(meshGeometry.normals));
|
|
3528
|
+
const uvValue = new Float32Array(length2); //AdapterUtils.flattenVectorArray(meshGeometry.textureCoordinates));
|
|
3529
|
+
const geomValue = new Float32Array(2 * length3 + length2);
|
|
3530
|
+
for (let j = 0; j < flatPositions.length; j++) {
|
|
3531
|
+
const offset2 = 2 * j;
|
|
3532
|
+
const offset3 = 3 * j;
|
|
3533
|
+
const { x, y, z } = flatPositions[j];
|
|
3534
|
+
const { x: nx, y: ny, z: nz } = meshGeometry.normals[j];
|
|
3535
|
+
const { x: u, y: v } = meshGeometry.textureCoordinates[j];
|
|
3536
|
+
positionsValue.set([x, y, z], offset3);
|
|
3537
|
+
normalsValue.set([nx, ny, nz], offset3);
|
|
3538
|
+
uvValue.set([u, v], offset2);
|
|
3539
|
+
geomValue.set([x, y, z, nx, ny, nz, u, v], offset3 * 2 + offset2);
|
|
3540
|
+
}
|
|
3492
3541
|
const positions = WebGPU.Buffers.create(device, positionsValue, WebGPU.LABEL_PREFIX + 'meshgeometry-' + key + '-positions-buffer');
|
|
3493
|
-
const normalsValue = new Float32Array(AdapterUtils.flattenVectorArray(meshGeometry.normals));
|
|
3494
3542
|
const normals = WebGPU.Buffers.create(device, normalsValue, WebGPU.LABEL_PREFIX + 'meshgeometry-' + key + '-normals-buffer');
|
|
3495
|
-
const uvValue = new Float32Array(AdapterUtils.flattenVectorArray(meshGeometry.textureCoordinates));
|
|
3496
3543
|
const uv = WebGPU.Buffers.create(device, uvValue, WebGPU.LABEL_PREFIX + 'meshgeometry-' + key + '-uvmap-buffer');
|
|
3544
|
+
const geom = WebGPU.Buffers.create(device, geomValue, WebGPU.LABEL_PREFIX + 'meshgeometry-' + key + '-buffer');
|
|
3497
3545
|
this.#geometryBuffers = {
|
|
3546
|
+
packed: { buffer: geom, value: geomValue },
|
|
3498
3547
|
positions: { buffer: positions, value: positionsValue },
|
|
3499
3548
|
normals: { buffer: normals, value: normalsValue },
|
|
3500
3549
|
uv: { buffer: uv, value: uvValue },
|
|
@@ -3507,8 +3556,10 @@ var Pacem;
|
|
|
3507
3556
|
positions: { buffer: positions, value: positionsValue },
|
|
3508
3557
|
normals: { buffer: null, value: null },
|
|
3509
3558
|
uv: { buffer: null, value: null },
|
|
3559
|
+
packed: { buffer: null, value: null }
|
|
3510
3560
|
};
|
|
3511
3561
|
}
|
|
3562
|
+
this.#freshness = { positions: true, normals: true, uv: true, packed: true };
|
|
3512
3563
|
}
|
|
3513
3564
|
destroy() {
|
|
3514
3565
|
this.destroyBuffers();
|
|
@@ -3639,6 +3690,7 @@ var Pacem;
|
|
|
3639
3690
|
case 'geometryPositions':
|
|
3640
3691
|
case 'geometryNormals':
|
|
3641
3692
|
case 'geometryTexCoords':
|
|
3693
|
+
case 'geometry':
|
|
3642
3694
|
return geom.buffer(context, key);
|
|
3643
3695
|
case 'vertexColors':
|
|
3644
3696
|
return mater.buffer(context, key);
|