@aura3d/rendering 2.0.4 → 3.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/dist/AtmosphereWetness.d.ts +61 -0
- package/dist/AtmosphereWetness.d.ts.map +1 -0
- package/dist/AtmosphereWetness.js +99 -0
- package/dist/AtmosphereWetness.js.map +1 -0
- package/dist/CascadedShadowMaps.d.ts.map +1 -1
- package/dist/CascadedShadowMaps.js +3 -1
- package/dist/CascadedShadowMaps.js.map +1 -1
- package/dist/ClusteredForwardLighting.d.ts +25 -1
- package/dist/ClusteredForwardLighting.d.ts.map +1 -1
- package/dist/ClusteredForwardLighting.js +80 -3
- package/dist/ClusteredForwardLighting.js.map +1 -1
- package/dist/DayNightSky.d.ts +63 -0
- package/dist/DayNightSky.d.ts.map +1 -0
- package/dist/DayNightSky.js +156 -0
- package/dist/DayNightSky.js.map +1 -0
- package/dist/EnvironmentPresetPack.d.ts +30 -0
- package/dist/EnvironmentPresetPack.d.ts.map +1 -0
- package/dist/EnvironmentPresetPack.js +49 -0
- package/dist/EnvironmentPresetPack.js.map +1 -0
- package/dist/ExtensionScalarAtlas.d.ts +18 -0
- package/dist/ExtensionScalarAtlas.d.ts.map +1 -0
- package/dist/ExtensionScalarAtlas.js +107 -0
- package/dist/ExtensionScalarAtlas.js.map +1 -0
- package/dist/ForwardPass.d.ts +65 -0
- package/dist/ForwardPass.d.ts.map +1 -1
- package/dist/ForwardPass.js +196 -2
- package/dist/ForwardPass.js.map +1 -1
- package/dist/InstancedPBRMaterial.d.ts +1 -0
- package/dist/InstancedPBRMaterial.d.ts.map +1 -1
- package/dist/InstancedPBRMaterial.js +3 -0
- package/dist/InstancedPBRMaterial.js.map +1 -1
- package/dist/InstancingDiagnostics.d.ts +69 -0
- package/dist/InstancingDiagnostics.d.ts.map +1 -0
- package/dist/InstancingDiagnostics.js +98 -0
- package/dist/InstancingDiagnostics.js.map +1 -0
- package/dist/LeanWebGL2Device.d.ts +265 -0
- package/dist/LeanWebGL2Device.d.ts.map +1 -0
- package/dist/LeanWebGL2Device.js +4001 -0
- package/dist/LeanWebGL2Device.js.map +1 -0
- package/dist/LightingRig.d.ts +19 -1
- package/dist/LightingRig.d.ts.map +1 -1
- package/dist/LightingRig.js +61 -1
- package/dist/LightingRig.js.map +1 -1
- package/dist/MaterialBinding.js +1 -1
- package/dist/MaterialBinding.js.map +1 -1
- package/dist/MeshConsolidation.d.ts +12 -0
- package/dist/MeshConsolidation.d.ts.map +1 -1
- package/dist/MeshConsolidation.js +28 -0
- package/dist/MeshConsolidation.js.map +1 -1
- package/dist/MorphTargetPlan.d.ts +29 -2
- package/dist/MorphTargetPlan.d.ts.map +1 -1
- package/dist/MorphTargetPlan.js +23 -4
- package/dist/MorphTargetPlan.js.map +1 -1
- package/dist/NormalMappedPBRMaterial.d.ts.map +1 -1
- package/dist/NormalMappedPBRMaterial.js +22 -2
- package/dist/NormalMappedPBRMaterial.js.map +1 -1
- package/dist/OceanSurface.d.ts +75 -0
- package/dist/OceanSurface.d.ts.map +1 -1
- package/dist/OceanSurface.js +211 -0
- package/dist/OceanSurface.js.map +1 -1
- package/dist/PBRMaterial.d.ts +1 -0
- package/dist/PBRMaterial.d.ts.map +1 -1
- package/dist/PBRMaterial.js +23 -2
- package/dist/PBRMaterial.js.map +1 -1
- package/dist/PbrReference.d.ts +48 -0
- package/dist/PbrReference.d.ts.map +1 -1
- package/dist/PbrReference.js +126 -0
- package/dist/PbrReference.js.map +1 -1
- package/dist/PlanarReflection.d.ts +221 -0
- package/dist/PlanarReflection.d.ts.map +1 -0
- package/dist/PlanarReflection.js +541 -0
- package/dist/PlanarReflection.js.map +1 -0
- package/dist/PostProcessPass.d.ts +32 -0
- package/dist/PostProcessPass.d.ts.map +1 -1
- package/dist/PostProcessPass.js +79 -36
- package/dist/PostProcessPass.js.map +1 -1
- package/dist/ProjectionMath.d.ts +3 -0
- package/dist/ProjectionMath.d.ts.map +1 -0
- package/dist/ProjectionMath.js +26 -0
- package/dist/ProjectionMath.js.map +1 -0
- package/dist/ReflectionSurfaces.d.ts +17 -0
- package/dist/ReflectionSurfaces.d.ts.map +1 -1
- package/dist/ReflectionSurfaces.js +103 -1
- package/dist/ReflectionSurfaces.js.map +1 -1
- package/dist/RenderDevice.d.ts +92 -0
- package/dist/RenderDevice.d.ts.map +1 -1
- package/dist/RenderDevice.js +85 -0
- package/dist/RenderDevice.js.map +1 -1
- package/dist/Renderer.d.ts +9 -0
- package/dist/Renderer.d.ts.map +1 -1
- package/dist/Renderer.js +97 -9
- package/dist/Renderer.js.map +1 -1
- package/dist/RendererPostprocessPlan.d.ts +64 -3
- package/dist/RendererPostprocessPlan.d.ts.map +1 -1
- package/dist/RendererPostprocessPlan.js +116 -12
- package/dist/RendererPostprocessPlan.js.map +1 -1
- package/dist/RendererVisualPipelineReport.d.ts.map +1 -1
- package/dist/RendererVisualPipelineReport.js +3 -1
- package/dist/RendererVisualPipelineReport.js.map +1 -1
- package/dist/Sampler.d.ts +29 -0
- package/dist/Sampler.d.ts.map +1 -1
- package/dist/Sampler.js +47 -0
- package/dist/Sampler.js.map +1 -1
- package/dist/ScreenSpaceReflectionPass.d.ts +43 -0
- package/dist/ScreenSpaceReflectionPass.d.ts.map +1 -0
- package/dist/ScreenSpaceReflectionPass.js +58 -0
- package/dist/ScreenSpaceReflectionPass.js.map +1 -0
- package/dist/SdfText.d.ts +250 -0
- package/dist/SdfText.d.ts.map +1 -0
- package/dist/SdfText.js +551 -0
- package/dist/SdfText.js.map +1 -0
- package/dist/ShaderChunks.d.ts.map +1 -1
- package/dist/ShaderChunks.js +30 -12
- package/dist/ShaderChunks.js.map +1 -1
- package/dist/ShaderLibrary.d.ts.map +1 -1
- package/dist/ShaderLibrary.js +601 -186
- package/dist/ShaderLibrary.js.map +1 -1
- package/dist/ShaderLibraryCore.d.ts +3 -0
- package/dist/ShaderLibraryCore.d.ts.map +1 -1
- package/dist/ShaderLibraryCore.js +73 -12
- package/dist/ShaderLibraryCore.js.map +1 -1
- package/dist/ShadowMap.d.ts +24 -0
- package/dist/ShadowMap.d.ts.map +1 -1
- package/dist/ShadowMap.js +43 -0
- package/dist/ShadowMap.js.map +1 -1
- package/dist/SkinnedLitMaterial.d.ts.map +1 -1
- package/dist/SkinnedLitMaterial.js +2 -0
- package/dist/SkinnedLitMaterial.js.map +1 -1
- package/dist/SkinningBounds.d.ts +10 -0
- package/dist/SkinningBounds.d.ts.map +1 -1
- package/dist/SkinningBounds.js +27 -0
- package/dist/SkinningBounds.js.map +1 -1
- package/dist/SpriteFlipbook.d.ts +60 -0
- package/dist/SpriteFlipbook.d.ts.map +1 -0
- package/dist/SpriteFlipbook.js +128 -0
- package/dist/SpriteFlipbook.js.map +1 -0
- package/dist/TemporalHistory.d.ts +37 -0
- package/dist/TemporalHistory.d.ts.map +1 -0
- package/dist/TemporalHistory.js +135 -0
- package/dist/TemporalHistory.js.map +1 -0
- package/dist/TemporalMath.d.ts +3 -0
- package/dist/TemporalMath.d.ts.map +1 -0
- package/dist/TemporalMath.js +9 -0
- package/dist/TemporalMath.js.map +1 -0
- package/dist/TerrainTiles.d.ts +120 -0
- package/dist/TerrainTiles.d.ts.map +1 -0
- package/dist/TerrainTiles.js +221 -0
- package/dist/TerrainTiles.js.map +1 -0
- package/dist/TexturedPBRMaterial.d.ts +4 -0
- package/dist/TexturedPBRMaterial.d.ts.map +1 -1
- package/dist/TexturedPBRMaterial.js +88 -5
- package/dist/TexturedPBRMaterial.js.map +1 -1
- package/dist/TexturedUnlitMaterial.d.ts.map +1 -1
- package/dist/TexturedUnlitMaterial.js +20 -2
- package/dist/TexturedUnlitMaterial.js.map +1 -1
- package/dist/UnlitMaterial.d.ts.map +1 -1
- package/dist/UnlitMaterial.js +20 -2
- package/dist/UnlitMaterial.js.map +1 -1
- package/dist/VertexFormat.d.ts +6 -0
- package/dist/VertexFormat.d.ts.map +1 -1
- package/dist/VertexFormat.js +12 -0
- package/dist/VertexFormat.js.map +1 -1
- package/dist/VolumetricFog.d.ts +55 -0
- package/dist/VolumetricFog.d.ts.map +1 -0
- package/dist/VolumetricFog.js +91 -0
- package/dist/VolumetricFog.js.map +1 -0
- package/dist/WaterSurface.d.ts +77 -0
- package/dist/WaterSurface.d.ts.map +1 -0
- package/dist/WaterSurface.js +133 -0
- package/dist/WaterSurface.js.map +1 -0
- package/dist/WebGL2Device.d.ts +73 -0
- package/dist/WebGL2Device.d.ts.map +1 -1
- package/dist/WebGL2Device.js +836 -79
- package/dist/WebGL2Device.js.map +1 -1
- package/dist/WebGPUDevice.d.ts +62 -1
- package/dist/WebGPUDevice.d.ts.map +1 -1
- package/dist/WebGPUDevice.js +844 -51
- package/dist/WebGPUDevice.js.map +1 -1
- package/dist/WebGPUExtensionAtlas.d.ts +6 -0
- package/dist/WebGPUExtensionAtlas.d.ts.map +1 -0
- package/dist/WebGPUExtensionAtlas.js +225 -0
- package/dist/WebGPUExtensionAtlas.js.map +1 -0
- package/dist/WebGPUSkinningLimits.d.ts +40 -0
- package/dist/WebGPUSkinningLimits.d.ts.map +1 -1
- package/dist/WebGPUSkinningLimits.js +32 -0
- package/dist/WebGPUSkinningLimits.js.map +1 -1
- package/dist/effects/CollisionModule.d.ts +9 -0
- package/dist/effects/CollisionModule.d.ts.map +1 -1
- package/dist/effects/CollisionModule.js +10 -0
- package/dist/effects/CollisionModule.js.map +1 -1
- package/dist/effects/ColorModule.d.ts +7 -0
- package/dist/effects/ColorModule.d.ts.map +1 -1
- package/dist/effects/ColorModule.js +23 -0
- package/dist/effects/ColorModule.js.map +1 -1
- package/dist/effects/ForceModule.d.ts +35 -0
- package/dist/effects/ForceModule.d.ts.map +1 -1
- package/dist/effects/ForceModule.js +49 -0
- package/dist/effects/ForceModule.js.map +1 -1
- package/dist/effects/GPUParticleBackend.d.ts +188 -0
- package/dist/effects/GPUParticleBackend.d.ts.map +1 -1
- package/dist/effects/GPUParticleBackend.js +710 -1
- package/dist/effects/GPUParticleBackend.js.map +1 -1
- package/dist/effects/HeightfieldModule.d.ts +58 -0
- package/dist/effects/HeightfieldModule.d.ts.map +1 -0
- package/dist/effects/HeightfieldModule.js +129 -0
- package/dist/effects/HeightfieldModule.js.map +1 -0
- package/dist/effects/LightingModule.d.ts +34 -0
- package/dist/effects/LightingModule.d.ts.map +1 -0
- package/dist/effects/LightingModule.js +54 -0
- package/dist/effects/LightingModule.js.map +1 -0
- package/dist/effects/ParticleDiagnostics.d.ts +8 -0
- package/dist/effects/ParticleDiagnostics.d.ts.map +1 -1
- package/dist/effects/ParticleDiagnostics.js +3 -0
- package/dist/effects/ParticleDiagnostics.js.map +1 -1
- package/dist/effects/ParticleModule.d.ts +8 -0
- package/dist/effects/ParticleModule.d.ts.map +1 -1
- package/dist/effects/ParticleModule.js.map +1 -1
- package/dist/effects/ParticleRenderer.d.ts +20 -0
- package/dist/effects/ParticleRenderer.d.ts.map +1 -1
- package/dist/effects/ParticleRenderer.js +57 -7
- package/dist/effects/ParticleRenderer.js.map +1 -1
- package/dist/effects/ParticleSystem.d.ts +45 -1
- package/dist/effects/ParticleSystem.d.ts.map +1 -1
- package/dist/effects/ParticleSystem.js +373 -4
- package/dist/effects/ParticleSystem.js.map +1 -1
- package/dist/effects/ResidentGPUParticleRenderer.d.ts +158 -0
- package/dist/effects/ResidentGPUParticleRenderer.d.ts.map +1 -0
- package/dist/effects/ResidentGPUParticleRenderer.js +576 -0
- package/dist/effects/ResidentGPUParticleRenderer.js.map +1 -0
- package/dist/effects/SizeModule.d.ts +4 -0
- package/dist/effects/SizeModule.d.ts.map +1 -1
- package/dist/effects/SizeModule.js +16 -0
- package/dist/effects/SizeModule.js.map +1 -1
- package/dist/effects/SubEmitterModule.d.ts +61 -0
- package/dist/effects/SubEmitterModule.d.ts.map +1 -0
- package/dist/effects/SubEmitterModule.js +119 -0
- package/dist/effects/SubEmitterModule.js.map +1 -0
- package/dist/effects/TrailModule.d.ts +38 -0
- package/dist/effects/TrailModule.d.ts.map +1 -1
- package/dist/effects/TrailModule.js +95 -2
- package/dist/effects/TrailModule.js.map +1 -1
- package/dist/effects/TurbulenceModule.d.ts +43 -0
- package/dist/effects/TurbulenceModule.d.ts.map +1 -0
- package/dist/effects/TurbulenceModule.js +130 -0
- package/dist/effects/TurbulenceModule.js.map +1 -0
- package/dist/effects/index.d.ts +4 -0
- package/dist/effects/index.d.ts.map +1 -1
- package/dist/effects/index.js +4 -0
- package/dist/effects/index.js.map +1 -1
- package/dist/extension-scalar-atlas.d.ts +3 -0
- package/dist/extension-scalar-atlas.d.ts.map +1 -0
- package/dist/extension-scalar-atlas.js +2 -0
- package/dist/extension-scalar-atlas.js.map +1 -0
- package/dist/index.d.ts +58 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +32 -10
- package/dist/index.js.map +1 -1
- package/dist/lean/LeanProductionRenderer.d.ts.map +1 -1
- package/dist/lean/LeanProductionRenderer.js +2 -2
- package/dist/lean/LeanProductionRenderer.js.map +1 -1
- package/dist/lean-core-runtime.d.ts +13 -0
- package/dist/lean-core-runtime.d.ts.map +1 -0
- package/dist/lean-core-runtime.js +10 -0
- package/dist/lean-core-runtime.js.map +1 -0
- package/dist/materials/MaterialExtensions.js +3 -3
- package/dist/materials/MaterialExtensions.js.map +1 -1
- package/dist/postprocess/NativeBloomPyramid.d.ts +44 -0
- package/dist/postprocess/NativeBloomPyramid.d.ts.map +1 -0
- package/dist/postprocess/NativeBloomPyramid.js +84 -0
- package/dist/postprocess/NativeBloomPyramid.js.map +1 -0
- package/dist/postprocess/NativeLdrEffectLuts.d.ts +10 -1
- package/dist/postprocess/NativeLdrEffectLuts.d.ts.map +1 -1
- package/dist/postprocess/NativeLdrEffectLuts.js +19 -2
- package/dist/postprocess/NativeLdrEffectLuts.js.map +1 -1
- package/dist/postprocess/index.d.ts +2 -0
- package/dist/postprocess/index.d.ts.map +1 -1
- package/dist/postprocess/index.js +1 -0
- package/dist/postprocess/index.js.map +1 -1
- package/dist/production-runtime/PBRHDRPipeline.d.ts +22 -0
- package/dist/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
- package/dist/production-runtime/PBRHDRPipeline.js +125 -0
- package/dist/production-runtime/PBRHDRPipeline.js.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.d.ts +1 -0
- package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +3 -0
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js +8 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js.map +1 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +4 -0
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.js +15 -0
- package/dist/production-runtime/ProductionWebGL2Renderer.js.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts +58 -0
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.js +127 -0
- package/dist/production-runtime/ProductionWebGPURenderer.js.map +1 -1
- package/dist/production-runtime/framegraph/FrameGraph.d.ts +4 -2
- package/dist/production-runtime/framegraph/FrameGraph.d.ts.map +1 -1
- package/dist/production-runtime/framegraph/FrameGraph.js +62 -4
- package/dist/production-runtime/framegraph/FrameGraph.js.map +1 -1
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts +32 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts.map +1 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js +111 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js.map +1 -0
- package/dist/production-runtime/framegraph/RenderPass.d.ts +23 -0
- package/dist/production-runtime/framegraph/RenderPass.d.ts.map +1 -1
- package/dist/production-runtime/framegraph/RenderPass.js +87 -1
- package/dist/production-runtime/framegraph/RenderPass.js.map +1 -1
- package/dist/production-runtime/index.d.ts +7 -4
- package/dist/production-runtime/index.d.ts.map +1 -1
- package/dist/production-runtime/index.js +4 -2
- package/dist/production-runtime/index.js.map +1 -1
- package/dist/production-runtime/passes/DepthPrepass.d.ts +18 -1
- package/dist/production-runtime/passes/DepthPrepass.d.ts.map +1 -1
- package/dist/production-runtime/passes/DepthPrepass.js +41 -2
- package/dist/production-runtime/passes/DepthPrepass.js.map +1 -1
- package/dist/production-runtime/passes/FramegraphTopology.d.ts +13 -0
- package/dist/production-runtime/passes/FramegraphTopology.d.ts.map +1 -0
- package/dist/production-runtime/passes/FramegraphTopology.js +59 -0
- package/dist/production-runtime/passes/FramegraphTopology.js.map +1 -0
- package/dist/production-runtime/passes/OpaquePass.d.ts +19 -1
- package/dist/production-runtime/passes/OpaquePass.d.ts.map +1 -1
- package/dist/production-runtime/passes/OpaquePass.js +43 -2
- package/dist/production-runtime/passes/OpaquePass.js.map +1 -1
- package/dist/production-runtime/passes/ShadowPass.d.ts +19 -1
- package/dist/production-runtime/passes/ShadowPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ShadowPass.js +45 -2
- package/dist/production-runtime/passes/ShadowPass.js.map +1 -1
- package/dist/production-runtime/passes/SkyboxPass.d.ts +17 -1
- package/dist/production-runtime/passes/SkyboxPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/SkyboxPass.js +41 -2
- package/dist/production-runtime/passes/SkyboxPass.js.map +1 -1
- package/dist/production-runtime/passes/ToneMappingPass.d.ts +26 -1
- package/dist/production-runtime/passes/ToneMappingPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ToneMappingPass.js +62 -2
- package/dist/production-runtime/passes/ToneMappingPass.js.map +1 -1
- package/dist/production-runtime/passes/TransparentPass.d.ts +19 -1
- package/dist/production-runtime/passes/TransparentPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/TransparentPass.js +47 -2
- package/dist/production-runtime/passes/TransparentPass.js.map +1 -1
- package/dist/reflection-surfaces.d.ts +5 -0
- package/dist/reflection-surfaces.d.ts.map +1 -0
- package/dist/reflection-surfaces.js +3 -0
- package/dist/reflection-surfaces.js.map +1 -0
- package/dist/shadows/CascadeHysteresis.d.ts +67 -0
- package/dist/shadows/CascadeHysteresis.d.ts.map +1 -0
- package/dist/shadows/CascadeHysteresis.js +104 -0
- package/dist/shadows/CascadeHysteresis.js.map +1 -0
- package/dist/shadows/ContactShadows.d.ts +52 -0
- package/dist/shadows/ContactShadows.d.ts.map +1 -1
- package/dist/shadows/ContactShadows.js +122 -0
- package/dist/shadows/ContactShadows.js.map +1 -1
- package/dist/shadows/SpotShadowMaps.d.ts +77 -0
- package/dist/shadows/SpotShadowMaps.d.ts.map +1 -0
- package/dist/shadows/SpotShadowMaps.js +106 -0
- package/dist/shadows/SpotShadowMaps.js.map +1 -0
- package/dist/webgpu/WebGPUPostProcess.d.ts +2 -0
- package/dist/webgpu/WebGPUPostProcess.d.ts.map +1 -1
- package/dist/webgpu/WebGPUPostProcess.js +1 -0
- package/dist/webgpu/WebGPUPostProcess.js.map +1 -1
- package/dist/webgpu/WebGPUPostShaders.d.ts +77 -0
- package/dist/webgpu/WebGPUPostShaders.d.ts.map +1 -0
- package/dist/webgpu/WebGPUPostShaders.js +261 -0
- package/dist/webgpu/WebGPUPostShaders.js.map +1 -0
- package/dist/webgpu/WebGPUTemporal.d.ts +17 -0
- package/dist/webgpu/WebGPUTemporal.d.ts.map +1 -0
- package/dist/webgpu/WebGPUTemporal.js +64 -0
- package/dist/webgpu/WebGPUTemporal.js.map +1 -0
- package/dist/webgpu.d.ts +6 -0
- package/dist/webgpu.d.ts.map +1 -1
- package/dist/webgpu.js +4 -0
- package/dist/webgpu.js.map +1 -1
- package/package.json +15 -3
|
@@ -0,0 +1,541 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* B4 reflection math (muse3jsparity-PRD).
|
|
3
|
+
*
|
|
4
|
+
* Owns the planar-reflector math the `ReflectionSurfaces.ts` claim-boundary
|
|
5
|
+
* contract records as missing: mirror-camera construction, oblique
|
|
6
|
+
* near-plane clipping, glass thickness-tinted refraction parameters, water
|
|
7
|
+
* depth-tinted reflection/refraction parameters, and a package-level SSR
|
|
8
|
+
* ray-march pass descriptor with explicit resolution/step caps.
|
|
9
|
+
*
|
|
10
|
+
* Scope honesty: the plan/descriptor functions below are CPU-side math a
|
|
11
|
+
* renderer path consumes. The capture classes further down ARE renderer
|
|
12
|
+
* paths: they own real render targets, bind the oblique clip projection and
|
|
13
|
+
* the Beer-Lambert / depth-tint pixel composites, and expose sampled
|
|
14
|
+
* textures. ScreenSpaceReflectionPass consumes the SSR descriptor and shares
|
|
15
|
+
* the native renderer kernel; this remains package-level evidence.
|
|
16
|
+
*/
|
|
17
|
+
import { Sampler } from "./Sampler.js";
|
|
18
|
+
import { Texture } from "./Texture.js";
|
|
19
|
+
import { TextureBinding } from "./TextureBinding.js";
|
|
20
|
+
import { TexturedUnlitMaterial } from "./TexturedUnlitMaterial.js";
|
|
21
|
+
/**
|
|
22
|
+
* Mirror-camera construction for a horizontal plane at height `planeY`.
|
|
23
|
+
* Follows the three.js Reflector convention: reflect eye/target/up across
|
|
24
|
+
* the plane and supply the reflection matrix for texture-matrix computation.
|
|
25
|
+
*/
|
|
26
|
+
export function computePlanarMirrorCamera(eye, target, up, planeY) {
|
|
27
|
+
for (const [label, v] of [["eye", eye], ["target", target], ["up", up]]) {
|
|
28
|
+
if (v.length !== 3 || v.some((c) => !Number.isFinite(c))) {
|
|
29
|
+
throw new RangeError(`Planar mirror ${label} must contain three finite values.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (!Number.isFinite(planeY))
|
|
33
|
+
throw new RangeError("Planar mirror planeY must be finite.");
|
|
34
|
+
const mirror = (p) => [p[0], 2 * planeY - p[1], p[2]];
|
|
35
|
+
// Reflection across y = planeY flips the Y basis vector.
|
|
36
|
+
const reflectionMatrix = [
|
|
37
|
+
1, 0, 0, 0,
|
|
38
|
+
0, -1, 0, 0,
|
|
39
|
+
0, 0, 1, 0,
|
|
40
|
+
0, 2 * planeY, 0, 1,
|
|
41
|
+
];
|
|
42
|
+
// Oblique clip plane in mirrored space: keep geometry above the plane.
|
|
43
|
+
const clipPlane = [0, -1, 0, planeY + 0.001];
|
|
44
|
+
return { eye: mirror(eye), target: mirror(target), up: mirror(up), reflectionMatrix, clipPlane };
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Oblique near-plane clip, following the three.js Reflector formulation
|
|
48
|
+
* (r185 semantics): the camera-space clip plane is scaled against the
|
|
49
|
+
* projection elements and spliced into elements [2]/[6]/[10]/[14]
|
|
50
|
+
* (column-major storage, WebGL transpose=false convention used across
|
|
51
|
+
* ForwardPass matrices). Pure matrix surgery; the renderer binds the result.
|
|
52
|
+
*/
|
|
53
|
+
export function computeObliqueClipProjection(projectionMatrix, clipPlane, clipBias = 0) {
|
|
54
|
+
if (projectionMatrix.length !== 16 || projectionMatrix.some((c) => !Number.isFinite(c))) {
|
|
55
|
+
throw new RangeError("Oblique clip projection matrix must hold 16 finite numbers.");
|
|
56
|
+
}
|
|
57
|
+
if (clipPlane.length !== 4 || clipPlane.some((c) => !Number.isFinite(c))) {
|
|
58
|
+
throw new RangeError("Oblique clip plane must hold 4 finite numbers.");
|
|
59
|
+
}
|
|
60
|
+
if (!Number.isFinite(clipBias) || clipBias < 0)
|
|
61
|
+
throw new RangeError("Oblique clipBias must be finite and non-negative.");
|
|
62
|
+
const m = [...projectionMatrix];
|
|
63
|
+
const sign = (value) => (value >= 0 ? 1 : -1);
|
|
64
|
+
const qx = (sign(clipPlane[0]) + m[8]) / m[0];
|
|
65
|
+
const qy = (sign(clipPlane[1]) + m[9]) / m[5];
|
|
66
|
+
const qz = -1;
|
|
67
|
+
const qw = (1 + m[10]) / m[14];
|
|
68
|
+
if (![qx, qy, qz, qw].every(Number.isFinite)) {
|
|
69
|
+
throw new RangeError("Oblique clip projection is degenerate for this projection matrix.");
|
|
70
|
+
}
|
|
71
|
+
const dot = clipPlane[0] * qx + clipPlane[1] * qy + clipPlane[2] * qz + clipPlane[3] * qw;
|
|
72
|
+
if (Math.abs(dot) <= 1e-9)
|
|
73
|
+
throw new RangeError("Oblique clip plane is degenerate against the projection frustum.");
|
|
74
|
+
const scale = 2 / dot;
|
|
75
|
+
const scaled = [
|
|
76
|
+
clipPlane[0] * scale,
|
|
77
|
+
clipPlane[1] * scale,
|
|
78
|
+
clipPlane[2] * scale,
|
|
79
|
+
clipPlane[3] * scale,
|
|
80
|
+
];
|
|
81
|
+
m[2] = scaled[0];
|
|
82
|
+
m[6] = scaled[1];
|
|
83
|
+
m[10] = scaled[2] + 1 - clipBias;
|
|
84
|
+
m[14] = scaled[3];
|
|
85
|
+
return { projectionMatrix: m, clipPlane };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Glass refractor parameters: thickness drives a Beer-Lambert transmittance
|
|
89
|
+
* proxy and the fetch offset scale; roughness drives the blur radius.
|
|
90
|
+
* Bounded: single-scatter proxy, not spectral volume.
|
|
91
|
+
*/
|
|
92
|
+
export function resolveGlassRefractionParams(options) {
|
|
93
|
+
const thickness = options.thickness;
|
|
94
|
+
const roughness = options.roughness;
|
|
95
|
+
const absorption = options.absorption ?? 0.35;
|
|
96
|
+
const maxBlur = options.maxBlurTexels ?? 8;
|
|
97
|
+
if (!Number.isFinite(thickness) || thickness < 0)
|
|
98
|
+
throw new RangeError("Glass thickness must be finite and non-negative.");
|
|
99
|
+
if (!Number.isFinite(roughness) || roughness < 0 || roughness > 1)
|
|
100
|
+
throw new RangeError("Glass roughness must be in [0, 1].");
|
|
101
|
+
if (!Number.isFinite(absorption) || absorption < 0)
|
|
102
|
+
throw new RangeError("Glass absorption must be finite and non-negative.");
|
|
103
|
+
if (!Number.isFinite(maxBlur) || maxBlur <= 0)
|
|
104
|
+
throw new RangeError("Glass maxBlurTexels must be finite and positive.");
|
|
105
|
+
return {
|
|
106
|
+
offsetScale: Number((Math.min(thickness, 10) * 0.02).toFixed(6)),
|
|
107
|
+
transmittance: Number(Math.exp(-absorption * thickness).toFixed(6)),
|
|
108
|
+
blurRadiusTexels: Number((roughness * maxBlur).toFixed(4)),
|
|
109
|
+
diagnostic: "Thickness-tinted refraction proxy (single-scatter Beer-Lambert); not spectral volume.",
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Water look parameters: shallow water shows refracted bed color, deep
|
|
114
|
+
* water absorbs toward the tint color and favors planar reflection.
|
|
115
|
+
* No true ocean spectra claim.
|
|
116
|
+
*/
|
|
117
|
+
export function resolveWaterReflectionRefraction(options) {
|
|
118
|
+
const depth = options.depth;
|
|
119
|
+
if (!Number.isFinite(depth) || depth < 0)
|
|
120
|
+
throw new RangeError("Water depth must be finite and non-negative.");
|
|
121
|
+
const turbidity = options.turbidity ?? 0.5;
|
|
122
|
+
if (!Number.isFinite(turbidity) || turbidity < 0 || turbidity > 1)
|
|
123
|
+
throw new RangeError("Water turbidity must be in [0, 1].");
|
|
124
|
+
const shallow = options.shallowColor ?? [0.35, 0.55, 0.55];
|
|
125
|
+
const deep = options.deepColor ?? [0.02, 0.12, 0.2];
|
|
126
|
+
for (const [label, color] of [["shallowColor", shallow], ["deepColor", deep]]) {
|
|
127
|
+
if (color.length !== 3 || color.some((c) => !Number.isFinite(c) || c < 0 || c > 1)) {
|
|
128
|
+
throw new RangeError(`Water ${label} must contain three finite values in [0, 1].`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const depthFactor = 1 - Math.exp(-depth * (0.35 + turbidity));
|
|
132
|
+
const mixAmount = Number(depthFactor.toFixed(6));
|
|
133
|
+
const depthTint = [
|
|
134
|
+
Number((shallow[0] + (deep[0] - shallow[0]) * mixAmount).toFixed(6)),
|
|
135
|
+
Number((shallow[1] + (deep[1] - shallow[1]) * mixAmount).toFixed(6)),
|
|
136
|
+
Number((shallow[2] + (deep[2] - shallow[2]) * mixAmount).toFixed(6)),
|
|
137
|
+
];
|
|
138
|
+
return {
|
|
139
|
+
reflectionStrength: Number((0.25 + 0.65 * mixAmount).toFixed(4)),
|
|
140
|
+
refractionStrength: Number((0.9 * (1 - mixAmount) + 0.1).toFixed(4)),
|
|
141
|
+
depthTint,
|
|
142
|
+
diagnostic: "Depth-tinted planar look (no true ocean spectra); planar target binding stays a B4 renderer dependency.",
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Column-major lookAt for a planar-mirror eye, matching the ForwardPass
|
|
147
|
+
* matrix convention (WebGL transpose=false storage).
|
|
148
|
+
*/
|
|
149
|
+
export function computePlanarViewMatrix(eye, target, up) {
|
|
150
|
+
for (const [label, v] of [["eye", eye], ["target", target], ["up", up]]) {
|
|
151
|
+
if (v.length !== 3 || v.some((c) => !Number.isFinite(c))) {
|
|
152
|
+
throw new RangeError(`Planar view ${label} must contain three finite values.`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
const z = normalize3([eye[0] - target[0], eye[1] - target[1], eye[2] - target[2]]);
|
|
156
|
+
const x = normalize3(cross3(up, z));
|
|
157
|
+
const y = cross3(z, x);
|
|
158
|
+
return new Float32Array([
|
|
159
|
+
x[0], y[0], z[0], 0,
|
|
160
|
+
x[1], y[1], z[1], 0,
|
|
161
|
+
x[2], y[2], z[2], 0,
|
|
162
|
+
-dot3(x, eye), -dot3(y, eye), -dot3(z, eye), 1,
|
|
163
|
+
]);
|
|
164
|
+
}
|
|
165
|
+
/** Column-major perspective matrix (WebGL transpose=false storage). */
|
|
166
|
+
export function createPlanarProjectionMatrix(fovYRadians, aspect, near, far) {
|
|
167
|
+
if (!Number.isFinite(fovYRadians) || fovYRadians <= 0 || fovYRadians >= Math.PI) {
|
|
168
|
+
throw new RangeError("Planar projection fovY must be in (0, pi).");
|
|
169
|
+
}
|
|
170
|
+
if (!Number.isFinite(aspect) || aspect <= 0)
|
|
171
|
+
throw new RangeError("Planar projection aspect must be finite and positive.");
|
|
172
|
+
if (!Number.isFinite(near) || near <= 0)
|
|
173
|
+
throw new RangeError("Planar projection near must be finite and positive.");
|
|
174
|
+
if (!Number.isFinite(far) || far <= near)
|
|
175
|
+
throw new RangeError("Planar projection far must be greater than near.");
|
|
176
|
+
const f = 1 / Math.tan(fovYRadians / 2);
|
|
177
|
+
const range = 1 / (near - far);
|
|
178
|
+
return new Float32Array([
|
|
179
|
+
f / aspect, 0, 0, 0,
|
|
180
|
+
0, f, 0, 0,
|
|
181
|
+
0, 0, (far + near) * range, -1,
|
|
182
|
+
0, 0, 2 * far * near * range, 0,
|
|
183
|
+
]);
|
|
184
|
+
}
|
|
185
|
+
/** Column-major 4x4 product `out = a * b`. */
|
|
186
|
+
export function multiplyPlanarMatrices(a, b) {
|
|
187
|
+
if (a.length !== 16 || b.length !== 16)
|
|
188
|
+
throw new RangeError("Planar matrix factors must hold 16 numbers each.");
|
|
189
|
+
const out = new Float32Array(16);
|
|
190
|
+
for (let column = 0; column < 4; column += 1) {
|
|
191
|
+
for (let row = 0; row < 4; row += 1) {
|
|
192
|
+
let value = 0;
|
|
193
|
+
for (let index = 0; index < 4; index += 1)
|
|
194
|
+
value += a[index * 4 + row] * b[column * 4 + index];
|
|
195
|
+
out[column * 4 + row] = value;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return out;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Renderer-owned mirror path for one horizontal reflector plane.
|
|
202
|
+
*
|
|
203
|
+
* Owns the mirror render target, binds the oblique near-plane clip
|
|
204
|
+
* projection for every capture, and exposes the mirrored scene color as a
|
|
205
|
+
* real 2D texture + `u_planarReflectionTexture` binding that reflector
|
|
206
|
+
* materials sample. The caller renders the scene (minus the reflector
|
|
207
|
+
* itself) through the frame's view-projection matrix.
|
|
208
|
+
*/
|
|
209
|
+
export class PlanarReflectionCapture {
|
|
210
|
+
planeY;
|
|
211
|
+
resolution;
|
|
212
|
+
clipBias;
|
|
213
|
+
device;
|
|
214
|
+
target;
|
|
215
|
+
clearColor;
|
|
216
|
+
label;
|
|
217
|
+
texture = null;
|
|
218
|
+
previousPixels = null;
|
|
219
|
+
revision = 0;
|
|
220
|
+
disposed = false;
|
|
221
|
+
constructor(device, planeY, options = {}) {
|
|
222
|
+
if (!device)
|
|
223
|
+
throw new Error("Planar reflection capture requires a render device.");
|
|
224
|
+
if (!Number.isFinite(planeY))
|
|
225
|
+
throw new RangeError("Planar reflection planeY must be finite.");
|
|
226
|
+
this.device = device;
|
|
227
|
+
this.planeY = planeY;
|
|
228
|
+
this.resolution = positiveInteger(options.resolution ?? 128, "planar reflection resolution");
|
|
229
|
+
this.clipBias = options.clipBias ?? 0;
|
|
230
|
+
if (!Number.isFinite(this.clipBias) || this.clipBias < 0) {
|
|
231
|
+
throw new RangeError("Planar reflection clipBias must be finite and non-negative.");
|
|
232
|
+
}
|
|
233
|
+
this.clearColor = validateClearColor(options.clearColor ?? [0, 0, 0, 1]);
|
|
234
|
+
this.label = options.label ?? `planar-reflector-y${planeY}`;
|
|
235
|
+
this.target = device.createRenderTarget({
|
|
236
|
+
width: this.resolution,
|
|
237
|
+
height: this.resolution,
|
|
238
|
+
label: `${this.label}-mirror-target`,
|
|
239
|
+
format: "rgba8",
|
|
240
|
+
depth: "renderbuffer",
|
|
241
|
+
sampleCount: 1,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
computeFrame(eye, target, up, projectionMatrix) {
|
|
245
|
+
this.assertAlive();
|
|
246
|
+
if (projectionMatrix.length !== 16)
|
|
247
|
+
throw new RangeError("Planar reflection projection matrix must hold 16 numbers.");
|
|
248
|
+
const mirror = computePlanarMirrorCamera(eye, target, up, this.planeY);
|
|
249
|
+
const oblique = computeObliqueClipProjection(projectionMatrix, mirror.clipPlane, this.clipBias);
|
|
250
|
+
const viewMatrix = computePlanarViewMatrix(mirror.eye, mirror.target, mirror.up);
|
|
251
|
+
return {
|
|
252
|
+
mirror,
|
|
253
|
+
oblique,
|
|
254
|
+
viewMatrix,
|
|
255
|
+
viewProjectionMatrix: multiplyPlanarMatrices(Float32Array.from(oblique.projectionMatrix), viewMatrix),
|
|
256
|
+
renderTarget: this.target,
|
|
257
|
+
planeY: this.planeY,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
capture(renderScene, eye, target, up, projectionMatrix) {
|
|
261
|
+
const frame = this.computeFrame(eye, target, up, projectionMatrix);
|
|
262
|
+
this.device.beginFrame(this.resolution, this.resolution);
|
|
263
|
+
this.device.setRenderTarget(frame.renderTarget);
|
|
264
|
+
if (this.device.clearRenderTarget)
|
|
265
|
+
this.device.clearRenderTarget(this.clearColor);
|
|
266
|
+
else
|
|
267
|
+
this.device.clear(this.clearColor);
|
|
268
|
+
this.device.endFrame();
|
|
269
|
+
renderScene(frame);
|
|
270
|
+
this.device.setRenderTarget(frame.renderTarget);
|
|
271
|
+
const pixels = this.device.readPixels(0, 0, this.resolution, this.resolution);
|
|
272
|
+
this.device.setRenderTarget(null);
|
|
273
|
+
const pixelHash = hashPixels(pixels);
|
|
274
|
+
const changedPixelCount = this.previousPixels ? countChangedPixels(this.previousPixels, pixels) : pixels.length / 4;
|
|
275
|
+
this.previousPixels = new Uint8Array(pixels);
|
|
276
|
+
this.revision += 1;
|
|
277
|
+
this.texture?.dispose();
|
|
278
|
+
const texture = new Texture({
|
|
279
|
+
width: this.resolution,
|
|
280
|
+
height: this.resolution,
|
|
281
|
+
dimension: "2d",
|
|
282
|
+
format: "rgba8",
|
|
283
|
+
colorSpace: "srgb",
|
|
284
|
+
label: `${this.label}-mirror-r${this.revision}`,
|
|
285
|
+
data: new Uint8Array(pixels),
|
|
286
|
+
});
|
|
287
|
+
this.texture = texture;
|
|
288
|
+
const binding = new TextureBinding({
|
|
289
|
+
name: "u_planarReflectionTexture",
|
|
290
|
+
texture,
|
|
291
|
+
sampler: new Sampler({ minFilter: "linear", magFilter: "linear", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
292
|
+
required: true,
|
|
293
|
+
ready: true,
|
|
294
|
+
expectedColorSpace: "srgb",
|
|
295
|
+
expectedDimension: "2d",
|
|
296
|
+
});
|
|
297
|
+
return {
|
|
298
|
+
planeY: this.planeY,
|
|
299
|
+
frame,
|
|
300
|
+
texture,
|
|
301
|
+
binding,
|
|
302
|
+
revision: this.revision,
|
|
303
|
+
pixelHash,
|
|
304
|
+
changedPixelCount,
|
|
305
|
+
capturedPixelCount: this.resolution * this.resolution,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/** Reflector floor material sampling the latest mirror capture texture. */
|
|
309
|
+
createReflectorMaterial(name = `${this.label}-reflector-material`) {
|
|
310
|
+
this.assertAlive();
|
|
311
|
+
if (!this.texture)
|
|
312
|
+
throw new Error(`Planar reflection capture ${this.label} has no capture yet; call capture() before creating the reflector material.`);
|
|
313
|
+
return new TexturedUnlitMaterial({ name, texture: this.texture });
|
|
314
|
+
}
|
|
315
|
+
dispose() {
|
|
316
|
+
if (this.disposed)
|
|
317
|
+
return;
|
|
318
|
+
this.disposed = true;
|
|
319
|
+
this.texture?.dispose();
|
|
320
|
+
this.target.dispose();
|
|
321
|
+
}
|
|
322
|
+
assertAlive() {
|
|
323
|
+
if (this.disposed)
|
|
324
|
+
throw new Error(`Planar reflection capture ${this.label} is disposed.`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Renderer-owned glass path: captures scene color into a real target, then
|
|
329
|
+
* applies the thickness-driven Beer-Lambert transmittance and the
|
|
330
|
+
* roughness-driven scene-color blur fetch on the captured pixels. The
|
|
331
|
+
* blurred+tinted output is exposed as `u_glassRefractionTexture`.
|
|
332
|
+
*/
|
|
333
|
+
export class GlassRefractionCapture {
|
|
334
|
+
resolution;
|
|
335
|
+
device;
|
|
336
|
+
target;
|
|
337
|
+
absorption;
|
|
338
|
+
maxBlurTexels;
|
|
339
|
+
clearColor;
|
|
340
|
+
label;
|
|
341
|
+
sceneTexture = null;
|
|
342
|
+
outputTexture = null;
|
|
343
|
+
revision = 0;
|
|
344
|
+
disposed = false;
|
|
345
|
+
constructor(device, options = {}) {
|
|
346
|
+
if (!device)
|
|
347
|
+
throw new Error("Glass refraction capture requires a render device.");
|
|
348
|
+
this.device = device;
|
|
349
|
+
this.resolution = positiveInteger(options.resolution ?? 128, "glass refraction resolution");
|
|
350
|
+
this.absorption = options.absorption ?? 0.35;
|
|
351
|
+
if (!Number.isFinite(this.absorption) || this.absorption < 0) {
|
|
352
|
+
throw new RangeError("Glass capture absorption must be finite and non-negative.");
|
|
353
|
+
}
|
|
354
|
+
this.maxBlurTexels = options.maxBlurTexels ?? 8;
|
|
355
|
+
if (!Number.isFinite(this.maxBlurTexels) || this.maxBlurTexels <= 0) {
|
|
356
|
+
throw new RangeError("Glass capture maxBlurTexels must be finite and positive.");
|
|
357
|
+
}
|
|
358
|
+
this.clearColor = validateClearColor(options.clearColor ?? [0, 0, 0, 1]);
|
|
359
|
+
this.label = options.label ?? "refractor-glass";
|
|
360
|
+
this.target = device.createRenderTarget({
|
|
361
|
+
width: this.resolution,
|
|
362
|
+
height: this.resolution,
|
|
363
|
+
label: `${this.label}-scene-color-target`,
|
|
364
|
+
format: "rgba8",
|
|
365
|
+
depth: "renderbuffer",
|
|
366
|
+
sampleCount: 1,
|
|
367
|
+
});
|
|
368
|
+
}
|
|
369
|
+
capture(renderScene, options) {
|
|
370
|
+
this.assertAlive();
|
|
371
|
+
const params = resolveGlassRefractionParams({
|
|
372
|
+
thickness: options.thickness,
|
|
373
|
+
roughness: options.roughness,
|
|
374
|
+
absorption: this.absorption,
|
|
375
|
+
maxBlurTexels: this.maxBlurTexels,
|
|
376
|
+
});
|
|
377
|
+
this.device.beginFrame(this.resolution, this.resolution);
|
|
378
|
+
this.device.setRenderTarget(this.target);
|
|
379
|
+
if (this.device.clearRenderTarget)
|
|
380
|
+
this.device.clearRenderTarget(this.clearColor);
|
|
381
|
+
else
|
|
382
|
+
this.device.clear(this.clearColor);
|
|
383
|
+
this.device.endFrame();
|
|
384
|
+
renderScene(this.target);
|
|
385
|
+
this.device.setRenderTarget(this.target);
|
|
386
|
+
const scenePixels = this.device.readPixels(0, 0, this.resolution, this.resolution);
|
|
387
|
+
this.device.setRenderTarget(null);
|
|
388
|
+
const blurred = boxBlurPixels(scenePixels, this.resolution, this.resolution, Math.round(params.blurRadiusTexels));
|
|
389
|
+
const output = applyTransmittance(blurred, params.transmittance);
|
|
390
|
+
const tintedPixelCount = countChangedPixels(scenePixels, output);
|
|
391
|
+
this.revision += 1;
|
|
392
|
+
this.sceneTexture?.dispose();
|
|
393
|
+
this.outputTexture?.dispose();
|
|
394
|
+
const sceneTexture = new Texture({
|
|
395
|
+
width: this.resolution, height: this.resolution, dimension: "2d", format: "rgba8",
|
|
396
|
+
colorSpace: "srgb", label: `${this.label}-scene-r${this.revision}`, data: new Uint8Array(scenePixels),
|
|
397
|
+
});
|
|
398
|
+
const texture = new Texture({
|
|
399
|
+
width: this.resolution, height: this.resolution, dimension: "2d", format: "rgba8",
|
|
400
|
+
colorSpace: "srgb", label: `${this.label}-refraction-r${this.revision}`, data: output,
|
|
401
|
+
});
|
|
402
|
+
this.sceneTexture = sceneTexture;
|
|
403
|
+
this.outputTexture = texture;
|
|
404
|
+
const binding = new TextureBinding({
|
|
405
|
+
name: "u_glassRefractionTexture",
|
|
406
|
+
texture,
|
|
407
|
+
sampler: new Sampler({ minFilter: "linear", magFilter: "linear", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
408
|
+
required: true,
|
|
409
|
+
ready: true,
|
|
410
|
+
expectedColorSpace: "srgb",
|
|
411
|
+
expectedDimension: "2d",
|
|
412
|
+
});
|
|
413
|
+
return {
|
|
414
|
+
params, thickness: options.thickness, roughness: options.roughness,
|
|
415
|
+
sceneTexture, texture, binding, revision: this.revision,
|
|
416
|
+
pixelHash: hashPixels(output), tintedPixelCount, capturedPixelCount: this.resolution * this.resolution,
|
|
417
|
+
};
|
|
418
|
+
}
|
|
419
|
+
dispose() {
|
|
420
|
+
if (this.disposed)
|
|
421
|
+
return;
|
|
422
|
+
this.disposed = true;
|
|
423
|
+
this.sceneTexture?.dispose();
|
|
424
|
+
this.outputTexture?.dispose();
|
|
425
|
+
this.target.dispose();
|
|
426
|
+
}
|
|
427
|
+
assertAlive() {
|
|
428
|
+
if (this.disposed)
|
|
429
|
+
throw new Error(`Glass refraction capture ${this.label} is disposed.`);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
function positiveInteger(value, label) {
|
|
433
|
+
if (!Number.isInteger(value) || value <= 0)
|
|
434
|
+
throw new RangeError(`${label} must be a positive integer.`);
|
|
435
|
+
return value;
|
|
436
|
+
}
|
|
437
|
+
function validateClearColor(value) {
|
|
438
|
+
if (value.length !== 4 || !value.every((channel) => Number.isFinite(channel) && channel >= 0 && channel <= 1)) {
|
|
439
|
+
throw new RangeError("Reflection clear color must contain four finite values in [0, 1].");
|
|
440
|
+
}
|
|
441
|
+
return value;
|
|
442
|
+
}
|
|
443
|
+
function normalize3(value) {
|
|
444
|
+
const length = Math.hypot(value[0], value[1], value[2]);
|
|
445
|
+
if (length <= 1e-8)
|
|
446
|
+
throw new Error("Planar view direction vectors must not be parallel.");
|
|
447
|
+
return [value[0] / length, value[1] / length, value[2] / length];
|
|
448
|
+
}
|
|
449
|
+
function cross3(a, b) {
|
|
450
|
+
return [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]];
|
|
451
|
+
}
|
|
452
|
+
function dot3(a, b) {
|
|
453
|
+
return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
|
|
454
|
+
}
|
|
455
|
+
function hashPixels(pixels) {
|
|
456
|
+
let hash = 0x811c9dc5;
|
|
457
|
+
for (const value of pixels) {
|
|
458
|
+
hash ^= value;
|
|
459
|
+
hash = Math.imul(hash, 0x01000193);
|
|
460
|
+
}
|
|
461
|
+
return (hash >>> 0).toString(16).padStart(8, "0");
|
|
462
|
+
}
|
|
463
|
+
function countChangedPixels(first, second, threshold = 2) {
|
|
464
|
+
let changed = 0;
|
|
465
|
+
for (let offset = 0; offset < first.length; offset += 4) {
|
|
466
|
+
if (Math.abs((first[offset] ?? 0) - (second[offset] ?? 0)) > threshold ||
|
|
467
|
+
Math.abs((first[offset + 1] ?? 0) - (second[offset + 1] ?? 0)) > threshold ||
|
|
468
|
+
Math.abs((first[offset + 2] ?? 0) - (second[offset + 2] ?? 0)) > threshold)
|
|
469
|
+
changed += 1;
|
|
470
|
+
}
|
|
471
|
+
return changed;
|
|
472
|
+
}
|
|
473
|
+
function boxBlurPixels(pixels, width, height, radius) {
|
|
474
|
+
if (radius <= 0)
|
|
475
|
+
return new Uint8Array(pixels);
|
|
476
|
+
const output = new Uint8Array(pixels.length);
|
|
477
|
+
for (let y = 0; y < height; y += 1) {
|
|
478
|
+
for (let x = 0; x < width; x += 1) {
|
|
479
|
+
let r = 0, g = 0, b = 0, a = 0, count = 0;
|
|
480
|
+
for (let ky = -radius; ky <= radius; ky += 1) {
|
|
481
|
+
for (let kx = -radius; kx <= radius; kx += 1) {
|
|
482
|
+
const sx = Math.min(width - 1, Math.max(0, x + kx));
|
|
483
|
+
const sy = Math.min(height - 1, Math.max(0, y + ky));
|
|
484
|
+
const offset = (sy * width + sx) * 4;
|
|
485
|
+
r += pixels[offset] ?? 0;
|
|
486
|
+
g += pixels[offset + 1] ?? 0;
|
|
487
|
+
b += pixels[offset + 2] ?? 0;
|
|
488
|
+
a += pixels[offset + 3] ?? 0;
|
|
489
|
+
count += 1;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
const offset = (y * width + x) * 4;
|
|
493
|
+
output[offset] = Math.round(r / count);
|
|
494
|
+
output[offset + 1] = Math.round(g / count);
|
|
495
|
+
output[offset + 2] = Math.round(b / count);
|
|
496
|
+
output[offset + 3] = Math.round(a / count);
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return output;
|
|
500
|
+
}
|
|
501
|
+
function applyTransmittance(pixels, transmittance) {
|
|
502
|
+
const output = new Uint8Array(pixels.length);
|
|
503
|
+
for (let offset = 0; offset < pixels.length; offset += 4) {
|
|
504
|
+
output[offset] = Math.round((pixels[offset] ?? 0) * transmittance);
|
|
505
|
+
output[offset + 1] = Math.round((pixels[offset + 1] ?? 0) * transmittance);
|
|
506
|
+
output[offset + 2] = Math.round((pixels[offset + 2] ?? 0) * transmittance);
|
|
507
|
+
output[offset + 3] = pixels[offset + 3] ?? 255;
|
|
508
|
+
}
|
|
509
|
+
return output;
|
|
510
|
+
}
|
|
511
|
+
/** SSR ray-march pass descriptor: package-level only, explicit caps. */
|
|
512
|
+
export function createSsrPassDescriptor(options = { width: 0, height: 0 }) {
|
|
513
|
+
const resolutionScale = options.resolutionScale ?? 0.5;
|
|
514
|
+
const maxSteps = options.maxSteps ?? 32;
|
|
515
|
+
const maxDistance = options.maxDistance ?? 25;
|
|
516
|
+
const thickness = options.thickness ?? 0.2;
|
|
517
|
+
if (!Number.isInteger(options.width) || options.width <= 0)
|
|
518
|
+
throw new RangeError("SSR width must be a positive integer.");
|
|
519
|
+
if (!Number.isInteger(options.height) || options.height <= 0)
|
|
520
|
+
throw new RangeError("SSR height must be a positive integer.");
|
|
521
|
+
if (!Number.isFinite(resolutionScale) || resolutionScale <= 0 || resolutionScale > 1) {
|
|
522
|
+
throw new RangeError("SSR resolutionScale must be in (0, 1].");
|
|
523
|
+
}
|
|
524
|
+
if (!Number.isInteger(maxSteps) || maxSteps < 4 || maxSteps > 64) {
|
|
525
|
+
throw new RangeError("SSR maxSteps must be an integer in [4, 64].");
|
|
526
|
+
}
|
|
527
|
+
if (!Number.isFinite(maxDistance) || maxDistance <= 0)
|
|
528
|
+
throw new RangeError("SSR maxDistance must be finite and positive.");
|
|
529
|
+
if (!Number.isFinite(thickness) || thickness <= 0)
|
|
530
|
+
throw new RangeError("SSR thickness must be finite and positive.");
|
|
531
|
+
return {
|
|
532
|
+
enabled: true,
|
|
533
|
+
resolutionScale,
|
|
534
|
+
maxSteps,
|
|
535
|
+
maxDistance,
|
|
536
|
+
thickness,
|
|
537
|
+
packageLevel: true,
|
|
538
|
+
diagnostic: "Validated native ScreenSpaceReflectionPass configuration; descriptor alone is not pixel evidence.",
|
|
539
|
+
};
|
|
540
|
+
}
|
|
541
|
+
//# sourceMappingURL=PlanarReflection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlanarReflection.js","sourceRoot":"","sources":["../../../../packages/rendering/src/PlanarReflection.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAiBhE;;;;GAIG;AACH,MAAM,UAAU,yBAAyB,CACvC,GAAY,EACZ,MAAe,EACf,EAAW,EACX,MAAc;IAEd,KAAK,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,CAAU,EAAE,CAAC;QACjF,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,MAAM,IAAI,UAAU,CAAC,iBAAiB,KAAK,oCAAoC,CAAC,CAAC;QACnF,CAAC;IACH,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,sCAAsC,CAAC,CAAC;IAC3F,MAAM,MAAM,GAAG,CAAC,CAAU,EAAW,EAAE,CAAC,CAAC,CAAC,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AC,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,CAAC,KAAK,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,uCAAuC,CAAC,CAAC;IAC1H,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,MAAM,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,wCAAwC,CAAC,CAAC;IAC7H,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,eAAe,IAAI,CAAC,IAAI,eAAe,GAAG,CAAC,EAAE,CAAC;QACrF,MAAM,IAAI,UAAU,CAAC,wCAAwC,CAAC,CAAC;IACjE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,GAAG,EAAE,EAAE,CAAC;QACjE,MAAM,IAAI,UAAU,CAAC,6CAA6C,CAAC,CAAC;IACtE,CAAC;IACD,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,WAAW,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,8CAA8C,CAAC,CAAC;IAC5H,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CAAC;QAAE,MAAM,IAAI,UAAU,CAAC,4CAA4C,CAAC,CAAC;IACtH,OAAO;QACL,OAAO,EAAE,IAAI;QACb,eAAe;QACf,QAAQ;QACR,WAAW;QACX,SAAS;QACT,YAAY,EAAE,IAAI;QAClB,UAAU,EAAE,mGAAmG;KAChH,CAAC;AACJ,CAAC"}
|
|
@@ -4,10 +4,21 @@ export type ToneMappingOperator = "linear" | "reinhard" | "aces" | "filmic" | "u
|
|
|
4
4
|
export type PostProcessColorSpace = "linear" | "srgb";
|
|
5
5
|
export type DepthTextureFormat = "depth24";
|
|
6
6
|
export type ToneMappingPresetName = "natural" | "cinematic" | "vibrant" | "realistic" | "stylized";
|
|
7
|
+
export type BloomQualityOption = "performance" | "balanced" | "cinematic";
|
|
7
8
|
export interface BloomOptions {
|
|
8
9
|
readonly threshold?: number;
|
|
9
10
|
readonly intensity?: number;
|
|
10
11
|
readonly radius?: number;
|
|
12
|
+
/**
|
|
13
|
+
* Native bloom path only (muse3jsparity-PRD A1): `performance` keeps the
|
|
14
|
+
* legacy single-scale ping-pong; `balanced`/`cinematic` use the 5/3-mip
|
|
15
|
+
* pyramid (cinematic implies half-float targets). CPU kernels ignore it.
|
|
16
|
+
*/
|
|
17
|
+
readonly quality?: BloomQualityOption;
|
|
18
|
+
/** HDR float bright-extract knee width in [0, 0.5]; 0 keeps the hard step. */
|
|
19
|
+
readonly softKnee?: number;
|
|
20
|
+
/** LDR composite highlight shoulder in [0, 1]; 0 keeps the legacy clamp. */
|
|
21
|
+
readonly shoulder?: number;
|
|
11
22
|
}
|
|
12
23
|
export interface FXAAOptions {
|
|
13
24
|
readonly edgeThreshold?: number;
|
|
@@ -155,6 +166,8 @@ export interface VolumetricLightOptions {
|
|
|
155
166
|
readonly exposure?: number;
|
|
156
167
|
readonly samples?: number;
|
|
157
168
|
readonly occlusionThreshold?: number;
|
|
169
|
+
/** A5 ordered-dither output (one LSB); default false preserves legacy bytes. */
|
|
170
|
+
readonly dither?: boolean;
|
|
158
171
|
}
|
|
159
172
|
export interface VolumetricLightResult {
|
|
160
173
|
readonly width: number;
|
|
@@ -222,6 +235,9 @@ export interface SSRResult {
|
|
|
222
235
|
readonly maxDistance: number;
|
|
223
236
|
}
|
|
224
237
|
export interface SSROptions {
|
|
238
|
+
/** Exact projection or view-projection; native SSR reconstructs in its coordinate space. */
|
|
239
|
+
readonly projection?: Float32Array;
|
|
240
|
+
readonly inverseProjection?: Float32Array;
|
|
225
241
|
readonly depth?: DepthTextureBinding;
|
|
226
242
|
readonly intensity?: number;
|
|
227
243
|
readonly maxDistance?: number;
|
|
@@ -435,6 +451,22 @@ export declare function extractBloomBrightPixels(pixels: Uint8Array, width: numb
|
|
|
435
451
|
readonly brightPixelCount: number;
|
|
436
452
|
readonly brightEnergy: number;
|
|
437
453
|
};
|
|
454
|
+
/**
|
|
455
|
+
* Separable Gaussian weights shared by the CPU bloom kernels and the native
|
|
456
|
+
* WebGL2 `webgl2-bloom-blur` program, so the byte kernels remain the exact
|
|
457
|
+
* mirror of the device pass.
|
|
458
|
+
*
|
|
459
|
+
* The 3.0.1 parity contract (muse3jsparity-PRD, native bloom item 2) upgraded
|
|
460
|
+
* the native pass to a separable Gaussian; the CPU mirror was left as a uniform
|
|
461
|
+
* box average, which made the native-vs-CPU equality proof in
|
|
462
|
+
* tests/browser/native-outline-pixel.spec.ts unsatisfiable. `sigma`,
|
|
463
|
+
* `coefficient` and the truncation at 16 taps are the same expressions the
|
|
464
|
+
* shader uses.
|
|
465
|
+
*/
|
|
466
|
+
export declare function bloomBlurWeights(radius: number): {
|
|
467
|
+
readonly weights: readonly number[];
|
|
468
|
+
readonly weightSum: number;
|
|
469
|
+
};
|
|
438
470
|
export declare function blurBloomPixelsHorizontal(pixels: Uint8Array, width: number, height: number, radius: number): Uint8Array;
|
|
439
471
|
export declare function blurBloomPixelsVertical(pixels: Uint8Array, width: number, height: number, radius: number): Uint8Array;
|
|
440
472
|
export declare function compositeBloomPixels(sourcePixels: Uint8Array, blurredPixels: Uint8Array, width: number, height: number, intensity: number, brightPixels?: Uint8Array): {
|