@babylonjs/core 7.35.2 → 7.37.0
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/Collisions/gpuPicker.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.d.ts +11 -0
- package/Engines/Extensions/engine.multiRender.js +71 -32
- package/Engines/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/Extensions/engine.rawTexture.d.ts +8 -8
- package/Engines/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/Extensions/engine.renderTarget.js +1 -13
- package/Engines/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGL/webGLRenderTargetWrapper.d.ts +2 -0
- package/Engines/WebGL/webGLRenderTargetWrapper.js +37 -7
- package/Engines/WebGL/webGLRenderTargetWrapper.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.d.ts +11 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.js +30 -11
- package/Engines/WebGPU/Extensions/engine.multiRender.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.rawTexture.d.ts +9 -9
- package/Engines/WebGPU/Extensions/engine.rawTexture.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.js +2 -5
- package/Engines/WebGPU/Extensions/engine.renderTarget.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTargetCube.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +3 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuConstants.d.ts +6 -0
- package/Engines/WebGPU/webgpuConstants.js +6 -0
- package/Engines/WebGPU/webgpuConstants.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.d.ts +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +5 -4
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +18 -0
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.js +8 -2
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.d.ts +12 -1
- package/Engines/abstractEngine.js +4 -4
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/constants.d.ts +17 -1
- package/Engines/constants.js +17 -1
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.d.ts +31 -1
- package/Engines/engine.js +17 -1
- package/Engines/engine.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +2 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/nativeEngine.js +1 -0
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.d.ts +2 -2
- package/Engines/nullEngine.js +3 -2
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +33 -1
- package/Engines/renderTargetWrapper.js +64 -4
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +13 -1
- package/Engines/thinEngine.functions.d.ts +4 -0
- package/Engines/thinEngine.functions.js +17 -0
- package/Engines/thinEngine.functions.js.map +1 -1
- package/Engines/thinEngine.js +151 -32
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +2 -0
- package/Engines/thinWebGPUEngine.js +7 -0
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +12 -3
- package/Engines/webgpuEngine.js +40 -9
- package/Engines/webgpuEngine.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/clearBlock.d.ts +8 -0
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js +22 -1
- package/FrameGraph/Node/Blocks/Textures/clearBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.d.ts +4 -9
- package/FrameGraph/Node/Blocks/inputBlock.js +15 -25
- package/FrameGraph/Node/Blocks/inputBlock.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js +10 -2
- package/FrameGraph/Node/nodeRenderGraphBlockConnectionPoint.js.map +1 -1
- package/FrameGraph/Passes/renderPass.d.ts +10 -10
- package/FrameGraph/Passes/renderPass.js +10 -10
- package/FrameGraph/Passes/renderPass.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/bloomTask.d.ts +10 -5
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js +29 -14
- package/FrameGraph/Tasks/PostProcesses/bloomTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js +4 -0
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldMergeTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.d.ts +11 -6
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js +30 -13
- package/FrameGraph/Tasks/PostProcesses/depthOfFieldTask.js.map +1 -1
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js +4 -6
- package/FrameGraph/Tasks/PostProcesses/postProcessTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.d.ts +1 -1
- package/FrameGraph/Tasks/Rendering/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +3 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +33 -32
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.d.ts +4 -2
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +8 -12
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js +13 -18
- package/FrameGraph/Tasks/Rendering/taaObjectRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/clearTextureTask.d.ts +15 -2
- package/FrameGraph/Tasks/Texture/clearTextureTask.js +17 -4
- package/FrameGraph/Tasks/Texture/clearTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js +2 -2
- package/FrameGraph/Tasks/Texture/copyToTextureTask.js.map +1 -1
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js +3 -3
- package/FrameGraph/Tasks/Texture/generateMipMapsTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +11 -74
- package/FrameGraph/frameGraph.js +12 -126
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +17 -8
- package/FrameGraph/frameGraphRenderContext.js +55 -43
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/frameGraphRenderTarget.d.ts +16 -0
- package/FrameGraph/frameGraphRenderTarget.js +67 -0
- package/FrameGraph/frameGraphRenderTarget.js.map +1 -0
- package/FrameGraph/frameGraphTask.d.ts +4 -3
- package/FrameGraph/frameGraphTask.js +41 -8
- package/FrameGraph/frameGraphTask.js.map +1 -1
- package/FrameGraph/frameGraphTextureManager.d.ts +130 -22
- package/FrameGraph/frameGraphTextureManager.js +312 -130
- package/FrameGraph/frameGraphTextureManager.js.map +1 -1
- package/FrameGraph/frameGraphTypes.d.ts +28 -13
- package/FrameGraph/frameGraphTypes.js.map +1 -1
- package/FrameGraph/index.d.ts +1 -0
- package/FrameGraph/index.js +1 -0
- package/FrameGraph/index.js.map +1 -1
- package/Helpers/environmentHelper.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/glowLayer.d.ts +1 -1
- package/Layers/glowLayer.js.map +1 -1
- package/Layers/highlightLayer.d.ts +1 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.d.ts +2 -0
- package/Materials/Node/Blocks/conditionalBlock.js +13 -0
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +12 -4
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/colorGradingTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +20 -0
- package/Materials/Textures/internalTexture.js +48 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +5 -0
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/rawCubeTexture.d.ts +2 -2
- package/Materials/Textures/rawCubeTexture.js +2 -2
- package/Materials/Textures/rawCubeTexture.js.map +1 -1
- package/Materials/Textures/rawTexture.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.d.ts +1 -1
- package/Materials/Textures/rawTexture2DArray.js +1 -1
- package/Materials/Textures/rawTexture2DArray.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/textureCreationOptions.d.ts +6 -6
- package/Materials/Textures/textureCreationOptions.js.map +1 -1
- package/Materials/drawWrapper.d.ts +6 -1
- package/Materials/drawWrapper.js +18 -2
- package/Materials/drawWrapper.js.map +1 -1
- package/Materials/effect.d.ts +6 -1
- package/Materials/effect.functions.d.ts +5 -0
- package/Materials/effect.functions.js +19 -0
- package/Materials/effect.functions.js.map +1 -1
- package/Materials/effect.js +22 -20
- package/Materials/effect.js.map +1 -1
- package/Materials/effect.webgl.functions.js +12 -4
- package/Materials/effect.webgl.functions.js.map +1 -1
- package/Maths/math.color.d.ts +16 -0
- package/Maths/math.color.js +16 -0
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.vector.d.ts +32 -0
- package/Maths/math.vector.js +32 -0
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +3 -1
- package/Meshes/Compression/dracoCompression.js +5 -2
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +2 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationXBlock.d.ts +0 -1
- package/Meshes/Node/Blocks/Matrices/rotationXBlock.js +1 -9
- package/Meshes/Node/Blocks/Matrices/rotationXBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationYBlock.d.ts +0 -1
- package/Meshes/Node/Blocks/Matrices/rotationYBlock.js +1 -9
- package/Meshes/Node/Blocks/Matrices/rotationYBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Matrices/rotationZBlock.d.ts +0 -1
- package/Meshes/Node/Blocks/Matrices/rotationZBlock.js +1 -9
- package/Meshes/Node/Blocks/Matrices/rotationZBlock.js.map +1 -1
- package/Meshes/Node/Blocks/Set/latticeBlock.js +3 -1
- package/Meshes/Node/Blocks/Set/latticeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.d.ts +2 -0
- package/Meshes/Node/Blocks/conditionBlock.js +15 -0
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryClampBlock.d.ts +4 -4
- package/Meshes/Node/Blocks/geometryClampBlock.js +16 -25
- package/Meshes/Node/Blocks/geometryClampBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryLerpBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryLerpBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryNLerpBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryNLerpBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryReplaceColorBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryReplaceColorBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryRotate2dBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryRotate2dBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js +3 -3
- package/Meshes/Node/Blocks/geometrySmoothStepBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryStepBlock.js +2 -2
- package/Meshes/Node/Blocks/geometryStepBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometry.js +1 -1
- package/Meshes/Node/nodeGeometry.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlock.d.ts +3 -1
- package/Meshes/Node/nodeGeometryBlock.js +2 -1
- package/Meshes/Node/nodeGeometryBlock.js.map +1 -1
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js +10 -2
- package/Meshes/Node/nodeGeometryBlockConnectionPoint.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +5 -3
- package/Meshes/abstractMesh.js +9 -7
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/subMesh.d.ts +5 -3
- package/Meshes/subMesh.js +9 -7
- package/Meshes/subMesh.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/dds.d.ts +1 -1
- package/Misc/dds.js.map +1 -1
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/observable.d.ts +1 -3
- package/Misc/observable.js +9 -7
- package/Misc/observable.js.map +1 -1
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +3 -0
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/textureTools.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/defaultRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.d.ts +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/bloomMergePostProcess.js.map +1 -1
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/chromaticAberrationPostProcess.js.map +1 -1
- package/PostProcesses/circleOfConfusionPostProcess.js.map +1 -1
- package/PostProcesses/convolutionPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldBlurPostProcess.js.map +1 -1
- package/PostProcesses/depthOfFieldMergePostProcess.js.map +1 -1
- package/PostProcesses/extractHighlightsPostProcess.js.map +1 -1
- package/PostProcesses/fxaaPostProcess.js.map +1 -1
- package/PostProcesses/grainPostProcess.js.map +1 -1
- package/PostProcesses/highlightsPostProcess.d.ts +1 -1
- package/PostProcesses/highlightsPostProcess.js +1 -1
- package/PostProcesses/highlightsPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/motionBlurPostProcess.js.map +1 -1
- package/PostProcesses/passPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +1 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/screenSpaceCurvaturePostProcess.js.map +1 -1
- package/PostProcesses/screenSpaceReflectionPostProcess.js.map +1 -1
- package/PostProcesses/sharpenPostProcess.js.map +1 -1
- package/PostProcesses/subSurfaceScatteringPostProcess.js.map +1 -1
- package/PostProcesses/tonemapPostProcess.d.ts +1 -1
- package/PostProcesses/tonemapPostProcess.js +1 -1
- package/PostProcesses/tonemapPostProcess.js.map +1 -1
- package/PostProcesses/volumetricLightScatteringPostProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
- package/Rendering/prePassRenderer.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +4 -3
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { _processShaderCode, createAndPreparePipelineContext } from "./effect.functions.js";
|
|
2
|
-
import { _executeWhenRenderingStateIsCompiled, _preparePipelineContext, createPipelineContext, getStateObject } from "../Engines/thinEngine.functions.js";
|
|
1
|
+
import { _processShaderCode, _retryWithInterval, createAndPreparePipelineContext } from "./effect.functions.js";
|
|
2
|
+
import { _executeWhenRenderingStateIsCompiled, _isRenderingStateCompiled, _preparePipelineContext, createPipelineContext, getStateObject } from "../Engines/thinEngine.functions.js";
|
|
3
3
|
import { _getGlobalDefines } from "../Engines/abstractEngine.functions.js";
|
|
4
4
|
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
5
|
+
import { WebGL2ShaderProcessor } from "../Engines/WebGL/webGL2ShaderProcessors.js";
|
|
5
6
|
/**
|
|
6
7
|
* Generate a pipeline context from the provided options
|
|
7
8
|
* Note - at the moment only WebGL is supported
|
|
@@ -26,7 +27,8 @@ export async function generatePipelineContext(options, context, createPipelineCo
|
|
|
26
27
|
break;
|
|
27
28
|
case "WEBGL2":
|
|
28
29
|
default:
|
|
29
|
-
|
|
30
|
+
// default to WebGL2, which is included in the package. Avoid async-load the default.
|
|
31
|
+
processor = new WebGL2ShaderProcessor();
|
|
30
32
|
break;
|
|
31
33
|
}
|
|
32
34
|
}
|
|
@@ -67,7 +69,13 @@ export async function generatePipelineContext(options, context, createPipelineCo
|
|
|
67
69
|
transformFeedbackVaryings: null,
|
|
68
70
|
...options.extendedCreatePipelineOptions,
|
|
69
71
|
}, createPipelineContextInjection, _preparePipelineContext, _executeWhenRenderingStateIsCompiled);
|
|
70
|
-
resolve
|
|
72
|
+
// the default behavior so far. If not async or no request to wait for isReady, resolve immediately
|
|
73
|
+
if (!options.waitForIsReady || !pipeline.isAsync) {
|
|
74
|
+
resolve(pipeline);
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
_retryWithInterval(() => _isRenderingStateCompiled(pipeline, context), () => resolve(pipeline), () => reject(new Error("Timeout while waiting for pipeline to be ready")));
|
|
78
|
+
}
|
|
71
79
|
}
|
|
72
80
|
catch (e) {
|
|
73
81
|
reject(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"effect.webgl.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/effect.webgl.functions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"effect.webgl.functions.js","sourceRoot":"","sources":["../../../../dev/core/src/Materials/effect.webgl.functions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAC;AAE7G,OAAO,EAAE,oCAAoC,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,cAAc,EAAE,2CAA0C;AAEpL,OAAO,EAAE,iBAAiB,EAAE,+CAA8C;AAE1E,OAAO,EAAE,WAAW,EAAE,kCAAiC;AACvD,OAAO,EAAE,qBAAqB,EAAE,mDAAkD;AAElF;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CACzC,OAAmC,EACnC,OAAuD,EACvD,iCAAwF,qBAAqB,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,EACjI,mCAA4F,uBAAuB;IAEnH,oCAAoC;IACpC,cAAc,CAAC,OAAO,CAAC,CAAC;IACxB,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,QAAQ,CAAC;IACtD,IAAI,SAAS,GAAG,OAAO,CAAC,yBAAyB,EAAE,SAAS,CAAC;IAC7D,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc,+BAAuB,CAAC;IAC/D,8CAA8C;IAC9C,+EAA+E;IAC/E,IAAI,CAAC,SAAS,EAAE,CAAC;Q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,CAAC,CAAC,CAC5E,CAAC;oBACN,CAAC;gBACL,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACT,MAAM,CAAC,CAAC,CAAC,CAAC;gBACd,CAAC;YACL,CAAC,EACD,QAAQ,CACX,CAAC;QACN,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACT,MAAM,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC","sourcesContent":["import type { AbstractEngine } from \"core/Engines/abstractEngine\";\r\nimport type { IPipelineGenerationOptions } from \"./effect.functions\";\r\nimport { _processShaderCode, _retryWithInterval, createAndPreparePipelineContext } from \"./effect.functions\";\r\nimport type { IPipelineContext } from \"core/Engines/IPipelineContext\";\r\nimport { _executeWhenRenderingStateIsCompiled, _isRenderingStateCompiled, _preparePipelineContext, createPipelineContext, getStateObject } from \"core/Engines/thinEngine.functions\";\r\nimport { ShaderLanguage } from \"./shaderLanguage\";\r\nimport { _getGlobalDefines } from \"core/Engines/abstractEngine.functions\";\r\nimport type { ProcessingOptions } from \"core/Engines/Processors/shaderProcessingOptions\";\r\nimport { ShaderStore } from \"core/Engines/shaderStore\";\r\nimport { WebGL2ShaderProcessor } from \"core/Engines/WebGL/webGL2ShaderProcessors\";\r\n\r\n/**\r\n * Generate a pipeline context from the provided options\r\n * Note - at the moment only WebGL is supported\r\n * @param options the options to be used when generating the pipeline\r\n * @param context the context to be used when creating the pipeline\r\n * @param createPipelineContextInjection the function to create the pipeline context\r\n * @param _preparePipelineContextInjection the function to prepare the pipeline context\r\n * @returns a promise that resolves to the pipeline context\r\n */\r\nexport async function generatePipelineContext(\r\n options: IPipelineGenerationOptions,\r\n context: WebGL2RenderingContext | WebGLRenderingContext,\r\n createPipelineContextInjection: typeof AbstractEngine.prototype.createPipelineContext = createPipelineContext.bind(null, context),\r\n _preparePipelineContextInjection: typeof AbstractEngine.prototype._preparePipelineContext = _preparePipelineContext\r\n): Promise<IPipelineContext> {\r\n // make sure the state object exists\r\n getStateObject(context);\r\n const platformName = options.platformName || \"WEBGL2\";\r\n let processor = options.extendedProcessingOptions?.processor;\r\n const language = options.shaderLanguage || ShaderLanguage.GLSL;\r\n // auto-populate the processor if not provided\r\n // Note - async but can be synchronous if we load all dependencies at the start\r\n if (!processor) {\r\n switch (platformName) {\r\n case \"WEBGL1\":\r\n processor = new (await import(\"core/Engines/WebGL/webGLShaderProcessors\")).WebGLShaderProcessor();\r\n break;\r\n case \"WEBGL2\":\r\n default:\r\n // default to WebGL2, which is included in the package. Avoid async-load the default.\r\n processor = new WebGL2ShaderProcessor();\r\n break;\r\n }\r\n }\r\n const shaderDef: any = options.shaderNameOrContent;\r\n const vertex = shaderDef.vertex || shaderDef.vertexSource || shaderDef;\r\n const fragment = shaderDef.fragment || shaderDef.fragmentSource || shaderDef;\r\n const globalDefines = _getGlobalDefines()?.split(\"\\n\") || [];\r\n const defines = [...(options.defines || []), ...(options.addGlobalDefines ? globalDefines : [])];\r\n const key = options.key?.replace(/\\r/g, \"\").replace(/\\n/g, \"|\") || vertex + \"+\" + fragment + \"@\" + defines.join(\"|\");\r\n // defaults, extended with optionally provided options\r\n const processorOptions: ProcessingOptions = {\r\n defines,\r\n indexParameters: undefined,\r\n isFragment: false,\r\n shouldUseHighPrecisionShader: true,\r\n processor,\r\n supportsUniformBuffers: false,\r\n shadersRepository: ShaderStore.GetShadersRepository(language),\r\n includesShadersStore: ShaderStore.GetIncludesShadersStore(language),\r\n version: platformName === \"WEBGL2\" ? \"200\" : \"100\",\r\n platformName,\r\n processingContext: null,\r\n isNDCHalfZRange: false,\r\n useReverseDepthBuffer: false,\r\n ...options.extendedProcessingOptions,\r\n };\r\n return new Promise((resolve, reject) => {\r\n try {\r\n _processShaderCode(\r\n processorOptions,\r\n shaderDef,\r\n undefined,\r\n function (vertexCode, fragmentCode) {\r\n try {\r\n const pipeline = createAndPreparePipelineContext(\r\n {\r\n name: key,\r\n vertex: vertexCode,\r\n fragment: fragmentCode,\r\n context,\r\n defines: defines.length ? defines.join(\"\\n\") : null,\r\n shaderProcessingContext: options.extendedProcessingOptions?.processingContext || null,\r\n transformFeedbackVaryings: null,\r\n ...options.extendedCreatePipelineOptions,\r\n },\r\n createPipelineContextInjection,\r\n _preparePipelineContext,\r\n _executeWhenRenderingStateIsCompiled\r\n );\r\n // the default behavior so far. If not async or no request to wait for isReady, resolve immediately\r\n if (!options.waitForIsReady || !pipeline.isAsync) {\r\n resolve(pipeline);\r\n } else {\r\n _retryWithInterval(\r\n () => _isRenderingStateCompiled(pipeline, context),\r\n () => resolve(pipeline),\r\n () => reject(new Error(\"Timeout while waiting for pipeline to be ready\"))\r\n );\r\n }\r\n } catch (e) {\r\n reject(e);\r\n }\r\n },\r\n language\r\n );\r\n } catch (e) {\r\n reject(e);\r\n }\r\n });\r\n}\r\n"]}
|
package/Maths/math.color.d.ts
CHANGED
|
@@ -17,6 +17,14 @@ export declare class Color3 implements Tensor<Tuple<number, 3>, IColor3Like>, IC
|
|
|
17
17
|
* [0] Defines the blue component (between 0 and 1, default is 0)
|
|
18
18
|
*/
|
|
19
19
|
b: number;
|
|
20
|
+
/**
|
|
21
|
+
* If the first color is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
|
|
22
|
+
* If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
|
|
23
|
+
* and henceforth it will use floating-point representation for all color instances that it creates.
|
|
24
|
+
* But the original color instances are unchanged and has a "deprecated map".
|
|
25
|
+
* If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
|
|
26
|
+
*/
|
|
27
|
+
static _V8PerformanceHack: DeepImmutable<Color3>;
|
|
20
28
|
/**
|
|
21
29
|
* @see Tensor.dimension
|
|
22
30
|
*/
|
|
@@ -573,6 +581,14 @@ export declare class Color4 implements Tensor<Tuple<number, 4>, IColor4Like>, IC
|
|
|
573
581
|
* [1] Defines the alpha component (between 0 and 1, default is 1)
|
|
574
582
|
*/
|
|
575
583
|
a: number;
|
|
584
|
+
/**
|
|
585
|
+
* If the first color is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
|
|
586
|
+
* If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
|
|
587
|
+
* and henceforth it will use floating-point representation for all color instances that it creates.
|
|
588
|
+
* But the original color instances are unchanged and has a "deprecated map".
|
|
589
|
+
* If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
|
|
590
|
+
*/
|
|
591
|
+
static _V8PerformanceHack: DeepImmutable<Color4>;
|
|
576
592
|
/**
|
|
577
593
|
* @see Tensor.dimension
|
|
578
594
|
*/
|
package/Maths/math.color.js
CHANGED
|
@@ -891,6 +891,14 @@ export class Color3 {
|
|
|
891
891
|
return new Color3(Math.random(), Math.random(), Math.random());
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
+
/**
|
|
895
|
+
* If the first color is flagged with integers (as everything is 0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
|
|
896
|
+
* If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
|
|
897
|
+
* and henceforth it will use floating-point representation for all color instances that it creates.
|
|
898
|
+
* But the original color instances are unchanged and has a "deprecated map".
|
|
899
|
+
* If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
|
|
900
|
+
*/
|
|
901
|
+
Color3._V8PerformanceHack = new Color3(0.5, 0.5, 0.5);
|
|
894
902
|
// Statics
|
|
895
903
|
Color3._BlackReadOnly = Color3.Black();
|
|
896
904
|
Object.defineProperties(Color3.prototype, {
|
|
@@ -1673,6 +1681,14 @@ export class Color4 {
|
|
|
1673
1681
|
return colors;
|
|
1674
1682
|
}
|
|
1675
1683
|
}
|
|
1684
|
+
/**
|
|
1685
|
+
* If the first color is flagged with integers (as everything is 0,0,0,0), V8 stores all of the properties as integers internally because it doesn't know any better yet.
|
|
1686
|
+
* If subsequent colors are created with non-integer values, V8 determines that it would be best to represent these properties as doubles instead of integers,
|
|
1687
|
+
* and henceforth it will use floating-point representation for all color instances that it creates.
|
|
1688
|
+
* But the original color instances are unchanged and has a "deprecated map".
|
|
1689
|
+
* If we keep using the color instances from step 1, it will now be a poison pill which will mess up optimizations in any code it touches.
|
|
1690
|
+
*/
|
|
1691
|
+
Color4._V8PerformanceHack = new Color4(0.5, 0.5, 0.5, 0.5);
|
|
1676
1692
|
Object.defineProperties(Color4.prototype, {
|
|
1677
1693
|
dimension: { value: [4] },
|
|
1678
1694
|
rank: { value: 1 },
|