@babylonjs/core 7.26.0 → 7.26.2
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/Engines/Extensions/engine.readTexture.d.ts +2 -9
- package/Engines/Extensions/engine.readTexture.js +3 -76
- package/Engines/Extensions/engine.readTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js +1 -1
- package/Engines/WebGPU/webgpuBufferManager.js.map +1 -1
- package/Engines/abstractEngine.functions.d.ts +9 -0
- package/Engines/abstractEngine.functions.js +76 -0
- package/Engines/abstractEngine.functions.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engine.d.ts +2 -0
- package/Engines/engine.js +2 -0
- package/Engines/engine.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.d.ts +4 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +17 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.d.ts +2 -0
- package/Materials/Node/Blocks/Dual/textureBlock.js +29 -22
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/index.d.ts +3 -0
- package/Materials/Node/Blocks/index.js +3 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Node/Blocks/loopBlock.d.ts +49 -0
- package/Materials/Node/Blocks/loopBlock.js +110 -0
- package/Materials/Node/Blocks/loopBlock.js.map +1 -0
- package/Materials/Node/Blocks/storageReadBlock.d.ts +27 -0
- package/Materials/Node/Blocks/storageReadBlock.js +52 -0
- package/Materials/Node/Blocks/storageReadBlock.js.map +1 -0
- package/Materials/Node/Blocks/storageWriteBlock.d.ts +31 -0
- package/Materials/Node/Blocks/storageWriteBlock.js +62 -0
- package/Materials/Node/Blocks/storageWriteBlock.js.map +1 -0
- package/Materials/Node/nodeMaterial.d.ts +1 -0
- package/Materials/Node/nodeMaterial.js +44 -12
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.d.ts +6 -0
- package/Materials/Node/nodeMaterialBlock.js +46 -3
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.d.ts +6 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +9 -0
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +3 -0
- package/Materials/Node/nodeMaterialBuildState.js +2 -0
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Textures/cubeTexture.d.ts +0 -1
- package/Materials/Textures/cubeTexture.js +0 -1
- package/Materials/Textures/cubeTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +2 -0
- package/Materials/Textures/renderTargetTexture.js +13 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/effectRenderer.d.ts +0 -1
- package/Materials/effectRenderer.js +0 -2
- package/Materials/effectRenderer.js.map +1 -1
- package/Materials/uniformBuffer.d.ts +0 -1
- package/Materials/uniformBuffer.js +0 -1
- package/Materials/uniformBuffer.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +3 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +19 -8
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Misc/dumpTools.js +103 -82
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/index.d.ts +2 -0
- package/Misc/index.js +3 -0
- package/Misc/index.js.map +1 -1
- package/Misc/textureTools.d.ts +0 -2
- package/Misc/textureTools.js +11 -2
- package/Misc/textureTools.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +0 -1
- package/PostProcesses/postProcess.js +0 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { NodeMaterialBlock } from "../nodeMaterialBlock.js";
|
|
2
|
+
import { NodeMaterialBlockConnectionPointTypes } from "../Enums/nodeMaterialBlockConnectionPointTypes.js";
|
|
3
|
+
import { NodeMaterialBlockTargets } from "../Enums/nodeMaterialBlockTargets.js";
|
|
4
|
+
import { RegisterClass } from "../../../Misc/typeStore.js";
|
|
5
|
+
import { LoopBlock } from "./loopBlock.js";
|
|
6
|
+
import { NodeMaterialConnectionPointCustomObject } from "../nodeMaterialConnectionPointCustomObject.js";
|
|
7
|
+
/**
|
|
8
|
+
* Block used to write to a variable within a loop
|
|
9
|
+
*/
|
|
10
|
+
export class StorageWriteBlock extends NodeMaterialBlock {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new StorageWriteBlock
|
|
13
|
+
* @param name defines the block name
|
|
14
|
+
*/
|
|
15
|
+
constructor(name) {
|
|
16
|
+
super(name, NodeMaterialBlockTargets.Neutral);
|
|
17
|
+
this.registerInput("loopID", NodeMaterialBlockConnectionPointTypes.Object, false, undefined, new NodeMaterialConnectionPointCustomObject("loopID", this, 0 /* NodeMaterialConnectionPointDirection.Input */, LoopBlock, "LoopBlock"));
|
|
18
|
+
this.registerInput("value", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
19
|
+
this._linkConnectionTypes(0, 1);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current class name
|
|
23
|
+
* @returns the class name
|
|
24
|
+
*/
|
|
25
|
+
getClassName() {
|
|
26
|
+
return "StorageWriteBlock";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Gets the loop link component
|
|
30
|
+
*/
|
|
31
|
+
get loopID() {
|
|
32
|
+
return this._inputs[0];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Gets the value component
|
|
36
|
+
*/
|
|
37
|
+
get value() {
|
|
38
|
+
return this._inputs[1];
|
|
39
|
+
}
|
|
40
|
+
/** Gets a boolean indicating that this connection will be used in the fragment shader
|
|
41
|
+
* @returns true if connected in fragment shader
|
|
42
|
+
*/
|
|
43
|
+
isConnectedInFragmentShader() {
|
|
44
|
+
if (!this.loopID.isConnected) {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
const loopBlock = this.loopID.connectedPoint.ownerBlock;
|
|
48
|
+
return loopBlock.output.isConnectedInFragmentShader;
|
|
49
|
+
}
|
|
50
|
+
_buildBlock(state) {
|
|
51
|
+
super._buildBlock(state);
|
|
52
|
+
const value = this.value;
|
|
53
|
+
if (!this.loopID.isConnected) {
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
const loopBlock = this.loopID.connectedPoint.ownerBlock;
|
|
57
|
+
state.compilationString += `${loopBlock.output.associatedVariableName} = ${value.associatedVariableName};\n`;
|
|
58
|
+
return this;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
RegisterClass("BABYLON.StorageWriteBlock", StorageWriteBlock);
|
|
62
|
+
//# sourceMappingURL=storageWriteBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storageWriteBlock.js","sourceRoot":"","sources":["../../../../../../dev/core/src/Materials/Node/Blocks/storageWriteBlock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAGvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,uCAAuC,EAAE,MAAM,4CAA4C,CAAC;AACrG;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,iBAAiB;IACpD;;;OAGG;IACH,YAAmB,IAAY;QAC3B,KAAK,CAAC,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE9C,IAAI,CAAC,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AAC;CACJ;AAED,aAAa,CAAC,2BAA2B,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from \"../nodeMaterialBlock\";\r\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes\";\r\nimport type { NodeMaterialBuildState } from \"../nodeMaterialBuildState\";\r\nimport { NodeMaterialConnectionPointDirection, type NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets\";\r\nimport { RegisterClass } from \"../../../Misc/typeStore\";\r\nimport { LoopBlock } from \"./loopBlock\";\r\nimport { NodeMaterialConnectionPointCustomObject } from \"../nodeMaterialConnectionPointCustomObject\";\r\n/**\r\n * Block used to write to a variable within a loop\r\n */\r\nexport class StorageWriteBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new StorageWriteBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name, NodeMaterialBlockTargets.Neutral);\r\n\r\n this.registerInput(\r\n \"loopID\",\r\n NodeMaterialBlockConnectionPointTypes.Object,\r\n false,\r\n undefined,\r\n new NodeMaterialConnectionPointCustomObject(\"loopID\", this, NodeMaterialConnectionPointDirection.Input, LoopBlock, \"LoopBlock\")\r\n );\r\n this.registerInput(\"value\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public override getClassName() {\r\n return \"StorageWriteBlock\";\r\n }\r\n\r\n /**\r\n * Gets the loop link component\r\n */\r\n public get loopID(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the value component\r\n */\r\n public get value(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /** Gets a boolean indicating that this connection will be used in the fragment shader\r\n * @returns true if connected in fragment shader\r\n */\r\n public override isConnectedInFragmentShader() {\r\n if (!this.loopID.isConnected) {\r\n return false;\r\n }\r\n const loopBlock = this.loopID.connectedPoint!.ownerBlock as LoopBlock;\r\n\r\n return loopBlock.output.isConnectedInFragmentShader;\r\n }\r\n\r\n protected override _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n const value = this.value;\r\n\r\n if (!this.loopID.isConnected) {\r\n return this;\r\n }\r\n\r\n const loopBlock = this.loopID.connectedPoint!.ownerBlock as LoopBlock;\r\n\r\n state.compilationString += `${loopBlock.output.associatedVariableName} = ${value.associatedVariableName};\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.StorageWriteBlock\", StorageWriteBlock);\r\n"]}
|
|
@@ -530,12 +530,7 @@ export class NodeMaterial extends PushMaterial {
|
|
|
530
530
|
}
|
|
531
531
|
this._initializeBlock(block, state, nodesToProcessForOtherBuildState, autoConfigure);
|
|
532
532
|
}
|
|
533
|
-
|
|
534
|
-
node.initialize(state);
|
|
535
|
-
if (autoConfigure) {
|
|
536
|
-
node.autoConfigure(this);
|
|
537
|
-
}
|
|
538
|
-
node._preparationId = this._buildId;
|
|
533
|
+
_attachBlock(node) {
|
|
539
534
|
if (this.attachedBlocks.indexOf(node) === -1) {
|
|
540
535
|
if (node.isUnique) {
|
|
541
536
|
const className = node.getClassName();
|
|
@@ -548,18 +543,41 @@ export class NodeMaterial extends PushMaterial {
|
|
|
548
543
|
}
|
|
549
544
|
this.attachedBlocks.push(node);
|
|
550
545
|
}
|
|
546
|
+
}
|
|
547
|
+
_initializeBlock(node, state, nodesToProcessForOtherBuildState, autoConfigure = true) {
|
|
548
|
+
node.initialize(state);
|
|
549
|
+
if (autoConfigure) {
|
|
550
|
+
node.autoConfigure(this);
|
|
551
|
+
}
|
|
552
|
+
node._preparationId = this._buildId;
|
|
553
|
+
this._attachBlock(node);
|
|
551
554
|
for (const input of node.inputs) {
|
|
552
555
|
input.associatedVariableName = "";
|
|
553
556
|
const connectedPoint = input.connectedPoint;
|
|
554
|
-
if (connectedPoint) {
|
|
557
|
+
if (connectedPoint && !connectedPoint._preventBubbleUp) {
|
|
555
558
|
const block = connectedPoint.ownerBlock;
|
|
556
559
|
if (block !== node) {
|
|
557
560
|
this._processInitializeOnLink(block, state, nodesToProcessForOtherBuildState, autoConfigure);
|
|
558
561
|
}
|
|
559
562
|
}
|
|
560
563
|
}
|
|
561
|
-
//
|
|
562
|
-
if (node.
|
|
564
|
+
// Loop
|
|
565
|
+
if (node.isLoop) {
|
|
566
|
+
// We need to keep the storage write block in the active blocks
|
|
567
|
+
const loopBlock = node;
|
|
568
|
+
if (loopBlock.loopID.hasEndpoints) {
|
|
569
|
+
for (const endpoint of loopBlock.loopID.endpoints) {
|
|
570
|
+
const block = endpoint.ownerBlock;
|
|
571
|
+
if (block.outputs.length !== 0) {
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
574
|
+
state._terminalBlocks.add(block); // Attach the storage write only
|
|
575
|
+
this._processInitializeOnLink(block, state, nodesToProcessForOtherBuildState, autoConfigure);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
else if (node.isTeleportOut) {
|
|
580
|
+
// Teleportation
|
|
563
581
|
const teleport = node;
|
|
564
582
|
if (teleport.entryPoint) {
|
|
565
583
|
this._processInitializeOnLink(teleport.entryPoint, state, nodesToProcessForOtherBuildState, autoConfigure);
|
|
@@ -573,9 +591,9 @@ export class NodeMaterial extends PushMaterial {
|
|
|
573
591
|
if (node.target === NodeMaterialBlockTargets.VertexAndFragment) {
|
|
574
592
|
node.buildId = id;
|
|
575
593
|
}
|
|
576
|
-
for (const
|
|
577
|
-
const connectedPoint =
|
|
578
|
-
if (connectedPoint) {
|
|
594
|
+
for (const input of node.inputs) {
|
|
595
|
+
const connectedPoint = input.connectedPoint;
|
|
596
|
+
if (connectedPoint && !connectedPoint._preventBubbleUp) {
|
|
579
597
|
const block = connectedPoint.ownerBlock;
|
|
580
598
|
if (block !== node) {
|
|
581
599
|
this._resetDualBlocks(block, id);
|
|
@@ -589,6 +607,19 @@ export class NodeMaterial extends PushMaterial {
|
|
|
589
607
|
this._resetDualBlocks(teleportOut.entryPoint, id);
|
|
590
608
|
}
|
|
591
609
|
}
|
|
610
|
+
else if (node.isLoop) {
|
|
611
|
+
// Loop
|
|
612
|
+
const loopBlock = node;
|
|
613
|
+
if (loopBlock.loopID.hasEndpoints) {
|
|
614
|
+
for (const endpoint of loopBlock.loopID.endpoints) {
|
|
615
|
+
const block = endpoint.ownerBlock;
|
|
616
|
+
if (block.outputs.length !== 0) {
|
|
617
|
+
continue;
|
|
618
|
+
}
|
|
619
|
+
this._resetDualBlocks(block, id);
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
}
|
|
592
623
|
}
|
|
593
624
|
/**
|
|
594
625
|
* Remove a block from the current node material
|
|
@@ -1416,6 +1447,7 @@ export class NodeMaterial extends PushMaterial {
|
|
|
1416
1447
|
this._vertexOutputNodes.length = 0;
|
|
1417
1448
|
this._fragmentOutputNodes.length = 0;
|
|
1418
1449
|
this.attachedBlocks.length = 0;
|
|
1450
|
+
this._buildIsInProgress = false;
|
|
1419
1451
|
}
|
|
1420
1452
|
/**
|
|
1421
1453
|
* Clear the current material and set it to a default state
|