@babylonjs/core 5.0.0-beta.3 → 5.0.0-beta.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/Actions/actionManager.d.ts +1 -1
- package/Actions/actionManager.js +5 -1
- package/Actions/actionManager.js.map +1 -1
- package/Audio/analyser.d.ts +2 -1
- package/Audio/analyser.js +5 -0
- package/Audio/analyser.js.map +1 -1
- package/Audio/audioSceneComponent.d.ts +1 -1
- package/Audio/audioSceneComponent.js +5 -0
- package/Audio/audioSceneComponent.js.map +1 -1
- package/Audio/sound.d.ts +1 -1
- package/Audio/sound.js +8 -1
- package/Audio/sound.js.map +1 -1
- package/Audio/soundTrack.d.ts +2 -1
- package/Audio/soundTrack.js +5 -0
- package/Audio/soundTrack.js.map +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.d.ts +1 -1
- package/BakedVertexAnimation/bakedVertexAnimationManager.js +5 -0
- package/BakedVertexAnimation/bakedVertexAnimationManager.js.map +1 -1
- package/Behaviors/Meshes/baseSixDofDragBehavior.js +29 -26
- package/Behaviors/Meshes/baseSixDofDragBehavior.js.map +1 -1
- package/Behaviors/Meshes/pointerDragBehavior.js +2 -0
- package/Behaviors/Meshes/pointerDragBehavior.js.map +1 -1
- package/Bones/bone.d.ts +2 -1
- package/Bones/bone.js +28 -18
- package/Bones/bone.js.map +1 -1
- package/Bones/skeleton.js +3 -3
- package/Bones/skeleton.js.map +1 -1
- package/Buffers/buffer.d.ts +4 -0
- package/Buffers/buffer.js +13 -3
- package/Buffers/buffer.js.map +1 -1
- package/Cameras/Inputs/freeCameraMouseInput.d.ts +1 -0
- package/Cameras/Inputs/freeCameraMouseInput.js +6 -3
- package/Cameras/Inputs/freeCameraMouseInput.js.map +1 -1
- package/Cameras/Inputs/freeCameraTouchInput.js +2 -4
- package/Cameras/Inputs/freeCameraTouchInput.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/anaglyphUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicArcRotateCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicFreeCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicGamepadCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicScreenUniversalCamera.js.map +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.d.ts +1 -1
- package/Cameras/Stereoscopic/stereoscopicUniversalCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationArcRotateCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationFreeCamera.js.map +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.d.ts +1 -1
- package/Cameras/VR/vrDeviceOrientationGamepadCamera.js.map +1 -1
- package/Cameras/VR/vrExperienceHelper.d.ts +1 -0
- package/Cameras/VR/vrExperienceHelper.js +1 -0
- package/Cameras/VR/vrExperienceHelper.js.map +1 -1
- package/Cameras/VR/webVRCamera.d.ts +2 -1
- package/Cameras/VR/webVRCamera.js +3 -2
- package/Cameras/VR/webVRCamera.js.map +1 -1
- package/Cameras/arcRotateCamera.d.ts +1 -1
- package/Cameras/arcRotateCamera.js.map +1 -1
- package/Cameras/camera.d.ts +1 -1
- package/Cameras/camera.js +1 -1
- package/Cameras/camera.js.map +1 -1
- package/Cameras/deviceOrientationCamera.d.ts +1 -1
- package/Cameras/deviceOrientationCamera.js.map +1 -1
- package/Cameras/flyCamera.d.ts +1 -1
- package/Cameras/flyCamera.js.map +1 -1
- package/Cameras/followCamera.d.ts +1 -1
- package/Cameras/followCamera.js.map +1 -1
- package/Cameras/freeCamera.d.ts +1 -1
- package/Cameras/freeCamera.js.map +1 -1
- package/Cameras/gamepadCamera.d.ts +1 -1
- package/Cameras/gamepadCamera.js.map +1 -1
- package/Cameras/targetCamera.d.ts +1 -1
- package/Cameras/targetCamera.js.map +1 -1
- package/Cameras/touchCamera.d.ts +1 -1
- package/Cameras/touchCamera.js.map +1 -1
- package/Cameras/universalCamera.d.ts +1 -1
- package/Cameras/universalCamera.js.map +1 -1
- package/Cameras/virtualJoysticksCamera.d.ts +1 -1
- package/Cameras/virtualJoysticksCamera.js.map +1 -1
- package/Collisions/collider.d.ts +1 -1
- package/Collisions/collider.js +48 -2
- package/Collisions/collider.js.map +1 -1
- package/Compute/computeEffect.js +2 -2
- package/Compute/computeEffect.js.map +1 -1
- package/Culling/Octrees/octreeSceneComponent.d.ts +1 -1
- package/Culling/Octrees/octreeSceneComponent.js +5 -0
- package/Culling/Octrees/octreeSceneComponent.js.map +1 -1
- package/Culling/ray.d.ts +6 -4
- package/Culling/ray.js +31 -10
- package/Culling/ray.js.map +1 -1
- package/Debug/axesViewer.d.ts +1 -1
- package/Debug/axesViewer.js +5 -0
- package/Debug/axesViewer.js.map +1 -1
- package/Debug/debugLayer.d.ts +1 -1
- package/Debug/debugLayer.js +6 -2
- package/Debug/debugLayer.js.map +1 -1
- package/Debug/physicsViewer.d.ts +1 -1
- package/Debug/physicsViewer.js +3 -0
- package/Debug/physicsViewer.js.map +1 -1
- package/DeviceInput/Helpers/eventFactory.d.ts +1 -1
- package/DeviceInput/Helpers/eventFactory.js +2 -5
- package/DeviceInput/Helpers/eventFactory.js.map +1 -1
- package/DeviceInput/InputDevices/deviceEnums.d.ts +55 -2
- package/DeviceInput/InputDevices/deviceEnums.js +54 -0
- package/DeviceInput/InputDevices/deviceEnums.js.map +1 -1
- package/DeviceInput/InputDevices/deviceSource.d.ts +35 -0
- package/DeviceInput/InputDevices/deviceSource.js +38 -0
- package/DeviceInput/InputDevices/deviceSource.js.map +1 -0
- package/DeviceInput/InputDevices/deviceSourceManager.d.ts +14 -72
- package/DeviceInput/InputDevices/deviceSourceManager.js +10 -180
- package/DeviceInput/InputDevices/deviceSourceManager.js.map +1 -1
- package/DeviceInput/InputDevices/deviceTypes.d.ts +2 -2
- package/DeviceInput/InputDevices/deviceTypes.js.map +1 -1
- package/DeviceInput/{Interfaces → InputDevices}/inputInterfaces.d.ts +1 -5
- package/DeviceInput/{Interfaces → InputDevices}/inputInterfaces.js +0 -0
- package/DeviceInput/InputDevices/inputInterfaces.js.map +1 -0
- package/DeviceInput/InputDevices/internalDeviceSourceManager.d.ts +46 -0
- package/DeviceInput/InputDevices/internalDeviceSourceManager.js +144 -0
- package/DeviceInput/InputDevices/internalDeviceSourceManager.js.map +1 -0
- package/DeviceInput/{Implementations → InputDevices}/nativeDeviceInputSystem.d.ts +3 -7
- package/DeviceInput/{Implementations → InputDevices}/nativeDeviceInputSystem.js +11 -16
- package/DeviceInput/InputDevices/nativeDeviceInputSystem.js.map +1 -0
- package/DeviceInput/{Implementations → InputDevices}/webDeviceInputSystem.d.ts +11 -15
- package/DeviceInput/{Implementations → InputDevices}/webDeviceInputSystem.js +121 -146
- package/DeviceInput/InputDevices/webDeviceInputSystem.js.map +1 -0
- package/DeviceInput/index.d.ts +1 -5
- package/DeviceInput/index.js +1 -5
- package/DeviceInput/index.js.map +1 -1
- package/Engines/Extensions/engine.cubeTexture.d.ts +1 -1
- package/Engines/Extensions/engine.cubeTexture.js +6 -2
- package/Engines/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/Extensions/engine.multiview.d.ts +5 -0
- package/Engines/Extensions/engine.multiview.js +4 -1
- package/Engines/Extensions/engine.multiview.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +3 -2
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Processors/Expressions/shaderDefineExpression.js +1 -1
- package/Engines/Processors/Expressions/shaderDefineExpression.js.map +1 -1
- package/Engines/Processors/shaderCodeInliner.js +13 -13
- package/Engines/Processors/shaderCodeInliner.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js +4 -1
- package/Engines/WebGPU/Extensions/engine.cubeTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheBindGroups.js +9 -9
- package/Engines/WebGPU/webgpuCacheBindGroups.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js +1 -1
- package/Engines/WebGPU/webgpuComputeContext.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js +13 -13
- package/Engines/WebGPU/webgpuShaderProcessorsGLSL.js.map +1 -1
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js +30 -30
- package/Engines/WebGPU/webgpuShaderProcessorsWGSL.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +13 -6
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/engine.d.ts +2 -6
- package/Engines/engine.js +1 -5
- package/Engines/engine.js.map +1 -1
- package/Engines/engineCapabilities.d.ts +4 -0
- package/Engines/engineCapabilities.js.map +1 -1
- package/Engines/nativeEngine.d.ts +1 -0
- package/Engines/nativeEngine.js +39 -12
- package/Engines/nativeEngine.js.map +1 -1
- package/Engines/nullEngine.js +3 -1
- package/Engines/nullEngine.js.map +1 -1
- package/Engines/renderTargetWrapper.d.ts +8 -0
- package/Engines/renderTargetWrapper.js +20 -0
- package/Engines/renderTargetWrapper.js.map +1 -1
- package/Engines/thinEngine.d.ts +17 -1
- package/Engines/thinEngine.js +50 -20
- package/Engines/thinEngine.js.map +1 -1
- package/Engines/webgpuEngine.d.ts +0 -4
- package/Engines/webgpuEngine.js +7 -14
- package/Engines/webgpuEngine.js.map +1 -1
- package/Gamepads/Controllers/daydreamController.js +1 -1
- package/Gamepads/Controllers/daydreamController.js.map +1 -1
- package/Gamepads/Controllers/oculusTouchController.js +2 -2
- package/Gamepads/Controllers/oculusTouchController.js.map +1 -1
- package/Gamepads/Controllers/webVRController.d.ts +1 -0
- package/Gamepads/Controllers/webVRController.js +1 -0
- package/Gamepads/Controllers/webVRController.js.map +1 -1
- package/Gamepads/gamepadManager.js +1 -1
- package/Gamepads/gamepadManager.js.map +1 -1
- package/Gizmos/gizmoManager.d.ts +2 -0
- package/Gizmos/gizmoManager.js +28 -24
- package/Gizmos/gizmoManager.js.map +1 -1
- package/Helpers/sceneHelpers.d.ts +1 -0
- package/Helpers/sceneHelpers.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +2 -2
- package/Inputs/scene.inputManager.js +11 -13
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Instrumentation/sceneInstrumentation.js +2 -2
- package/Instrumentation/sceneInstrumentation.js.map +1 -1
- package/Layers/effectLayer.d.ts +1 -1
- package/Layers/effectLayer.js +1 -1
- package/Layers/effectLayer.js.map +1 -1
- package/Layers/effectLayerSceneComponent.d.ts +1 -1
- package/Layers/effectLayerSceneComponent.js +7 -3
- package/Layers/effectLayerSceneComponent.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 +2 -1
- package/Layers/highlightLayer.js.map +1 -1
- package/Layers/layer.d.ts +2 -2
- package/Layers/layer.js.map +1 -1
- package/Layers/layerSceneComponent.d.ts +1 -1
- package/Layers/layerSceneComponent.js +7 -3
- package/Layers/layerSceneComponent.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.js +2 -2
- package/Lights/Shadows/cascadedShadowGenerator.js.map +1 -1
- package/Lights/Shadows/shadowGenerator.js +2 -2
- package/Lights/Shadows/shadowGenerator.js.map +1 -1
- package/Loading/Plugins/babylonFileLoader.js +115 -29
- package/Loading/Plugins/babylonFileLoader.js.map +1 -1
- package/Loading/loadingScreen.js +8 -8
- package/Loading/loadingScreen.js.map +1 -1
- package/Loading/sceneLoader.js +3 -3
- package/Loading/sceneLoader.js.map +1 -1
- package/Materials/Background/backgroundMaterial.d.ts +1 -1
- package/Materials/Background/backgroundMaterial.js.map +1 -1
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.d.ts +37 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js +117 -0
- package/Materials/Node/Blocks/Dual/clipPlanesBlock.js.map +1 -0
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js +12 -12
- package/Materials/Node/Blocks/Dual/currentScreenBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/fogBlock.js +5 -5
- package/Materials/Node/Blocks/Dual/fogBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js +13 -13
- package/Materials/Node/Blocks/Dual/imageSourceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/index.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/index.js +1 -0
- package/Materials/Node/Blocks/Dual/index.js.map +1 -1
- package/Materials/Node/Blocks/Dual/lightBlock.js +10 -10
- package/Materials/Node/Blocks/Dual/lightBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js +28 -28
- package/Materials/Node/Blocks/Dual/reflectionTextureBaseBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js +1 -1
- package/Materials/Node/Blocks/Dual/reflectionTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js +7 -7
- package/Materials/Node/Blocks/Dual/sceneDepthBlock.js.map +1 -1
- package/Materials/Node/Blocks/Dual/textureBlock.js +32 -32
- package/Materials/Node/Blocks/Dual/textureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js +2 -2
- package/Materials/Node/Blocks/Fragment/derivativeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/discardBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/discardBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/fragCoordBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js +10 -10
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js +7 -7
- package/Materials/Node/Blocks/Fragment/imageProcessingBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js +12 -12
- package/Materials/Node/Blocks/Fragment/perturbNormalBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js +1 -1
- package/Materials/Node/Blocks/Fragment/screenSizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js +7 -7
- package/Materials/Node/Blocks/Fragment/screenSpaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/twirlBlock.js +4 -4
- package/Materials/Node/Blocks/Fragment/twirlBlock.js.map +1 -1
- package/Materials/Node/Blocks/Input/inputBlock.d.ts +2 -1
- package/Materials/Node/Blocks/Input/inputBlock.js +29 -24
- package/Materials/Node/Blocks/Input/inputBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js +5 -5
- package/Materials/Node/Blocks/PBR/anisotropyBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js +5 -5
- package/Materials/Node/Blocks/PBR/clearCoatBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js +33 -33
- package/Materials/Node/Blocks/PBR/pbrMetallicRoughnessBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/reflectionBlock.js +11 -11
- package/Materials/Node/Blocks/PBR/reflectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/refractionBlock.js +11 -11
- package/Materials/Node/Blocks/PBR/refractionBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/sheenBlock.js +3 -3
- package/Materials/Node/Blocks/PBR/sheenBlock.js.map +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js +1 -1
- package/Materials/Node/Blocks/PBR/subSurfaceBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js +1 -1
- package/Materials/Node/Blocks/Particle/particleBlendMultiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js +1 -1
- package/Materials/Node/Blocks/Particle/particleRampGradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js +7 -7
- package/Materials/Node/Blocks/Particle/particleTextureBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/bonesBlock.js +3 -3
- package/Materials/Node/Blocks/Vertex/bonesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/instancesBlock.js +3 -3
- package/Materials/Node/Blocks/Vertex/instancesBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js +5 -5
- package/Materials/Node/Blocks/Vertex/lightInformationBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js +16 -16
- package/Materials/Node/Blocks/Vertex/morphTargetsBlock.js.map +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js +1 -1
- package/Materials/Node/Blocks/Vertex/vertexOutputBlock.js.map +1 -1
- package/Materials/Node/Blocks/addBlock.js +1 -1
- package/Materials/Node/Blocks/addBlock.js.map +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js +1 -1
- package/Materials/Node/Blocks/arcTan2Block.js.map +1 -1
- package/Materials/Node/Blocks/clampBlock.js +3 -3
- package/Materials/Node/Blocks/clampBlock.js.map +1 -1
- package/Materials/Node/Blocks/cloudBlock.js +7 -7
- package/Materials/Node/Blocks/cloudBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorMergerBlock.js +8 -8
- package/Materials/Node/Blocks/colorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/colorSplitterBlock.js +5 -5
- package/Materials/Node/Blocks/colorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/conditionalBlock.js +10 -10
- package/Materials/Node/Blocks/conditionalBlock.js.map +1 -1
- package/Materials/Node/Blocks/crossBlock.js +1 -1
- package/Materials/Node/Blocks/crossBlock.js.map +1 -1
- package/Materials/Node/Blocks/customBlock.js +1 -1
- package/Materials/Node/Blocks/customBlock.js.map +1 -1
- package/Materials/Node/Blocks/desaturateBlock.js +4 -4
- package/Materials/Node/Blocks/desaturateBlock.js.map +1 -1
- package/Materials/Node/Blocks/distanceBlock.js +1 -1
- package/Materials/Node/Blocks/distanceBlock.js.map +1 -1
- package/Materials/Node/Blocks/divideBlock.js +1 -1
- package/Materials/Node/Blocks/divideBlock.js.map +1 -1
- package/Materials/Node/Blocks/dotBlock.js +1 -1
- package/Materials/Node/Blocks/dotBlock.js.map +1 -1
- package/Materials/Node/Blocks/elbowBlock.d.ts +27 -0
- package/Materials/Node/Blocks/elbowBlock.js +60 -0
- package/Materials/Node/Blocks/elbowBlock.js.map +1 -0
- package/Materials/Node/Blocks/fresnelBlock.js +2 -2
- package/Materials/Node/Blocks/fresnelBlock.js.map +1 -1
- package/Materials/Node/Blocks/gradientBlock.js +8 -8
- package/Materials/Node/Blocks/gradientBlock.js.map +1 -1
- package/Materials/Node/Blocks/index.d.ts +1 -0
- package/Materials/Node/Blocks/index.js +1 -0
- package/Materials/Node/Blocks/index.js.map +1 -1
- package/Materials/Node/Blocks/lengthBlock.js +1 -1
- package/Materials/Node/Blocks/lengthBlock.js.map +1 -1
- package/Materials/Node/Blocks/lerpBlock.js +1 -1
- package/Materials/Node/Blocks/lerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js +1 -1
- package/Materials/Node/Blocks/matrixBuilderBlock.js.map +1 -1
- package/Materials/Node/Blocks/maxBlock.js +1 -1
- package/Materials/Node/Blocks/maxBlock.js.map +1 -1
- package/Materials/Node/Blocks/minBlock.js +1 -1
- package/Materials/Node/Blocks/minBlock.js.map +1 -1
- package/Materials/Node/Blocks/modBlock.js +1 -1
- package/Materials/Node/Blocks/modBlock.js.map +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js +1 -1
- package/Materials/Node/Blocks/multiplyBlock.js.map +1 -1
- package/Materials/Node/Blocks/nLerpBlock.js +1 -1
- package/Materials/Node/Blocks/nLerpBlock.js.map +1 -1
- package/Materials/Node/Blocks/negateBlock.js +1 -1
- package/Materials/Node/Blocks/negateBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalBlendBlock.js +5 -5
- package/Materials/Node/Blocks/normalBlendBlock.js.map +1 -1
- package/Materials/Node/Blocks/normalizeBlock.js +1 -1
- package/Materials/Node/Blocks/normalizeBlock.js.map +1 -1
- package/Materials/Node/Blocks/oneMinusBlock.js +1 -1
- package/Materials/Node/Blocks/oneMinusBlock.js.map +1 -1
- package/Materials/Node/Blocks/posterizeBlock.js +1 -1
- package/Materials/Node/Blocks/posterizeBlock.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/randomNumberBlock.js +2 -2
- package/Materials/Node/Blocks/randomNumberBlock.js.map +1 -1
- package/Materials/Node/Blocks/reciprocalBlock.js +1 -1
- package/Materials/Node/Blocks/reciprocalBlock.js.map +1 -1
- package/Materials/Node/Blocks/reflectBlock.js +1 -1
- package/Materials/Node/Blocks/reflectBlock.js.map +1 -1
- package/Materials/Node/Blocks/refractBlock.js +1 -1
- package/Materials/Node/Blocks/refractBlock.js.map +1 -1
- package/Materials/Node/Blocks/remapBlock.js +3 -3
- package/Materials/Node/Blocks/remapBlock.js.map +1 -1
- package/Materials/Node/Blocks/replaceColorBlock.js +3 -3
- package/Materials/Node/Blocks/replaceColorBlock.js.map +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.js +1 -1
- package/Materials/Node/Blocks/rotate2dBlock.js.map +1 -1
- package/Materials/Node/Blocks/scaleBlock.js +1 -1
- package/Materials/Node/Blocks/scaleBlock.js.map +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js +1 -1
- package/Materials/Node/Blocks/simplexPerlin3DBlock.js.map +1 -1
- package/Materials/Node/Blocks/smoothStepBlock.js +1 -1
- package/Materials/Node/Blocks/smoothStepBlock.js.map +1 -1
- package/Materials/Node/Blocks/stepBlock.js +1 -1
- package/Materials/Node/Blocks/stepBlock.js.map +1 -1
- package/Materials/Node/Blocks/subtractBlock.js +1 -1
- package/Materials/Node/Blocks/subtractBlock.js.map +1 -1
- package/Materials/Node/Blocks/transformBlock.js +13 -13
- package/Materials/Node/Blocks/transformBlock.js.map +1 -1
- package/Materials/Node/Blocks/trigonometryBlock.js +2 -2
- package/Materials/Node/Blocks/trigonometryBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorMergerBlock.js +22 -22
- package/Materials/Node/Blocks/vectorMergerBlock.js.map +1 -1
- package/Materials/Node/Blocks/vectorSplitterBlock.js +8 -8
- package/Materials/Node/Blocks/vectorSplitterBlock.js.map +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.js +1 -1
- package/Materials/Node/Blocks/viewDirectionBlock.js.map +1 -1
- package/Materials/Node/Blocks/voronoiNoiseBlock.js +5 -5
- package/Materials/Node/Blocks/voronoiNoiseBlock.js.map +1 -1
- package/Materials/Node/Blocks/waveBlock.js +3 -3
- package/Materials/Node/Blocks/waveBlock.js.map +1 -1
- package/Materials/Node/Blocks/worleyNoise3DBlock.js +5 -5
- package/Materials/Node/Blocks/worleyNoise3DBlock.js.map +1 -1
- package/Materials/Node/Enums/nodeMaterialSystemValues.d.ts +3 -1
- package/Materials/Node/Enums/nodeMaterialSystemValues.js +2 -0
- package/Materials/Node/Enums/nodeMaterialSystemValues.js.map +1 -1
- package/Materials/Node/nodeMaterial.d.ts +4 -0
- package/Materials/Node/nodeMaterial.js +22 -11
- package/Materials/Node/nodeMaterial.js.map +1 -1
- package/Materials/Node/nodeMaterialBlock.js +12 -12
- package/Materials/Node/nodeMaterialBlock.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +24 -24
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.js +1 -1
- package/Materials/Node/nodeMaterialBuildStateSharedData.js.map +1 -1
- package/Materials/PBR/pbrBaseMaterial.d.ts +2 -1
- package/Materials/PBR/pbrBaseMaterial.js +4 -3
- package/Materials/PBR/pbrBaseMaterial.js.map +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.d.ts +1 -1
- package/Materials/PBR/pbrBaseSimpleMaterial.js.map +1 -1
- package/Materials/PBR/pbrMaterial.d.ts +1 -1
- package/Materials/PBR/pbrMaterial.js +2 -3
- package/Materials/PBR/pbrMaterial.js.map +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.d.ts +1 -1
- package/Materials/PBR/pbrMetallicRoughnessMaterial.js.map +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.d.ts +1 -1
- package/Materials/PBR/pbrSpecularGlossinessMaterial.js.map +1 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.js +8 -1
- package/Materials/Textures/Loaders/ddsTextureLoader.js.map +1 -1
- package/Materials/Textures/Loaders/ktxTextureLoader.js +2 -2
- package/Materials/Textures/Loaders/ktxTextureLoader.js.map +1 -1
- package/Materials/Textures/MultiviewRenderTarget.d.ts +2 -1
- package/Materials/Textures/MultiviewRenderTarget.js +10 -2
- package/Materials/Textures/MultiviewRenderTarget.js.map +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js +1 -1
- package/Materials/Textures/Procedurals/proceduralTexture.js.map +1 -1
- package/Materials/Textures/baseTexture.d.ts +1 -1
- package/Materials/Textures/baseTexture.js.map +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js +1 -1
- package/Materials/Textures/equiRectangularCubeTexture.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +2 -0
- package/Materials/Textures/internalTexture.js +2 -0
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.d.ts +2 -2
- package/Materials/Textures/mirrorTexture.js +7 -3
- package/Materials/Textures/mirrorTexture.js.map +1 -1
- package/Materials/Textures/multiRenderTarget.d.ts +1 -1
- package/Materials/Textures/multiRenderTarget.js.map +1 -1
- package/Materials/Textures/prePassRenderTarget.d.ts +1 -1
- package/Materials/Textures/prePassRenderTarget.js.map +1 -1
- package/Materials/Textures/refractionTexture.d.ts +1 -1
- package/Materials/Textures/refractionTexture.js +2 -2
- package/Materials/Textures/refractionTexture.js.map +1 -1
- package/Materials/Textures/renderTargetTexture.d.ts +1 -1
- package/Materials/Textures/renderTargetTexture.js +2 -2
- package/Materials/Textures/renderTargetTexture.js.map +1 -1
- package/Materials/Textures/texture.d.ts +1 -1
- package/Materials/Textures/texture.js.map +1 -1
- package/Materials/Textures/videoTexture.js +1 -0
- package/Materials/Textures/videoTexture.js.map +1 -1
- package/Materials/effect.js +3 -3
- package/Materials/effect.js.map +1 -1
- package/Materials/material.d.ts +3 -1
- package/Materials/material.js +11 -3
- package/Materials/material.js.map +1 -1
- package/Materials/materialHelper.js +9 -1
- package/Materials/materialHelper.js.map +1 -1
- package/Materials/materialPluginManager.js +3 -3
- package/Materials/materialPluginManager.js.map +1 -1
- package/Materials/multiMaterial.d.ts +3 -1
- package/Materials/multiMaterial.js +13 -11
- package/Materials/multiMaterial.js.map +1 -1
- package/Materials/pushMaterial.d.ts +1 -1
- package/Materials/pushMaterial.js.map +1 -1
- package/Materials/shaderMaterial.js +8 -4
- package/Materials/shaderMaterial.js.map +1 -1
- package/Materials/shadowDepthWrapper.d.ts +1 -1
- package/Materials/shadowDepthWrapper.js +3 -3
- package/Materials/shadowDepthWrapper.js.map +1 -1
- package/Materials/standardMaterial.d.ts +2 -6
- package/Materials/standardMaterial.js +5 -10
- package/Materials/standardMaterial.js.map +1 -1
- package/Maths/math.size.js +1 -1
- package/Maths/math.size.js.map +1 -1
- package/Maths/math.vector.d.ts +4 -2
- package/Maths/math.vector.js +34 -32
- package/Maths/math.vector.js.map +1 -1
- package/Meshes/Builders/cylinderBuilder.d.ts +1 -1
- package/Meshes/Builders/cylinderBuilder.js +1 -1
- package/Meshes/Builders/cylinderBuilder.js.map +1 -1
- package/Meshes/Builders/linesBuilder.js.map +1 -1
- package/Meshes/Compression/dracoCompression.d.ts +3 -0
- package/Meshes/Compression/dracoCompression.js +23 -7
- package/Meshes/Compression/dracoCompression.js.map +1 -1
- package/Meshes/abstractMesh.d.ts +6 -0
- package/Meshes/abstractMesh.js +18 -2
- package/Meshes/abstractMesh.js.map +1 -1
- package/Meshes/geometry.d.ts +1 -1
- package/Meshes/geometry.js +7 -3
- package/Meshes/geometry.js.map +1 -1
- package/Meshes/groundMesh.d.ts +1 -1
- package/Meshes/groundMesh.js.map +1 -1
- package/Meshes/mesh.js +21 -6
- package/Meshes/mesh.js.map +1 -1
- package/Meshes/mesh.lts.d.ts +1 -1
- package/Meshes/mesh.lts.js.map +1 -1
- package/Meshes/mesh.vertexData.d.ts +1 -1
- package/Meshes/mesh.vertexData.js +2 -2
- package/Meshes/mesh.vertexData.js.map +1 -1
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/subMesh.js +1 -2
- package/Meshes/subMesh.js.map +1 -1
- package/Meshes/subMesh.project.js +1 -2
- package/Meshes/subMesh.project.js.map +1 -1
- package/Meshes/thinInstanceMesh.js +5 -0
- package/Meshes/thinInstanceMesh.js.map +1 -1
- package/Meshes/trailMesh.d.ts +1 -1
- package/Meshes/trailMesh.js.map +1 -1
- package/Meshes/transformNode.js +40 -13
- package/Meshes/transformNode.js.map +1 -1
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.d.ts +5 -0
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js +13 -2
- package/Misc/HighDynamicRange/cubemapToSphericalPolynomial.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js +6 -12
- package/Misc/PerformanceViewer/performanceViewerCollectionStrategies.js.map +1 -1
- package/Misc/PerformanceViewer/performanceViewerCollector.js +6 -6
- package/Misc/PerformanceViewer/performanceViewerCollector.js.map +1 -1
- package/Misc/assetsManager.d.ts +2 -1
- package/Misc/assetsManager.js +15 -1
- package/Misc/assetsManager.js.map +1 -1
- package/Misc/basis.js +1 -1
- package/Misc/basis.js.map +1 -1
- package/Misc/brdfTextureTools.js +4 -1
- package/Misc/brdfTextureTools.js.map +1 -1
- package/Misc/dds.js +7 -0
- package/Misc/dds.js.map +1 -1
- package/Misc/devTools.js +1 -1
- package/Misc/devTools.js.map +1 -1
- package/Misc/environmentTextureTools.js +2 -2
- package/Misc/environmentTextureTools.js.map +1 -1
- package/Misc/fileTools.js +4 -4
- package/Misc/fileTools.js.map +1 -1
- package/Misc/index.d.ts +1 -0
- package/Misc/index.js +1 -0
- package/Misc/index.js.map +1 -1
- package/Misc/khronosTextureContainer2.js +4 -3
- package/Misc/khronosTextureContainer2.js.map +1 -1
- package/Misc/reflector.js +6 -6
- package/Misc/reflector.js.map +1 -1
- package/Misc/tools.js +15 -13
- package/Misc/tools.js.map +1 -1
- package/Misc/uniqueIdGenerator.js +1 -1
- package/Misc/uniqueIdGenerator.js.map +1 -1
- package/Offline/database.js +1 -1
- package/Offline/database.js.map +1 -1
- package/Particles/baseParticleSystem.d.ts +4 -1
- package/Particles/baseParticleSystem.js +20 -5
- package/Particles/baseParticleSystem.js.map +1 -1
- package/Particles/gpuParticleSystem.js +2 -1
- package/Particles/gpuParticleSystem.js.map +1 -1
- package/Particles/particleHelper.js +2 -2
- package/Particles/particleHelper.js.map +1 -1
- package/Physics/Plugins/ammoJSPlugin.d.ts +5 -1
- package/Physics/Plugins/ammoJSPlugin.js +16 -11
- package/Physics/Plugins/ammoJSPlugin.js.map +1 -1
- package/Physics/physicsEngine.d.ts +1 -0
- package/Physics/physicsEngine.js +3 -1
- package/Physics/physicsEngine.js.map +1 -1
- package/Physics/physicsImpostor.d.ts +2 -2
- package/Physics/physicsImpostor.js.map +1 -1
- package/PostProcesses/blurPostProcess.js +5 -5
- package/PostProcesses/blurPostProcess.js.map +1 -1
- package/PostProcesses/imageProcessingPostProcess.js +1 -1
- package/PostProcesses/imageProcessingPostProcess.js.map +1 -1
- package/PostProcesses/postProcess.js +1 -1
- package/PostProcesses/postProcess.js.map +1 -1
- package/PostProcesses/postProcessManager.js +2 -2
- package/PostProcesses/postProcessManager.js.map +1 -1
- package/Probes/reflectionProbe.js +2 -2
- package/Probes/reflectionProbe.js.map +1 -1
- package/Rendering/depthPeelingRenderer.js +3 -3
- package/Rendering/depthPeelingRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.js +8 -8
- package/Rendering/geometryBufferRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.js +1 -1
- package/Rendering/outlineRenderer.js.map +1 -1
- package/Rendering/utilityLayerRenderer.js +4 -0
- package/Rendering/utilityLayerRenderer.js.map +1 -1
- package/Shaders/ShadersInclude/instancesDeclaration.js +1 -1
- package/Shaders/ShadersInclude/instancesDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js +1 -1
- package/Shaders/ShadersInclude/pbrBlockAlbedoOpacity.js.map +1 -1
- package/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js +1 -1
- package/Shaders/ShadersInclude/pbrFragmentExtraDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/prePassVertex.js +1 -1
- package/Shaders/ShadersInclude/prePassVertex.js.map +1 -1
- package/Shaders/color.fragment.js +1 -1
- package/Shaders/color.fragment.js.map +1 -1
- package/Shaders/color.vertex.js +1 -1
- package/Shaders/color.vertex.js.map +1 -1
- package/Shaders/default.fragment.js +1 -1
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/default.vertex.js +1 -1
- package/Shaders/default.vertex.js.map +1 -1
- package/Shaders/geometry.vertex.js +1 -1
- package/Shaders/geometry.vertex.js.map +1 -1
- package/Shaders/pbr.vertex.js +1 -1
- package/Shaders/pbr.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/instancesDeclaration.js +1 -1
- package/ShadersWGSL/ShadersInclude/instancesDeclaration.js.map +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js +1 -1
- package/ShadersWGSL/gpuUpdateParticles.compute.js.map +1 -1
- package/Sprites/spriteManager.js +9 -10
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteMap.js +2 -2
- package/Sprites/spriteMap.js.map +1 -1
- package/Sprites/spriteRenderer.js +1 -1
- package/Sprites/spriteRenderer.js.map +1 -1
- package/XR/features/WebXRControllerPointerSelection.js +15 -9
- package/XR/features/WebXRControllerPointerSelection.js.map +1 -1
- package/XR/features/WebXRDOMOverlay.js +1 -1
- package/XR/features/WebXRDOMOverlay.js.map +1 -1
- package/XR/features/WebXRHandTracking.js +30 -30
- package/XR/features/WebXRHandTracking.js.map +1 -1
- package/XR/features/WebXRImageTracking.js +2 -2
- package/XR/features/WebXRImageTracking.js.map +1 -1
- package/XR/features/WebXRLayers.d.ts +28 -5
- package/XR/features/WebXRLayers.js +54 -20
- package/XR/features/WebXRLayers.js.map +1 -1
- package/XR/features/WebXRNearInteraction.d.ts +35 -3
- package/XR/features/WebXRNearInteraction.js +201 -40
- package/XR/features/WebXRNearInteraction.js.map +1 -1
- package/XR/motionController/webXRAbstractMotionController.js +1 -1
- package/XR/motionController/webXRAbstractMotionController.js.map +1 -1
- package/XR/motionController/webXRMotionControllerManager.js +2 -2
- package/XR/motionController/webXRMotionControllerManager.js.map +1 -1
- package/XR/motionController/webXRProfiledMotionController.js +1 -1
- package/XR/motionController/webXRProfiledMotionController.js.map +1 -1
- package/XR/webXRCamera.js +17 -4
- package/XR/webXRCamera.js.map +1 -1
- package/XR/webXRDefaultExperience.js +3 -0
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.js +2 -2
- package/XR/webXREnterExitUI.js.map +1 -1
- package/XR/webXRExperienceHelper.js +3 -2
- package/XR/webXRExperienceHelper.js.map +1 -1
- package/XR/webXRFeaturesManager.js +6 -6
- package/XR/webXRFeaturesManager.js.map +1 -1
- package/XR/webXRInputSource.js +3 -3
- package/XR/webXRInputSource.js.map +1 -1
- package/XR/webXRRenderTargetTextureProvider.d.ts +3 -2
- package/XR/webXRRenderTargetTextureProvider.js +37 -18
- package/XR/webXRRenderTargetTextureProvider.js.map +1 -1
- package/XR/webXRSessionManager.d.ts +1 -0
- package/XR/webXRSessionManager.js +6 -1
- package/XR/webXRSessionManager.js.map +1 -1
- package/assetContainer.d.ts +1 -1
- package/assetContainer.js +4 -0
- package/assetContainer.js.map +1 -1
- package/node.d.ts +1 -1
- package/node.js.map +1 -1
- package/package.json +22 -13
- package/scene.d.ts +5 -2
- package/scene.js +31 -5
- package/scene.js.map +1 -1
- package/DeviceInput/Implementations/nativeDeviceInputSystem.js.map +0 -1
- package/DeviceInput/Implementations/webDeviceInputSystem.js.map +0 -1
- package/DeviceInput/Interfaces/inputInterfaces.js.map +0 -1
- package/DeviceInput/deviceInputSystem.d.ts +0 -60
- package/DeviceInput/deviceInputSystem.js +0 -84
- package/DeviceInput/deviceInputSystem.js.map +0 -1
|
@@ -125,19 +125,19 @@ var ColorSplitterBlock = /** @class */ (function (_super) {
|
|
|
125
125
|
var bOutput = this._outputs[3];
|
|
126
126
|
var aOutput = this._outputs[4];
|
|
127
127
|
if (rgbOutput.hasEndpoints) {
|
|
128
|
-
state.compilationString += this._declareOutput(rgbOutput, state) +
|
|
128
|
+
state.compilationString += this._declareOutput(rgbOutput, state) + " = ".concat(input.associatedVariableName, ".rgb;\r\n");
|
|
129
129
|
}
|
|
130
130
|
if (rOutput.hasEndpoints) {
|
|
131
|
-
state.compilationString += this._declareOutput(rOutput, state) +
|
|
131
|
+
state.compilationString += this._declareOutput(rOutput, state) + " = ".concat(input.associatedVariableName, ".r;\r\n");
|
|
132
132
|
}
|
|
133
133
|
if (gOutput.hasEndpoints) {
|
|
134
|
-
state.compilationString += this._declareOutput(gOutput, state) +
|
|
134
|
+
state.compilationString += this._declareOutput(gOutput, state) + " = ".concat(input.associatedVariableName, ".g;\r\n");
|
|
135
135
|
}
|
|
136
136
|
if (bOutput.hasEndpoints) {
|
|
137
|
-
state.compilationString += this._declareOutput(bOutput, state) +
|
|
137
|
+
state.compilationString += this._declareOutput(bOutput, state) + " = ".concat(input.associatedVariableName, ".b;\r\n");
|
|
138
138
|
}
|
|
139
139
|
if (aOutput.hasEndpoints) {
|
|
140
|
-
state.compilationString += this._declareOutput(aOutput, state) +
|
|
140
|
+
state.compilationString += this._declareOutput(aOutput, state) + " = ".concat(input.associatedVariableName, ".a;\r\n");
|
|
141
141
|
}
|
|
142
142
|
return this;
|
|
143
143
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colorSplitterBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/colorSplitterBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH;IAAwC,sCAAiB;IAErD;;;OAGG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CAAC,YAAY,EAAE;YACxB,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,SAAS,EAAE,KAAK,CAAC,
|
|
1
|
+
{"version":3,"file":"colorSplitterBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/colorSplitterBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAE7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD;;GAEG;AACH;IAAwC,sCAAiB;IAErD;;;OAGG;IACH,4BAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAYhD;QAVG,KAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAC/E,KAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QAE/E,KAAI,CAAC,cAAc,CAAC,KAAK,EAAE,qCAAqC,CAAC,MAAM,CAAC,CAAC;QACzE,KAAI,CAAC,cAAc,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACtE,KAAI,CAAC,cAAc,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACtE,KAAI,CAAC,cAAc,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACtE,KAAI,CAAC,cAAc,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAEtE,KAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC;;IACnC,CAAC;IAED;;;OAGG;IACI,yCAAY,GAAnB;QACI,OAAO,oBAAoB,CAAC;IAChC,CA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AC,GAAG,aAAM,KAAK,CAAC,sBAAsB,YAAS,CAAC;SAChH;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,yBAAC;AAAD,CAAC,AA3HD,CAAwC,iBAAiB,GA2HxD;;AAED,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n\r\n/**\r\n * Block used to expand a Color3/4 into 4 outputs (one for each component)\r\n */\r\nexport class ColorSplitterBlock extends NodeMaterialBlock {\r\n\r\n /**\r\n * Create a new ColorSplitterBlock\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(\"rgba\", NodeMaterialBlockConnectionPointTypes.Color4, true);\r\n this.registerInput(\"rgb \", NodeMaterialBlockConnectionPointTypes.Color3, true);\r\n\r\n this.registerOutput(\"rgb\", NodeMaterialBlockConnectionPointTypes.Color3);\r\n this.registerOutput(\"r\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"g\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"b\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"a\", NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this.inputsAreExclusive = true;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ColorSplitterBlock\";\r\n }\r\n\r\n /**\r\n * Gets the rgba component (input)\r\n */\r\n public get rgba(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the rgb component (input)\r\n */\r\n public get rgbIn(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the rgb component (output)\r\n */\r\n public get rgbOut(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n /**\r\n * Gets the r component (output)\r\n */\r\n public get r(): NodeMaterialConnectionPoint {\r\n return this._outputs[1];\r\n }\r\n\r\n /**\r\n * Gets the g component (output)\r\n */\r\n public get g(): NodeMaterialConnectionPoint {\r\n return this._outputs[2];\r\n }\r\n /**\r\n * Gets the b component (output)\r\n */\r\n public get b(): NodeMaterialConnectionPoint {\r\n return this._outputs[3];\r\n }\r\n /**\r\n * Gets the a component (output)\r\n */\r\n public get a(): NodeMaterialConnectionPoint {\r\n return this._outputs[4];\r\n }\r\n\r\n protected _inputRename(name: string) {\r\n if (name === \"rgb \") {\r\n return \"rgbIn\";\r\n }\r\n return name;\r\n }\r\n\r\n protected _outputRename(name: string) {\r\n if (name === \"rgb\") {\r\n return \"rgbOut\";\r\n }\r\n return name;\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let input = this.rgba.isConnected ? this.rgba : this.rgbIn;\r\n\r\n if (!input.isConnected) {\r\n return;\r\n }\r\n\r\n let rgbOutput = this._outputs[0];\r\n let rOutput = this._outputs[1];\r\n let gOutput = this._outputs[2];\r\n let bOutput = this._outputs[3];\r\n let aOutput = this._outputs[4];\r\n\r\n if (rgbOutput.hasEndpoints) {\r\n state.compilationString += this._declareOutput(rgbOutput, state) + ` = ${input.associatedVariableName}.rgb;\\r\\n`;\r\n }\r\n if (rOutput.hasEndpoints) {\r\n state.compilationString += this._declareOutput(rOutput, state) + ` = ${input.associatedVariableName}.r;\\r\\n`;\r\n }\r\n if (gOutput.hasEndpoints) {\r\n state.compilationString += this._declareOutput(gOutput, state) + ` = ${input.associatedVariableName}.g;\\r\\n`;\r\n }\r\n if (bOutput.hasEndpoints) {\r\n state.compilationString += this._declareOutput(bOutput, state) + ` = ${input.associatedVariableName}.b;\\r\\n`;\r\n }\r\n if (aOutput.hasEndpoints) {\r\n state.compilationString += this._declareOutput(aOutput, state) + ` = ${input.associatedVariableName}.a;\\r\\n`;\r\n }\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ColorSplitterBlock\", ColorSplitterBlock);"]}
|
|
@@ -117,39 +117,39 @@ var ConditionalBlock = /** @class */ (function (_super) {
|
|
|
117
117
|
var falseStatement = this.false.isConnected ? this.false.associatedVariableName : "0.0";
|
|
118
118
|
switch (this.condition) {
|
|
119
119
|
case ConditionalBlockConditions.Equal: {
|
|
120
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
120
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " == ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
121
121
|
break;
|
|
122
122
|
}
|
|
123
123
|
case ConditionalBlockConditions.NotEqual: {
|
|
124
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
124
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " != ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
125
125
|
break;
|
|
126
126
|
}
|
|
127
127
|
case ConditionalBlockConditions.LessThan: {
|
|
128
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
128
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " < ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
129
129
|
break;
|
|
130
130
|
}
|
|
131
131
|
case ConditionalBlockConditions.LessOrEqual: {
|
|
132
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
132
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " <= ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
133
133
|
break;
|
|
134
134
|
}
|
|
135
135
|
case ConditionalBlockConditions.GreaterThan: {
|
|
136
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
136
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " > ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
137
137
|
break;
|
|
138
138
|
}
|
|
139
139
|
case ConditionalBlockConditions.GreaterOrEqual: {
|
|
140
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
140
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.a.associatedVariableName, " >= ").concat(this.b.associatedVariableName, " ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
141
141
|
break;
|
|
142
142
|
}
|
|
143
143
|
case ConditionalBlockConditions.Xor: {
|
|
144
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
144
|
+
state.compilationString += this._declareOutput(output, state) + " = (mod(".concat(this.a.associatedVariableName, " + ").concat(this.b.associatedVariableName, ", 2.0) > 0.0) ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
145
145
|
break;
|
|
146
146
|
}
|
|
147
147
|
case ConditionalBlockConditions.Or: {
|
|
148
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
148
|
+
state.compilationString += this._declareOutput(output, state) + " = (min(".concat(this.a.associatedVariableName, " + ").concat(this.b.associatedVariableName, ", 1.0) > 0.0) ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
149
149
|
break;
|
|
150
150
|
}
|
|
151
151
|
case ConditionalBlockConditions.And: {
|
|
152
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
152
|
+
state.compilationString += this._declareOutput(output, state) + " = (".concat(this.a.associatedVariableName, " * ").concat(this.b.associatedVariableName, " > 0.0) ? ").concat(trueStatement, " : ").concat(falseStatement, ";\r\n");
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
155
|
}
|
|
@@ -165,7 +165,7 @@ var ConditionalBlock = /** @class */ (function (_super) {
|
|
|
165
165
|
this.condition = serializationObject.condition;
|
|
166
166
|
};
|
|
167
167
|
ConditionalBlock.prototype._dumpPropertiesCode = function () {
|
|
168
|
-
var codeString = _super.prototype._dumpPropertiesCode.call(this) + (this._codeVariableName
|
|
168
|
+
var codeString = _super.prototype._dumpPropertiesCode.call(this) + "".concat(this._codeVariableName, ".condition = BABYLON.ConditionalBlockConditions.").concat(ConditionalBlockConditions[this.condition], ";\r\n");
|
|
169
169
|
return codeString;
|
|
170
170
|
};
|
|
171
171
|
return ConditionalBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditionalBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/conditionalBlock.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;AAGxD;;GAEG;AACH,MAAM,CAAN,IAAY,0BAmBX;AAnBD,WAAY,0BAA0B;IAClC,YAAY;IACZ,6EAAK,CAAA;IACL,eAAe;IACf,mFAAQ,CAAA;IACR,eAAe;IACf,mFAAQ,CAAA;IACR,kBAAkB;IAClB,yFAAW,CAAA;IACX,kBAAkB;IAClB,yFAAW,CAAA;IACX,qBAAqB;IACrB,+FAAc,CAAA;IACd,2BAA2B;IAC3B,yEAAG,CAAA;IACH,iBAAiB;IACjB,uEAAE,CAAA;IACF,kBAAkB;IAClB,yEAAG,CAAA;AACP,CAAC,EAnBW,0BAA0B,KAA1B,0BAA0B,QAmBrC;AAED;;;GAGG;AACH;IAAsC,oCAAiB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AO,UAAU,CAAC;IACtB,CAAC;IACL,uBAAC;AAAD,CAAC,AAxID,CAAsC,iBAAiB,GAwItD;;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\nimport { Scene } from '../../../scene';\r\n\r\n/**\r\n * Operations supported by the ConditionalBlock block\r\n */\r\nexport enum ConditionalBlockConditions {\r\n /** Equal */\r\n Equal,\r\n /** NotEqual */\r\n NotEqual,\r\n /** LessThan */\r\n LessThan,\r\n /** GreaterThan */\r\n GreaterThan,\r\n /** LessOrEqual */\r\n LessOrEqual,\r\n /** GreaterOrEqual */\r\n GreaterOrEqual,\r\n /** Logical Exclusive OR */\r\n Xor,\r\n /** Logical Or */\r\n Or,\r\n /** Logical And */\r\n And\r\n}\r\n\r\n/**\r\n * Block used to apply conditional operation between floats\r\n * @since 5.0.0\r\n */\r\nexport class ConditionalBlock extends NodeMaterialBlock {\r\n\r\n /**\r\n * Gets or sets the condition applied by the block\r\n */\r\n public condition = ConditionalBlockConditions.LessThan;\r\n\r\n /**\r\n * Creates a new ConditionalBlock\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(\"a\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerInput(\"b\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerInput(\"true\", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\"false\", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._linkConnectionTypes(2, 3);\r\n this._outputs[0]._typeConnectionSource = this._inputs[2];\r\n this._outputs[0]._defaultConnectionPointType = NodeMaterialBlockConnectionPointTypes.Float;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ConditionalBlock\";\r\n }\r\n\r\n /**\r\n * Gets the first operand component\r\n */\r\n public get a(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the second operand component\r\n */\r\n public get b(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the value to return if condition is true\r\n */\r\n public get true(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the value to return if condition is false\r\n */\r\n public get false(): NodeMaterialConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n let trueStatement = this.true.isConnected ? this.true.associatedVariableName : \"1.0\";\r\n let falseStatement = this.false.isConnected ? this.false.associatedVariableName : \"0.0\";\r\n\r\n switch (this.condition) {\r\n case ConditionalBlockConditions.Equal: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} == ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.NotEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} != ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.LessThan: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} < ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.LessOrEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} <= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.GreaterThan: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} > ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.GreaterOrEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} >= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.Xor: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (mod(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 2.0) > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.Or: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.And: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n let serializationObject = super.serialize();\r\n\r\n serializationObject.condition = this.condition;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this.condition = serializationObject.condition;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n var codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${ConditionalBlockConditions[this.condition]};\\r\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConditionalBlock\", ConditionalBlock);"]}
|
|
1
|
+
{"version":3,"file":"conditionalBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/conditionalBlock.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;AAGxD;;GAEG;AACH,MAAM,CAAN,IAAY,0BAmBX;AAnBD,WAAY,0BAA0B;IAClC,YAAY;IACZ,6EAAK,CAAA;IACL,eAAe;IACf,mFAAQ,CAAA;IACR,eAAe;IACf,mFAAQ,CAAA;IACR,kBAAkB;IAClB,yFAAW,CAAA;IACX,kBAAkB;IAClB,yFAAW,CAAA;IACX,qBAAqB;IACrB,+FAAc,CAAA;IACd,2BAA2B;IAC3B,yEAAG,CAAA;IACH,iBAAiB;IACjB,uEAAE,CAAA;IACF,kBAAkB;IAClB,yEAAG,CAAA;AACP,CAAC,EAnBW,0BAA0B,KAA1B,0BAA0B,QAmBrC;AAED;;;GAGG;AACH;IAAsC,oCAAiB;IAOnD;;;OAGG;IACH,0BAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAWhD;QArBD;;WAEG;QACI,eAAS,GAAG,0BAA0B,CAAC,QAAQ,CAAC;QASnD,KAAI,CAAC,aAAa,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QACrE,KAAI,CAAC,aAAa,CAAC,GAAG,EAAE,qCAAqC,CAAC,KAAK,C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AC,sBAAsB,6BAAmB,aAAa,gBAAM,cAAc,UAAO,CAAC;gBACvM,MAAM;aACT;YACD,KAAK,0BAA0B,CAAC,GAAG,CAAC,CAAC;gBACjC,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,cAAO,IAAI,CAAC,CAAC,CAAC,sBAAsB,gBAAM,IAAI,CAAC,CAAC,CAAC,sBAAsB,wBAAc,aAAa,gBAAM,cAAc,UAAO,CAAC;gBAC9L,MAAM;aACT;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,oCAAS,GAAhB;QACI,IAAI,mBAAmB,GAAG,iBAAM,SAAS,WAAE,CAAC;QAE5C,mBAAmB,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAE/C,OAAO,mBAAmB,CAAC;IAC/B,CAAC;IAEM,uCAAY,GAAnB,UAAoB,mBAAwB,EAAE,KAAY,EAAE,OAAe;QACvE,iBAAM,YAAY,YAAC,mBAAmB,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAExD,IAAI,CAAC,SAAS,GAAG,mBAAmB,CAAC,SAAS,CAAC;IACnD,CAAC;IAES,8CAAmB,GAA7B;QACI,IAAI,UAAU,GAAG,iBAAM,mBAAmB,WAAE,GAAG,UAAG,IAAI,CAAC,iBAAiB,6DAAmD,0BAA0B,CAAC,IAAI,CAAC,SAAS,CAAC,UAAO,CAAC;QAC7K,OAAO,UAAU,CAAC;IACtB,CAAC;IACL,uBAAC;AAAD,CAAC,AAxID,CAAsC,iBAAiB,GAwItD;;AAED,aAAa,CAAC,0BAA0B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\nimport { Scene } from '../../../scene';\r\n\r\n/**\r\n * Operations supported by the ConditionalBlock block\r\n */\r\nexport enum ConditionalBlockConditions {\r\n /** Equal */\r\n Equal,\r\n /** NotEqual */\r\n NotEqual,\r\n /** LessThan */\r\n LessThan,\r\n /** GreaterThan */\r\n GreaterThan,\r\n /** LessOrEqual */\r\n LessOrEqual,\r\n /** GreaterOrEqual */\r\n GreaterOrEqual,\r\n /** Logical Exclusive OR */\r\n Xor,\r\n /** Logical Or */\r\n Or,\r\n /** Logical And */\r\n And\r\n}\r\n\r\n/**\r\n * Block used to apply conditional operation between floats\r\n * @since 5.0.0\r\n */\r\nexport class ConditionalBlock extends NodeMaterialBlock {\r\n\r\n /**\r\n * Gets or sets the condition applied by the block\r\n */\r\n public condition = ConditionalBlockConditions.LessThan;\r\n\r\n /**\r\n * Creates a new ConditionalBlock\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(\"a\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerInput(\"b\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerInput(\"true\", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerInput(\"false\", NodeMaterialBlockConnectionPointTypes.AutoDetect, true);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._linkConnectionTypes(2, 3);\r\n this._outputs[0]._typeConnectionSource = this._inputs[2];\r\n this._outputs[0]._defaultConnectionPointType = NodeMaterialBlockConnectionPointTypes.Float;\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ConditionalBlock\";\r\n }\r\n\r\n /**\r\n * Gets the first operand component\r\n */\r\n public get a(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the second operand component\r\n */\r\n public get b(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the value to return if condition is true\r\n */\r\n public get true(): NodeMaterialConnectionPoint {\r\n return this._inputs[2];\r\n }\r\n\r\n /**\r\n * Gets the value to return if condition is false\r\n */\r\n public get false(): NodeMaterialConnectionPoint {\r\n return this._inputs[3];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n let trueStatement = this.true.isConnected ? this.true.associatedVariableName : \"1.0\";\r\n let falseStatement = this.false.isConnected ? this.false.associatedVariableName : \"0.0\";\r\n\r\n switch (this.condition) {\r\n case ConditionalBlockConditions.Equal: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} == ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.NotEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} != ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.LessThan: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} < ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.LessOrEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} <= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.GreaterThan: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} > ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.GreaterOrEqual: {\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.a.associatedVariableName} >= ${this.b.associatedVariableName} ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.Xor: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (mod(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 2.0) > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.Or: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (min(${this.a.associatedVariableName} + ${this.b.associatedVariableName}, 1.0) > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n case ConditionalBlockConditions.And: {\r\n state.compilationString += this._declareOutput(output, state) + ` = (${this.a.associatedVariableName} * ${this.b.associatedVariableName} > 0.0) ? ${trueStatement} : ${falseStatement};\\r\\n`;\r\n break;\r\n }\r\n }\r\n\r\n return this;\r\n }\r\n\r\n public serialize(): any {\r\n let serializationObject = super.serialize();\r\n\r\n serializationObject.condition = this.condition;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n\r\n this.condition = serializationObject.condition;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n var codeString = super._dumpPropertiesCode() + `${this._codeVariableName}.condition = BABYLON.ConditionalBlockConditions.${ConditionalBlockConditions[this.condition]};\\r\\n`;\r\n return codeString;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ConditionalBlock\", ConditionalBlock);"]}
|
|
@@ -66,7 +66,7 @@ var CrossBlock = /** @class */ (function (_super) {
|
|
|
66
66
|
CrossBlock.prototype._buildBlock = function (state) {
|
|
67
67
|
_super.prototype._buildBlock.call(this, state);
|
|
68
68
|
var output = this._outputs[0];
|
|
69
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
69
|
+
state.compilationString += this._declareOutput(output, state) + " = cross(".concat(this.left.associatedVariableName, ".xyz, ").concat(this.right.associatedVariableName, ".xyz);\r\n");
|
|
70
70
|
return this;
|
|
71
71
|
};
|
|
72
72
|
return CrossBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/crossBlock.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;;GAEG;AACH;IAAgC,8BAAiB;IAC7C;;;OAGG;IACH,oBAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAchD;QAZG,KAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,KAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,OAAO,CAAC,CAAC;QAE7E,KAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,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;QACI,OAAO,YAAY,CAAC;IACxB,CAAC;IAKD,sBAAW,4BAAI;QAHf;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;;;OAAA;IAKD,sBAAW,6BAAK;QAHhB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;;;OAAA;IAKD,sBAAW,8BAAM;QAHjB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;;;OAAA;IAES,gCAAW,GAArB,UAAsB,KAA6B;QAC/C,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9B,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,mBAAY,IAAI,CAAC,IAAI,CAAC,sBAAsB,mBAAS,IAAI,CAAC,KAAK,CAAC,sBAAsB,eAAY,CAAC;QAEnK,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,iBAAC;AAAD,CAAC,AA5DD,CAAgC,iBAAiB,GA4DhD;;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used to apply a cross product between 2 vectors\r\n */\r\nexport class CrossBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new CrossBlock\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(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Vector3);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Vector2);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"CrossBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = cross(${this.left.associatedVariableName}.xyz, ${this.right.associatedVariableName}.xyz);\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CrossBlock\", CrossBlock);"]}
|
|
@@ -79,7 +79,7 @@ var CustomBlock = /** @class */ (function (_super) {
|
|
|
79
79
|
};
|
|
80
80
|
CustomBlock.prototype._dumpPropertiesCode = function () {
|
|
81
81
|
var codeString = _super.prototype._dumpPropertiesCode.call(this);
|
|
82
|
-
codeString += this._codeVariableName
|
|
82
|
+
codeString += "".concat(this._codeVariableName, ".options = ").concat(JSON.stringify(this._options), ";\r\n");
|
|
83
83
|
return codeString;
|
|
84
84
|
};
|
|
85
85
|
CustomBlock.prototype.serialize = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/customBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD;;GAEG;AACH;IAAiC,+BAAiB;IAe9C;;;OAGG;IACH,qBAAmB,IAAY;eAC3B,kBAAM,IAAI,CAAC;IACf,CAAC;IAdD,sBAAW,gCAAO;QAHlB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAmB,OAAY;YAC3B,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;;;OAJA;IAcD;;;OAGG;IACI,kCAAY,GAAnB;QACI,OAAO,aAAa,CAAC;IACzB,CAAC;IAES,iCAAW,GAArB,UAAsB,KAA6B;QAAnD,iBAkDC;QAjDG,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QAEtB,IAAI,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAE9C,6CAA6C;QAC7C,IAA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AqB,GAAG,KAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,aAAa,CAAE,CAAC,CAAC,CAAC,CAAC;aAChG;QACL,CAAC,CAAC,CAAC;QAEH,MAAA,OAAO,CAAC,uBAAuB,0CAAE,OAAO,CAAC,UAAC,UAAe;YACrD,KAAI,CAAC,oBAAoB,CAAC,KAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,KAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1H,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,sCAAgB,GAAxB,UAAyB,IAAY;QACjC,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,IAAI,CAAC;SACf;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC/B;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,kBAAC;AAAD,CAAC,AA9JD,CAAiC,iBAAiB,GA8JjD;;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\nimport { Scene } from '../../../scene';\r\nimport { Nullable } from \"../../../types\";\r\nimport { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\n\r\n/**\r\n * Custom block created from user-defined json\r\n */\r\nexport class CustomBlock extends NodeMaterialBlock {\r\n private _options: any;\r\n private _code: string;\r\n\r\n /**\r\n * Gets or sets the options for this custom block\r\n */\r\n public get options() {\r\n return this._options;\r\n }\r\n\r\n public set options(options: any) {\r\n this._deserializeOptions(options);\r\n }\r\n\r\n /**\r\n * Creates a new CustomBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"CustomBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let code = this._code;\r\n\r\n let functionName = this._options.functionName;\r\n\r\n // Replace the TYPE_XXX placeholders (if any)\r\n this._inputs.forEach((input) => {\r\n const rexp = new RegExp(\"\\\\{TYPE_\" + input.name + \"\\\\}\", \"gm\");\r\n const type = state._getGLType(input.type);\r\n code = code.replace(rexp, type);\r\n functionName = functionName.replace(rexp, type);\r\n });\r\n this._outputs.forEach((output) => {\r\n const rexp = new RegExp(\"\\\\{TYPE_\" + output.name + \"\\\\}\", \"gm\");\r\n const type = state._getGLType(output.type);\r\n code = code.replace(rexp, type);\r\n functionName = functionName.replace(rexp, type);\r\n });\r\n\r\n state._emitFunction(functionName, code, \"\");\r\n\r\n // Declare the output variables\r\n this._outputs.forEach((output) => {\r\n state.compilationString += this._declareOutput(output, state) + \";\\r\\n\";\r\n });\r\n\r\n // Generate the function call\r\n state.compilationString += functionName + \"(\";\r\n\r\n let hasInput = false;\r\n this._inputs.forEach((input, index) => {\r\n if (index > 0) {\r\n state.compilationString += \", \";\r\n }\r\n state.compilationString += input.associatedVariableName;\r\n hasInput = true;\r\n });\r\n\r\n this._outputs.forEach((output, index) => {\r\n if (index > 0 || hasInput) {\r\n state.compilationString += \", \";\r\n }\r\n state.compilationString += output.associatedVariableName;\r\n });\r\n\r\n state.compilationString += \");\\r\\n\";\r\n\r\n return this;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n\r\n codeString += `${this._codeVariableName}.options = ${JSON.stringify(this._options)};\\r\\n`;\r\n\r\n return codeString;\r\n }\r\n\r\n public serialize(): any {\r\n let serializationObject = super.serialize();\r\n\r\n serializationObject.options = this._options;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n this._deserializeOptions(serializationObject.options);\r\n\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n }\r\n\r\n private _deserializeOptions(options: any) {\r\n this._options = options;\r\n this._code = options.code.join(\"\\r\\n\") + \"\\r\\n\";\r\n this.name = this.name || options.name;\r\n this.target = (<any> NodeMaterialBlockTargets)[options.target];\r\n\r\n options.inParameters?.forEach((input: any, index: number) => {\r\n const type = (<any> NodeMaterialBlockConnectionPointTypes)[input.type];\r\n this.registerInput(input.name, type);\r\n\r\n Object.defineProperty(this, input.name, {\r\n get: function () {\r\n return this._inputs[index];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n });\r\n\r\n options.outParameters?.forEach((output: any, index: number) => {\r\n this.registerOutput(output.name, (<any> NodeMaterialBlockConnectionPointTypes)[output.type]);\r\n\r\n Object.defineProperty(this, output.name, {\r\n get: function () {\r\n return this._outputs[index];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n\r\n if (output.type === \"BasedOnInput\") {\r\n this._outputs[index]._typeConnectionSource = this._findInputByName(output.typeFromInput)![0];\r\n }\r\n });\r\n\r\n options.inLinkedConnectionTypes?.forEach((connection: any) => {\r\n this._linkConnectionTypes(this._findInputByName(connection.input1)![1], this._findInputByName(connection.input2)![1]);\r\n });\r\n }\r\n\r\n private _findInputByName(name: string): Nullable<[NodeMaterialConnectionPoint, number]> {\r\n if (!name) {\r\n return null;\r\n }\r\n\r\n for (var i = 0; i < this._inputs.length; i++) {\r\n if (this._inputs[i].name === name) {\r\n return [this._inputs[i], i];\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CustomBlock\", CustomBlock);\r\n"]}
|
|
1
|
+
{"version":3,"file":"customBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/customBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,MAAM,gDAAgD,CAAC;AAEvG,OAAO,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAKxD;;GAEG;AACH;IAAiC,+BAAiB;IAe9C;;;OAGG;IACH,qBAAmB,IAAY;eAC3B,kBAAM,IAAI,CAAC;IACf,CAAC;IAdD,sBAAW,gCAAO;QAHlB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC;QACzB,CAAC;aAED,UAAmB,OAAY;YAC3B,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC;QACtC,CAAC;;;OAJA;IAcD;;;OAGG;IACI,kCAAY,GAAnB;QACI,OAAO,aAAa,CAAC;IACzB,CAAC;IAES,iCAAW,GAArB,UAAsB,KAA6B;QAAnD,iBAkDC;QAjDG,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC;QAEtB,IAAI,YAAY,GAAG,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC;QAE9C,6CAA6C;QAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAC,KAAK;YACvB,IAAM,IAAI,GAAG,IAAI,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,CAAC,CAAC;YAC/D,IAAM,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,K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BAAoB,CAAC,KAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,EAAE,KAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,MAAM,CAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC1H,CAAC,CAAC,CAAC;IACP,CAAC;IAEO,sCAAgB,GAAxB,UAAyB,IAAY;QACjC,IAAI,CAAC,IAAI,EAAE;YACP,OAAO,IAAI,CAAC;SACf;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,EAAE;gBAC/B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;aAC/B;SACJ;QAED,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,kBAAC;AAAD,CAAC,AA9JD,CAAiC,iBAAiB,GA8JjD;;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\nimport { Scene } from '../../../scene';\r\nimport { Nullable } from \"../../../types\";\r\nimport { NodeMaterialConnectionPoint } from \"../nodeMaterialBlockConnectionPoint\";\r\n\r\n/**\r\n * Custom block created from user-defined json\r\n */\r\nexport class CustomBlock extends NodeMaterialBlock {\r\n private _options: any;\r\n private _code: string;\r\n\r\n /**\r\n * Gets or sets the options for this custom block\r\n */\r\n public get options() {\r\n return this._options;\r\n }\r\n\r\n public set options(options: any) {\r\n this._deserializeOptions(options);\r\n }\r\n\r\n /**\r\n * Creates a new CustomBlock\r\n * @param name defines the block name\r\n */\r\n public constructor(name: string) {\r\n super(name);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"CustomBlock\";\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let code = this._code;\r\n\r\n let functionName = this._options.functionName;\r\n\r\n // Replace the TYPE_XXX placeholders (if any)\r\n this._inputs.forEach((input) => {\r\n const rexp = new RegExp(\"\\\\{TYPE_\" + input.name + \"\\\\}\", \"gm\");\r\n const type = state._getGLType(input.type);\r\n code = code.replace(rexp, type);\r\n functionName = functionName.replace(rexp, type);\r\n });\r\n this._outputs.forEach((output) => {\r\n const rexp = new RegExp(\"\\\\{TYPE_\" + output.name + \"\\\\}\", \"gm\");\r\n const type = state._getGLType(output.type);\r\n code = code.replace(rexp, type);\r\n functionName = functionName.replace(rexp, type);\r\n });\r\n\r\n state._emitFunction(functionName, code, \"\");\r\n\r\n // Declare the output variables\r\n this._outputs.forEach((output) => {\r\n state.compilationString += this._declareOutput(output, state) + \";\\r\\n\";\r\n });\r\n\r\n // Generate the function call\r\n state.compilationString += functionName + \"(\";\r\n\r\n let hasInput = false;\r\n this._inputs.forEach((input, index) => {\r\n if (index > 0) {\r\n state.compilationString += \", \";\r\n }\r\n state.compilationString += input.associatedVariableName;\r\n hasInput = true;\r\n });\r\n\r\n this._outputs.forEach((output, index) => {\r\n if (index > 0 || hasInput) {\r\n state.compilationString += \", \";\r\n }\r\n state.compilationString += output.associatedVariableName;\r\n });\r\n\r\n state.compilationString += \");\\r\\n\";\r\n\r\n return this;\r\n }\r\n\r\n protected _dumpPropertiesCode() {\r\n let codeString = super._dumpPropertiesCode();\r\n\r\n codeString += `${this._codeVariableName}.options = ${JSON.stringify(this._options)};\\r\\n`;\r\n\r\n return codeString;\r\n }\r\n\r\n public serialize(): any {\r\n let serializationObject = super.serialize();\r\n\r\n serializationObject.options = this._options;\r\n\r\n return serializationObject;\r\n }\r\n\r\n public _deserialize(serializationObject: any, scene: Scene, rootUrl: string) {\r\n this._deserializeOptions(serializationObject.options);\r\n\r\n super._deserialize(serializationObject, scene, rootUrl);\r\n }\r\n\r\n private _deserializeOptions(options: any) {\r\n this._options = options;\r\n this._code = options.code.join(\"\\r\\n\") + \"\\r\\n\";\r\n this.name = this.name || options.name;\r\n this.target = (<any> NodeMaterialBlockTargets)[options.target];\r\n\r\n options.inParameters?.forEach((input: any, index: number) => {\r\n const type = (<any> NodeMaterialBlockConnectionPointTypes)[input.type];\r\n this.registerInput(input.name, type);\r\n\r\n Object.defineProperty(this, input.name, {\r\n get: function () {\r\n return this._inputs[index];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n });\r\n\r\n options.outParameters?.forEach((output: any, index: number) => {\r\n this.registerOutput(output.name, (<any> NodeMaterialBlockConnectionPointTypes)[output.type]);\r\n\r\n Object.defineProperty(this, output.name, {\r\n get: function () {\r\n return this._outputs[index];\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n\r\n if (output.type === \"BasedOnInput\") {\r\n this._outputs[index]._typeConnectionSource = this._findInputByName(output.typeFromInput)![0];\r\n }\r\n });\r\n\r\n options.inLinkedConnectionTypes?.forEach((connection: any) => {\r\n this._linkConnectionTypes(this._findInputByName(connection.input1)![1], this._findInputByName(connection.input2)![1]);\r\n });\r\n }\r\n\r\n private _findInputByName(name: string): Nullable<[NodeMaterialConnectionPoint, number]> {\r\n if (!name) {\r\n return null;\r\n }\r\n\r\n for (var i = 0; i < this._inputs.length; i++) {\r\n if (this._inputs[i].name === name) {\r\n return [this._inputs[i], i];\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.CustomBlock\", CustomBlock);\r\n"]}
|
|
@@ -64,10 +64,10 @@ var DesaturateBlock = /** @class */ (function (_super) {
|
|
|
64
64
|
var tempMin = state._getFreeVariableName("colorMin");
|
|
65
65
|
var tempMax = state._getFreeVariableName("colorMax");
|
|
66
66
|
var tempMerge = state._getFreeVariableName("colorMerge");
|
|
67
|
-
state.compilationString += "float "
|
|
68
|
-
state.compilationString += "float "
|
|
69
|
-
state.compilationString += "float "
|
|
70
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
67
|
+
state.compilationString += "float ".concat(tempMin, " = min(min(").concat(colorName, ".x, ").concat(colorName, ".y), ").concat(colorName, ".z);\r\n");
|
|
68
|
+
state.compilationString += "float ".concat(tempMax, " = max(max(").concat(colorName, ".x, ").concat(colorName, ".y), ").concat(colorName, ".z);\r\n");
|
|
69
|
+
state.compilationString += "float ".concat(tempMerge, " = 0.5 * (").concat(tempMin, " + ").concat(tempMax, ");\r\n");
|
|
70
|
+
state.compilationString += this._declareOutput(output, state) + " = mix(".concat(colorName, ", vec3(").concat(tempMerge, ", ").concat(tempMerge, ", ").concat(tempMerge, "), ").concat(this.level.associatedVariableName, ");\r\n");
|
|
71
71
|
return this;
|
|
72
72
|
};
|
|
73
73
|
return DesaturateBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desaturateBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/desaturateBlock.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;;GAEG;AACH;IAAqC,mCAAiB;IAClD;;;OAGG;IACH,yBAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAKhD;QAHG,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,MAAM,CAAC,CA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AAoB,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,OAAO,GAAG,KAAK,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,SAAS,GAAG,KAAK,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC;QAEzD,KAAK,CAAC,iBAAiB,IAAI,gBAAS,OAAO,wBAAc,SAAS,iBAAO,SAAS,kBAAQ,SAAS,aAAU,CAAC;QAC9G,KAAK,CAAC,iBAAiB,IAAI,gBAAS,OAAO,wBAAc,SAAS,iBAAO,SAAS,kBAAQ,SAAS,aAAU,CAAC;QAC9G,KAAK,CAAC,iBAAiB,IAAI,gBAAS,SAAS,uBAAa,OAAO,gBAAM,OAAO,WAAQ,CAAC;QACvF,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,iBAAU,SAAS,oBAAU,SAAS,eAAK,SAAS,eAAK,SAAS,gBAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,WAAQ,CAAC;QAElL,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,sBAAC;AAAD,CAAC,AA3DD,CAAqC,iBAAiB,GA2DrD;;AAED,aAAa,CAAC,yBAAyB,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used to desaturate a color\r\n */\r\nexport class DesaturateBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new DesaturateBlock\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(\"color\", NodeMaterialBlockConnectionPointTypes.Color3);\r\n this.registerInput(\"level\", NodeMaterialBlockConnectionPointTypes.Float);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Color3);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DesaturateBlock\";\r\n }\r\n\r\n /**\r\n * Gets the color operand input component\r\n */\r\n public get color(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the level operand input component\r\n */\r\n public get level(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n let color = this.color;\r\n let colorName = color.associatedVariableName;\r\n let tempMin = state._getFreeVariableName(\"colorMin\");\r\n let tempMax = state._getFreeVariableName(\"colorMax\");\r\n let tempMerge = state._getFreeVariableName(\"colorMerge\");\r\n\r\n state.compilationString += `float ${tempMin} = min(min(${colorName}.x, ${colorName}.y), ${colorName}.z);\\r\\n`;\r\n state.compilationString += `float ${tempMax} = max(max(${colorName}.x, ${colorName}.y), ${colorName}.z);\\r\\n`;\r\n state.compilationString += `float ${tempMerge} = 0.5 * (${tempMin} + ${tempMax});\\r\\n`;\r\n state.compilationString += this._declareOutput(output, state) + ` = mix(${colorName}, vec3(${tempMerge}, ${tempMerge}, ${tempMerge}), ${this.level.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DesaturateBlock\", DesaturateBlock);"]}
|
|
@@ -64,7 +64,7 @@ var DistanceBlock = /** @class */ (function (_super) {
|
|
|
64
64
|
DistanceBlock.prototype._buildBlock = function (state) {
|
|
65
65
|
_super.prototype._buildBlock.call(this, state);
|
|
66
66
|
var output = this._outputs[0];
|
|
67
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
67
|
+
state.compilationString += this._declareOutput(output, state) + " = length(".concat(this.left.associatedVariableName, " - ").concat(this.right.associatedVariableName, ");\r\n");
|
|
68
68
|
return this;
|
|
69
69
|
};
|
|
70
70
|
return DistanceBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"distanceBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/distanceBlock.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;;GAEG;AACH;IAAmC,iCAAiB;IAChD;;;OAGG;IACH,uBAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAYhD;QAVG,KAAI,CAAC,aAAa,CAAC,MAAM,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC7E,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,KAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAE3E,KAAI,CAAC,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEhC,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,KAAK,CAAC,CAAC;QAC/F,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,4BAA4B,CAAC,IAAI,CAAC,qCAAqC,CAAC,MAAM,CAAC,CAAC;QAChG,KAAI,CAAC,OAAO,CAAC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KAA6B;QAC/C,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9B,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,oBAAa,IAAI,CAAC,IAAI,CAAC,sBAAsB,gBAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,WAAQ,CAAC;QAE7J,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,oBAAC;AAAD,CAAC,AA1DD,CAAmC,iBAAiB,GA0DnD;;AAED,aAAa,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used to get the distance between 2 values\r\n */\r\nexport class DistanceBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new DistanceBlock\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(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DistanceBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = length(${this.left.associatedVariableName} - ${this.right.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DistanceBlock\", DistanceBlock);"]}
|
|
@@ -61,7 +61,7 @@ var DivideBlock = /** @class */ (function (_super) {
|
|
|
61
61
|
DivideBlock.prototype._buildBlock = function (state) {
|
|
62
62
|
_super.prototype._buildBlock.call(this, state);
|
|
63
63
|
var output = this._outputs[0];
|
|
64
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
64
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(this.left.associatedVariableName, " / ").concat(this.right.associatedVariableName, ";\r\n");
|
|
65
65
|
return this;
|
|
66
66
|
};
|
|
67
67
|
return DivideBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divideBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/divideBlock.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qCAAqC,EAAE,M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sBAAW,+BAAM;QAHjB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;;;OAAA;IAES,iCAAW,GAArB,UAAsB,KAA6B;QAC/C,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAE9B,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,aAAM,IAAI,CAAC,IAAI,CAAC,sBAAsB,gBAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,UAAO,CAAC;QAErJ,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,kBAAC;AAAD,CAAC,AAtDD,CAAiC,iBAAiB,GAsDjD;;AAED,aAAa,CAAC,qBAAqB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used to divide 2 vectors\r\n */\r\nexport class DivideBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new DivideBlock\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(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\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 getClassName() {\r\n return \"DivideBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = ${this.left.associatedVariableName} / ${this.right.associatedVariableName};\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DivideBlock\", DivideBlock);"]}
|
|
@@ -64,7 +64,7 @@ var DotBlock = /** @class */ (function (_super) {
|
|
|
64
64
|
DotBlock.prototype._buildBlock = function (state) {
|
|
65
65
|
_super.prototype._buildBlock.call(this, state);
|
|
66
66
|
var output = this._outputs[0];
|
|
67
|
-
state.compilationString += this._declareOutput(output, state) +
|
|
67
|
+
state.compilationString += this._declareOutput(output, state) + " = dot(".concat(this.left.associatedVariableName, ", ").concat(this.right.associatedVariableName, ");\r\n");
|
|
68
68
|
return this;
|
|
69
69
|
};
|
|
70
70
|
return DotBlock;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dotBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/dotBlock.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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MaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used to apply a dot product between 2 vectors\r\n */\r\nexport class DotBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new DotBlock\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(\"left\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerInput(\"right\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.Float);\r\n\r\n this._linkConnectionTypes(0, 1);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Float);\r\n this._inputs[1].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"DotBlock\";\r\n }\r\n\r\n /**\r\n * Gets the left operand input component\r\n */\r\n public get left(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the right operand input component\r\n */\r\n public get right(): NodeMaterialConnectionPoint {\r\n return this._inputs[1];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = dot(${this.left.associatedVariableName}, ${this.right.associatedVariableName});\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.DotBlock\", DotBlock);"]}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NodeMaterialBlock } from '../nodeMaterialBlock';
|
|
2
|
+
import { NodeMaterialBuildState } from '../nodeMaterialBuildState';
|
|
3
|
+
import { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';
|
|
4
|
+
/**
|
|
5
|
+
* Block used as a pass through
|
|
6
|
+
*/
|
|
7
|
+
export declare class ElbowBlock extends NodeMaterialBlock {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a new ElbowBlock
|
|
10
|
+
* @param name defines the block name
|
|
11
|
+
*/
|
|
12
|
+
constructor(name: string);
|
|
13
|
+
/**
|
|
14
|
+
* Gets the current class name
|
|
15
|
+
* @returns the class name
|
|
16
|
+
*/
|
|
17
|
+
getClassName(): string;
|
|
18
|
+
/**
|
|
19
|
+
* Gets the input component
|
|
20
|
+
*/
|
|
21
|
+
get input(): NodeMaterialConnectionPoint;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the output component
|
|
24
|
+
*/
|
|
25
|
+
get output(): NodeMaterialConnectionPoint;
|
|
26
|
+
protected _buildBlock(state: NodeMaterialBuildState): this;
|
|
27
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { __extends } from "tslib";
|
|
2
|
+
import { NodeMaterialBlock } from '../nodeMaterialBlock.js';
|
|
3
|
+
import { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes.js';
|
|
4
|
+
import { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets.js';
|
|
5
|
+
import { RegisterClass } from '../../../Misc/typeStore.js';
|
|
6
|
+
/**
|
|
7
|
+
* Block used as a pass through
|
|
8
|
+
*/
|
|
9
|
+
var ElbowBlock = /** @class */ (function (_super) {
|
|
10
|
+
__extends(ElbowBlock, _super);
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new ElbowBlock
|
|
13
|
+
* @param name defines the block name
|
|
14
|
+
*/
|
|
15
|
+
function ElbowBlock(name) {
|
|
16
|
+
var _this = _super.call(this, name, NodeMaterialBlockTargets.Neutral) || this;
|
|
17
|
+
_this.registerInput("input", NodeMaterialBlockConnectionPointTypes.AutoDetect);
|
|
18
|
+
_this.registerOutput("output", NodeMaterialBlockConnectionPointTypes.BasedOnInput);
|
|
19
|
+
_this._outputs[0]._typeConnectionSource = _this._inputs[0];
|
|
20
|
+
return _this;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gets the current class name
|
|
24
|
+
* @returns the class name
|
|
25
|
+
*/
|
|
26
|
+
ElbowBlock.prototype.getClassName = function () {
|
|
27
|
+
return "ElbowBlock";
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(ElbowBlock.prototype, "input", {
|
|
30
|
+
/**
|
|
31
|
+
* Gets the input component
|
|
32
|
+
*/
|
|
33
|
+
get: function () {
|
|
34
|
+
return this._inputs[0];
|
|
35
|
+
},
|
|
36
|
+
enumerable: false,
|
|
37
|
+
configurable: true
|
|
38
|
+
});
|
|
39
|
+
Object.defineProperty(ElbowBlock.prototype, "output", {
|
|
40
|
+
/**
|
|
41
|
+
* Gets the output component
|
|
42
|
+
*/
|
|
43
|
+
get: function () {
|
|
44
|
+
return this._outputs[0];
|
|
45
|
+
},
|
|
46
|
+
enumerable: false,
|
|
47
|
+
configurable: true
|
|
48
|
+
});
|
|
49
|
+
ElbowBlock.prototype._buildBlock = function (state) {
|
|
50
|
+
_super.prototype._buildBlock.call(this, state);
|
|
51
|
+
var output = this._outputs[0];
|
|
52
|
+
var input = this._inputs[0];
|
|
53
|
+
state.compilationString += this._declareOutput(output, state) + " = ".concat(input.associatedVariableName, ";\r\n");
|
|
54
|
+
return this;
|
|
55
|
+
};
|
|
56
|
+
return ElbowBlock;
|
|
57
|
+
}(NodeMaterialBlock));
|
|
58
|
+
export { ElbowBlock };
|
|
59
|
+
RegisterClass("BABYLON.ElbowBlock", ElbowBlock);
|
|
60
|
+
//# sourceMappingURL=elbowBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"elbowBlock.js","sourceRoot":"","sources":["../../../../../sourceES6/core/Materials/Node/Blocks/elbowBlock.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;;GAEG;AACH;IAAgC,8BAAiB;IAC7C;;;OAGG;IACH,oBAAmB,IAAY;QAA/B,YACI,kBAAM,IAAI,EAAE,wBAAwB,CAAC,OAAO,CAAC,SAMhD;QAJG,KAAI,CAAC,aAAa,CAAC,OAAO,EAAE,qCAAqC,CAAC,UAAU,CAAC,CAAC;QAC9E,KAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,qCAAqC,CAAC,YAAY,CAAC,CAAC;QAElF,KAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,qBAAqB,GAAG,KAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;;IAC7D,CAAC;IAED;;;OAGG;IACI,iCAAY,GAAnB;QACI,OAAO,YAAY,CAAC;IACxB,CAAC;IAKD,sBAAW,6BAAK;QAHhB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3B,CAAC;;;OAAA;IAKD,sBAAW,8BAAM;QAHjB;;WAEG;aACH;YACI,OAAO,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;;;OAAA;IAES,gCAAW,GAArB,UAAsB,KAA6B;QAC/C,iBAAM,WAAW,YAAC,KAAK,CAAC,CAAC;QAEzB,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC9B,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAE5B,KAAK,CAAC,iBAAiB,IAAI,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,KAAK,CAAC,GAAG,aAAM,KAAK,CAAC,sBAAsB,UAAO,CAAC;QAE1G,OAAO,IAAI,CAAC;IAChB,CAAC;IACL,iBAAC;AAAD,CAAC,AA9CD,CAAgC,iBAAiB,GA8ChD;;AAED,aAAa,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC","sourcesContent":["import { NodeMaterialBlock } from '../nodeMaterialBlock';\r\nimport { NodeMaterialBlockConnectionPointTypes } from '../Enums/nodeMaterialBlockConnectionPointTypes';\r\nimport { NodeMaterialBuildState } from '../nodeMaterialBuildState';\r\nimport { NodeMaterialConnectionPoint } from '../nodeMaterialBlockConnectionPoint';\r\nimport { NodeMaterialBlockTargets } from '../Enums/nodeMaterialBlockTargets';\r\nimport { RegisterClass } from '../../../Misc/typeStore';\r\n/**\r\n * Block used as a pass through\r\n */\r\nexport class ElbowBlock extends NodeMaterialBlock {\r\n /**\r\n * Creates a new ElbowBlock\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(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\r\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\r\n\r\n this._outputs[0]._typeConnectionSource = this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the current class name\r\n * @returns the class name\r\n */\r\n public getClassName() {\r\n return \"ElbowBlock\";\r\n }\r\n\r\n /**\r\n * Gets the input component\r\n */\r\n public get input(): NodeMaterialConnectionPoint {\r\n return this._inputs[0];\r\n }\r\n\r\n /**\r\n * Gets the output component\r\n */\r\n public get output(): NodeMaterialConnectionPoint {\r\n return this._outputs[0];\r\n }\r\n\r\n protected _buildBlock(state: NodeMaterialBuildState) {\r\n super._buildBlock(state);\r\n\r\n let output = this._outputs[0];\r\n let input = this._inputs[0];\r\n\r\n state.compilationString += this._declareOutput(output, state) + ` = ${input.associatedVariableName};\\r\\n`;\r\n\r\n return this;\r\n }\r\n}\r\n\r\nRegisterClass(\"BABYLON.ElbowBlock\", ElbowBlock);"]}
|
|
@@ -100,9 +100,9 @@ var FresnelBlock = /** @class */ (function (_super) {
|
|
|
100
100
|
};
|
|
101
101
|
FresnelBlock.prototype._buildBlock = function (state) {
|
|
102
102
|
_super.prototype._buildBlock.call(this, state);
|
|
103
|
-
var comments = "//"
|
|
103
|
+
var comments = "//".concat(this.name);
|
|
104
104
|
state._emitFunctionFromInclude("fresnelFunction", comments, { removeIfDef: true });
|
|
105
|
-
state.compilationString += this._declareOutput(this.fresnel, state) +
|
|
105
|
+
state.compilationString += this._declareOutput(this.fresnel, state) + " = computeFresnelTerm(".concat(this.viewDirection.associatedVariableName, ".xyz, ").concat(this.worldNormal.associatedVariableName, ".xyz, ").concat(this.bias.associatedVariableName, ", ").concat(this.power.associatedVariableName, ");\r\n");
|
|
106
106
|
return this;
|
|
107
107
|
};
|
|
108
108
|
return FresnelBlock;
|