@onerjs/core 8.56.4 → 9.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Animations/animatable.core.js +36 -0
- package/Animations/animatable.core.js.map +1 -1
- package/Animations/animationGroup.pure.d.ts +61 -1
- package/Animations/animationGroup.pure.js +191 -2
- package/Animations/animationGroup.pure.js.map +1 -1
- package/Animations/index.d.ts +1 -0
- package/Animations/index.js +1 -0
- package/Animations/index.js.map +1 -1
- package/Animations/pure.d.ts +1 -0
- package/Animations/pure.js +1 -0
- package/Animations/pure.js.map +1 -1
- package/Animations/rootMotion.d.ts +560 -0
- package/Animations/rootMotion.js +1709 -0
- package/Animations/rootMotion.js.map +1 -0
- package/Animations/runtimeAnimation.d.ts +57 -0
- package/Animations/runtimeAnimation.js +127 -3
- package/Animations/runtimeAnimation.js.map +1 -1
- package/Cameras/arcRotateCamera.pure.d.ts +2 -0
- package/Cameras/arcRotateCamera.pure.js +2 -0
- package/Cameras/arcRotateCamera.pure.js.map +1 -1
- package/Cameras/targetCamera.pure.d.ts +2 -0
- package/Cameras/targetCamera.pure.js +13 -2
- package/Cameras/targetCamera.pure.js.map +1 -1
- package/Collisions/gpuPicker.js +5 -5
- package/Collisions/gpuPicker.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.pure.js +4 -2
- package/Engines/AbstractEngine/abstractEngine.query.pure.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.query.types.d.ts +11 -2
- package/Engines/AbstractEngine/abstractEngine.query.types.js.map +1 -1
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js +1 -0
- package/Engines/AbstractEngine/abstractEngine.renderPass.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.pure.js +63 -0
- package/Engines/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js +2 -2
- package/Engines/Extensions/engine.prefilteredCubeTexture.pure.js.map +1 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.d.ts +2 -1
- package/Engines/Extensions/engine.prefilteredCubeTexture.types.js.map +1 -1
- package/Engines/Extensions/index.d.ts +1 -0
- package/Engines/Extensions/index.js +1 -0
- package/Engines/Extensions/index.js.map +1 -1
- package/Engines/Extensions/pure.d.ts +1 -1
- package/Engines/Extensions/pure.js +1 -1
- package/Engines/Extensions/pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js +88 -39
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.pure.js.map +1 -1
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.d.ts +20 -2
- package/Engines/Native/Extensions/nativeEngine.cubeTexture.types.js.map +1 -1
- package/Engines/Native/nativeHardwareTexture.d.ts +8 -1
- package/Engines/Native/nativeHardwareTexture.js +7 -0
- package/Engines/Native/nativeHardwareTexture.js.map +1 -1
- package/Engines/Native/nativeHelpers.js +56 -1
- package/Engines/Native/nativeHelpers.js.map +1 -1
- package/Engines/Native/nativeInterfaces.d.ts +37 -8
- package/Engines/Native/nativeInterfaces.js.map +1 -1
- package/Engines/Native/nativeRenderTargetWrapper.d.ts +40 -0
- package/Engines/Native/nativeRenderTargetWrapper.js +265 -5
- package/Engines/Native/nativeRenderTargetWrapper.js.map +1 -1
- package/Engines/Processors/shaderCodeCursor.d.ts +1 -0
- package/Engines/Processors/shaderCodeCursor.js +40 -3
- package/Engines/Processors/shaderCodeCursor.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js +4 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.multiRender.types.d.ts +13 -0
- package/Engines/WebGPU/Extensions/engine.multiRender.types.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.query.pure.js +11 -3
- package/Engines/WebGPU/Extensions/engine.query.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js +1 -0
- package/Engines/WebGPU/Extensions/engine.renderTarget.pure.js.map +1 -1
- package/Engines/WebGPU/Extensions/index.d.ts +1 -0
- package/Engines/WebGPU/Extensions/index.js +1 -0
- package/Engines/WebGPU/Extensions/index.js.map +1 -1
- package/Engines/WebGPU/Extensions/pure.d.ts +1 -1
- package/Engines/WebGPU/Extensions/pure.js +1 -1
- package/Engines/WebGPU/Extensions/pure.js.map +1 -1
- package/Engines/WebGPU/webgpuBundleList.d.ts +2 -0
- package/Engines/WebGPU/webgpuBundleList.js +4 -0
- package/Engines/WebGPU/webgpuBundleList.js.map +1 -1
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js +5 -2
- package/Engines/WebGPU/webgpuCacheRenderPipeline.js.map +1 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js +3 -1
- package/Engines/WebGPU/webgpuHardwareTexture.js.map +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js +1 -1
- package/Engines/WebGPU/webgpuOcclusionQuery.js.map +1 -1
- package/Engines/WebGPU/webgpuSnapshotRendering.d.ts +4 -0
- package/Engines/WebGPU/webgpuSnapshotRendering.js +40 -7
- package/Engines/WebGPU/webgpuSnapshotRendering.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.d.ts +1 -1
- package/Engines/WebGPU/webgpuTextureHelper.js +2 -2
- package/Engines/WebGPU/webgpuTextureHelper.js.map +1 -1
- package/Engines/WebGPU/webgpuTextureManager.d.ts +2 -0
- package/Engines/WebGPU/webgpuTextureManager.js +286 -13
- package/Engines/WebGPU/webgpuTextureManager.js.map +1 -1
- package/Engines/abstractEngine.pure.d.ts +17 -1
- package/Engines/abstractEngine.pure.js +17 -5
- package/Engines/abstractEngine.pure.js.map +1 -1
- package/Engines/constants.d.ts +4 -0
- package/Engines/constants.js +4 -0
- package/Engines/constants.js.map +1 -1
- package/Engines/engine.pure.d.ts +0 -1
- package/Engines/engine.pure.js +0 -7
- package/Engines/engine.pure.js.map +1 -1
- package/Engines/nativeEngine.pure.js +1 -1
- package/Engines/nativeEngine.pure.js.map +1 -1
- package/Engines/thinEngine.pure.d.ts +15 -0
- package/Engines/thinEngine.pure.js +61 -14
- package/Engines/thinEngine.pure.js.map +1 -1
- package/Engines/thinNativeEngine.pure.d.ts +218 -17
- package/Engines/thinNativeEngine.pure.js +1438 -165
- package/Engines/thinNativeEngine.pure.js.map +1 -1
- package/Engines/thinWebGPUEngine.d.ts +4 -0
- package/Engines/thinWebGPUEngine.js +16 -2
- package/Engines/thinWebGPUEngine.js.map +1 -1
- package/Engines/webgpuEngine.pure.d.ts +17 -3
- package/Engines/webgpuEngine.pure.js +56 -13
- package/Engines/webgpuEngine.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js +2 -2
- package/FlowGraph/Blocks/Data/Math/flowGraphMathBlocks.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.d.ts +10 -0
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js +24 -12
- package/FlowGraph/Blocks/Data/Transformers/flowGraphJsonPointerParserBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.d.ts +11 -2
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js +1 -1
- package/FlowGraph/Blocks/Data/Utils/flowGraphArrayIndexBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.d.ts +7 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js +43 -0
- package/FlowGraph/Blocks/Data/flowGraphGetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.d.ts +9 -1
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js +6 -8
- package/FlowGraph/Blocks/Event/flowGraphMeshPickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOutEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Event/flowGraphPointerOverEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.d.ts +9 -0
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js +34 -9
- package/FlowGraph/Blocks/Event/flowGraphReceiveCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js +4 -0
- package/FlowGraph/Blocks/Event/flowGraphSceneReadyEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.d.ts +18 -4
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js +24 -6
- package/FlowGraph/Blocks/Event/flowGraphSceneTickEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js +19 -7
- package/FlowGraph/Blocks/Event/flowGraphSendCustomEventBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js +3 -3
- package/FlowGraph/Blocks/Execution/Animation/flowGraphInterpolationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.d.ts +20 -2
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js +85 -25
- package/FlowGraph/Blocks/Execution/Animation/flowGraphPlayAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.d.ts +16 -1
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js +64 -14
- package/FlowGraph/Blocks/Execution/Animation/flowGraphStopAnimationBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js +8 -0
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphCancelDelayBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js +4 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphForLoopBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.d.ts +12 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js +5 -1
- package/FlowGraph/Blocks/Execution/ControlFlow/flowGraphThrottleBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js +64 -16
- package/FlowGraph/Blocks/Execution/flowGraphConsoleLogBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.d.ts +2 -0
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js +14 -2
- package/FlowGraph/Blocks/Execution/flowGraphSetPropertyBlock.pure.js.map +1 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.d.ts +5 -1
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js +23 -8
- package/FlowGraph/Blocks/Execution/flowGraphSetVariableBlock.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.d.ts +5 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js +7 -0
- package/FlowGraph/CustomTypes/flowGraphInteger.pure.js.map +1 -1
- package/FlowGraph/CustomTypes/flowGraphMatrix.d.ts +10 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js +14 -0
- package/FlowGraph/CustomTypes/flowGraphMatrix.js.map +1 -1
- package/FlowGraph/flowGraph.d.ts +6 -1
- package/FlowGraph/flowGraph.js +41 -9
- package/FlowGraph/flowGraph.js.map +1 -1
- package/FlowGraph/flowGraphAnimationHelpers.d.ts +24 -0
- package/FlowGraph/flowGraphAnimationHelpers.js +21 -0
- package/FlowGraph/flowGraphAnimationHelpers.js.map +1 -0
- package/FlowGraph/flowGraphBlock.js +3 -0
- package/FlowGraph/flowGraphBlock.js.map +1 -1
- package/FlowGraph/flowGraphConnection.d.ts +7 -0
- package/FlowGraph/flowGraphConnection.js +7 -0
- package/FlowGraph/flowGraphConnection.js.map +1 -1
- package/FlowGraph/flowGraphContext.d.ts +2 -1
- package/FlowGraph/flowGraphContext.js +5 -3
- package/FlowGraph/flowGraphContext.js.map +1 -1
- package/FlowGraph/flowGraphCoordinator.d.ts +15 -1
- package/FlowGraph/flowGraphCoordinator.js +47 -16
- package/FlowGraph/flowGraphCoordinator.js.map +1 -1
- package/FlowGraph/flowGraphEventBlock.d.ts +5 -0
- package/FlowGraph/flowGraphEventBlock.js +7 -0
- package/FlowGraph/flowGraphEventBlock.js.map +1 -1
- package/FlowGraph/flowGraphHostResolver.d.ts +2 -1
- package/FlowGraph/flowGraphHostResolver.js.map +1 -1
- package/FlowGraph/flowGraphParser.js +60 -2
- package/FlowGraph/flowGraphParser.js.map +1 -1
- package/FlowGraph/flowGraphValidator.js +0 -4
- package/FlowGraph/flowGraphValidator.js.map +1 -1
- package/FlowGraph/index.d.ts +2 -0
- package/FlowGraph/index.js +2 -0
- package/FlowGraph/index.js.map +1 -1
- package/FlowGraph/pure.d.ts +2 -0
- package/FlowGraph/pure.js +2 -0
- package/FlowGraph/pure.js.map +1 -1
- package/FlowGraph/serialization.d.ts +4 -2
- package/FlowGraph/serialization.js +12 -24
- package/FlowGraph/serialization.js.map +1 -1
- package/FlowGraph/typeDefinitions.d.ts +9 -1
- package/FlowGraph/typeDefinitions.js.map +1 -1
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.d.ts +5 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js +8 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.d.ts +87 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js +295 -0
- package/FrameGraph/Node/Blocks/PostProcesses/meshBlendingPostProcessBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js +1 -0
- package/FrameGraph/Node/Blocks/PostProcesses/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js +4 -4
- package/FrameGraph/Node/Blocks/Rendering/baseObjectRendererBlock.js.map +1 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.d.ts +5 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js +13 -1
- package/FrameGraph/Node/Blocks/Rendering/geometryRendererBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js +4 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.d.ts +54 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js +155 -0
- package/FrameGraph/Node/Blocks/Textures/minMaxReducerBlock.pure.js.map +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.d.ts +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js +1 -0
- package/FrameGraph/Node/Blocks/Textures/pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/allBlocks.pure.js +4 -0
- package/FrameGraph/Node/Blocks/allBlocks.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/index.d.ts +2 -0
- package/FrameGraph/Node/Blocks/index.js +2 -0
- package/FrameGraph/Node/Blocks/index.js.map +1 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js +20 -1
- package/FrameGraph/Node/Blocks/inputBlock.pure.js.map +1 -1
- package/FrameGraph/Node/Blocks/pure.d.ts +2 -0
- package/FrameGraph/Node/Blocks/pure.js +2 -0
- package/FrameGraph/Node/Blocks/pure.js.map +1 -1
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.d.ts +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js +4 -2
- package/FrameGraph/Node/Types/nodeRenderGraphTypes.js.map +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js +1 -1
- package/FrameGraph/Node/nodeRenderGraph.js.map +1 -1
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js +1 -0
- package/FrameGraph/Tasks/Layers/selectionOutlineTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js +5 -1
- package/FrameGraph/Tasks/Misc/cullObjectsTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js +1 -0
- package/FrameGraph/Tasks/Misc/lightingVolumeTask.js.map +1 -1
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.d.ts +62 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js +159 -0
- package/FrameGraph/Tasks/Misc/minMaxReducerTask.js.map +1 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.d.ts +69 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js +223 -0
- package/FrameGraph/Tasks/PostProcesses/meshBlendingTask.js.map +1 -0
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.d.ts +25 -3
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js +72 -34
- package/FrameGraph/Tasks/Rendering/geometryRendererTask.js.map +1 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js +3 -1
- package/FrameGraph/Tasks/Rendering/objectRendererTask.js.map +1 -1
- package/FrameGraph/frameGraph.d.ts +4 -0
- package/FrameGraph/frameGraph.js +14 -0
- package/FrameGraph/frameGraph.js.map +1 -1
- package/FrameGraph/frameGraphObjectList.d.ts +6 -1
- package/FrameGraph/frameGraphObjectList.js.map +1 -1
- package/FrameGraph/frameGraphRenderContext.d.ts +3 -1
- package/FrameGraph/frameGraphRenderContext.js +5 -5
- package/FrameGraph/frameGraphRenderContext.js.map +1 -1
- package/FrameGraph/index.d.ts +2 -0
- package/FrameGraph/index.js +2 -0
- package/FrameGraph/index.js.map +1 -1
- package/FrameGraph/pure.d.ts +2 -0
- package/FrameGraph/pure.js +2 -0
- package/FrameGraph/pure.js.map +1 -1
- package/Inputs/scene.inputManager.d.ts +4 -0
- package/Inputs/scene.inputManager.js +50 -8
- package/Inputs/scene.inputManager.js.map +1 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.d.ts +5 -0
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js +22 -1
- package/Lights/Clustered/clusteredLightingSceneComponent.pure.js.map +1 -1
- package/Lights/Shadows/cascadedShadowGenerator.pure.js +7 -3
- package/Lights/Shadows/cascadedShadowGenerator.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.d.ts +54 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js +81 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.d.ts +7 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js +8 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.d.ts +60 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js +90 -0
- package/Materials/GaussianSplatting/gaussianPointSplattingDepthBlitMaterial.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.d.ts +31 -0
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js +103 -5
- package/Materials/GaussianSplatting/gaussianSplattingDebugMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js +6 -6
- package/Materials/GaussianSplatting/gaussianSplattingGpuPickingMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.d.ts +26 -1
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js +153 -49
- package/Materials/GaussianSplatting/gaussianSplattingMaterial.pure.js.map +1 -1
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.d.ts +83 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js +191 -0
- package/Materials/GaussianSplatting/gaussianSplattingOverdrawMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.d.ts +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js +4 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.d.ts +62 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js +125 -0
- package/Materials/GaussianSplatting/gaussianSplattingSizeMaterialPlugin.pure.js.map +1 -0
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js +5 -5
- package/Materials/GaussianSplatting/gaussianSplattingSolidColorMaterialPlugin.pure.js.map +1 -1
- package/Materials/GaussianSplatting/pure.d.ts +4 -0
- package/Materials/GaussianSplatting/pure.js +4 -0
- package/Materials/GaussianSplatting/pure.js.map +1 -1
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.d.ts +1 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js +12 -0
- package/Materials/Node/Blocks/Dual/imageSourceBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js +11 -1
- package/Materials/Node/Blocks/Fragment/fragmentOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js +17 -2
- package/Materials/Node/Blocks/Fragment/prePassOutputBlock.pure.js.map +1 -1
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js +2 -2
- package/Materials/Node/Blocks/GaussianSplatting/gaussianSplattingBlock.pure.js.map +1 -1
- package/Materials/Node/nodeMaterial.pure.d.ts +4 -0
- package/Materials/Node/nodeMaterial.pure.js +4 -0
- package/Materials/Node/nodeMaterial.pure.js.map +1 -1
- package/Materials/Node/nodeMaterialBuildState.d.ts +1 -1
- package/Materials/Node/nodeMaterialBuildState.js +25 -3
- package/Materials/Node/nodeMaterialBuildState.js.map +1 -1
- package/Materials/PBR/openpbrMaterial.pure.d.ts +2 -0
- package/Materials/PBR/pbrBaseMaterial.pure.d.ts +2 -0
- package/Materials/Textures/Procedurals/proceduralTexture.pure.d.ts +14 -14
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js +37 -13
- package/Materials/Textures/Procedurals/proceduralTexture.pure.js.map +1 -1
- package/Materials/Textures/baseTexture.pure.js +3 -0
- package/Materials/Textures/baseTexture.pure.js.map +1 -1
- package/Materials/Textures/cubeTexture.pure.js +1 -1
- package/Materials/Textures/cubeTexture.pure.js.map +1 -1
- package/Materials/Textures/internalTexture.d.ts +8 -1
- package/Materials/Textures/internalTexture.js +9 -2
- package/Materials/Textures/internalTexture.js.map +1 -1
- package/Materials/Textures/mirrorTexture.pure.js +3 -1
- package/Materials/Textures/mirrorTexture.pure.js.map +1 -1
- package/Materials/Textures/rawTexture2DArray.functions.d.ts +3 -3
- package/Materials/Textures/rawTexture2DArray.functions.js.map +1 -1
- package/Materials/Textures/rawTexture3D.d.ts +1 -1
- package/Materials/Textures/rawTexture3D.js +1 -1
- package/Materials/Textures/rawTexture3D.js.map +1 -1
- package/Materials/Textures/texture.pure.js +1 -1
- package/Materials/Textures/texture.pure.js.map +1 -1
- package/Materials/Textures/textureHelper.functions.d.ts +14 -0
- package/Materials/Textures/textureHelper.functions.js +24 -0
- package/Materials/Textures/textureHelper.functions.js.map +1 -1
- package/Materials/ditheredTileFadeMaterialPlugin.d.ts +210 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js +509 -0
- package/Materials/ditheredTileFadeMaterialPlugin.js.map +1 -0
- package/Materials/effectRenderer.pure.d.ts +4 -0
- package/Materials/effectRenderer.pure.js +3 -2
- package/Materials/effectRenderer.pure.js.map +1 -1
- package/Materials/index.d.ts +5 -0
- package/Materials/index.js +5 -0
- package/Materials/index.js.map +1 -1
- package/Materials/material.pure.js +25 -12
- package/Materials/material.pure.js.map +1 -1
- package/Materials/materialHelper.geometryrendering.d.ts +46 -1
- package/Materials/materialHelper.geometryrendering.js +105 -8
- package/Materials/materialHelper.geometryrendering.js.map +1 -1
- package/Materials/prepass.defines.d.ts +2 -0
- package/Materials/prepass.defines.js +2 -0
- package/Materials/prepass.defines.js.map +1 -1
- package/Materials/pure.d.ts +5 -0
- package/Materials/pure.js +5 -0
- package/Materials/pure.js.map +1 -1
- package/Materials/standardMaterial.pure.d.ts +10 -0
- package/Materials/standardMaterial.pure.js +30 -5
- package/Materials/standardMaterial.pure.js.map +1 -1
- package/Meshes/Builders/polygonBuilder.pure.d.ts +4 -0
- package/Meshes/Builders/polygonBuilder.pure.js +3 -0
- package/Meshes/Builders/polygonBuilder.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.d.ts +8 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js +11 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.d.ts +231 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js +1212 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingController.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.d.ts +14 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js +15 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.d.ts +285 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js +812 -0
- package/Meshes/GaussianSplatting/gaussianPointSplattingRenderer.pure.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.d.ts +19 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js +23 -0
- package/Meshes/GaussianSplatting/gaussianSplatting.functions.js.map +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.d.ts +1 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js +2 -0
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.d.ts +163 -14
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js +239 -24
- package/Meshes/GaussianSplatting/gaussianSplattingMesh.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.d.ts +34 -4
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js +125 -25
- package/Meshes/GaussianSplatting/gaussianSplattingMeshBase.pure.js.map +1 -1
- package/Meshes/GaussianSplatting/pure.d.ts +2 -0
- package/Meshes/GaussianSplatting/pure.js +2 -0
- package/Meshes/GaussianSplatting/pure.js.map +1 -1
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js +25 -11
- package/Meshes/Node/Blocks/booleanGeometryBlock.pure.js.map +1 -1
- package/Meshes/abstractMesh.pure.d.ts +30 -0
- package/Meshes/abstractMesh.pure.js +54 -0
- package/Meshes/abstractMesh.pure.js.map +1 -1
- package/Meshes/index.d.ts +2 -0
- package/Meshes/index.js +2 -0
- package/Meshes/index.js.map +1 -1
- package/Meshes/instancedMesh.pure.d.ts +5 -0
- package/Meshes/instancedMesh.pure.js +12 -0
- package/Meshes/instancedMesh.pure.js.map +1 -1
- package/Meshes/mesh.pure.js +23 -8
- package/Meshes/mesh.pure.js.map +1 -1
- package/Meshes/meshBlendingTag.d.ts +47 -0
- package/Meshes/meshBlendingTag.js +64 -0
- package/Meshes/meshBlendingTag.js.map +1 -0
- package/Meshes/polygonMesh.js +2 -2
- package/Meshes/polygonMesh.js.map +1 -1
- package/Meshes/pure.d.ts +2 -0
- package/Meshes/pure.js +2 -0
- package/Meshes/pure.js.map +1 -1
- package/Meshes/subMesh.pure.d.ts +11 -2
- package/Meshes/subMesh.pure.js +20 -5
- package/Meshes/subMesh.pure.js.map +1 -1
- package/Meshes/thinInstanceMesh.pure.js +1 -0
- package/Meshes/thinInstanceMesh.pure.js.map +1 -1
- package/Misc/andOrNotEvaluator.js +4 -0
- package/Misc/andOrNotEvaluator.js.map +1 -1
- package/Misc/fileTools.pure.js +21 -0
- package/Misc/fileTools.pure.js.map +1 -1
- package/Misc/minMaxReducer.pure.d.ts +6 -0
- package/Misc/minMaxReducer.pure.js +10 -0
- package/Misc/minMaxReducer.pure.js.map +1 -1
- package/Misc/snapshotRenderingHelper.js +2 -2
- package/Misc/snapshotRenderingHelper.js.map +1 -1
- package/Misc/thinMinMaxReducer.d.ts +19 -2
- package/Misc/thinMinMaxReducer.js +74 -21
- package/Misc/thinMinMaxReducer.js.map +1 -1
- package/Misc/tools.pure.js +1 -1
- package/Misc/tools.pure.js.map +1 -1
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js +19 -7
- package/Particles/Node/Blocks/Update/updateNoiseBlock.pure.js.map +1 -1
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js +3 -2
- package/Particles/Node/Blocks/particleSourceTextureBlock.pure.js.map +1 -1
- package/Particles/gpuParticleSystem.pure.d.ts +4 -0
- package/Particles/gpuParticleSystem.pure.js +101 -32
- package/Particles/gpuParticleSystem.pure.js.map +1 -1
- package/Particles/particle.js +3 -2
- package/Particles/particle.js.map +1 -1
- package/Particles/solidParticleSystem.js +7 -1
- package/Particles/solidParticleSystem.js.map +1 -1
- package/Particles/thinParticleSystem.function.d.ts +6 -0
- package/Particles/thinParticleSystem.function.js +144 -88
- package/Particles/thinParticleSystem.function.js.map +1 -1
- package/Particles/thinParticleSystem.pure.d.ts +8 -0
- package/Particles/thinParticleSystem.pure.js +154 -28
- package/Particles/thinParticleSystem.pure.js.map +1 -1
- package/Particles/webgl2ParticleSystem.pure.d.ts +1 -0
- package/Particles/webgl2ParticleSystem.pure.js +12 -4
- package/Particles/webgl2ParticleSystem.pure.js.map +1 -1
- package/Physics/v2/ragdoll.d.ts +2 -4
- package/Physics/v2/ragdoll.js +11 -4
- package/Physics/v2/ragdoll.js.map +1 -1
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js +7 -0
- package/PostProcesses/RenderPipeline/Pipelines/lensRenderingPipeline.pure.js.map +1 -1
- package/PostProcesses/index.d.ts +2 -0
- package/PostProcesses/index.js +2 -0
- package/PostProcesses/index.js.map +1 -1
- package/PostProcesses/meshBlendingBlueNoise.d.ts +15 -0
- package/PostProcesses/meshBlendingBlueNoise.js +77 -0
- package/PostProcesses/meshBlendingBlueNoise.js.map +1 -0
- package/PostProcesses/meshBlendingPostProcess.d.ts +131 -0
- package/PostProcesses/meshBlendingPostProcess.js +315 -0
- package/PostProcesses/meshBlendingPostProcess.js.map +1 -0
- package/PostProcesses/pure.d.ts +2 -0
- package/PostProcesses/pure.js +2 -0
- package/PostProcesses/pure.js.map +1 -1
- package/PostProcesses/thinMeshBlendingPostProcess.d.ts +339 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js +771 -0
- package/PostProcesses/thinMeshBlendingPostProcess.js.map +1 -0
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js +6 -6
- package/Rendering/IBLShadows/iblShadowsRenderPipeline.pure.js.map +1 -1
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.d.ts +12 -0
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js +50 -25
- package/Rendering/IBLShadows/iblShadowsVoxelRenderer.pure.js.map +1 -1
- package/Rendering/boundingBoxRenderer.pure.js +2 -1
- package/Rendering/boundingBoxRenderer.pure.js.map +1 -1
- package/Rendering/depthRenderer.pure.d.ts +9 -0
- package/Rendering/depthRenderer.pure.js +15 -4
- package/Rendering/depthRenderer.pure.js.map +1 -1
- package/Rendering/edgesRenderer.pure.d.ts +4 -2
- package/Rendering/edgesRenderer.pure.js +11 -2
- package/Rendering/edgesRenderer.pure.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObject.d.ts +14 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js +26 -0
- package/Rendering/fluidRenderer/fluidRenderingObject.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.d.ts +13 -3
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js +22 -9
- package/Rendering/fluidRenderer/fluidRenderingObjectParticleSystem.js.map +1 -1
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js +3 -0
- package/Rendering/fluidRenderer/fluidRenderingTargetRenderer.js.map +1 -1
- package/Rendering/geometryBufferRenderer.pure.d.ts +38 -4
- package/Rendering/geometryBufferRenderer.pure.js +130 -18
- package/Rendering/geometryBufferRenderer.pure.js.map +1 -1
- package/Rendering/objectRenderer.d.ts +7 -1
- package/Rendering/objectRenderer.js +45 -7
- package/Rendering/objectRenderer.js.map +1 -1
- package/Rendering/outlineRenderer.pure.js +6 -2
- package/Rendering/outlineRenderer.pure.js.map +1 -1
- package/Rendering/prePassRenderer.pure.js +3 -3
- package/Rendering/prePassRenderer.pure.js.map +1 -1
- package/Rendering/renderingManager.d.ts +1 -1
- package/Rendering/renderingManager.js +5 -4
- package/Rendering/renderingManager.js.map +1 -1
- package/Shaders/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js +34 -0
- package/Shaders/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/Shaders/ShadersInclude/gaussianSplatting.js +3 -1
- package/Shaders/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js +5 -1
- package/Shaders/ShadersInclude/gaussianSplattingVertexDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/geometryRenderingFragment.d.ts +5 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js +74 -0
- package/Shaders/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/Shaders/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js +89 -0
- package/Shaders/ShadersInclude/mrtFragmentDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js +1 -1
- package/Shaders/ShadersInclude/oitDeclaration.js.map +1 -1
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js +24 -17
- package/Shaders/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrBlockPrePass.js +27 -20
- package/Shaders/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/Shaders/ShadersInclude/pbrDebug.js +6 -2
- package/Shaders/ShadersInclude/pbrDebug.js.map +1 -1
- package/Shaders/ShadersInclude/prePassDeclaration.js +95 -2
- package/Shaders/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/Shaders/default.fragment.js +31 -40
- package/Shaders/default.fragment.js.map +1 -1
- package/Shaders/depthOfField.fragment.js +13 -9
- package/Shaders/depthOfField.fragment.js.map +1 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js +16 -1
- package/Shaders/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/Shaders/gaussianSplatting.fragment.js +63 -3
- package/Shaders/gaussianSplatting.fragment.js.map +1 -1
- package/Shaders/gaussianSplatting.vertex.js +80 -0
- package/Shaders/gaussianSplatting.vertex.js.map +1 -1
- package/Shaders/geometry.fragment.js +17 -11
- package/Shaders/geometry.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.fragment.js +43 -1
- package/Shaders/gpuRenderParticles.fragment.js.map +1 -1
- package/Shaders/gpuRenderParticles.vertex.js +96 -16
- package/Shaders/gpuRenderParticles.vertex.js.map +1 -1
- package/Shaders/meshBlending.fragment.d.ts +5 -0
- package/Shaders/meshBlending.fragment.js +519 -0
- package/Shaders/meshBlending.fragment.js.map +1 -0
- package/Shaders/minmaxRedux.fragment.js +6 -1
- package/Shaders/minmaxRedux.fragment.js.map +1 -1
- package/Shaders/particles.fragment.js +43 -1
- package/Shaders/particles.fragment.js.map +1 -1
- package/Shaders/particles.vertex.js +84 -3
- package/Shaders/particles.vertex.js.map +1 -1
- package/Shaders/sprites.fragment.js +52 -2
- package/Shaders/sprites.fragment.js.map +1 -1
- package/Shaders/sprites.vertex.js +62 -1
- package/Shaders/sprites.vertex.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js +33 -0
- package/ShadersWGSL/ShadersInclude/defaultFragmentAlpha.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js +65 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplatting.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js +17 -0
- package/ShadersWGSL/ShadersInclude/gaussianPointSplattingScan.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js +6 -78
- package/ShadersWGSL/ShadersInclude/gaussianSplatting.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js +2 -2
- package/ShadersWGSL/ShadersInclude/gaussianSplattingFragmentDeclaration.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js +79 -0
- package/ShadersWGSL/ShadersInclude/gaussianSplattingShared.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.d.ts +6 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js +76 -0
- package/ShadersWGSL/ShadersInclude/geometryRenderingFragment.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/lightFragment.js +1 -1
- package/ShadersWGSL/ShadersInclude/lightFragment.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js +27 -3
- package/ShadersWGSL/ShadersInclude/lightsFragmentFunctions.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.d.ts +5 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js +18 -0
- package/ShadersWGSL/ShadersInclude/meshBlendTagFragmentOutput.js.map +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/openpbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.d.ts +1 -0
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js +11 -25
- package/ShadersWGSL/ShadersInclude/pbrBlockPrePass.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js +5 -1
- package/ShadersWGSL/ShadersInclude/pbrDebug.js.map +1 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js +6 -1
- package/ShadersWGSL/ShadersInclude/prePassDeclaration.js.map +1 -1
- package/ShadersWGSL/default.fragment.js +17 -48
- package/ShadersWGSL/default.fragment.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleDepth.vertex.js.map +1 -1
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js +15 -2
- package/ShadersWGSL/fluidRenderingParticleThickness.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js +22 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js +19 -0
- package/ShadersWGSL/gaussianPointSplattingBlit.vertex.js.map +1 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.d.ts +5 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js +21 -0
- package/ShadersWGSL/gaussianPointSplattingDepthBlit.fragment.js.map +1 -0
- package/ShadersWGSL/gaussianSplatting.fragment.js +63 -2
- package/ShadersWGSL/gaussianSplatting.fragment.js.map +1 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js +82 -1
- package/ShadersWGSL/gaussianSplatting.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingDepth.vertex.js.map +1 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js +2 -1
- package/ShadersWGSL/gaussianSplattingVoxel.vertex.js.map +1 -1
- package/ShadersWGSL/geometry.fragment.js +37 -2
- package/ShadersWGSL/geometry.fragment.js.map +1 -1
- package/ShadersWGSL/gpsHiZBuild.compute.d.ts +5 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js +16 -0
- package/ShadersWGSL/gpsHiZBuild.compute.js.map +1 -0
- package/ShadersWGSL/gpsPartition.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPartition.compute.js +27 -0
- package/ShadersWGSL/gpsPartition.compute.js.map +1 -0
- package/ShadersWGSL/gpsPreprocess.compute.d.ts +5 -0
- package/ShadersWGSL/gpsPreprocess.compute.js +86 -0
- package/ShadersWGSL/gpsPreprocess.compute.js.map +1 -0
- package/ShadersWGSL/gpsResolve.compute.d.ts +5 -0
- package/ShadersWGSL/gpsResolve.compute.js +41 -0
- package/ShadersWGSL/gpsResolve.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanAdd.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanAdd.compute.js +22 -0
- package/ShadersWGSL/gpsScanAdd.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanBlocks.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js +23 -0
- package/ShadersWGSL/gpsScanBlocks.compute.js.map +1 -0
- package/ShadersWGSL/gpsScanSums.compute.d.ts +5 -0
- package/ShadersWGSL/gpsScanSums.compute.js +30 -0
- package/ShadersWGSL/gpsScanSums.compute.js.map +1 -0
- package/ShadersWGSL/gpsSplat.compute.d.ts +5 -0
- package/ShadersWGSL/gpsSplat.compute.js +37 -0
- package/ShadersWGSL/gpsSplat.compute.js.map +1 -0
- package/ShadersWGSL/gpuRenderParticles.fragment.js +47 -2
- package/ShadersWGSL/gpuRenderParticles.fragment.js.map +1 -1
- package/ShadersWGSL/gpuRenderParticles.vertex.js +110 -7
- package/ShadersWGSL/gpuRenderParticles.vertex.js.map +1 -1
- package/ShadersWGSL/meshBlending.fragment.d.ts +5 -0
- package/ShadersWGSL/meshBlending.fragment.js +576 -0
- package/ShadersWGSL/meshBlending.fragment.js.map +1 -0
- package/ShadersWGSL/minmaxRedux.fragment.js +20 -3
- package/ShadersWGSL/minmaxRedux.fragment.js.map +1 -1
- package/ShadersWGSL/openpbr.fragment.js +2 -1
- package/ShadersWGSL/openpbr.fragment.js.map +1 -1
- package/ShadersWGSL/particles.fragment.js +45 -1
- package/ShadersWGSL/particles.fragment.js.map +1 -1
- package/ShadersWGSL/particles.vertex.js +86 -4
- package/ShadersWGSL/particles.vertex.js.map +1 -1
- package/ShadersWGSL/pbr.fragment.js +2 -1
- package/ShadersWGSL/pbr.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.fragment.js +56 -2
- package/ShadersWGSL/sprites.fragment.js.map +1 -1
- package/ShadersWGSL/sprites.vertex.js +62 -1
- package/ShadersWGSL/sprites.vertex.js.map +1 -1
- package/Sprites/spriteManager.d.ts +13 -0
- package/Sprites/spriteManager.js +15 -0
- package/Sprites/spriteManager.js.map +1 -1
- package/Sprites/spriteRenderer.d.ts +24 -1
- package/Sprites/spriteRenderer.js +368 -50
- package/Sprites/spriteRenderer.js.map +1 -1
- package/Sprites/thinSprite.d.ts +4 -0
- package/Sprites/thinSprite.js +4 -0
- package/Sprites/thinSprite.js.map +1 -1
- package/States/alphaCullingState.d.ts +3 -1
- package/States/alphaCullingState.js +18 -3
- package/States/alphaCullingState.js.map +1 -1
- package/XR/features/WebXRSpaceWarp.pure.js +2 -1
- package/XR/features/WebXRSpaceWarp.pure.js.map +1 -1
- package/XR/webXRDefaultExperience.d.ts +5 -1
- package/XR/webXRDefaultExperience.js.map +1 -1
- package/XR/webXREnterExitUI.d.ts +2 -1
- package/XR/webXREnterExitUI.js.map +1 -1
- package/assetContainer.d.ts +1 -0
- package/assetContainer.js +5 -1
- package/assetContainer.js.map +1 -1
- package/package.json +1 -1
- package/scene.pure.d.ts +36 -2
- package/scene.pure.js +63 -4
- package/scene.pure.js.map +1 -1
|
@@ -0,0 +1,576 @@
|
|
|
1
|
+
// Do not edit.
|
|
2
|
+
import { ShaderStore } from "../Engines/shaderStore.js";
|
|
3
|
+
const name = "meshBlendingPixelShader";
|
|
4
|
+
const shader = `#define DISABLE_UNIFORMITY_ANALYSIS
|
|
5
|
+
varying vUV: vec2f;var textureSampler: texture_2d<f32>;var meshBlendTagSampler: texture_2d<u32>;var meshBlendDepthSampler: texture_2d<f32>;
|
|
6
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
7
|
+
var meshBlendBaseColorSampler: texture_2d<f32>;
|
|
8
|
+
#endif
|
|
9
|
+
var meshBlendBlueNoiseSampler: texture_2d<f32>;uniform projection: mat4x4f;uniform inverseProjection: mat4x4f;uniform inverseView: mat4x4f;uniform blendWorldRadii: vec4f;uniform minimumProjectedRadii: vec4f;uniform meshBlendIsOrthographic: f32;uniform slopeFactor: f32;
|
|
10
|
+
#ifndef MESH_BLEND_DIRECTION_COUNT
|
|
11
|
+
#define MESH_BLEND_DIRECTION_COUNT 3
|
|
12
|
+
#define MESH_BLEND_RADIAL_SAMPLE_COUNT 3
|
|
13
|
+
#define MESH_BLEND_DIRECTION_REFINEMENT_SAMPLE_COUNT 2
|
|
14
|
+
#define MESH_BLEND_DIRECTION_REFINEMENT_STEP_COUNT 4
|
|
15
|
+
#define MESH_BLEND_EXACT_EDGE_SAMPLE_COUNT 8
|
|
16
|
+
#define MESH_BLEND_RADIUS_SCALE 0.9
|
|
17
|
+
#define MESH_BLEND_JITTER_FACTOR 0.5
|
|
18
|
+
#define MESH_BLEND_COLOR_INTERPOLATION_OKLAB
|
|
19
|
+
#endif
|
|
20
|
+
#define MESH_BLEND_TWO_PI 6.283185307179586
|
|
21
|
+
#define MESH_BLEND_EPSILON 0.00001
|
|
22
|
+
#define MESH_BLEND_DIRECTION_REFINEMENT_SECTOR_SCALE 0.2
|
|
23
|
+
#define MESH_BLEND_TINY_OBJECT_PROBE_COUNT 8
|
|
24
|
+
#define MESH_BLEND_MIN_SLOPE_SCALE 0.25
|
|
25
|
+
#define MESH_BLEND_BOUNDARY_SEPARATION_FACTOR 0.75
|
|
26
|
+
#define MESH_BLEND_BOUNDARY_PIXEL_TOLERANCE 3.0
|
|
27
|
+
#define MESH_BLEND_FOREGROUND_DEPTH_FACTOR 0.35
|
|
28
|
+
#define MESH_BLEND_FOREGROUND_LATERAL_FACTOR 2.0
|
|
29
|
+
#define MESH_BLEND_TARGET_SPAN_FACTOR 1.5
|
|
30
|
+
#define MESH_BLEND_TOTAL_SPAN_FACTOR 2.5
|
|
31
|
+
#define MESH_BLEND_NEAR_EDGE_TARGET_WEIGHT 0.35
|
|
32
|
+
#define MESH_BLEND_NEAR_SEAM_MAX_DISTANCE 1.25
|
|
33
|
+
#define MESH_BLEND_NEAR_SEAM_COLOR_DELTA 0.02
|
|
34
|
+
#define MESH_BLEND_BASE_LUMINANCE_EPSILON 0.00001
|
|
35
|
+
#define MESH_BLEND_TARGET_DARKER_RATIO 0.65
|
|
36
|
+
#define MESH_BLEND_TARGET_NON_DARK_RATIO 0.9
|
|
37
|
+
#define MESH_BLEND_SHADOW_DIFFERENCE_LOW 0.15
|
|
38
|
+
#define MESH_BLEND_SHADOW_DIFFERENCE_HIGH 0.5
|
|
39
|
+
#define MESH_BLEND_SHADOW_MIN_ATTENUATION 0.25
|
|
40
|
+
#define MESH_BLEND_REJECTION_NONE 0
|
|
41
|
+
#define MESH_BLEND_REJECTION_NO_CANDIDATE 1
|
|
42
|
+
#define MESH_BLEND_REJECTION_NO_CONTINUATION 2
|
|
43
|
+
#define MESH_BLEND_REJECTION_INVALID_DEPTH 3
|
|
44
|
+
#define MESH_BLEND_REJECTION_DEPTH_SEPARATION 4
|
|
45
|
+
#define MESH_BLEND_REJECTION_FOREGROUND_BACKGROUND 5
|
|
46
|
+
#define MESH_BLEND_REJECTION_PHYSICAL_SPAN 6
|
|
47
|
+
#define MESH_BLEND_REJECTION_CONTACT_ANGLE 7
|
|
48
|
+
struct MeshBlendTag {groupId: u32,
|
|
49
|
+
radiusClass: u32,};struct MeshBlendCandidate {targetGroupId: u32,
|
|
50
|
+
radiusClass: u32,
|
|
51
|
+
direction: vec2f,
|
|
52
|
+
distancePixels: f32,
|
|
53
|
+
searchRadiusPixels: f32,
|
|
54
|
+
score: f32,
|
|
55
|
+
valid: bool,};struct MeshBlendResult {candidate: MeshBlendCandidate,
|
|
56
|
+
targetPixel: vec2i,
|
|
57
|
+
targetFarPixel: vec2i,
|
|
58
|
+
currentViewPosition: vec3f,
|
|
59
|
+
effectiveRadiusPixels: f32,
|
|
60
|
+
fade: f32,
|
|
61
|
+
tinyObjectRadiusRatio: f32,
|
|
62
|
+
rejectionReason: i32,
|
|
63
|
+
stageReached: i32,
|
|
64
|
+
valid: bool,
|
|
65
|
+
continuationFound: bool,
|
|
66
|
+
usedFallback: bool,
|
|
67
|
+
tinyObjectRadiusReduced: bool,};struct MeshBlendTargetColorSamples {fartherColor: vec4f,
|
|
68
|
+
boundaryPlusOneColor: vec4f,
|
|
69
|
+
boundaryPlusTwoColor: vec4f,
|
|
70
|
+
conservativeNearColor: vec4f,
|
|
71
|
+
targetColor: vec4f,
|
|
72
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
73
|
+
fartherBaseColor: vec3f,
|
|
74
|
+
conservativeNearBaseColor: vec3f,
|
|
75
|
+
#endif
|
|
76
|
+
onePixelEdge: bool,};struct MeshBlendColorEvaluation {samples: MeshBlendTargetColorSamples,
|
|
77
|
+
currentColor: vec4f,
|
|
78
|
+
blendedColor: vec4f,
|
|
79
|
+
#ifdef MESH_BLEND_DEBUG_WORLD_POSITION
|
|
80
|
+
worldPosition: vec3f,
|
|
81
|
+
#endif
|
|
82
|
+
shadowAttenuation: f32,
|
|
83
|
+
adjustedFade: f32,
|
|
84
|
+
nearSeamCorrected: bool,};fn clampPixel(pixel: vec2i,renderSize: vec2i)->vec2i {return clamp(pixel,vec2i(0),renderSize-vec2i(1));}
|
|
85
|
+
fn isPixelInBounds(pixel: vec2i,renderSize: vec2i)->bool {return pixel.x>=0 && pixel.y>=0 && pixel.x<renderSize.x && pixel.y<renderSize.y;}
|
|
86
|
+
fn pixelToUv(pixel: vec2i,renderSize: vec2i)->vec2f {return (vec2f(clampPixel(pixel,renderSize))+vec2f(0.5))/vec2f(renderSize);}
|
|
87
|
+
fn loadMeshBlendTag(pixel: vec2i,renderSize: vec2i)->MeshBlendTag {let packedTag: u32=textureLoad(meshBlendTagSampler,clampPixel(pixel,renderSize),0).r;var tag: MeshBlendTag;tag.groupId=packedTag & 0x3fu;tag.radiusClass=packedTag>>6u;return tag;}
|
|
88
|
+
fn loadMeshBlendDepth(pixel: vec2i,renderSize: vec2i)->f32 {return textureLoad(meshBlendDepthSampler,clampPixel(pixel,renderSize),0).r;}
|
|
89
|
+
fn classValue(values: vec4f,index: u32)->f32 {if (index==0u) {return values.x;}
|
|
90
|
+
if (index==1u) {return values.y;}
|
|
91
|
+
if (index==2u) {return values.z;}
|
|
92
|
+
return values.w;}
|
|
93
|
+
fn meshBlendDepthToNdc(depth: f32)->f32 {
|
|
94
|
+
#ifdef MESH_BLEND_DEPTH_SCREEN
|
|
95
|
+
#ifdef IS_NDC_HALF_ZRANGE
|
|
96
|
+
return depth;
|
|
97
|
+
#else
|
|
98
|
+
return depth*2.0-1.0;
|
|
99
|
+
#endif
|
|
100
|
+
#else
|
|
101
|
+
let projectedDepth: vec4f=uniforms.projection*vec4f(0.0,0.0,depth,1.0);return projectedDepth.z/projectedDepth.w;
|
|
102
|
+
#endif
|
|
103
|
+
}
|
|
104
|
+
fn reconstructMeshBlendViewPosition(pixel: vec2i,renderSize: vec2i,depth: f32)->vec3f {let ndcXY: vec2f=pixelToUv(pixel,renderSize)*2.0-1.0;let viewPosition: vec4f=uniforms.inverseProjection*vec4f(ndcXY,meshBlendDepthToNdc(depth),1.0);return viewPosition.xyz/viewPosition.w;}
|
|
105
|
+
fn reconstructMeshBlendWorldPosition(viewPosition: vec3f)->vec3f {return (uniforms.inverseView*vec4f(viewPosition,1.0)).xyz;}
|
|
106
|
+
fn isFiniteMeshBlendValue(value: f32)->bool {return (bitcast<u32>(value) & 0x7f800000u) != 0x7f800000u;}
|
|
107
|
+
fn isValidMeshBlendPosition(position: vec3f)->bool {return isFiniteMeshBlendValue(position.x) && isFiniteMeshBlendValue(position.y) && isFiniteMeshBlendValue(position.z);}
|
|
108
|
+
fn meshBlendProjectionScale(renderHeight: f32)->f32 {return max(0.5*renderHeight*abs(uniforms.projection[1][1]),MESH_BLEND_EPSILON);}
|
|
109
|
+
fn searchRadiusForClass(radiusClass: u32,viewDepth: f32,renderHeight: f32)->f32 {let projectionScale: f32=meshBlendProjectionScale(renderHeight);var projectedWorldRadius: f32=classValue(uniforms.blendWorldRadii,radiusClass)*projectionScale;if (uniforms.meshBlendIsOrthographic<0.5) {projectedWorldRadius/=max(viewDepth,MESH_BLEND_EPSILON);}
|
|
110
|
+
let scaledRadius: f32=max(projectedWorldRadius,classValue(uniforms.minimumProjectedRadii,radiusClass))*MESH_BLEND_RADIUS_SCALE;return select(0.0,max(1.0,scaledRadius),scaledRadius>0.0);}
|
|
111
|
+
fn worldUnitsPerPixel(viewDepth: f32,renderHeight: f32)->f32 {let unitsPerPixel: f32=1.0/meshBlendProjectionScale(renderHeight);if (uniforms.meshBlendIsOrthographic>0.5) {return unitsPerPixel;}
|
|
112
|
+
return unitsPerPixel*max(viewDepth,MESH_BLEND_EPSILON);}
|
|
113
|
+
fn calculateSlopeScale(oppositeFacing: f32)->f32 {if (uniforms.slopeFactor<=1.0) {return 1.0;}
|
|
114
|
+
return MESH_BLEND_MIN_SLOPE_SCALE +
|
|
115
|
+
(1.0-MESH_BLEND_MIN_SLOPE_SCALE)*pow(clamp(oppositeFacing,0.0,1.0),uniforms.slopeFactor-1.0);}
|
|
116
|
+
fn loadStableBlueNoise(pixel: vec2i)->vec2f {let noiseSize: vec2i=vec2i(textureDimensions(meshBlendBlueNoiseSampler,0));let wrappedPixel: vec2i=vec2i(pixel.x % noiseSize.x,pixel.y % noiseSize.y);return textureLoad(meshBlendBlueNoiseSampler,wrappedPixel,0).rg;}
|
|
117
|
+
fn directionAt(index: i32,rotation: f32,sectorAngle: f32,direction0: vec2f,direction1: vec2f,direction2: vec2f)->vec2f {
|
|
118
|
+
#if MESH_BLEND_DIRECTION_COUNT==3
|
|
119
|
+
if (index==0) {return direction0;}
|
|
120
|
+
if (index==1) {return direction1;}
|
|
121
|
+
return direction2;
|
|
122
|
+
#else
|
|
123
|
+
let angle: f32=rotation+sectorAngle*f32(index);return vec2f(cos(angle),sin(angle));
|
|
124
|
+
#endif
|
|
125
|
+
}
|
|
126
|
+
fn invalidCandidate()->MeshBlendCandidate {var candidate: MeshBlendCandidate;candidate.targetGroupId=0u;candidate.radiusClass=0u;candidate.direction=vec2f(0.0);candidate.distancePixels=0.0;candidate.searchRadiusPixels=0.0;candidate.score=-1.0;candidate.valid=false;return candidate;}
|
|
127
|
+
fn invalidBlendResult()->MeshBlendResult {var result: MeshBlendResult;result.candidate=invalidCandidate();result.targetPixel=vec2i(0);result.targetFarPixel=vec2i(0);result.currentViewPosition=vec3f(0.0);result.effectiveRadiusPixels=0.0;result.fade=0.0;result.tinyObjectRadiusRatio=1.0;result.rejectionReason=MESH_BLEND_REJECTION_NO_CANDIDATE;result.stageReached=1;result.valid=false;result.continuationFound=false;result.usedFallback=false;result.tinyObjectRadiusReduced=false;return result;}
|
|
128
|
+
fn findInitialCandidate(
|
|
129
|
+
pixel: vec2i,
|
|
130
|
+
renderSize: vec2i,
|
|
131
|
+
currentTag: MeshBlendTag,
|
|
132
|
+
currentSearchRadius: f32,
|
|
133
|
+
viewDepth: f32,
|
|
134
|
+
ignoredGroupId: u32,
|
|
135
|
+
randomValues: vec2f,
|
|
136
|
+
rotation: f32,
|
|
137
|
+
sectorAngle: f32,
|
|
138
|
+
direction0: vec2f,
|
|
139
|
+
direction1: vec2f,
|
|
140
|
+
direction2: vec2f
|
|
141
|
+
)->MeshBlendCandidate {var best: MeshBlendCandidate=invalidCandidate();let radialJitter: f32=mix(0.5,randomValues.y,MESH_BLEND_JITTER_FACTOR);for (var radialIndex: i32=0; radialIndex<MESH_BLEND_RADIAL_SAMPLE_COUNT; radialIndex++) {let normalizedDistance: f32=(f32(radialIndex)+radialJitter)/f32(MESH_BLEND_RADIAL_SAMPLE_COUNT);let distancePixels: f32=max(1.0,ceil(normalizedDistance*normalizedDistance*normalizedDistance*currentSearchRadius));for (var directionIndex: i32=0; directionIndex<MESH_BLEND_DIRECTION_COUNT; directionIndex++) {let direction: vec2f=directionAt(directionIndex,rotation,sectorAngle,direction0,direction1,direction2);let samplePixel: vec2i=pixel+vec2i(round(direction*distancePixels));let candidateTag: MeshBlendTag=loadMeshBlendTag(samplePixel,renderSize);if (candidateTag.groupId==0u || candidateTag.groupId==currentTag.groupId || candidateTag.groupId==ignoredGroupId) {continue;}
|
|
142
|
+
let seamRadiusClass: u32=min(currentTag.radiusClass,candidateTag.radiusClass);let candidateSearchRadius: f32=searchRadiusForClass(seamRadiusClass,viewDepth,f32(renderSize.y));if (distancePixels>candidateSearchRadius) {continue;}
|
|
143
|
+
let score: f32=1.0-clamp(distancePixels/max(candidateSearchRadius,MESH_BLEND_EPSILON),0.0,1.0);if (score>best.score) {best.targetGroupId=candidateTag.groupId;best.radiusClass=seamRadiusClass;best.direction=direction;best.distancePixels=distancePixels;best.searchRadiusPixels=candidateSearchRadius;best.score=score;best.valid=true;}}
|
|
144
|
+
if (best.valid) {break;}}
|
|
145
|
+
return best;}
|
|
146
|
+
fn refineCandidateDirection(pixel: vec2i,renderSize: vec2i,candidate: MeshBlendCandidate,randomValues: vec2f)->MeshBlendCandidate {var refinedCandidate: MeshBlendCandidate=candidate;if (refinedCandidate.distancePixels<=2.0) {return refinedCandidate;}
|
|
147
|
+
let centerAngle: f32=atan2(refinedCandidate.direction.y,refinedCandidate.direction.x);let angularHalfWidth: f32=(MESH_BLEND_TWO_PI/f32(MESH_BLEND_DIRECTION_COUNT))*MESH_BLEND_DIRECTION_REFINEMENT_SECTOR_SCALE;let stepSize: f32=max(1.0,refinedCandidate.distancePixels/f32(MESH_BLEND_DIRECTION_REFINEMENT_STEP_COUNT+1));for (var sampleIndex: i32=0; sampleIndex<MESH_BLEND_DIRECTION_REFINEMENT_SAMPLE_COUNT; sampleIndex++) {let sampleRandom: f32=fract(randomValues.y+randomValues.x*0.754877666+f32(sampleIndex)*0.618033989);let angle: f32=centerAngle+mix(-angularHalfWidth,angularHalfWidth,sampleRandom);let direction: vec2f=vec2f(cos(angle),sin(angle));var testDistance: f32=refinedCandidate.distancePixels-stepSize;for (var stepIndex: i32=0; stepIndex<MESH_BLEND_DIRECTION_REFINEMENT_STEP_COUNT; stepIndex++) {if (testDistance<=0.0) {break;}
|
|
148
|
+
let samplePixel: vec2i=pixel+vec2i(round(direction*testDistance));let sampleTag: MeshBlendTag=loadMeshBlendTag(samplePixel,renderSize);if (sampleTag.groupId != refinedCandidate.targetGroupId) {break;}
|
|
149
|
+
refinedCandidate.direction=direction;refinedCandidate.distancePixels=testDistance;testDistance-=stepSize;}}
|
|
150
|
+
return refinedCandidate;}
|
|
151
|
+
fn refineExactBoundary(pixel: vec2i,renderSize: vec2i,candidate: MeshBlendCandidate)->MeshBlendCandidate {var refinedCandidate: MeshBlendCandidate=candidate;var distancePixels: f32=refinedCandidate.distancePixels;for (var sampleIndex: i32=0; sampleIndex<MESH_BLEND_EXACT_EDGE_SAMPLE_COUNT; sampleIndex++) {distancePixels-=1.0;if (distancePixels<=0.0) {break;}
|
|
152
|
+
let samplePixel: vec2i=pixel+vec2i(round(refinedCandidate.direction*distancePixels));let sampleTag: MeshBlendTag=loadMeshBlendTag(samplePixel,renderSize);if (sampleTag.groupId != refinedCandidate.targetGroupId) {break;}
|
|
153
|
+
refinedCandidate.distancePixels=distancePixels;}
|
|
154
|
+
return refinedCandidate;}
|
|
155
|
+
fn hasTargetContinuation(
|
|
156
|
+
pixel: vec2i,
|
|
157
|
+
renderSize: vec2i,
|
|
158
|
+
candidate: MeshBlendCandidate,
|
|
159
|
+
continuationPixel: ptr<function,vec2i>
|
|
160
|
+
)->bool {let continuationDistance: f32=max(candidate.distancePixels*2.0,candidate.distancePixels+1.0);*continuationPixel=pixel+vec2i(round(candidate.direction*continuationDistance));if (!isPixelInBounds(*continuationPixel,renderSize)) {return false;}
|
|
161
|
+
return loadMeshBlendTag(*continuationPixel,renderSize).groupId==candidate.targetGroupId;}
|
|
162
|
+
fn applyTargetRadiusClass(
|
|
163
|
+
targetPixel: vec2i,
|
|
164
|
+
renderSize: vec2i,
|
|
165
|
+
viewDepth: f32,
|
|
166
|
+
candidate: ptr<function,MeshBlendCandidate>
|
|
167
|
+
)->bool {let targetTag: MeshBlendTag=loadMeshBlendTag(targetPixel,renderSize);(*candidate).radiusClass=min((*candidate).radiusClass,targetTag.radiusClass);(*candidate).searchRadiusPixels=min(
|
|
168
|
+
(*candidate).searchRadiusPixels,
|
|
169
|
+
searchRadiusForClass((*candidate).radiusClass,viewDepth,f32(renderSize.y))
|
|
170
|
+
);return (*candidate).distancePixels<=(*candidate).searchRadiusPixels;}
|
|
171
|
+
#ifdef MESH_BLEND_FOUR_NEIGHBOR_FALLBACK
|
|
172
|
+
fn findImmediateNeighborCandidate(
|
|
173
|
+
pixel: vec2i,
|
|
174
|
+
renderSize: vec2i,
|
|
175
|
+
currentTag: MeshBlendTag,
|
|
176
|
+
viewDepth: f32,
|
|
177
|
+
ignoredGroupId: u32,
|
|
178
|
+
preferredGroupId: u32
|
|
179
|
+
)->MeshBlendCandidate {var best: MeshBlendCandidate=invalidCandidate();for (var neighborIndex: i32=0; neighborIndex<4; neighborIndex++) {var offset: vec2i;if (neighborIndex==0) {offset=vec2i(1,0);} else if (neighborIndex==1) {offset=vec2i(-1,0);} else if (neighborIndex==2) {offset=vec2i(0,1);} else {offset=vec2i(0,-1);}
|
|
180
|
+
let neighborTag: MeshBlendTag=loadMeshBlendTag(pixel+offset,renderSize);if (neighborTag.groupId==0u || neighborTag.groupId==currentTag.groupId || neighborTag.groupId==ignoredGroupId) {continue;}
|
|
181
|
+
let seamRadiusClass: u32=min(currentTag.radiusClass,neighborTag.radiusClass);let candidateSearchRadius: f32=searchRadiusForClass(seamRadiusClass,viewDepth,f32(renderSize.y));if (candidateSearchRadius<1.0) {continue;}
|
|
182
|
+
var score: f32=1.0-1.0/max(candidateSearchRadius,1.0);if (neighborTag.groupId==preferredGroupId) {score+=1.0;}
|
|
183
|
+
if (score>best.score) {best.targetGroupId=neighborTag.groupId;best.radiusClass=seamRadiusClass;best.direction=vec2f(offset);best.distancePixels=1.0;best.searchRadiusPixels=candidateSearchRadius;best.score=score;best.valid=true;}}
|
|
184
|
+
return best;}
|
|
185
|
+
#endif
|
|
186
|
+
#ifdef MESH_BLEND_TINY_OBJECT_SAFEGUARD
|
|
187
|
+
fn reduceRadiusForTinyObject(
|
|
188
|
+
pixel: vec2i,
|
|
189
|
+
renderSize: vec2i,
|
|
190
|
+
currentTag: MeshBlendTag,
|
|
191
|
+
candidate: MeshBlendCandidate,
|
|
192
|
+
radiusReduced: ptr<function,bool>
|
|
193
|
+
)->f32 {var measuredThickness: f32=candidate.searchRadiusPixels;var foundOppositeBoundary: bool=false;for (var probeIndex: i32=1; probeIndex<=MESH_BLEND_TINY_OBJECT_PROBE_COUNT; probeIndex++) {let probeDistance: f32=max(1.0,candidate.searchRadiusPixels*f32(probeIndex)/f32(MESH_BLEND_TINY_OBJECT_PROBE_COUNT));let oppositeTag: MeshBlendTag=loadMeshBlendTag(pixel-vec2i(round(candidate.direction*probeDistance)),renderSize);if (oppositeTag.groupId != currentTag.groupId) {measuredThickness=probeDistance;foundOppositeBoundary=true;break;}}
|
|
194
|
+
var outsideDirectionCount: i32=0;for (var neighborIndex: i32=0; neighborIndex<4; neighborIndex++) {var direction: vec2f;if (neighborIndex==0) {direction=vec2f(1.0,0.0);} else if (neighborIndex==1) {direction=vec2f(-1.0,0.0);} else if (neighborIndex==2) {direction=vec2f(0.0,1.0);} else {direction=vec2f(0.0,-1.0);}
|
|
195
|
+
let radiusTag: MeshBlendTag=loadMeshBlendTag(pixel+vec2i(round(direction*candidate.searchRadiusPixels)),renderSize);if (radiusTag.groupId != currentTag.groupId) {outsideDirectionCount++;}}
|
|
196
|
+
*radiusReduced=foundOppositeBoundary && outsideDirectionCount>=3;if (!*radiusReduced) {return candidate.searchRadiusPixels;}
|
|
197
|
+
let thicknessRadius: f32=max(1.0,measuredThickness*1.25);return max(candidate.distancePixels,min(candidate.searchRadiusPixels,thicknessRadius));}
|
|
198
|
+
#endif
|
|
199
|
+
fn validateMeshBlendContact(
|
|
200
|
+
pixelA: vec2i,
|
|
201
|
+
pixelE: vec2i,
|
|
202
|
+
pixelB: vec2i,
|
|
203
|
+
pixelC: vec2i,
|
|
204
|
+
renderSize: vec2i,
|
|
205
|
+
currentTag: MeshBlendTag,
|
|
206
|
+
candidate: MeshBlendCandidate,
|
|
207
|
+
allowMissingContinuation: bool,
|
|
208
|
+
narrowedSearchRadius: ptr<function,f32>,
|
|
209
|
+
currentViewPosition: ptr<function,vec3f>
|
|
210
|
+
)->i32 {*currentViewPosition=vec3f(0.0);let tagE: MeshBlendTag=loadMeshBlendTag(pixelE,renderSize);let tagB: MeshBlendTag=loadMeshBlendTag(pixelB,renderSize);let tagC: MeshBlendTag=loadMeshBlendTag(pixelC,renderSize);if (
|
|
211
|
+
tagE.groupId != currentTag.groupId ||
|
|
212
|
+
tagB.groupId != candidate.targetGroupId ||
|
|
213
|
+
(!allowMissingContinuation && tagC.groupId != candidate.targetGroupId)
|
|
214
|
+
) {return MESH_BLEND_REJECTION_NO_CONTINUATION;}
|
|
215
|
+
let depthA: f32=loadMeshBlendDepth(pixelA,renderSize);let depthE: f32=loadMeshBlendDepth(pixelE,renderSize);let depthB: f32=loadMeshBlendDepth(pixelB,renderSize);let depthC: f32=loadMeshBlendDepth(pixelC,renderSize);let positionA: vec3f=reconstructMeshBlendViewPosition(pixelA,renderSize,depthA);let positionE: vec3f=reconstructMeshBlendViewPosition(pixelE,renderSize,depthE);let positionB: vec3f=reconstructMeshBlendViewPosition(pixelB,renderSize,depthB);let positionC: vec3f=reconstructMeshBlendViewPosition(pixelC,renderSize,depthC);if (!isValidMeshBlendPosition(positionA) || !isValidMeshBlendPosition(positionE) || !isValidMeshBlendPosition(positionB) || !isValidMeshBlendPosition(positionC)) {return MESH_BLEND_REJECTION_INVALID_DEPTH;}
|
|
216
|
+
*currentViewPosition=positionA;let viewDepth: f32=abs(positionA.z);let unitsPerPixel: f32=worldUnitsPerPixel(viewDepth,f32(renderSize.y));let effectiveWorldRadius: f32=candidate.searchRadiusPixels*unitsPerPixel;let pixelTolerance: f32=unitsPerPixel*MESH_BLEND_BOUNDARY_PIXEL_TOLERANCE;let boundarySpan: vec3f=positionB-positionE;let boundarySeparation: f32=length(boundarySpan);if (boundarySeparation>effectiveWorldRadius*MESH_BLEND_BOUNDARY_SEPARATION_FACTOR+pixelTolerance) {return MESH_BLEND_REJECTION_DEPTH_SEPARATION;}
|
|
217
|
+
let boundaryDepthDelta: f32=abs(abs(positionB.z)-abs(positionE.z));let boundaryLateralSpan: f32=length(boundarySpan.xy);if (
|
|
218
|
+
boundaryDepthDelta>max(effectiveWorldRadius*MESH_BLEND_FOREGROUND_DEPTH_FACTOR,pixelTolerance) &&
|
|
219
|
+
boundaryDepthDelta>boundaryLateralSpan*MESH_BLEND_FOREGROUND_LATERAL_FACTOR
|
|
220
|
+
) {return MESH_BLEND_REJECTION_FOREGROUND_BACKGROUND;}
|
|
221
|
+
let targetSpan: f32=distance(positionB,positionC);let totalSpan: f32=distance(positionA,positionC);if (
|
|
222
|
+
targetSpan>effectiveWorldRadius*MESH_BLEND_TARGET_SPAN_FACTOR+pixelTolerance ||
|
|
223
|
+
totalSpan>effectiveWorldRadius*MESH_BLEND_TOTAL_SPAN_FACTOR+pixelTolerance
|
|
224
|
+
) {return MESH_BLEND_REJECTION_PHYSICAL_SPAN;}
|
|
225
|
+
let currentDirection: vec3f=positionA-positionB;let targetDirection: vec3f=positionC-positionB;let currentLength: f32=length(currentDirection);let targetLength: f32=length(targetDirection);var oppositeFacing: f32=1.0;if (currentLength>MESH_BLEND_EPSILON && targetLength>MESH_BLEND_EPSILON) {oppositeFacing=-dot(currentDirection/currentLength,targetDirection/targetLength);}
|
|
226
|
+
*narrowedSearchRadius=candidate.searchRadiusPixels*calculateSlopeScale(oppositeFacing);if (candidate.distancePixels>*narrowedSearchRadius) {return MESH_BLEND_REJECTION_CONTACT_ANGLE;}
|
|
227
|
+
return MESH_BLEND_REJECTION_NONE;}
|
|
228
|
+
fn calculateMeshBlendFade(distancePixels: f32,searchRadiusPixels: f32)->f32 {let boundaryDistance: f32=max(distancePixels-0.5,0.0);let normalizedDistance: f32=clamp(boundaryDistance/max(searchRadiusPixels,MESH_BLEND_EPSILON),0.0,1.0);let inverseDistance: f32=1.0-normalizedDistance;let fade: f32=mix(inverseDistance*inverseDistance,inverseDistance,clamp(inverseDistance-0.75,0.0,1.0));return fade*0.5;}
|
|
229
|
+
fn evaluateMeshBlend(
|
|
230
|
+
pixel: vec2i,
|
|
231
|
+
renderSize: vec2i,
|
|
232
|
+
currentTag: MeshBlendTag,
|
|
233
|
+
currentSearchRadius: f32,
|
|
234
|
+
viewDepth: f32,
|
|
235
|
+
ignoredGroupId: u32,
|
|
236
|
+
randomValues: vec2f,
|
|
237
|
+
rotation: f32,
|
|
238
|
+
sectorAngle: f32,
|
|
239
|
+
direction0: vec2f,
|
|
240
|
+
direction1: vec2f,
|
|
241
|
+
direction2: vec2f
|
|
242
|
+
)->MeshBlendResult {var result: MeshBlendResult=invalidBlendResult();var candidate: MeshBlendCandidate=findInitialCandidate(
|
|
243
|
+
pixel,
|
|
244
|
+
renderSize,
|
|
245
|
+
currentTag,
|
|
246
|
+
currentSearchRadius,
|
|
247
|
+
viewDepth,
|
|
248
|
+
ignoredGroupId,
|
|
249
|
+
randomValues,
|
|
250
|
+
rotation,
|
|
251
|
+
sectorAngle,
|
|
252
|
+
direction0,
|
|
253
|
+
direction1,
|
|
254
|
+
direction2
|
|
255
|
+
);result.candidate=candidate;if (!candidate.valid) {return result;}
|
|
256
|
+
result.stageReached=2;candidate=refineCandidateDirection(pixel,renderSize,candidate,randomValues);candidate=refineExactBoundary(pixel,renderSize,candidate);result.candidate=candidate;result.stageReached=3;let refinedTargetPixel: vec2i=clampPixel(pixel+vec2i(round(candidate.direction*candidate.distancePixels)),renderSize);if (!applyTargetRadiusClass(refinedTargetPixel,renderSize,viewDepth,&candidate)) {result.candidate=candidate;result.rejectionReason=MESH_BLEND_REJECTION_PHYSICAL_SPAN;return result;}
|
|
257
|
+
result.candidate=candidate;var continuationPixel: vec2i;var continuationFound: bool=hasTargetContinuation(pixel,renderSize,candidate,&continuationPixel);if (!continuationFound) {
|
|
258
|
+
#ifdef MESH_BLEND_FOUR_NEIGHBOR_FALLBACK
|
|
259
|
+
let fallbackCandidate: MeshBlendCandidate=findImmediateNeighborCandidate(
|
|
260
|
+
pixel,
|
|
261
|
+
renderSize,
|
|
262
|
+
currentTag,
|
|
263
|
+
viewDepth,
|
|
264
|
+
ignoredGroupId,
|
|
265
|
+
candidate.targetGroupId
|
|
266
|
+
);if (!fallbackCandidate.valid) {result.rejectionReason=MESH_BLEND_REJECTION_NO_CONTINUATION;return result;}
|
|
267
|
+
candidate=fallbackCandidate;result.candidate=candidate;result.usedFallback=true;continuationFound=hasTargetContinuation(pixel,renderSize,candidate,&continuationPixel);
|
|
268
|
+
#else
|
|
269
|
+
result.rejectionReason=MESH_BLEND_REJECTION_NO_CONTINUATION;return result;
|
|
270
|
+
#endif
|
|
271
|
+
}
|
|
272
|
+
result.continuationFound=continuationFound;result.stageReached=4;if (continuationFound && !applyTargetRadiusClass(continuationPixel,renderSize,viewDepth,&candidate)) {result.candidate=candidate;result.rejectionReason=MESH_BLEND_REJECTION_PHYSICAL_SPAN;return result;}
|
|
273
|
+
result.candidate=candidate;let originalSearchRadius: f32=candidate.searchRadiusPixels;
|
|
274
|
+
#ifdef MESH_BLEND_TINY_OBJECT_SAFEGUARD
|
|
275
|
+
var tinyObjectRadiusReduced: bool=false;candidate.searchRadiusPixels=reduceRadiusForTinyObject(pixel,renderSize,currentTag,candidate,&tinyObjectRadiusReduced);result.tinyObjectRadiusReduced=tinyObjectRadiusReduced;result.stageReached=5;
|
|
276
|
+
#endif
|
|
277
|
+
result.candidate=candidate;result.effectiveRadiusPixels=candidate.searchRadiusPixels;result.tinyObjectRadiusRatio=candidate.searchRadiusPixels/max(originalSearchRadius,MESH_BLEND_EPSILON);let pixelB: vec2i=clampPixel(pixel+vec2i(round(candidate.direction*candidate.distancePixels)),renderSize);let pixelE: vec2i=clampPixel(pixel+vec2i(round(candidate.direction*max(candidate.distancePixels-2.0,0.0))),renderSize);var pixelC: vec2i=pixelB;if (continuationFound) {pixelC=continuationPixel;}
|
|
278
|
+
var narrowedSearchRadius: f32=candidate.searchRadiusPixels;var currentViewPosition: vec3f=vec3f(0.0);result.rejectionReason=validateMeshBlendContact(
|
|
279
|
+
pixel,
|
|
280
|
+
pixelE,
|
|
281
|
+
pixelB,
|
|
282
|
+
pixelC,
|
|
283
|
+
renderSize,
|
|
284
|
+
currentTag,
|
|
285
|
+
candidate,
|
|
286
|
+
result.usedFallback && !continuationFound,
|
|
287
|
+
&narrowedSearchRadius,
|
|
288
|
+
¤tViewPosition
|
|
289
|
+
);result.currentViewPosition=currentViewPosition;result.stageReached=6;result.effectiveRadiusPixels=narrowedSearchRadius;if (result.rejectionReason != MESH_BLEND_REJECTION_NONE) {return result;}
|
|
290
|
+
result.fade=calculateMeshBlendFade(candidate.distancePixels,narrowedSearchRadius);if (result.fade<=0.0) {result.rejectionReason=MESH_BLEND_REJECTION_PHYSICAL_SPAN;return result;}
|
|
291
|
+
result.targetPixel=pixelB;result.targetFarPixel=pixelB;if (continuationFound) {result.targetFarPixel=continuationPixel;}
|
|
292
|
+
result.stageReached=7;result.valid=true;return result;}
|
|
293
|
+
fn meshBlendLinearToSrgbChannel(value: f32)->f32 {if (value<=0.0031308) {return value*12.92;}
|
|
294
|
+
return 1.055*pow(value,1.0/2.4)-0.055;}
|
|
295
|
+
fn meshBlendSrgbToLinearChannel(value: f32)->f32 {if (value<=0.04045) {return value/12.92;}
|
|
296
|
+
return pow((value+0.055)/1.055,2.4);}
|
|
297
|
+
fn meshBlendLinearToSrgb(color: vec3f)->vec3f {return vec3f(
|
|
298
|
+
meshBlendLinearToSrgbChannel(color.r),
|
|
299
|
+
meshBlendLinearToSrgbChannel(color.g),
|
|
300
|
+
meshBlendLinearToSrgbChannel(color.b)
|
|
301
|
+
);}
|
|
302
|
+
fn meshBlendSrgbToLinear(color: vec3f)->vec3f {return vec3f(
|
|
303
|
+
meshBlendSrgbToLinearChannel(color.r),
|
|
304
|
+
meshBlendSrgbToLinearChannel(color.g),
|
|
305
|
+
meshBlendSrgbToLinearChannel(color.b)
|
|
306
|
+
);}
|
|
307
|
+
fn meshBlendSignedCubeRoot(value: f32)->f32 {return sign(value)*pow(abs(value),1.0/3.0);}
|
|
308
|
+
fn meshBlendLinearSrgbToOklab(color: vec3f)->vec3f {let longResponse: f32=0.4122214708*color.r+0.5363325363*color.g+0.0514459929*color.b;let mediumResponse: f32=0.2119034982*color.r+0.6806995451*color.g+0.1073969566*color.b;let shortResponse: f32=0.0883024619*color.r+0.2817188376*color.g+0.6299787005*color.b;let longRoot: f32=meshBlendSignedCubeRoot(longResponse);let mediumRoot: f32=meshBlendSignedCubeRoot(mediumResponse);let shortRoot: f32=meshBlendSignedCubeRoot(shortResponse);return vec3f(
|
|
309
|
+
0.2104542553*longRoot+0.7936177850*mediumRoot-0.0040720468*shortRoot,
|
|
310
|
+
1.9779984951*longRoot-2.4285922050*mediumRoot+0.4505937099*shortRoot,
|
|
311
|
+
0.0259040371*longRoot+0.7827717662*mediumRoot-0.8086757660*shortRoot
|
|
312
|
+
);}
|
|
313
|
+
fn meshBlendOklabToLinearSrgb(color: vec3f)->vec3f {let longRoot: f32=color.x+0.3963377774*color.y+0.2158037573*color.z;let mediumRoot: f32=color.x-0.1055613458*color.y-0.0638541728*color.z;let shortRoot: f32=color.x-0.0894841775*color.y-1.2914855480*color.z;let longResponse: f32=longRoot*longRoot*longRoot;let mediumResponse: f32=mediumRoot*mediumRoot*mediumRoot;let shortResponse: f32=shortRoot*shortRoot*shortRoot;return vec3f(
|
|
314
|
+
4.0767416621*longResponse-3.3077115913*mediumResponse+0.2309699292*shortResponse,
|
|
315
|
+
-1.2684380046*longResponse+2.6097574011*mediumResponse-0.3413193965*shortResponse,
|
|
316
|
+
-0.0041960863*longResponse-0.7034186147*mediumResponse+1.7076147010*shortResponse
|
|
317
|
+
);}
|
|
318
|
+
fn interpolateMeshBlendColor(currentColor: vec3f,targetColor: vec3f,factor: f32)->vec3f {
|
|
319
|
+
#ifdef MESH_BLEND_COLOR_INTERPOLATION_SRGB
|
|
320
|
+
return meshBlendSrgbToLinear(mix(meshBlendLinearToSrgb(currentColor),meshBlendLinearToSrgb(targetColor),factor));
|
|
321
|
+
#else
|
|
322
|
+
return meshBlendOklabToLinearSrgb(mix(meshBlendLinearSrgbToOklab(currentColor),meshBlendLinearSrgbToOklab(targetColor),factor));
|
|
323
|
+
#endif
|
|
324
|
+
}
|
|
325
|
+
fn meshBlendLuminance(srgbColor: vec3f)->f32 {return dot(srgbColor,vec3f(0.2126,0.7152,0.0722));}
|
|
326
|
+
fn constructMeshBlendTargetColorSamples(renderSize: vec2i,result: MeshBlendResult)->MeshBlendTargetColorSamples {var samples: MeshBlendTargetColorSamples;let boundaryPlusOnePixel: vec2i=clampPixel(result.targetPixel+vec2i(round(result.candidate.direction)),renderSize);let boundaryPlusTwoPixel: vec2i=clampPixel(result.targetPixel+vec2i(round(result.candidate.direction*2.0)),renderSize);let boundaryPlusOneTag: MeshBlendTag=loadMeshBlendTag(boundaryPlusOnePixel,renderSize);let boundaryPlusTwoTag: MeshBlendTag=loadMeshBlendTag(boundaryPlusTwoPixel,renderSize);samples.fartherColor=textureLoad(textureSampler,result.targetFarPixel,0);samples.boundaryPlusOneColor=textureLoad(textureSampler,boundaryPlusOnePixel,0);samples.boundaryPlusTwoColor=textureLoad(textureSampler,boundaryPlusTwoPixel,0);
|
|
327
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
328
|
+
samples.fartherBaseColor=textureLoad(meshBlendBaseColorSampler,result.targetFarPixel,0).rgb;let boundaryPlusOneBaseColor: vec3f=textureLoad(meshBlendBaseColorSampler,boundaryPlusOnePixel,0).rgb;let boundaryPlusTwoBaseColor: vec3f=textureLoad(meshBlendBaseColorSampler,boundaryPlusTwoPixel,0).rgb;
|
|
329
|
+
#endif
|
|
330
|
+
samples.onePixelEdge=boundaryPlusOneTag.groupId != result.candidate.targetGroupId;if (samples.onePixelEdge) {samples.conservativeNearColor=samples.fartherColor;
|
|
331
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
332
|
+
samples.conservativeNearBaseColor=samples.fartherBaseColor;
|
|
333
|
+
#endif
|
|
334
|
+
samples.targetColor=samples.fartherColor;return samples;}
|
|
335
|
+
let secondNearSampleIsTarget: bool=boundaryPlusTwoTag.groupId==result.candidate.targetGroupId;let firstNearLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(samples.boundaryPlusOneColor.rgb));let secondNearLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(samples.boundaryPlusTwoColor.rgb));let useSecondNearSample: bool=secondNearSampleIsTarget && secondNearLuminance<firstNearLuminance;if (useSecondNearSample) {samples.conservativeNearColor=samples.boundaryPlusTwoColor;
|
|
336
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
337
|
+
samples.conservativeNearBaseColor=boundaryPlusTwoBaseColor;
|
|
338
|
+
#endif
|
|
339
|
+
} else {samples.conservativeNearColor=samples.boundaryPlusOneColor;
|
|
340
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
341
|
+
samples.conservativeNearBaseColor=boundaryPlusOneBaseColor;
|
|
342
|
+
#endif
|
|
343
|
+
}
|
|
344
|
+
samples.targetColor=mix(samples.fartherColor,samples.conservativeNearColor,MESH_BLEND_NEAR_EDGE_TARGET_WEIGHT);return samples;}
|
|
345
|
+
fn applyMeshBlendNearSeamCorrection(
|
|
346
|
+
pixel: vec2i,
|
|
347
|
+
renderSize: vec2i,
|
|
348
|
+
currentTag: MeshBlendTag,
|
|
349
|
+
result: MeshBlendResult,
|
|
350
|
+
samples: MeshBlendTargetColorSamples,
|
|
351
|
+
currentColor: vec4f,
|
|
352
|
+
corrected: ptr<function,bool>
|
|
353
|
+
)->vec4f {*corrected=false;if (!samples.onePixelEdge || result.candidate.distancePixels>MESH_BLEND_NEAR_SEAM_MAX_DISTANCE) {return currentColor;}
|
|
354
|
+
let oppositePixel: vec2i=clampPixel(pixel-vec2i(round(result.candidate.direction)),renderSize);let oppositeTag: MeshBlendTag=loadMeshBlendTag(oppositePixel,renderSize);if (oppositeTag.groupId != currentTag.groupId) {return currentColor;}
|
|
355
|
+
let oppositeColor: vec4f=textureLoad(textureSampler,oppositePixel,0);let currentTargetDistance: f32=distance(currentColor.rgb,samples.targetColor.rgb);let oppositeTargetDistance: f32=distance(oppositeColor.rgb,samples.targetColor.rgb);if (currentTargetDistance+MESH_BLEND_NEAR_SEAM_COLOR_DELTA>=oppositeTargetDistance) {return currentColor;}
|
|
356
|
+
*corrected=true;return oppositeColor;}
|
|
357
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
358
|
+
fn estimateMeshBlendShadow(renderedLinear: vec3f,baseColorLinear: vec3f)->f32 {let renderedLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(renderedLinear));let baseLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(baseColorLinear));if (baseLuminance<=MESH_BLEND_BASE_LUMINANCE_EPSILON) {return 1.0;}
|
|
359
|
+
return renderedLuminance/baseLuminance;}
|
|
360
|
+
fn calculateMeshBlendShadowAttenuation(currentColor: vec3f,samples: MeshBlendTargetColorSamples)->f32 {let fartherShadow: f32=estimateMeshBlendShadow(samples.fartherColor.rgb,samples.fartherBaseColor);let nearShadow: f32=estimateMeshBlendShadow(samples.conservativeNearColor.rgb,samples.conservativeNearBaseColor);let shadowDifference: f32=abs(fartherShadow-nearShadow);let shadowMismatch: f32=smoothstep(MESH_BLEND_SHADOW_DIFFERENCE_LOW,MESH_BLEND_SHADOW_DIFFERENCE_HIGH,shadowDifference);let currentLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(currentColor));let targetLuminance: f32=meshBlendLuminance(meshBlendLinearToSrgb(samples.targetColor.rgb));let targetToCurrentRatio: f32=targetLuminance/max(currentLuminance,MESH_BLEND_BASE_LUMINANCE_EPSILON);let targetIsNotDark: f32=smoothstep(MESH_BLEND_TARGET_DARKER_RATIO,MESH_BLEND_TARGET_NON_DARK_RATIO,targetToCurrentRatio);return mix(1.0,MESH_BLEND_SHADOW_MIN_ATTENUATION,shadowMismatch*targetIsNotDark);}
|
|
361
|
+
#endif
|
|
362
|
+
fn evaluateMeshBlendColor(
|
|
363
|
+
pixel: vec2i,
|
|
364
|
+
renderSize: vec2i,
|
|
365
|
+
currentTag: MeshBlendTag,
|
|
366
|
+
result: MeshBlendResult
|
|
367
|
+
)->MeshBlendColorEvaluation {var evaluation: MeshBlendColorEvaluation;evaluation.samples=constructMeshBlendTargetColorSamples(renderSize,result);
|
|
368
|
+
#ifdef MESH_BLEND_DEBUG_WORLD_POSITION
|
|
369
|
+
evaluation.worldPosition=reconstructMeshBlendWorldPosition(result.currentViewPosition);
|
|
370
|
+
#endif
|
|
371
|
+
let currentSceneColor: vec4f=textureLoad(textureSampler,pixel,0);var nearSeamCorrected: bool=false;evaluation.currentColor=applyMeshBlendNearSeamCorrection(
|
|
372
|
+
pixel,
|
|
373
|
+
renderSize,
|
|
374
|
+
currentTag,
|
|
375
|
+
result,
|
|
376
|
+
evaluation.samples,
|
|
377
|
+
currentSceneColor,
|
|
378
|
+
&nearSeamCorrected
|
|
379
|
+
);evaluation.nearSeamCorrected=nearSeamCorrected;evaluation.shadowAttenuation=1.0;
|
|
380
|
+
#ifdef MESH_BLEND_SHADOW_ESTIMATION
|
|
381
|
+
evaluation.shadowAttenuation=calculateMeshBlendShadowAttenuation(evaluation.currentColor.rgb,evaluation.samples);
|
|
382
|
+
#endif
|
|
383
|
+
evaluation.adjustedFade=result.fade*evaluation.shadowAttenuation;evaluation.blendedColor=vec4f(
|
|
384
|
+
interpolateMeshBlendColor(evaluation.currentColor.rgb,evaluation.samples.targetColor.rgb,evaluation.adjustedFade),
|
|
385
|
+
mix(evaluation.currentColor.a,evaluation.samples.targetColor.a,evaluation.adjustedFade)
|
|
386
|
+
);return evaluation;}
|
|
387
|
+
fn radiusClassDebugColor(radiusClass: u32)->vec3f {if (radiusClass==0u) {return vec3f(0.15,0.55,1.0);}
|
|
388
|
+
if (radiusClass==1u) {return vec3f(0.15,0.9,0.35);}
|
|
389
|
+
if (radiusClass==2u) {return vec3f(1.0,0.65,0.1);}
|
|
390
|
+
return vec3f(0.95,0.2,0.65);}
|
|
391
|
+
fn validationDebugColor(rejectionReason: i32,narrowedRadiusRatio: f32)->vec3f {if (rejectionReason==MESH_BLEND_REJECTION_NONE) {return mix(vec3f(0.1,0.55,1.0),vec3f(0.2,1.0,0.25),narrowedRadiusRatio);}
|
|
392
|
+
if (rejectionReason==MESH_BLEND_REJECTION_NO_CANDIDATE) {return vec3f(0.12);}
|
|
393
|
+
if (rejectionReason==MESH_BLEND_REJECTION_NO_CONTINUATION) {return vec3f(0.75,0.1,0.85);}
|
|
394
|
+
if (rejectionReason==MESH_BLEND_REJECTION_INVALID_DEPTH) {return vec3f(1.0,0.0,1.0);}
|
|
395
|
+
if (rejectionReason==MESH_BLEND_REJECTION_DEPTH_SEPARATION) {return vec3f(1.0,0.1,0.1);}
|
|
396
|
+
if (rejectionReason==MESH_BLEND_REJECTION_FOREGROUND_BACKGROUND) {return vec3f(1.0,0.4,0.05);}
|
|
397
|
+
if (rejectionReason==MESH_BLEND_REJECTION_PHYSICAL_SPAN) {return vec3f(1.0,0.9,0.05);}
|
|
398
|
+
return vec3f(0.05,0.8,1.0);}
|
|
399
|
+
fn processingStageDebugColor(stageReached: i32)->vec3f {if (stageReached<=0) {return vec3f(0.03);}
|
|
400
|
+
if (stageReached==1) {return vec3f(0.1,0.15,0.45);}
|
|
401
|
+
if (stageReached==2) {return vec3f(0.1,0.35,0.7);}
|
|
402
|
+
if (stageReached==3) {return vec3f(0.05,0.65,0.8);}
|
|
403
|
+
if (stageReached==4) {return vec3f(0.1,0.8,0.55);}
|
|
404
|
+
if (stageReached==5) {return vec3f(0.45,0.9,0.25);}
|
|
405
|
+
if (stageReached==6) {return vec3f(0.95,0.75,0.1);}
|
|
406
|
+
return vec3f(0.15,1.0,0.25);}
|
|
407
|
+
fn candidateDebugColor(result: MeshBlendResult)->vec3f {if (!result.candidate.valid) {return vec3f(0.04);}
|
|
408
|
+
let normalizedDistance: f32=clamp(
|
|
409
|
+
result.candidate.distancePixels/max(result.candidate.searchRadiusPixels,MESH_BLEND_EPSILON),
|
|
410
|
+
0.0,
|
|
411
|
+
1.0
|
|
412
|
+
);return vec3f(result.candidate.direction*0.5+0.5,1.0-normalizedDistance);}
|
|
413
|
+
#define CUSTOM_FRAGMENT_DEFINITIONS
|
|
414
|
+
@fragment
|
|
415
|
+
fn main(input: FragmentInputs)->FragmentOutputs {let renderSize: vec2i=vec2i(textureDimensions(meshBlendDepthSampler,0));let pixel: vec2i=clampPixel(vec2i(floor(input.vUV*vec2f(renderSize))),renderSize);let currentTag: MeshBlendTag=loadMeshBlendTag(pixel,renderSize);
|
|
416
|
+
#ifdef MESH_BLEND_DEBUG_PACKED_TAG
|
|
417
|
+
let groupVariation: f32=0.45+0.55*fract(f32(currentTag.groupId)*0.61803398875);let tagColor: vec3f=radiusClassDebugColor(currentTag.radiusClass)*groupVariation;if (currentTag.groupId==0u) {fragmentOutputs.color=vec4f(0.0,0.0,0.0,1.0);} else {fragmentOutputs.color=vec4f(tagColor,1.0);}
|
|
418
|
+
return fragmentOutputs;
|
|
419
|
+
#endif
|
|
420
|
+
if (currentTag.groupId==0u) {
|
|
421
|
+
#ifdef MESH_BLEND_DEBUG_SEAM_FADE
|
|
422
|
+
fragmentOutputs.color=vec4f(0.0,0.0,0.0,1.0);
|
|
423
|
+
#elif defined(MESH_BLEND_DEBUG_ENABLED)
|
|
424
|
+
fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);
|
|
425
|
+
#else
|
|
426
|
+
fragmentOutputs.color=textureLoad(textureSampler,pixel,0);
|
|
427
|
+
#endif
|
|
428
|
+
return fragmentOutputs;}
|
|
429
|
+
let sizingDepth: f32=loadMeshBlendDepth(pixel,renderSize);let sizingPosition: vec3f=reconstructMeshBlendViewPosition(pixel,renderSize,sizingDepth);if (!isValidMeshBlendPosition(sizingPosition)) {
|
|
430
|
+
#ifdef MESH_BLEND_DEBUG_REJECTION_REASON
|
|
431
|
+
fragmentOutputs.color=vec4f(validationDebugColor(MESH_BLEND_REJECTION_INVALID_DEPTH,0.0),1.0);
|
|
432
|
+
#elif defined(MESH_BLEND_DEBUG_STAGE_WORK)
|
|
433
|
+
fragmentOutputs.color=vec4f(0.45,0.1,0.1,1.0);
|
|
434
|
+
#elif defined(MESH_BLEND_DEBUG_ENABLED)
|
|
435
|
+
fragmentOutputs.color=vec4f(0.4,0.05,0.4,1.0);
|
|
436
|
+
#else
|
|
437
|
+
fragmentOutputs.color=textureLoad(textureSampler,pixel,0);
|
|
438
|
+
#endif
|
|
439
|
+
return fragmentOutputs;}
|
|
440
|
+
let currentViewDepth: f32=abs(sizingPosition.z);let currentSearchRadius: f32=searchRadiusForClass(currentTag.radiusClass,currentViewDepth,f32(renderSize.y));if (currentSearchRadius<1.0) {
|
|
441
|
+
#ifdef MESH_BLEND_DEBUG_SEAM_FADE
|
|
442
|
+
fragmentOutputs.color=vec4f(radiusClassDebugColor(currentTag.radiusClass)*0.25,1.0);
|
|
443
|
+
#elif defined(MESH_BLEND_DEBUG_REJECTION_REASON)
|
|
444
|
+
fragmentOutputs.color=vec4f(validationDebugColor(MESH_BLEND_REJECTION_PHYSICAL_SPAN,0.0),1.0);
|
|
445
|
+
#elif defined(MESH_BLEND_DEBUG_STAGE_WORK)
|
|
446
|
+
fragmentOutputs.color=vec4f(0.2,0.2,0.65,1.0);
|
|
447
|
+
#elif defined(MESH_BLEND_DEBUG_ENABLED)
|
|
448
|
+
fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);
|
|
449
|
+
#else
|
|
450
|
+
fragmentOutputs.color=textureLoad(textureSampler,pixel,0);
|
|
451
|
+
#endif
|
|
452
|
+
return fragmentOutputs;}
|
|
453
|
+
let randomValues: vec2f=loadStableBlueNoise(pixel);let sectorAngle: f32=MESH_BLEND_TWO_PI/f32(MESH_BLEND_DIRECTION_COUNT);var rotation: f32;
|
|
454
|
+
#ifdef MESH_BLEND_FULL_RANDOM_ROTATION
|
|
455
|
+
rotation=randomValues.x*sectorAngle;
|
|
456
|
+
#else
|
|
457
|
+
rotation=floor(randomValues.x*8.0)*0.125*sectorAngle;
|
|
458
|
+
#endif
|
|
459
|
+
let direction0: vec2f=vec2f(cos(rotation),sin(rotation));let direction1: vec2f=vec2f(cos(rotation+sectorAngle),sin(rotation+sectorAngle));let direction2: vec2f=vec2f(cos(rotation+sectorAngle*2.0),sin(rotation+sectorAngle*2.0));let primaryResult: MeshBlendResult=evaluateMeshBlend(
|
|
460
|
+
pixel,
|
|
461
|
+
renderSize,
|
|
462
|
+
currentTag,
|
|
463
|
+
currentSearchRadius,
|
|
464
|
+
currentViewDepth,
|
|
465
|
+
0u,
|
|
466
|
+
randomValues,
|
|
467
|
+
rotation,
|
|
468
|
+
sectorAngle,
|
|
469
|
+
direction0,
|
|
470
|
+
direction1,
|
|
471
|
+
direction2
|
|
472
|
+
);var secondaryResult: MeshBlendResult=invalidBlendResult();
|
|
473
|
+
#ifdef MESH_BLEND_MULTI_TARGET_SECONDARY_BLEND
|
|
474
|
+
if (primaryResult.valid) {secondaryResult=evaluateMeshBlend(
|
|
475
|
+
pixel,
|
|
476
|
+
renderSize,
|
|
477
|
+
currentTag,
|
|
478
|
+
currentSearchRadius,
|
|
479
|
+
currentViewDepth,
|
|
480
|
+
primaryResult.candidate.targetGroupId,
|
|
481
|
+
randomValues,
|
|
482
|
+
rotation,
|
|
483
|
+
sectorAngle,
|
|
484
|
+
direction0,
|
|
485
|
+
direction1,
|
|
486
|
+
direction2
|
|
487
|
+
);}
|
|
488
|
+
#endif
|
|
489
|
+
#ifdef MESH_BLEND_DEBUG_CANDIDATE_DIRECTION_DISTANCE
|
|
490
|
+
fragmentOutputs.color=vec4f(candidateDebugColor(primaryResult),1.0);return fragmentOutputs;
|
|
491
|
+
#elif defined(MESH_BLEND_DEBUG_CONTINUATION)
|
|
492
|
+
if (!primaryResult.candidate.valid) {fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);} else if (primaryResult.rejectionReason==MESH_BLEND_REJECTION_NO_CONTINUATION) {fragmentOutputs.color=vec4f(0.85,0.05,0.7,1.0);} else if (primaryResult.usedFallback) {fragmentOutputs.color=vec4f(1.0,0.75,0.05,1.0);} else {fragmentOutputs.color=vec4f(0.1,0.9,0.25,1.0);}
|
|
493
|
+
return fragmentOutputs;
|
|
494
|
+
#elif defined(MESH_BLEND_DEBUG_TINY_OBJECT)
|
|
495
|
+
#ifdef MESH_BLEND_TINY_OBJECT_SAFEGUARD
|
|
496
|
+
if (!primaryResult.candidate.valid) {fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);} else {let radiusColor: vec3f=mix(vec3f(1.0,0.1,0.05),vec3f(0.1,0.65,1.0),primaryResult.tinyObjectRadiusRatio);if (primaryResult.tinyObjectRadiusReduced) {fragmentOutputs.color=vec4f(radiusColor,1.0);} else {fragmentOutputs.color=vec4f(radiusColor*0.45,1.0);}}
|
|
497
|
+
#else
|
|
498
|
+
fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);
|
|
499
|
+
#endif
|
|
500
|
+
return fragmentOutputs;
|
|
501
|
+
#elif defined(MESH_BLEND_DEBUG_MULTI_TARGET)
|
|
502
|
+
#ifdef MESH_BLEND_MULTI_TARGET_SECONDARY_BLEND
|
|
503
|
+
if (secondaryResult.valid) {fragmentOutputs.color=vec4f(0.95,0.95,1.0,1.0);} else if (secondaryResult.candidate.valid) {fragmentOutputs.color=vec4f(0.8,0.15,0.75,1.0);} else if (primaryResult.valid) {fragmentOutputs.color=vec4f(0.1,0.45,0.95,1.0);} else {fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);}
|
|
504
|
+
#else
|
|
505
|
+
if (primaryResult.valid) {fragmentOutputs.color=vec4f(0.1,0.45,0.95,1.0);} else {fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);}
|
|
506
|
+
#endif
|
|
507
|
+
return fragmentOutputs;
|
|
508
|
+
#elif defined(MESH_BLEND_DEBUG_REJECTION_REASON)
|
|
509
|
+
var narrowedRadiusRatio: f32=0.0;if (primaryResult.candidate.valid) {narrowedRadiusRatio=primaryResult.effectiveRadiusPixels/max(primaryResult.candidate.searchRadiusPixels,MESH_BLEND_EPSILON);}
|
|
510
|
+
fragmentOutputs.color=vec4f(validationDebugColor(primaryResult.rejectionReason,narrowedRadiusRatio),1.0);return fragmentOutputs;
|
|
511
|
+
#elif defined(MESH_BLEND_DEBUG_STAGE_WORK)
|
|
512
|
+
var stageReached: i32=primaryResult.stageReached;
|
|
513
|
+
#ifdef MESH_BLEND_MULTI_TARGET_SECONDARY_BLEND
|
|
514
|
+
stageReached=max(stageReached,secondaryResult.stageReached);
|
|
515
|
+
#endif
|
|
516
|
+
fragmentOutputs.color=vec4f(processingStageDebugColor(stageReached),1.0);return fragmentOutputs;
|
|
517
|
+
#endif
|
|
518
|
+
if (!primaryResult.valid) {
|
|
519
|
+
#ifdef MESH_BLEND_DEBUG_SEAM_FADE
|
|
520
|
+
var debugRadiusClass: u32=currentTag.radiusClass;if (primaryResult.candidate.valid) {debugRadiusClass=primaryResult.candidate.radiusClass;}
|
|
521
|
+
fragmentOutputs.color=vec4f(radiusClassDebugColor(debugRadiusClass)*0.25,1.0);
|
|
522
|
+
#elif defined(MESH_BLEND_DEBUG_TARGET_COLOR) || defined(MESH_BLEND_DEBUG_SHADOW_ATTENUATION) || defined(MESH_BLEND_DEBUG_COLOR_INTERPOLATION) || defined(MESH_BLEND_DEBUG_WORLD_POSITION)
|
|
523
|
+
fragmentOutputs.color=vec4f(0.04,0.04,0.04,1.0);
|
|
524
|
+
#else
|
|
525
|
+
fragmentOutputs.color=textureLoad(textureSampler,pixel,0);
|
|
526
|
+
#endif
|
|
527
|
+
return fragmentOutputs;}
|
|
528
|
+
#ifdef MESH_BLEND_DEBUG_SEAM_FADE
|
|
529
|
+
var debugFade: f32=primaryResult.fade;
|
|
530
|
+
#ifdef MESH_BLEND_MULTI_TARGET_SECONDARY_BLEND
|
|
531
|
+
if (secondaryResult.valid) {debugFade=min(0.5,primaryResult.fade+secondaryResult.fade);}
|
|
532
|
+
#endif
|
|
533
|
+
let classColor: vec3f=radiusClassDebugColor(primaryResult.candidate.radiusClass)*0.25;fragmentOutputs.color=vec4f(mix(classColor,vec3f(1.0),clamp(debugFade*2.0,0.0,1.0)),1.0);return fragmentOutputs;
|
|
534
|
+
#else
|
|
535
|
+
let primaryColorEvaluation: MeshBlendColorEvaluation=evaluateMeshBlendColor(pixel,renderSize,currentTag,primaryResult);
|
|
536
|
+
#ifdef MESH_BLEND_DEBUG_WORLD_POSITION
|
|
537
|
+
fragmentOutputs.color=vec4f(fract(primaryColorEvaluation.worldPosition*0.1),1.0);return fragmentOutputs;
|
|
538
|
+
#elif defined(MESH_BLEND_DEBUG_TARGET_COLOR)
|
|
539
|
+
let targetSampleIndex: i32=(pixel.x/4) % 4;if (targetSampleIndex==0) {fragmentOutputs.color=primaryColorEvaluation.samples.fartherColor;} else if (targetSampleIndex==1) {fragmentOutputs.color=primaryColorEvaluation.samples.boundaryPlusOneColor;} else if (targetSampleIndex==2) {fragmentOutputs.color=primaryColorEvaluation.samples.boundaryPlusTwoColor;} else {fragmentOutputs.color=primaryColorEvaluation.samples.targetColor;}
|
|
540
|
+
return fragmentOutputs;
|
|
541
|
+
#elif defined(MESH_BLEND_DEBUG_SHADOW_ATTENUATION)
|
|
542
|
+
var nearSeamCorrectionDebug: f32=0.0;if (primaryColorEvaluation.nearSeamCorrected) {nearSeamCorrectionDebug=1.0;}
|
|
543
|
+
fragmentOutputs.color=vec4f(
|
|
544
|
+
1.0-primaryColorEvaluation.shadowAttenuation,
|
|
545
|
+
primaryColorEvaluation.shadowAttenuation,
|
|
546
|
+
nearSeamCorrectionDebug,
|
|
547
|
+
1.0
|
|
548
|
+
);return fragmentOutputs;
|
|
549
|
+
#elif defined(MESH_BLEND_DEBUG_COLOR_INTERPOLATION)
|
|
550
|
+
#ifdef MESH_BLEND_COLOR_INTERPOLATION_SRGB
|
|
551
|
+
let interpolationModeColor: vec3f=vec3f(1.0,0.4,0.05);
|
|
552
|
+
#else
|
|
553
|
+
let interpolationModeColor: vec3f=vec3f(0.1,0.75,1.0);
|
|
554
|
+
#endif
|
|
555
|
+
let interpolationStage: f32=mix(0.35,1.0,clamp(primaryColorEvaluation.adjustedFade*2.0,0.0,1.0));fragmentOutputs.color=vec4f(interpolationModeColor*interpolationStage,1.0);return fragmentOutputs;
|
|
556
|
+
#else
|
|
557
|
+
#ifdef MESH_BLEND_MULTI_TARGET_SECONDARY_BLEND
|
|
558
|
+
if (secondaryResult.valid) {let secondaryColorEvaluation: MeshBlendColorEvaluation=evaluateMeshBlendColor(pixel,renderSize,currentTag,secondaryResult);let totalBoundaryDistance: f32=max(
|
|
559
|
+
primaryResult.candidate.distancePixels+secondaryResult.candidate.distancePixels,
|
|
560
|
+
MESH_BLEND_EPSILON
|
|
561
|
+
);let primaryRelativeProximity: f32=secondaryResult.candidate.distancePixels/totalBoundaryDistance;let secondaryRelativeProximity: f32=primaryResult.candidate.distancePixels/totalBoundaryDistance;let primaryWeight: f32=primaryColorEvaluation.adjustedFade*primaryRelativeProximity;let secondaryWeight: f32=secondaryColorEvaluation.adjustedFade*secondaryRelativeProximity;let combinedWeight: f32=primaryWeight+secondaryWeight;if (combinedWeight<=MESH_BLEND_EPSILON) {fragmentOutputs.color=textureLoad(textureSampler,pixel,0);return fragmentOutputs;}
|
|
562
|
+
fragmentOutputs.color =
|
|
563
|
+
(primaryColorEvaluation.blendedColor*primaryWeight+secondaryColorEvaluation.blendedColor*secondaryWeight)/combinedWeight;return fragmentOutputs;}
|
|
564
|
+
#endif
|
|
565
|
+
fragmentOutputs.color=primaryColorEvaluation.blendedColor;
|
|
566
|
+
#endif
|
|
567
|
+
#endif
|
|
568
|
+
}
|
|
569
|
+
`;
|
|
570
|
+
// Sideeffect
|
|
571
|
+
if (!ShaderStore.ShadersStoreWGSL[name]) {
|
|
572
|
+
ShaderStore.ShadersStoreWGSL[name] = shader;
|
|
573
|
+
}
|
|
574
|
+
/** @internal */
|
|
575
|
+
export const meshBlendingPixelShaderWGSL = { name, shader };
|
|
576
|
+
//# sourceMappingURL=meshBlending.fragment.js.map
|