@onerjs/core 8.31.5 → 8.31.7
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/Animations/animation.d.ts +3 -1
- package/Animations/animation.js +5 -4
- package/Animations/animation.js.map +1 -1
- package/Behaviors/Cameras/interpolatingBehavior.d.ts +2 -1
- package/Behaviors/Cameras/interpolatingBehavior.js +11 -4
- package/Behaviors/Cameras/interpolatingBehavior.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js +2 -0
- package/Cameras/Inputs/geospatialCameraKeyboardInput.js.map +1 -1
- package/Cameras/Inputs/geospatialCameraPointersInput.js +3 -5
- package/Cameras/Inputs/geospatialCameraPointersInput.js.map +1 -1
- package/Cameras/geospatialCamera.d.ts +20 -1
- package/Cameras/geospatialCamera.js +105 -28
- package/Cameras/geospatialCamera.js.map +1 -1
- package/Cameras/geospatialCameraMovement.d.ts +7 -2
- package/Cameras/geospatialCameraMovement.js +46 -10
- package/Cameras/geospatialCameraMovement.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/thinEngine.js +1 -1
- package/Engines/thinEngine.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.d.ts +22 -5
- package/FrameGraph/Node/nodeRenderGraph.js +39 -18
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Passes/pass.d.ts +2 -0
- package/FrameGraph/Passes/pass.js +2 -0
- package/FrameGraph/Passes/pass.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +2 -0
- package/FrameGraph/Passes/renderPass.js +4 -0
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +13 -4
- package/FrameGraph/frameGraph.js +45 -5
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderTarget.d.ts +1 -0
- package/FrameGraph/frameGraphRenderTarget.js +3 -0
- package/FrameGraph/frameGraphRenderTarget.js.map +1 -1
- package/FrameGraph/frameGraphTask.d.ts +6 -0
- package/FrameGraph/frameGraphTask.js +15 -0
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +2 -0
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/Materials/Node/nodeMaterial.js +3 -0
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/materialHelper.functions.d.ts +29 -7
- package/Materials/materialHelper.functions.js +59 -24
- package/Materials/materialHelper.functions.js.map +1 -1
- package/Materials/shaderMaterial.d.ts +1 -0
- package/Materials/shaderMaterial.js +6 -17
- package/Materials/shaderMaterial.js.map +1 -1
- package/Meshes/mesh.js +1 -1
- package/Meshes/mesh.js.map +1 -1
- package/Misc/screenshotTools.js +2 -8
- package/Misc/screenshotTools.js.map +1 -1
- package/Particles/Node/Blocks/index.d.ts +1 -0
- package/Particles/Node/Blocks/index.js +1 -0
- package/Particles/Node/Blocks/index.js.map +1 -1
- package/Particles/Node/Blocks/particleFloatToIntBlock.d.ts +46 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js +120 -0
- package/Particles/Node/Blocks/particleFloatToIntBlock.js.map +1 -0
- package/Particles/Node/Blocks/systemBlock.d.ts +4 -4
- package/Particles/Node/Blocks/systemBlock.js +22 -16
- package/Particles/Node/Blocks/systemBlock.js.map +1 -1
- package/Particles/Node/nodeParticleBuildState.js +1 -1
- package/Particles/Node/nodeParticleBuildState.js.map +1 -1
- package/Particles/Node/nodeParticleSystemSet.helper.js +61 -30
- package/Particles/Node/nodeParticleSystemSet.helper.js.map +1 -1
- package/Particles/thinParticleSystem.d.ts +6 -0
- package/Particles/thinParticleSystem.js +21 -12
- package/Particles/thinParticleSystem.js.map +1 -1
- package/ShadersWGSL/iblVoxelGrid.vertex.d.ts +1 -0
- package/ShadersWGSL/iblVoxelGrid.vertex.js +53 -64
- package/ShadersWGSL/iblVoxelGrid.vertex.js.map +1 -1
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import type { Material } from "./material.js";
|
|
|
12
12
|
import type { Nullable } from "../types.js";
|
|
13
13
|
import type { MorphTargetManager } from "../Morph/morphTargetManager.js";
|
|
14
14
|
import type { Color3 } from "../Maths/math.color.js";
|
|
15
|
+
import type { Geometry } from "../Meshes/geometry.js";
|
|
15
16
|
export * from "./materialHelper.functions.pure.js";
|
|
16
17
|
/**
|
|
17
18
|
* Binds the fog information from the scene to the effect for the given mesh.
|
|
@@ -180,13 +181,34 @@ export declare function HandleFallbacksForShadows(defines: any, fallbacks: Effec
|
|
|
180
181
|
*/
|
|
181
182
|
export declare function GetFogState(mesh: AbstractMesh, scene: Scene): boolean;
|
|
182
183
|
/**
|
|
183
|
-
*
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
184
|
+
* Interface representing metadata for vertex pulling
|
|
185
|
+
*/
|
|
186
|
+
export interface IVertexPullingMetadata {
|
|
187
|
+
/**
|
|
188
|
+
* Offset in vertex buffer where data starts
|
|
189
|
+
*/
|
|
190
|
+
offset: number;
|
|
191
|
+
/**
|
|
192
|
+
* Stride between elements in the vertex buffer
|
|
193
|
+
*/
|
|
194
|
+
stride: number;
|
|
195
|
+
/**
|
|
196
|
+
* Type of the vertex buffer (e.g., float, int)
|
|
197
|
+
*/
|
|
198
|
+
type: number;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Prepares vertex pulling uniforms for the given attributes and mesh
|
|
202
|
+
* @param geometry The geometry containing the vertex buffers
|
|
203
|
+
* @returns A map of attribute names to their metadata, or null if unavailable
|
|
204
|
+
*/
|
|
205
|
+
export declare function PrepareVertexPullingUniforms(geometry: Geometry): Nullable<Map<string, IVertexPullingMetadata>>;
|
|
206
|
+
/**
|
|
207
|
+
* Bind vertex pulling uniforms to the effect
|
|
208
|
+
* @param effect The effect to bind the uniforms to
|
|
209
|
+
* @param metadata The vertex pulling metadata
|
|
210
|
+
*/
|
|
211
|
+
export declare function BindVertexPullingUniforms(effect: Effect, metadata: Map<string, IVertexPullingMetadata>): void;
|
|
190
212
|
/**
|
|
191
213
|
* Helper used to prepare the list of defines associated with misc. values for shader compilation
|
|
192
214
|
* @param mesh defines the current mesh
|
|
@@ -5,7 +5,7 @@ import { LightConstants } from "../Lights/lightConstants.js";
|
|
|
5
5
|
import { PrepareDefinesForClipPlanes } from "./clipPlaneMaterialHelper.js";
|
|
6
6
|
import { MaterialFlags } from "./materialFlags.js";
|
|
7
7
|
import { Texture } from "./Textures/texture.js";
|
|
8
|
-
import {
|
|
8
|
+
import { Vector3 } from "../Maths/math.vector.js";
|
|
9
9
|
// For backwards compatibility, we export everything from the pure version of this file.
|
|
10
10
|
export * from "./materialHelper.functions.pure.js";
|
|
11
11
|
// Temps
|
|
@@ -502,34 +502,69 @@ export function HandleFallbacksForShadows(defines, fallbacks, maxSimultaneousLig
|
|
|
502
502
|
export function GetFogState(mesh, scene) {
|
|
503
503
|
return scene.fogEnabled && mesh.applyFog && scene.fogMode !== 0;
|
|
504
504
|
}
|
|
505
|
+
// Store vertex pulling metadata per geometry
|
|
506
|
+
const _VertexPullingMetadataCache = new WeakMap();
|
|
505
507
|
/**
|
|
506
|
-
*
|
|
507
|
-
*
|
|
508
|
-
* @
|
|
509
|
-
* @param defines The defines object to update
|
|
510
|
-
* @param attributeNames Array of attribute names to configure (e.g., ["position", "normal"])
|
|
508
|
+
* Prepares vertex pulling uniforms for the given attributes and mesh
|
|
509
|
+
* @param geometry The geometry containing the vertex buffers
|
|
510
|
+
* @returns A map of attribute names to their metadata, or null if unavailable
|
|
511
511
|
*/
|
|
512
|
-
export function
|
|
513
|
-
if (!defines["USE_VERTEX_PULLING"]) {
|
|
514
|
-
return;
|
|
515
|
-
}
|
|
516
|
-
const geometry = mesh.geometry;
|
|
512
|
+
export function PrepareVertexPullingUniforms(geometry) {
|
|
517
513
|
if (!geometry) {
|
|
518
|
-
return;
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
const vertexBuffers = geometry.getVertexBuffers();
|
|
517
|
+
if (!vertexBuffers) {
|
|
518
|
+
return null;
|
|
519
|
+
}
|
|
520
|
+
// Check cache first
|
|
521
|
+
let metadata = _VertexPullingMetadataCache.get(geometry);
|
|
522
|
+
if (!metadata) {
|
|
523
|
+
metadata = new Map();
|
|
524
|
+
_VertexPullingMetadataCache.set(geometry, metadata);
|
|
519
525
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
526
|
+
else {
|
|
527
|
+
// Return cached metadata if it exists and hasn't changed
|
|
528
|
+
let needsUpdate = false;
|
|
529
|
+
for (const vb in vertexBuffers) {
|
|
530
|
+
if (!metadata.has(vb)) {
|
|
531
|
+
needsUpdate = true;
|
|
532
|
+
break;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
if (!needsUpdate) {
|
|
536
|
+
return metadata;
|
|
524
537
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
const
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
538
|
+
}
|
|
539
|
+
// Build or update metadata
|
|
540
|
+
for (const vb in vertexBuffers) {
|
|
541
|
+
const vertexBuffer = vertexBuffers[vb];
|
|
542
|
+
if (vertexBuffer) {
|
|
543
|
+
const offset = vertexBuffer.byteOffset;
|
|
544
|
+
const stride = vertexBuffer.byteStride;
|
|
545
|
+
const type = vertexBuffer.type;
|
|
546
|
+
metadata.set(vb, {
|
|
547
|
+
offset: offset,
|
|
548
|
+
stride: stride,
|
|
549
|
+
type: type,
|
|
550
|
+
});
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
return metadata;
|
|
554
|
+
}
|
|
555
|
+
/**
|
|
556
|
+
* Bind vertex pulling uniforms to the effect
|
|
557
|
+
* @param effect The effect to bind the uniforms to
|
|
558
|
+
* @param metadata The vertex pulling metadata
|
|
559
|
+
*/
|
|
560
|
+
export function BindVertexPullingUniforms(effect, metadata) {
|
|
561
|
+
if (!metadata || !effect) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
for (const [attribute, data] of metadata.entries()) {
|
|
565
|
+
const uniformName = `vp_${attribute}_info`;
|
|
566
|
+
// Pack into vec3: (offset, stride, type)
|
|
567
|
+
effect.setVector3(uniformName, new Vector3(data.offset, data.stride, data.type));
|
|
533
568
|
}
|
|
534
569
|
}
|
|
535
570
|
/**
|