@babylonjs/core 7.24.0 → 7.25.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/Animations/animation.js +3 -3
- package/Animations/animation.js.map +1 -1
- package/Audio/sound.js +13 -6
- package/Audio/sound.js.map +1 -1
- package/Audio/weightedsound.js +6 -4
- package/Audio/weightedsound.js.map +1 -1
- package/Behaviors/Meshes/followBehavior.js +3 -3
- package/Behaviors/Meshes/followBehavior.js.map +1 -1
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js +2 -2
- package/Cameras/Inputs/arcRotateCameraMouseWheelInput.js.map +1 -1
- package/Compute/computeEffect.js +4 -4
- package/Compute/computeEffect.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.js +2 -3
- package/Engines/Extensions/engine.prefilteredCubeTexture.js.map +1 -1
- package/Engines/Processors/Expressions/shaderDefineExpression.js +1 -1
- package/Engines/Processors/Expressions/shaderDefineExpression.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +2 -2
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +2 -2
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +12 -10
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/abstractEngine.js +2 -2
- package/Engines/abstractEngine.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +2 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/nativeEngine.js +3 -2
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +1 -0
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/thinEngine.js +2 -0
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.js +1 -0
- package/Engines/webgpuEngine.js.map +1 -1
- package/LensFlares/lensFlareSystem.js +2 -2
- package/LensFlares/lensFlareSystem.js.map +1 -1
- package/Loading/sceneLoader.js +3 -3
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +17 -8
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +2 -2
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +1 -2
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +2 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/powBlock.js +1 -1
- package/Materials/Node/Blocks/powBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js +3 -1
- package/Materials/Node/nodeMaterialBlockConnectionPoint.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.js +1 -2
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrSubSurfaceConfiguration.js +1 -2
- package/Materials/PBR/pbrSubSurfaceConfiguration.js.map +1 -1
- package/Materials/Textures/Filtering/hdrFiltering.d.ts +0 -2
- package/Materials/Textures/Filtering/hdrFiltering.js +12 -4
- package/Materials/Textures/Filtering/hdrFiltering.js.map +1 -1
- package/Materials/Textures/Loaders/textureLoaderManager.d.ts +14 -1
- package/Materials/Textures/Loaders/textureLoaderManager.js +50 -21
- package/Materials/Textures/Loaders/textureLoaderManager.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.d.ts +15 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +24 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/index.d.ts +6 -0
- package/Materials/Textures/index.js +8 -0
- package/Materials/Textures/index.js.map +1 -1
- package/Materials/Textures/texture.js +2 -2
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/effect.functions.js +4 -4
- package/Materials/effect.functions.js.map +1 -1
- package/Maths/math.color.js +6 -7
- package/Maths/math.color.js.map +1 -1
- package/Maths/math.path.js +5 -5
- package/Maths/math.path.js.map +1 -1
- package/Maths/math.scalar.d.ts +33 -191
- package/Maths/math.scalar.functions.d.ts +147 -0
- package/Maths/math.scalar.functions.js +247 -0
- package/Maths/math.scalar.functions.js.map +1 -1
- package/Maths/math.scalar.js +15 -303
- package/Maths/math.scalar.js.map +1 -1
- package/Meshes/Builders/decalBuilder.js +3 -3
- package/Meshes/Builders/decalBuilder.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +8 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +30 -13
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/Node/Blocks/conditionBlock.js +2 -2
- package/Meshes/Node/Blocks/conditionBlock.js.map +1 -1
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js +4 -4
- package/Meshes/Node/Blocks/geometryOptimizeBlock.js.map +1 -1
- package/Meshes/Node/Blocks/noiseBlock.js +3 -3
- package/Meshes/Node/Blocks/noiseBlock.js.map +1 -1
- package/Meshes/geodesicMesh.js +3 -3
- package/Meshes/geodesicMesh.js.map +1 -1
- package/Meshes/trailMesh.js +4 -4
- package/Meshes/trailMesh.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +7 -7
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +2 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/basis.js +2 -3
- package/Misc/basis.js.map +1 -1
- package/Misc/dds.js +9 -9
- package/Misc/dds.js.map +1 -1
- package/Misc/dumpTools.js +2 -2
- package/Misc/dumpTools.js.map +1 -1
- package/Misc/environmentTextureTools.js +4 -4
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/reflector.js +3 -3
- package/Misc/reflector.js.map +1 -1
- package/Misc/screenshotTools.d.ts +2 -1
- package/Misc/screenshotTools.js +3 -2
- package/Misc/screenshotTools.js.map +1 -1
- package/Misc/tools.d.ts +6 -3
- package/Misc/tools.js +5 -3
- package/Misc/tools.js.map +1 -1
- package/Particles/EmitterTypes/coneParticleEmitter.js +10 -10
- package/Particles/EmitterTypes/coneParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/cylinderParticleEmitter.js +9 -9
- package/Particles/EmitterTypes/cylinderParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/hemisphericParticleEmitter.js +7 -7
- package/Particles/EmitterTypes/hemisphericParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/meshParticleEmitter.js +4 -4
- package/Particles/EmitterTypes/meshParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/pointParticleEmitter.js +4 -4
- package/Particles/EmitterTypes/pointParticleEmitter.js.map +1 -1
- package/Particles/EmitterTypes/sphereParticleEmitter.js +10 -10
- package/Particles/EmitterTypes/sphereParticleEmitter.js.map +1 -1
- package/Particles/gpuParticleSystem.js +2 -2
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/pointsCloudSystem.js +8 -8
- package/Particles/pointsCloudSystem.js.map +1 -1
- package/Physics/v1/Plugins/ammoJSPlugin.js +2 -2
- package/Physics/v1/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/v2/physicsAggregate.js +2 -2
- package/Physics/v2/physicsAggregate.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/ssao2RenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js +4 -4
- package/PostProcesses/RenderPipeline/Pipelines/ssaoRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js +2 -2
- package/PostProcesses/RenderPipeline/Pipelines/standardRenderingPipeline.js.map +1 -1
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.d.ts +4 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js +6 -0
- package/PostProcesses/RenderPipeline/postProcessRenderPipeline.js.map +1 -1
- package/PostProcesses/postProcess.d.ts +4 -0
- package/PostProcesses/postProcess.js +1 -0
- package/PostProcesses/postProcess.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.d.ts +0 -2
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js +46 -3
- package/Rendering/IBLShadows/iblShadowsAccumulationPass.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.d.ts +0 -5
- package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js +33 -5
- package/Rendering/IBLShadows/iblShadowsImportanceSamplingRenderer.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.d.ts +8 -3
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js +56 -18
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.d.ts +0 -2
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js +20 -2
- package/Rendering/IBLShadows/iblShadowsSpatialBlurPass.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.d.ts +2 -14
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js +108 -36
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.d.ts +0 -2
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js +23 -11
- package/Rendering/IBLShadows/iblShadowsVoxelTracingPass.js.map +1 -1
- package/Rendering/depthPeelingRenderer.d.ts +7 -3
- package/Rendering/depthPeelingRenderer.js +38 -3
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/index.d.ts +44 -0
- package/Rendering/index.js +46 -0
- package/Rendering/index.js.map +1 -1
- package/Shaders/iblCombineVoxelGrids.fragment.d.ts +5 -0
- package/Shaders/{combineVoxelGrids.fragment.js → iblCombineVoxelGrids.fragment.js} +3 -3
- package/Shaders/iblCombineVoxelGrids.fragment.js.map +1 -0
- package/Shaders/iblGenerateVoxelMip.fragment.d.ts +5 -0
- package/Shaders/{generateVoxelMip.fragment.js → iblGenerateVoxelMip.fragment.js} +3 -3
- package/Shaders/iblGenerateVoxelMip.fragment.js.map +1 -0
- package/Shaders/iblShadowVoxelTracing.fragment.js +18 -10
- package/Shaders/iblShadowVoxelTracing.fragment.js.map +1 -1
- package/Shaders/iblShadowsImportanceSamplingDebug.fragment.js +2 -1
- package/Shaders/iblShadowsImportanceSamplingDebug.fragment.js.map +1 -1
- package/Shaders/{voxelGrid.fragment.d.ts → iblVoxelGrid.fragment.d.ts} +1 -1
- package/Shaders/{voxelGrid.fragment.js → iblVoxelGrid.fragment.js} +3 -3
- package/Shaders/iblVoxelGrid.fragment.js.map +1 -0
- package/Shaders/{voxelSlabDebug.fragment.d.ts → iblVoxelGrid.vertex.d.ts} +1 -1
- package/Shaders/{voxelGrid.vertex.js → iblVoxelGrid.vertex.js} +8 -4
- package/Shaders/iblVoxelGrid.vertex.js.map +1 -0
- package/Shaders/iblVoxelGrid2dArrayDebug.fragment.d.ts +5 -0
- package/Shaders/{voxelGrid2dArrayDebug.fragment.js → iblVoxelGrid2dArrayDebug.fragment.js} +3 -3
- package/Shaders/iblVoxelGrid2dArrayDebug.fragment.js.map +1 -0
- package/Shaders/iblVoxelGrid3dDebug.fragment.d.ts +5 -0
- package/Shaders/{voxelGrid3dDebug.fragment.js → iblVoxelGrid3dDebug.fragment.js} +3 -3
- package/Shaders/iblVoxelGrid3dDebug.fragment.js.map +1 -0
- package/Shaders/{combineVoxelGrids.fragment.d.ts → iblVoxelSlabDebug.fragment.d.ts} +1 -1
- package/Shaders/{voxelSlabDebug.fragment.js → iblVoxelSlabDebug.fragment.js} +3 -3
- package/Shaders/iblVoxelSlabDebug.fragment.js.map +1 -0
- package/Shaders/iblVoxelSlabDebug.vertex.d.ts +5 -0
- package/Shaders/{voxelSlabDebug.vertex.js → iblVoxelSlabDebug.vertex.js} +3 -3
- package/Shaders/iblVoxelSlabDebug.vertex.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +7 -7
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.d.ts +5 -0
- package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.js +10 -0
- package/ShadersWGSL/copyTexture3DLayerToTexture.fragment.js.map +1 -0
- package/ShadersWGSL/default.fragment.js +4 -0
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/hdrFiltering.fragment.d.ts +9 -0
- package/ShadersWGSL/hdrFiltering.fragment.js +18 -0
- package/ShadersWGSL/hdrFiltering.fragment.js.map +1 -0
- package/ShadersWGSL/hdrFiltering.vertex.d.ts +5 -0
- package/ShadersWGSL/hdrFiltering.vertex.js +16 -0
- package/ShadersWGSL/hdrFiltering.vertex.js.map +1 -0
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.d.ts +5 -0
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js +10 -0
- package/ShadersWGSL/iblCombineVoxelGrids.fragment.js.map +1 -0
- package/ShadersWGSL/iblGenerateVoxelMip.fragment.d.ts +5 -0
- package/ShadersWGSL/iblGenerateVoxelMip.fragment.js +26 -0
- package/ShadersWGSL/iblGenerateVoxelMip.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowAccumulation.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowAccumulation.fragment.js +24 -0
- package/ShadersWGSL/iblShadowAccumulation.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowDebug.fragment.js +16 -0
- package/ShadersWGSL/iblShadowDebug.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowGBufferDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowGBufferDebug.fragment.js +17 -0
- package/ShadersWGSL/iblShadowGBufferDebug.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowSpatialBlur.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowSpatialBlur.fragment.js +20 -0
- package/ShadersWGSL/iblShadowSpatialBlur.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js +163 -0
- package/ShadersWGSL/iblShadowVoxelTracing.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsCdfx.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsCdfx.fragment.js +12 -0
- package/ShadersWGSL/iblShadowsCdfx.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsCdfy.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsCdfy.fragment.js +33 -0
- package/ShadersWGSL/iblShadowsCdfy.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsCombine.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsCombine.fragment.js +10 -0
- package/ShadersWGSL/iblShadowsCombine.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsIcdfx.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsIcdfx.fragment.js +18 -0
- package/ShadersWGSL/iblShadowsIcdfx.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsIcdfy.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsIcdfy.fragment.js +17 -0
- package/ShadersWGSL/iblShadowsIcdfy.fragment.js.map +1 -0
- package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js +41 -0
- package/ShadersWGSL/iblShadowsImportanceSamplingDebug.fragment.js.map +1 -0
- package/{Shaders/voxelGrid3dDebug.fragment.d.ts → ShadersWGSL/iblVoxelGrid.fragment.d.ts} +1 -1
- package/ShadersWGSL/iblVoxelGrid.fragment.js +15 -0
- package/ShadersWGSL/iblVoxelGrid.fragment.js.map +1 -0
- package/ShadersWGSL/iblVoxelGrid.vertex.d.ts +5 -0
- package/ShadersWGSL/iblVoxelGrid.vertex.js +14 -0
- package/ShadersWGSL/iblVoxelGrid.vertex.js.map +1 -0
- package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js +10 -0
- package/ShadersWGSL/iblVoxelGrid2dArrayDebug.fragment.js.map +1 -0
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js +22 -0
- package/ShadersWGSL/iblVoxelGrid3dDebug.fragment.js.map +1 -0
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.d.ts +5 -0
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.js +12 -0
- package/ShadersWGSL/iblVoxelSlabDebug.fragment.js.map +1 -0
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.d.ts +5 -0
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.js +10 -0
- package/ShadersWGSL/iblVoxelSlabDebug.vertex.js.map +1 -0
- package/{Shaders/generateVoxelMip.fragment.d.ts → ShadersWGSL/oitBackBlend.fragment.d.ts} +1 -1
- package/ShadersWGSL/oitBackBlend.fragment.js +11 -0
- package/ShadersWGSL/oitBackBlend.fragment.js.map +1 -0
- package/{Shaders/voxelGrid.vertex.d.ts → ShadersWGSL/oitFinal.fragment.d.ts} +1 -1
- package/ShadersWGSL/oitFinal.fragment.js +14 -0
- package/ShadersWGSL/oitFinal.fragment.js.map +1 -0
- package/ShadersWGSL/pbr.fragment.js +17 -8
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/{Shaders/voxelSlabDebug.vertex.d.ts → ShadersWGSL/procedural.vertex.d.ts} +1 -1
- package/ShadersWGSL/procedural.vertex.js +16 -0
- package/ShadersWGSL/procedural.vertex.js.map +1 -0
- package/XR/features/WebXRHandTracking.d.ts +5 -0
- package/XR/features/WebXRHandTracking.js +34 -12
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/package.json +2 -2
- package/Shaders/combineVoxelGrids.fragment.js.map +0 -1
- package/Shaders/generateVoxelMip.fragment.js.map +0 -1
- package/Shaders/voxelGrid.fragment.js.map +0 -1
- package/Shaders/voxelGrid.vertex.js.map +0 -1
- package/Shaders/voxelGrid2dArrayDebug.fragment.d.ts +0 -5
- package/Shaders/voxelGrid2dArrayDebug.fragment.js.map +0 -1
- package/Shaders/voxelGrid3dDebug.fragment.js.map +0 -1
- package/Shaders/voxelSlabDebug.fragment.js.map +0 -1
- package/Shaders/voxelSlabDebug.vertex.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sphereParticleEmitter.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/EmitterTypes/sphereParticleEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAGj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type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { Scalar } from \"../../Maths/math.scalar\";\r\nimport type { Particle } from \"../../Particles/particle\";\r\nimport type { IParticleEmitterType } from \"./IParticleEmitterType\";\r\nimport { DeepCopier } from \"../../Misc/deepCopier\";\r\nimport type { UniformBufferEffectCommonAccessor } from \"../../Materials/uniformBufferEffectCommonAccessor\";\r\nimport type { UniformBuffer } from \"../../Materials/uniformBuffer\";\r\n/**\r\n * Particle emitter emitting particles from the inside of a sphere.\r\n * It emits the particles alongside the sphere radius. The emission direction might be randomized.\r\n */\r\nexport class SphereParticleEmitter implements IParticleEmitterType {\r\n /**\r\n * Creates a new instance SphereParticleEmitter\r\n * @param radius the radius of the emission sphere (1 by default)\r\n * @param radiusRange the range of the emission sphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param directionRandomizer defines how much to randomize the particle direction [0-1]\r\n */\r\n constructor(\r\n /**\r\n * [1] The radius of the emission sphere.\r\n */\r\n public radius = 1,\r\n /**\r\n * [1] The range of emission [0-1] 0 Surface only, 1 Entire Radius.\r\n */\r\n public radiusRange = 1,\r\n /**\r\n * [0] How much to randomize the particle direction [0-1].\r\n */\r\n public directionRandomizer = 0\r\n ) {}\r\n\r\n /**\r\n * Called by the particle System when the direction is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param directionToUpdate is the direction vector to update with the result\r\n * @param particle is the particle we are computed the direction for\r\n * @param isLocal defines if the direction should be set in local space\r\n */\r\n public startDirectionFunction(worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle, isLocal: boolean): void {\r\n const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize();\r\n const randX = Scalar.RandomRange(0, this.directionRandomizer);\r\n const randY = Scalar.RandomRange(0, this.directionRandomizer);\r\n const randZ = Scalar.RandomRange(0, this.directionRandomizer);\r\n direction.x += randX;\r\n direction.y += randY;\r\n direction.z += randZ;\r\n direction.normalize();\r\n\r\n if (isLocal) {\r\n directionToUpdate.copyFrom(direction);\r\n return;\r\n }\r\n\r\n Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);\r\n }\r\n\r\n /**\r\n * Called by the particle System when the position is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param positionToUpdate is the position vector to update with the result\r\n * @param particle is the particle we are computed the position for\r\n * @param isLocal defines if the position should be set in local space\r\n */\r\n public startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle, isLocal: boolean): void {\r\n const randRadius = this.radius - Scalar.RandomRange(0, this.radius * this.radiusRange);\r\n const v = Scalar.RandomRange(0, 1.0);\r\n const phi = Scalar.RandomRange(0, 2 * Math.PI);\r\n const theta = Math.acos(2 * v - 1);\r\n const randX = randRadius * Math.cos(phi) * Math.sin(theta);\r\n const randY = randRadius * Math.cos(theta);\r\n const randZ = randRadius * Math.sin(phi) * Math.sin(theta);\r\n\r\n if (isLocal) {\r\n positionToUpdate.copyFromFloats(randX, randY, randZ);\r\n return;\r\n }\r\n\r\n Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);\r\n }\r\n\r\n /**\r\n * Clones the current emitter and returns a copy of it\r\n * @returns the new emitter\r\n */\r\n public clone(): SphereParticleEmitter {\r\n const newOne = new SphereParticleEmitter(this.radius, this.directionRandomizer);\r\n\r\n DeepCopier.DeepCopy(this, newOne);\r\n\r\n return newOne;\r\n }\r\n\r\n /**\r\n * Called by the GPUParticleSystem to setup the update shader\r\n * @param uboOrEffect defines the update shader\r\n */\r\n public applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void {\r\n uboOrEffect.setFloat(\"radius\", this.radius);\r\n uboOrEffect.setFloat(\"radiusRange\", this.radiusRange);\r\n uboOrEffect.setFloat(\"directionRandomizer\", this.directionRandomizer);\r\n }\r\n\r\n /**\r\n * Creates the structure of the ubo for this particle emitter\r\n * @param ubo ubo to create the structure for\r\n */\r\n public buildUniformLayout(ubo: UniformBuffer): void {\r\n ubo.addUniform(\"radius\", 1);\r\n ubo.addUniform(\"radiusRange\", 1);\r\n ubo.addUniform(\"directionRandomizer\", 1);\r\n }\r\n\r\n /**\r\n * Returns a string to use to update the GPU particles update shader\r\n * @returns a string containing the defines string\r\n */\r\n public getEffectDefines(): string {\r\n return \"#define SPHEREEMITTER\";\r\n }\r\n\r\n /**\r\n * Returns the string \"SphereParticleEmitter\"\r\n * @returns a string containing the class name\r\n */\r\n public getClassName(): string {\r\n return \"SphereParticleEmitter\";\r\n }\r\n\r\n /**\r\n * Serializes the particle system to a JSON object.\r\n * @returns the JSON object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n serializationObject.type = this.getClassName();\r\n serializationObject.radius = this.radius;\r\n serializationObject.radiusRange = this.radiusRange;\r\n serializationObject.directionRandomizer = this.directionRandomizer;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parse properties from a JSON object\r\n * @param serializationObject defines the JSON object\r\n */\r\n public parse(serializationObject: any): void {\r\n this.radius = serializationObject.radius;\r\n this.radiusRange = serializationObject.radiusRange;\r\n this.directionRandomizer = serializationObject.directionRandomizer;\r\n }\r\n}\r\n\r\n/**\r\n * Particle emitter emitting particles from the inside of a sphere.\r\n * It emits the particles randomly between two vectors.\r\n */\r\nexport class SphereDirectedParticleEmitter extends SphereParticleEmitter {\r\n /**\r\n * Creates a new instance SphereDirectedParticleEmitter\r\n * @param radius the radius of the emission sphere (1 by default)\r\n * @param direction1 the min limit of the emission direction (up vector by default)\r\n * @param direction2 the max limit of the emission direction (up vector by default)\r\n */\r\n constructor(\r\n radius = 1,\r\n /**\r\n * [Up vector] The min limit of the emission direction.\r\n */\r\n public direction1 = new Vector3(0, 1, 0),\r\n /**\r\n * [Up vector] The max limit of the emission direction.\r\n */\r\n public direction2 = new Vector3(0, 1, 0)\r\n ) {\r\n super(radius);\r\n }\r\n\r\n /**\r\n * Called by the particle System when the direction is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param directionToUpdate is the direction vector to update with the result\r\n */\r\n public override startDirectionFunction(worldMatrix: Matrix, directionToUpdate: Vector3): void {\r\n const randX = Scalar.RandomRange(this.direction1.x, this.direction2.x);\r\n const randY = Scalar.RandomRange(this.direction1.y, this.direction2.y);\r\n const randZ = Scalar.RandomRange(this.direction1.z, this.direction2.z);\r\n Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);\r\n }\r\n\r\n /**\r\n * Clones the current emitter and returns a copy of it\r\n * @returns the new emitter\r\n */\r\n public override clone(): SphereDirectedParticleEmitter {\r\n const newOne = new SphereDirectedParticleEmitter(this.radius, this.direction1, this.direction2);\r\n\r\n DeepCopier.DeepCopy(this, newOne);\r\n\r\n return newOne;\r\n }\r\n\r\n /**\r\n * Called by the GPUParticleSystem to setup the update shader\r\n * @param uboOrEffect defines the update shader\r\n */\r\n public override applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void {\r\n uboOrEffect.setFloat(\"radius\", this.radius);\r\n uboOrEffect.setFloat(\"radiusRange\", this.radiusRange);\r\n uboOrEffect.setVector3(\"direction1\", this.direction1);\r\n uboOrEffect.setVector3(\"direction2\", this.direction2);\r\n }\r\n\r\n /**\r\n * Creates the structure of the ubo for this particle emitter\r\n * @param ubo ubo to create the structure for\r\n */\r\n public override buildUniformLayout(ubo: UniformBuffer): void {\r\n ubo.addUniform(\"radius\", 1);\r\n ubo.addUniform(\"radiusRange\", 1);\r\n ubo.addUniform(\"direction1\", 3);\r\n ubo.addUniform(\"direction2\", 3);\r\n }\r\n\r\n /**\r\n * Returns a string to use to update the GPU particles update shader\r\n * @returns a string containing the defines string\r\n */\r\n public override getEffectDefines(): string {\r\n return \"#define SPHEREEMITTER\\n#define DIRECTEDSPHEREEMITTER\";\r\n }\r\n\r\n /**\r\n * Returns the string \"SphereDirectedParticleEmitter\"\r\n * @returns a string containing the class name\r\n */\r\n public override getClassName(): string {\r\n return \"SphereDirectedParticleEmitter\";\r\n }\r\n\r\n /**\r\n * Serializes the particle system to a JSON object.\r\n * @returns the JSON object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.direction1 = this.direction1.asArray();\r\n serializationObject.direction2 = this.direction2.asArray();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parse properties from a JSON object\r\n * @param serializationObject defines the JSON object\r\n */\r\n public override parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this.direction1.copyFrom(serializationObject.direction1);\r\n this.direction2.copyFrom(serializationObject.direction2);\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"sphereParticleEmitter.js","sourceRoot":"","sources":["../../../../../dev/core/src/Particles/EmitterTypes/sphereParticleEmitter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAGnD;;;GAGG;AACH,MAAM,OAAO,qBAAqB;IAC9B;;;;;OAKG;IACH;IACI;;OAEG;IACI,SAAS,CAAC;IACjB;;OAEG;IACI,cAAc,CAAC;IACtB;;OAEG;IACI,sBAAsB,CAAC;QARvB,WAAM,GAAN,MAAM,CAAI;QAIV,gBAAW,GAAX,WAAW,CAAI;QAIf,wBAAmB,GAAnB,mBAAmB,CAAI;IAC/B,CAAC;IAEJ;;;;;;OAMG;IACI,sBAAsB,CAAC,WAAmB,EAAE,iBAA0B,EAAE,QAAkB,EAAE,OAAgB;QAC/G,MAAM,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,CAAC;QACvF,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;Q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ACrB,MAAM,mBAAmB,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;QAE9C,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAC3D,mBAAmB,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QAE3D,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAED;;;OAGG;IACa,KAAK,CAAC,mBAAwB;QAC1C,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACjC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;QACzD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IAC7D,CAAC;CACJ","sourcesContent":["import type { Matrix } from \"../../Maths/math.vector\";\r\nimport { Vector3 } from \"../../Maths/math.vector\";\r\nimport { RandomRange } from \"../../Maths/math.scalar.functions\";\r\nimport type { Particle } from \"../../Particles/particle\";\r\nimport type { IParticleEmitterType } from \"./IParticleEmitterType\";\r\nimport { DeepCopier } from \"../../Misc/deepCopier\";\r\nimport type { UniformBufferEffectCommonAccessor } from \"../../Materials/uniformBufferEffectCommonAccessor\";\r\nimport type { UniformBuffer } from \"../../Materials/uniformBuffer\";\r\n/**\r\n * Particle emitter emitting particles from the inside of a sphere.\r\n * It emits the particles alongside the sphere radius. The emission direction might be randomized.\r\n */\r\nexport class SphereParticleEmitter implements IParticleEmitterType {\r\n /**\r\n * Creates a new instance SphereParticleEmitter\r\n * @param radius the radius of the emission sphere (1 by default)\r\n * @param radiusRange the range of the emission sphere [0-1] 0 Surface only, 1 Entire Radius (1 by default)\r\n * @param directionRandomizer defines how much to randomize the particle direction [0-1]\r\n */\r\n constructor(\r\n /**\r\n * [1] The radius of the emission sphere.\r\n */\r\n public radius = 1,\r\n /**\r\n * [1] The range of emission [0-1] 0 Surface only, 1 Entire Radius.\r\n */\r\n public radiusRange = 1,\r\n /**\r\n * [0] How much to randomize the particle direction [0-1].\r\n */\r\n public directionRandomizer = 0\r\n ) {}\r\n\r\n /**\r\n * Called by the particle System when the direction is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param directionToUpdate is the direction vector to update with the result\r\n * @param particle is the particle we are computed the direction for\r\n * @param isLocal defines if the direction should be set in local space\r\n */\r\n public startDirectionFunction(worldMatrix: Matrix, directionToUpdate: Vector3, particle: Particle, isLocal: boolean): void {\r\n const direction = particle.position.subtract(worldMatrix.getTranslation()).normalize();\r\n const randX = RandomRange(0, this.directionRandomizer);\r\n const randY = RandomRange(0, this.directionRandomizer);\r\n const randZ = RandomRange(0, this.directionRandomizer);\r\n direction.x += randX;\r\n direction.y += randY;\r\n direction.z += randZ;\r\n direction.normalize();\r\n\r\n if (isLocal) {\r\n directionToUpdate.copyFrom(direction);\r\n return;\r\n }\r\n\r\n Vector3.TransformNormalFromFloatsToRef(direction.x, direction.y, direction.z, worldMatrix, directionToUpdate);\r\n }\r\n\r\n /**\r\n * Called by the particle System when the position is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param positionToUpdate is the position vector to update with the result\r\n * @param particle is the particle we are computed the position for\r\n * @param isLocal defines if the position should be set in local space\r\n */\r\n public startPositionFunction(worldMatrix: Matrix, positionToUpdate: Vector3, particle: Particle, isLocal: boolean): void {\r\n const randRadius = this.radius - RandomRange(0, this.radius * this.radiusRange);\r\n const v = RandomRange(0, 1.0);\r\n const phi = RandomRange(0, 2 * Math.PI);\r\n const theta = Math.acos(2 * v - 1);\r\n const randX = randRadius * Math.cos(phi) * Math.sin(theta);\r\n const randY = randRadius * Math.cos(theta);\r\n const randZ = randRadius * Math.sin(phi) * Math.sin(theta);\r\n\r\n if (isLocal) {\r\n positionToUpdate.copyFromFloats(randX, randY, randZ);\r\n return;\r\n }\r\n\r\n Vector3.TransformCoordinatesFromFloatsToRef(randX, randY, randZ, worldMatrix, positionToUpdate);\r\n }\r\n\r\n /**\r\n * Clones the current emitter and returns a copy of it\r\n * @returns the new emitter\r\n */\r\n public clone(): SphereParticleEmitter {\r\n const newOne = new SphereParticleEmitter(this.radius, this.directionRandomizer);\r\n\r\n DeepCopier.DeepCopy(this, newOne);\r\n\r\n return newOne;\r\n }\r\n\r\n /**\r\n * Called by the GPUParticleSystem to setup the update shader\r\n * @param uboOrEffect defines the update shader\r\n */\r\n public applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void {\r\n uboOrEffect.setFloat(\"radius\", this.radius);\r\n uboOrEffect.setFloat(\"radiusRange\", this.radiusRange);\r\n uboOrEffect.setFloat(\"directionRandomizer\", this.directionRandomizer);\r\n }\r\n\r\n /**\r\n * Creates the structure of the ubo for this particle emitter\r\n * @param ubo ubo to create the structure for\r\n */\r\n public buildUniformLayout(ubo: UniformBuffer): void {\r\n ubo.addUniform(\"radius\", 1);\r\n ubo.addUniform(\"radiusRange\", 1);\r\n ubo.addUniform(\"directionRandomizer\", 1);\r\n }\r\n\r\n /**\r\n * Returns a string to use to update the GPU particles update shader\r\n * @returns a string containing the defines string\r\n */\r\n public getEffectDefines(): string {\r\n return \"#define SPHEREEMITTER\";\r\n }\r\n\r\n /**\r\n * Returns the string \"SphereParticleEmitter\"\r\n * @returns a string containing the class name\r\n */\r\n public getClassName(): string {\r\n return \"SphereParticleEmitter\";\r\n }\r\n\r\n /**\r\n * Serializes the particle system to a JSON object.\r\n * @returns the JSON object\r\n */\r\n public serialize(): any {\r\n const serializationObject: any = {};\r\n serializationObject.type = this.getClassName();\r\n serializationObject.radius = this.radius;\r\n serializationObject.radiusRange = this.radiusRange;\r\n serializationObject.directionRandomizer = this.directionRandomizer;\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parse properties from a JSON object\r\n * @param serializationObject defines the JSON object\r\n */\r\n public parse(serializationObject: any): void {\r\n this.radius = serializationObject.radius;\r\n this.radiusRange = serializationObject.radiusRange;\r\n this.directionRandomizer = serializationObject.directionRandomizer;\r\n }\r\n}\r\n\r\n/**\r\n * Particle emitter emitting particles from the inside of a sphere.\r\n * It emits the particles randomly between two vectors.\r\n */\r\nexport class SphereDirectedParticleEmitter extends SphereParticleEmitter {\r\n /**\r\n * Creates a new instance SphereDirectedParticleEmitter\r\n * @param radius the radius of the emission sphere (1 by default)\r\n * @param direction1 the min limit of the emission direction (up vector by default)\r\n * @param direction2 the max limit of the emission direction (up vector by default)\r\n */\r\n constructor(\r\n radius = 1,\r\n /**\r\n * [Up vector] The min limit of the emission direction.\r\n */\r\n public direction1 = new Vector3(0, 1, 0),\r\n /**\r\n * [Up vector] The max limit of the emission direction.\r\n */\r\n public direction2 = new Vector3(0, 1, 0)\r\n ) {\r\n super(radius);\r\n }\r\n\r\n /**\r\n * Called by the particle System when the direction is computed for the created particle.\r\n * @param worldMatrix is the world matrix of the particle system\r\n * @param directionToUpdate is the direction vector to update with the result\r\n */\r\n public override startDirectionFunction(worldMatrix: Matrix, directionToUpdate: Vector3): void {\r\n const randX = RandomRange(this.direction1.x, this.direction2.x);\r\n const randY = RandomRange(this.direction1.y, this.direction2.y);\r\n const randZ = RandomRange(this.direction1.z, this.direction2.z);\r\n Vector3.TransformNormalFromFloatsToRef(randX, randY, randZ, worldMatrix, directionToUpdate);\r\n }\r\n\r\n /**\r\n * Clones the current emitter and returns a copy of it\r\n * @returns the new emitter\r\n */\r\n public override clone(): SphereDirectedParticleEmitter {\r\n const newOne = new SphereDirectedParticleEmitter(this.radius, this.direction1, this.direction2);\r\n\r\n DeepCopier.DeepCopy(this, newOne);\r\n\r\n return newOne;\r\n }\r\n\r\n /**\r\n * Called by the GPUParticleSystem to setup the update shader\r\n * @param uboOrEffect defines the update shader\r\n */\r\n public override applyToShader(uboOrEffect: UniformBufferEffectCommonAccessor): void {\r\n uboOrEffect.setFloat(\"radius\", this.radius);\r\n uboOrEffect.setFloat(\"radiusRange\", this.radiusRange);\r\n uboOrEffect.setVector3(\"direction1\", this.direction1);\r\n uboOrEffect.setVector3(\"direction2\", this.direction2);\r\n }\r\n\r\n /**\r\n * Creates the structure of the ubo for this particle emitter\r\n * @param ubo ubo to create the structure for\r\n */\r\n public override buildUniformLayout(ubo: UniformBuffer): void {\r\n ubo.addUniform(\"radius\", 1);\r\n ubo.addUniform(\"radiusRange\", 1);\r\n ubo.addUniform(\"direction1\", 3);\r\n ubo.addUniform(\"direction2\", 3);\r\n }\r\n\r\n /**\r\n * Returns a string to use to update the GPU particles update shader\r\n * @returns a string containing the defines string\r\n */\r\n public override getEffectDefines(): string {\r\n return \"#define SPHEREEMITTER\\n#define DIRECTEDSPHEREEMITTER\";\r\n }\r\n\r\n /**\r\n * Returns the string \"SphereDirectedParticleEmitter\"\r\n * @returns a string containing the class name\r\n */\r\n public override getClassName(): string {\r\n return \"SphereDirectedParticleEmitter\";\r\n }\r\n\r\n /**\r\n * Serializes the particle system to a JSON object.\r\n * @returns the JSON object\r\n */\r\n public override serialize(): any {\r\n const serializationObject = super.serialize();\r\n\r\n serializationObject.direction1 = this.direction1.asArray();\r\n serializationObject.direction2 = this.direction2.asArray();\r\n\r\n return serializationObject;\r\n }\r\n\r\n /**\r\n * Parse properties from a JSON object\r\n * @param serializationObject defines the JSON object\r\n */\r\n public override parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this.direction1.copyFrom(serializationObject.direction1);\r\n this.direction2.copyFrom(serializationObject.direction2);\r\n }\r\n}\r\n"]}
|
|
@@ -2,7 +2,7 @@ import { FactorGradient, ColorGradient, GradientHelper } from "../Misc/gradients
|
|
|
2
2
|
import { Observable } from "../Misc/observable.js";
|
|
3
3
|
import { Vector3, Matrix, TmpVectors } from "../Maths/math.vector.js";
|
|
4
4
|
import { Color4, TmpColors } from "../Maths/math.color.js";
|
|
5
|
-
import {
|
|
5
|
+
import { Lerp } from "../Maths/math.scalar.functions.js";
|
|
6
6
|
import { VertexBuffer, Buffer } from "../Buffers/buffer.js";
|
|
7
7
|
import { BaseParticleSystem } from "./baseParticleSystem.js";
|
|
8
8
|
import { ParticleSystem } from "./particleSystem.js";
|
|
@@ -1234,7 +1234,7 @@ export class GPUParticleSystem extends BaseParticleSystem {
|
|
|
1234
1234
|
for (let x = 0; x < this._rawTextureWidth; x++) {
|
|
1235
1235
|
const ratio = x / this._rawTextureWidth;
|
|
1236
1236
|
GradientHelper.GetCurrentGradient(ratio, factorGradients, (currentGradient, nextGradient, scale) => {
|
|
1237
|
-
data[x] =
|
|
1237
|
+
data[x] = Lerp(currentGradient.factor1, nextGradient.factor1, scale);
|
|
1238
1238
|
});
|
|
1239
1239
|
}
|
|
1240
1240
|
this[textureName] = RawTexture.CreateRTexture(data, this._rawTextureWidth, 1, this._scene || this._engine, false, false, 1);
|