@aura3d/rendering 3.0.1 → 4.0.2
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/BlendModes.d.ts +34 -0
- package/dist/BlendModes.d.ts.map +1 -0
- package/dist/BlendModes.js +42 -0
- package/dist/BlendModes.js.map +1 -0
- package/dist/DepthPass.d.ts +18 -0
- package/dist/DepthPass.d.ts.map +1 -1
- package/dist/DepthPass.js +103 -20
- package/dist/DepthPass.js.map +1 -1
- package/dist/EnvironmentBackgroundPass.d.ts +7 -0
- package/dist/EnvironmentBackgroundPass.d.ts.map +1 -1
- package/dist/EnvironmentBackgroundPass.js +39 -14
- package/dist/EnvironmentBackgroundPass.js.map +1 -1
- package/dist/EnvironmentMapResources.d.ts +1 -1
- package/dist/EnvironmentMapResources.d.ts.map +1 -1
- package/dist/EnvironmentMapResources.js +19 -8
- package/dist/EnvironmentMapResources.js.map +1 -1
- package/dist/EnvironmentPlatform.d.ts +6 -0
- package/dist/EnvironmentPlatform.d.ts.map +1 -1
- package/dist/EnvironmentPlatform.js +3 -1
- package/dist/EnvironmentPlatform.js.map +1 -1
- package/dist/EnvironmentPreset.d.ts +7 -0
- package/dist/EnvironmentPreset.d.ts.map +1 -1
- package/dist/EnvironmentPreset.js +11 -11
- package/dist/EnvironmentPreset.js.map +1 -1
- package/dist/EnvironmentPresetPack.d.ts +16 -0
- package/dist/EnvironmentPresetPack.d.ts.map +1 -1
- package/dist/EnvironmentPresetPack.js +28 -0
- package/dist/EnvironmentPresetPack.js.map +1 -1
- package/dist/ExternalParityRenderPreset.d.ts +15 -1
- package/dist/ExternalParityRenderPreset.d.ts.map +1 -1
- package/dist/ExternalParityRenderPreset.js +52 -7
- package/dist/ExternalParityRenderPreset.js.map +1 -1
- package/dist/ForwardPass.d.ts +240 -50
- package/dist/ForwardPass.d.ts.map +1 -1
- package/dist/ForwardPass.js +845 -866
- package/dist/ForwardPass.js.map +1 -1
- package/dist/Geometry.d.ts +44 -1
- package/dist/Geometry.d.ts.map +1 -1
- package/dist/Geometry.js +174 -24
- package/dist/Geometry.js.map +1 -1
- package/dist/InstancedPBRMaterial.d.ts +5 -0
- package/dist/InstancedPBRMaterial.d.ts.map +1 -1
- package/dist/InstancedPBRMaterial.js +7 -0
- package/dist/InstancedPBRMaterial.js.map +1 -1
- package/dist/LightCollector.d.ts +8 -0
- package/dist/LightCollector.d.ts.map +1 -1
- package/dist/LightCollector.js +1 -1
- package/dist/LightCollector.js.map +1 -1
- package/dist/LightUniforms.d.ts +78 -0
- package/dist/LightUniforms.d.ts.map +1 -1
- package/dist/LightUniforms.js +100 -0
- package/dist/LightUniforms.js.map +1 -1
- package/dist/Material.d.ts +15 -0
- package/dist/Material.d.ts.map +1 -1
- package/dist/Material.js +19 -2
- package/dist/Material.js.map +1 -1
- package/dist/MaterialBinding.d.ts +10 -0
- package/dist/MaterialBinding.d.ts.map +1 -1
- package/dist/MaterialBinding.js +91 -1
- package/dist/MaterialBinding.js.map +1 -1
- package/dist/MaterialPresets.d.ts +60 -0
- package/dist/MaterialPresets.d.ts.map +1 -1
- package/dist/MaterialPresets.js +212 -0
- package/dist/MaterialPresets.js.map +1 -1
- package/dist/NormalMappedPBRMaterial.d.ts +5 -0
- package/dist/NormalMappedPBRMaterial.d.ts.map +1 -1
- package/dist/NormalMappedPBRMaterial.js +7 -0
- package/dist/NormalMappedPBRMaterial.js.map +1 -1
- package/dist/OceanSurface.d.ts +8 -0
- package/dist/OceanSurface.d.ts.map +1 -1
- package/dist/OceanSurface.js +10 -79
- package/dist/OceanSurface.js.map +1 -1
- package/dist/PBRLightingDefaults.d.ts +8 -0
- package/dist/PBRLightingDefaults.d.ts.map +1 -1
- package/dist/PBRLightingDefaults.js +8 -0
- package/dist/PBRLightingDefaults.js.map +1 -1
- package/dist/PBRMaterial.d.ts +5 -0
- package/dist/PBRMaterial.d.ts.map +1 -1
- package/dist/PBRMaterial.js +7 -0
- package/dist/PBRMaterial.js.map +1 -1
- package/dist/PostProcessPass.d.ts +6 -490
- package/dist/PostProcessPass.d.ts.map +1 -1
- package/dist/PostProcessPass.js +6 -2016
- package/dist/PostProcessPass.js.map +1 -1
- package/dist/ProceduralMaterialTextures.d.ts +28 -0
- package/dist/ProceduralMaterialTextures.d.ts.map +1 -0
- package/dist/ProceduralMaterialTextures.js +217 -0
- package/dist/ProceduralMaterialTextures.js.map +1 -0
- package/dist/ReflectionProbe.d.ts.map +1 -1
- package/dist/ReflectionProbe.js +4 -1
- package/dist/ReflectionProbe.js.map +1 -1
- package/dist/RenderBackend.d.ts +2 -0
- package/dist/RenderBackend.d.ts.map +1 -1
- package/dist/RenderBackend.js +3 -0
- package/dist/RenderBackend.js.map +1 -1
- package/dist/RenderDevice.d.ts +92 -5
- package/dist/RenderDevice.d.ts.map +1 -1
- package/dist/RenderDevice.js +166 -9
- package/dist/RenderDevice.js.map +1 -1
- package/dist/RenderGraph.d.ts.map +1 -1
- package/dist/RenderGraph.js +17 -0
- package/dist/RenderGraph.js.map +1 -1
- package/dist/RenderPass.d.ts +7 -0
- package/dist/RenderPass.d.ts.map +1 -1
- package/dist/RenderPass.js.map +1 -1
- package/dist/RenderPipeline.d.ts +5 -0
- package/dist/RenderPipeline.d.ts.map +1 -1
- package/dist/RenderPipeline.js +6 -0
- package/dist/RenderPipeline.js.map +1 -1
- package/dist/Renderer.d.ts +261 -66
- package/dist/Renderer.d.ts.map +1 -1
- package/dist/Renderer.js +902 -1256
- package/dist/Renderer.js.map +1 -1
- package/dist/RendererPostprocessPlan.d.ts +4 -0
- package/dist/RendererPostprocessPlan.d.ts.map +1 -1
- package/dist/RendererPostprocessPlan.js +16 -2
- package/dist/RendererPostprocessPlan.js.map +1 -1
- package/dist/RendererTiming.d.ts +27 -0
- package/dist/RendererTiming.d.ts.map +1 -1
- package/dist/RendererTiming.js +179 -12
- package/dist/RendererTiming.js.map +1 -1
- package/dist/ResolutionGovernor.d.ts +56 -0
- package/dist/ResolutionGovernor.d.ts.map +1 -0
- package/dist/ResolutionGovernor.js +87 -0
- package/dist/ResolutionGovernor.js.map +1 -0
- package/dist/Sampler.d.ts +34 -1
- package/dist/Sampler.d.ts.map +1 -1
- package/dist/Sampler.js +55 -2
- package/dist/Sampler.js.map +1 -1
- package/dist/ShaderLibrary.d.ts.map +1 -1
- package/dist/ShaderLibrary.js +15 -10
- package/dist/ShaderLibrary.js.map +1 -1
- package/dist/ShaderLibraryCore.d.ts.map +1 -1
- package/dist/ShaderLibraryCore.js +3 -2
- package/dist/ShaderLibraryCore.js.map +1 -1
- package/dist/ShaderModule.d.ts +7 -1
- package/dist/ShaderModule.d.ts.map +1 -1
- package/dist/ShaderModule.js +20 -5
- package/dist/ShaderModule.js.map +1 -1
- package/dist/ShadowPass.d.ts.map +1 -1
- package/dist/ShadowPass.js +14 -7
- package/dist/ShadowPass.js.map +1 -1
- package/dist/SkinnedLitMaterial.d.ts +5 -0
- package/dist/SkinnedLitMaterial.d.ts.map +1 -1
- package/dist/SkinnedLitMaterial.js +13 -0
- package/dist/SkinnedLitMaterial.js.map +1 -1
- package/dist/SkinningBounds.d.ts +18 -0
- package/dist/SkinningBounds.d.ts.map +1 -1
- package/dist/SkinningBounds.js +78 -0
- package/dist/SkinningBounds.js.map +1 -1
- package/dist/SkinningPaletteTextureCache.d.ts +117 -0
- package/dist/SkinningPaletteTextureCache.d.ts.map +1 -0
- package/dist/SkinningPaletteTextureCache.js +205 -0
- package/dist/SkinningPaletteTextureCache.js.map +1 -0
- package/dist/SkinningUniforms.d.ts +56 -0
- package/dist/SkinningUniforms.d.ts.map +1 -0
- package/dist/SkinningUniforms.js +262 -0
- package/dist/SkinningUniforms.js.map +1 -0
- package/dist/TemporalHistory.d.ts +33 -0
- package/dist/TemporalHistory.d.ts.map +1 -1
- package/dist/TemporalHistory.js +84 -1
- package/dist/TemporalHistory.js.map +1 -1
- package/dist/TerrainHeightfield.d.ts +12 -0
- package/dist/TerrainHeightfield.d.ts.map +1 -1
- package/dist/TerrainHeightfield.js +29 -6
- package/dist/TerrainHeightfield.js.map +1 -1
- package/dist/TerrainTiles.d.ts +40 -10
- package/dist/TerrainTiles.d.ts.map +1 -1
- package/dist/TerrainTiles.js +18 -57
- package/dist/TerrainTiles.js.map +1 -1
- package/dist/Texture.d.ts +47 -2
- package/dist/Texture.d.ts.map +1 -1
- package/dist/Texture.js +119 -3
- package/dist/Texture.js.map +1 -1
- package/dist/TexturedPBRMaterial.d.ts +24 -0
- package/dist/TexturedPBRMaterial.d.ts.map +1 -1
- package/dist/TexturedPBRMaterial.js +72 -20
- package/dist/TexturedPBRMaterial.js.map +1 -1
- package/dist/TransmissionRenderTarget.d.ts +33 -0
- package/dist/TransmissionRenderTarget.d.ts.map +1 -0
- package/dist/TransmissionRenderTarget.js +61 -0
- package/dist/TransmissionRenderTarget.js.map +1 -0
- package/dist/VegetationScatter.js +1 -1
- package/dist/VegetationScatter.js.map +1 -1
- package/dist/VolumetricFog.d.ts +42 -0
- package/dist/VolumetricFog.d.ts.map +1 -1
- package/dist/VolumetricFog.js +52 -1
- package/dist/VolumetricFog.js.map +1 -1
- package/dist/WaterSurface.d.ts +5 -0
- package/dist/WaterSurface.d.ts.map +1 -1
- package/dist/WaterSurface.js +5 -0
- package/dist/WaterSurface.js.map +1 -1
- package/dist/WebGL2Device.d.ts +154 -207
- package/dist/WebGL2Device.d.ts.map +1 -1
- package/dist/WebGL2Device.js +831 -3703
- package/dist/WebGL2Device.js.map +1 -1
- package/dist/WebGL2StateCache.d.ts +15 -1
- package/dist/WebGL2StateCache.d.ts.map +1 -1
- package/dist/WebGL2StateCache.js +31 -2
- package/dist/WebGL2StateCache.js.map +1 -1
- package/dist/WebGPUDevice.d.ts +0 -4
- package/dist/WebGPUDevice.d.ts.map +1 -1
- package/dist/WebGPUDevice.js +31 -605
- package/dist/WebGPUDevice.js.map +1 -1
- package/dist/WebGPUSkinningLimits.d.ts +10 -1
- package/dist/WebGPUSkinningLimits.d.ts.map +1 -1
- package/dist/WebGPUSkinningLimits.js +15 -1
- package/dist/WebGPUSkinningLimits.js.map +1 -1
- package/dist/advanced-runtime/index.d.ts +6 -2
- package/dist/advanced-runtime/index.d.ts.map +1 -1
- package/dist/advanced-runtime/index.js +0 -1
- package/dist/advanced-runtime/index.js.map +1 -1
- package/dist/animation/AnimationRenderPreset.d.ts +1 -1
- package/dist/animation/AnimationRenderPreset.d.ts.map +1 -1
- package/dist/animation/AnimationRenderPreset.js +1 -1
- package/dist/animation/AnimationRenderPreset.js.map +1 -1
- package/dist/animation/applyAnimationRenderPreset.d.ts +1 -1
- package/dist/animation/applyAnimationRenderPreset.d.ts.map +1 -1
- package/dist/animation/index.d.ts +2 -1
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +1 -1
- package/dist/animation/index.js.map +1 -1
- package/dist/atmosphere/CloudLayer.d.ts +24 -0
- package/dist/atmosphere/CloudLayer.d.ts.map +1 -0
- package/dist/atmosphere/CloudLayer.js +30 -0
- package/dist/atmosphere/CloudLayer.js.map +1 -0
- package/dist/atmosphere/FogVolumes.d.ts +30 -0
- package/dist/atmosphere/FogVolumes.d.ts.map +1 -0
- package/dist/atmosphere/FogVolumes.js +96 -0
- package/dist/atmosphere/FogVolumes.js.map +1 -0
- package/dist/atmosphere/GradientSky.d.ts +40 -0
- package/dist/atmosphere/GradientSky.d.ts.map +1 -0
- package/dist/atmosphere/GradientSky.js +75 -0
- package/dist/atmosphere/GradientSky.js.map +1 -0
- package/dist/atmosphere/HeightFog.d.ts +154 -0
- package/dist/atmosphere/HeightFog.d.ts.map +1 -0
- package/dist/atmosphere/HeightFog.js +379 -0
- package/dist/atmosphere/HeightFog.js.map +1 -0
- package/dist/atmosphere/PreethamSky.d.ts +38 -0
- package/dist/atmosphere/PreethamSky.d.ts.map +1 -0
- package/dist/atmosphere/PreethamSky.js +150 -0
- package/dist/atmosphere/PreethamSky.js.map +1 -0
- package/dist/atmosphere/SkyBackgroundPass.d.ts +63 -0
- package/dist/atmosphere/SkyBackgroundPass.d.ts.map +1 -0
- package/dist/atmosphere/SkyBackgroundPass.js +233 -0
- package/dist/atmosphere/SkyBackgroundPass.js.map +1 -0
- package/dist/atmosphere/SkyCaptureAdapter.d.ts +45 -0
- package/dist/atmosphere/SkyCaptureAdapter.d.ts.map +1 -0
- package/dist/atmosphere/SkyCaptureAdapter.js +65 -0
- package/dist/atmosphere/SkyCaptureAdapter.js.map +1 -0
- package/dist/atmosphere/SkyEval.d.ts +56 -0
- package/dist/atmosphere/SkyEval.d.ts.map +1 -0
- package/dist/atmosphere/SkyEval.js +99 -0
- package/dist/atmosphere/SkyEval.js.map +1 -0
- package/dist/atmosphere/StarField.d.ts +26 -0
- package/dist/atmosphere/StarField.d.ts.map +1 -0
- package/dist/atmosphere/StarField.js +31 -0
- package/dist/atmosphere/StarField.js.map +1 -0
- package/dist/atmosphere/VolumetricFogPass.d.ts +69 -0
- package/dist/atmosphere/VolumetricFogPass.d.ts.map +1 -0
- package/dist/atmosphere/VolumetricFogPass.js +265 -0
- package/dist/atmosphere/VolumetricFogPass.js.map +1 -0
- package/dist/atmosphere/fogChunks.d.ts +8 -0
- package/dist/atmosphere/fogChunks.d.ts.map +1 -0
- package/dist/atmosphere/fogChunks.js +39 -0
- package/dist/atmosphere/fogChunks.js.map +1 -0
- package/dist/atmosphere/fogUniformStore.d.ts +20 -0
- package/dist/atmosphere/fogUniformStore.d.ts.map +1 -0
- package/dist/atmosphere/fogUniformStore.js +45 -0
- package/dist/atmosphere/fogUniformStore.js.map +1 -0
- package/dist/atmosphere/shaders/fog.glsl.d.ts +10 -0
- package/dist/atmosphere/shaders/fog.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/fog.glsl.js +161 -0
- package/dist/atmosphere/shaders/fog.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts +3 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.js +61 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts +4 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.js +129 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts +3 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.js +55 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/wetness.glsl.d.ts +34 -0
- package/dist/atmosphere/shaders/wetness.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/wetness.glsl.js +101 -0
- package/dist/atmosphere/shaders/wetness.glsl.js.map +1 -0
- package/dist/atmosphere/sky.glsl.d.ts +8 -0
- package/dist/atmosphere/sky.glsl.d.ts.map +1 -0
- package/dist/atmosphere/sky.glsl.js +249 -0
- package/dist/atmosphere/sky.glsl.js.map +1 -0
- package/dist/batching/BatchedGeometryPool.d.ts +72 -0
- package/dist/batching/BatchedGeometryPool.d.ts.map +1 -0
- package/dist/batching/BatchedGeometryPool.js +138 -0
- package/dist/batching/BatchedGeometryPool.js.map +1 -0
- package/dist/batching/ContentKeys.d.ts +29 -0
- package/dist/batching/ContentKeys.d.ts.map +1 -0
- package/dist/batching/ContentKeys.js +220 -0
- package/dist/batching/ContentKeys.js.map +1 -0
- package/dist/batching/DrawDataTexture.d.ts +51 -0
- package/dist/batching/DrawDataTexture.d.ts.map +1 -0
- package/dist/batching/DrawDataTexture.js +99 -0
- package/dist/batching/DrawDataTexture.js.map +1 -0
- package/dist/batching/MultiDrawBatch.d.ts +64 -0
- package/dist/batching/MultiDrawBatch.d.ts.map +1 -0
- package/dist/batching/MultiDrawBatch.js +103 -0
- package/dist/batching/MultiDrawBatch.js.map +1 -0
- package/dist/batching/StaticMergePlanner.d.ts +80 -0
- package/dist/batching/StaticMergePlanner.d.ts.map +1 -0
- package/dist/batching/StaticMergePlanner.js +323 -0
- package/dist/batching/StaticMergePlanner.js.map +1 -0
- package/dist/batching/index.d.ts +8 -0
- package/dist/batching/index.d.ts.map +1 -0
- package/dist/batching/index.js +8 -0
- package/dist/batching/index.js.map +1 -0
- package/dist/batching/shaders/drawId.glsl.d.ts +29 -0
- package/dist/batching/shaders/drawId.glsl.d.ts.map +1 -0
- package/dist/batching/shaders/drawId.glsl.js +93 -0
- package/dist/batching/shaders/drawId.glsl.js.map +1 -0
- package/dist/batching/shaders/instanceEmissive.glsl.d.ts +16 -0
- package/dist/batching/shaders/instanceEmissive.glsl.d.ts.map +1 -0
- package/dist/batching/shaders/instanceEmissive.glsl.js +63 -0
- package/dist/batching/shaders/instanceEmissive.glsl.js.map +1 -0
- package/dist/cinematic/BloomPass.d.ts +5 -9
- package/dist/cinematic/BloomPass.d.ts.map +1 -1
- package/dist/cinematic/BloomPass.js +5 -17
- package/dist/cinematic/BloomPass.js.map +1 -1
- package/dist/cinematic/DepthHazePass.d.ts +5 -11
- package/dist/cinematic/DepthHazePass.d.ts.map +1 -1
- package/dist/cinematic/DepthHazePass.js +5 -19
- package/dist/cinematic/DepthHazePass.js.map +1 -1
- package/dist/cinematic/FilmGrainPass.d.ts +5 -8
- package/dist/cinematic/FilmGrainPass.d.ts.map +1 -1
- package/dist/cinematic/FilmGrainPass.js +5 -16
- package/dist/cinematic/FilmGrainPass.js.map +1 -1
- package/dist/cinematic/VignettePass.d.ts +5 -9
- package/dist/cinematic/VignettePass.d.ts.map +1 -1
- package/dist/cinematic/VignettePass.js +5 -16
- package/dist/cinematic/VignettePass.js.map +1 -1
- package/dist/cinematic/index.d.ts +2 -1
- package/dist/cinematic/index.d.ts.map +1 -1
- package/dist/cinematic/index.js +1 -1
- package/dist/cinematic/index.js.map +1 -1
- package/dist/contracts/atmosphere.d.ts +30 -0
- package/dist/contracts/atmosphere.d.ts.map +1 -0
- package/dist/contracts/atmosphere.js +42 -0
- package/dist/contracts/atmosphere.js.map +1 -0
- package/dist/contracts/blend.d.ts +28 -0
- package/dist/contracts/blend.d.ts.map +1 -0
- package/dist/contracts/blend.js +73 -0
- package/dist/contracts/blend.js.map +1 -0
- package/dist/contracts/core.d.ts +47 -0
- package/dist/contracts/core.d.ts.map +1 -0
- package/dist/contracts/core.js +70 -0
- package/dist/contracts/core.js.map +1 -0
- package/dist/contracts/deform.d.ts +38 -0
- package/dist/contracts/deform.d.ts.map +1 -0
- package/dist/contracts/deform.js +14 -0
- package/dist/contracts/deform.js.map +1 -0
- package/dist/contracts/device.d.ts +71 -0
- package/dist/contracts/device.d.ts.map +1 -0
- package/dist/contracts/device.js +97 -0
- package/dist/contracts/device.js.map +1 -0
- package/dist/contracts/environment.d.ts +55 -0
- package/dist/contracts/environment.d.ts.map +1 -0
- package/dist/contracts/environment.js +115 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/flags.state.d.ts +15 -0
- package/dist/contracts/flags.state.d.ts.map +1 -0
- package/dist/contracts/flags.state.js +45 -0
- package/dist/contracts/flags.state.js.map +1 -0
- package/dist/contracts/frameGraph.d.ts +78 -0
- package/dist/contracts/frameGraph.d.ts.map +1 -0
- package/dist/contracts/frameGraph.js +32 -0
- package/dist/contracts/frameGraph.js.map +1 -0
- package/dist/contracts/frameUniforms.d.ts +43 -0
- package/dist/contracts/frameUniforms.d.ts.map +1 -0
- package/dist/contracts/frameUniforms.js +35 -0
- package/dist/contracts/frameUniforms.js.map +1 -0
- package/dist/contracts/geometry.d.ts +33 -0
- package/dist/contracts/geometry.d.ts.map +1 -0
- package/dist/contracts/geometry.js +59 -0
- package/dist/contracts/geometry.js.map +1 -0
- package/dist/contracts/index.d.ts +27 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +27 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/materialLobes.d.ts +41 -0
- package/dist/contracts/materialLobes.d.ts.map +1 -0
- package/dist/contracts/materialLobes.js +14 -0
- package/dist/contracts/materialLobes.js.map +1 -0
- package/dist/contracts/output.d.ts +35 -0
- package/dist/contracts/output.d.ts.map +1 -0
- package/dist/contracts/output.js +18 -0
- package/dist/contracts/output.js.map +1 -0
- package/dist/contracts/particles.d.ts +41 -0
- package/dist/contracts/particles.d.ts.map +1 -0
- package/dist/contracts/particles.js +15 -0
- package/dist/contracts/particles.js.map +1 -0
- package/dist/contracts/post.d.ts +71 -0
- package/dist/contracts/post.d.ts.map +1 -0
- package/dist/contracts/post.js +28 -0
- package/dist/contracts/post.js.map +1 -0
- package/dist/contracts/program.d.ts +158 -0
- package/dist/contracts/program.d.ts.map +1 -0
- package/dist/contracts/program.js +128 -0
- package/dist/contracts/program.js.map +1 -0
- package/dist/contracts/quality.d.ts +93 -0
- package/dist/contracts/quality.d.ts.map +1 -0
- package/dist/contracts/quality.js +149 -0
- package/dist/contracts/quality.js.map +1 -0
- package/dist/contracts/renderItem.d.ts +58 -0
- package/dist/contracts/renderItem.d.ts.map +1 -0
- package/dist/contracts/renderItem.js +8 -0
- package/dist/contracts/renderItem.js.map +1 -0
- package/dist/contracts/renderSource.d.ts +63 -0
- package/dist/contracts/renderSource.d.ts.map +1 -0
- package/dist/contracts/renderSource.js +7 -0
- package/dist/contracts/renderSource.js.map +1 -0
- package/dist/contracts/rendererFactory.d.ts +42 -0
- package/dist/contracts/rendererFactory.d.ts.map +1 -0
- package/dist/contracts/rendererFactory.js +32 -0
- package/dist/contracts/rendererFactory.js.map +1 -0
- package/dist/contracts/sampling.d.ts +23 -0
- package/dist/contracts/sampling.d.ts.map +1 -0
- package/dist/contracts/sampling.js +17 -0
- package/dist/contracts/sampling.js.map +1 -0
- package/dist/contracts/shadows.d.ts +53 -0
- package/dist/contracts/shadows.d.ts.map +1 -0
- package/dist/contracts/shadows.js +66 -0
- package/dist/contracts/shadows.js.map +1 -0
- package/dist/contracts/testing/ChunkHarness.d.ts +18 -0
- package/dist/contracts/testing/ChunkHarness.d.ts.map +1 -0
- package/dist/contracts/testing/ChunkHarness.js +68 -0
- package/dist/contracts/testing/ChunkHarness.js.map +1 -0
- package/dist/contracts/textureFormats.d.ts +18 -0
- package/dist/contracts/textureFormats.d.ts.map +1 -0
- package/dist/contracts/textureFormats.js +13 -0
- package/dist/contracts/textureFormats.js.map +1 -0
- package/dist/contracts/velocity.d.ts +37 -0
- package/dist/contracts/velocity.d.ts.map +1 -0
- package/dist/contracts/velocity.js +22 -0
- package/dist/contracts/velocity.js.map +1 -0
- package/dist/effects/ResidentGPUParticleRenderer.d.ts.map +1 -1
- package/dist/effects/ResidentGPUParticleRenderer.js +10 -5
- package/dist/effects/ResidentGPUParticleRenderer.js.map +1 -1
- package/dist/environment/EnvUniforms.d.ts +42 -0
- package/dist/environment/EnvUniforms.d.ts.map +1 -0
- package/dist/environment/EnvUniforms.js +54 -0
- package/dist/environment/EnvUniforms.js.map +1 -0
- package/dist/environment/EnvironmentCache.d.ts +83 -0
- package/dist/environment/EnvironmentCache.d.ts.map +1 -0
- package/dist/environment/EnvironmentCache.js +205 -0
- package/dist/environment/EnvironmentCache.js.map +1 -0
- package/dist/environment/EnvironmentProbeFactory.d.ts +41 -0
- package/dist/environment/EnvironmentProbeFactory.d.ts.map +1 -0
- package/dist/environment/EnvironmentProbeFactory.js +52 -0
- package/dist/environment/EnvironmentProbeFactory.js.map +1 -0
- package/dist/environment/GPUPMREMGenerator.d.ts +44 -0
- package/dist/environment/GPUPMREMGenerator.d.ts.map +1 -0
- package/dist/environment/GPUPMREMGenerator.js +98 -0
- package/dist/environment/GPUPMREMGenerator.js.map +1 -0
- package/dist/environment/HdrEquirect.d.ts +28 -0
- package/dist/environment/HdrEquirect.d.ts.map +1 -0
- package/dist/environment/HdrEquirect.js +205 -0
- package/dist/environment/HdrEquirect.js.map +1 -0
- package/dist/environment/LightingSamplerBudget.d.ts +20 -0
- package/dist/environment/LightingSamplerBudget.d.ts.map +1 -0
- package/dist/environment/LightingSamplerBudget.js +94 -0
- package/dist/environment/LightingSamplerBudget.js.map +1 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.d.ts +10 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.d.ts.map +1 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.js +100 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.js.map +1 -0
- package/dist/environment/Rgb9e5Cube.d.ts +25 -0
- package/dist/environment/Rgb9e5Cube.d.ts.map +1 -0
- package/dist/environment/Rgb9e5Cube.js +103 -0
- package/dist/environment/Rgb9e5Cube.js.map +1 -0
- package/dist/environment/RoomEnvironmentScene.d.ts +57 -0
- package/dist/environment/RoomEnvironmentScene.d.ts.map +1 -0
- package/dist/environment/RoomEnvironmentScene.js +165 -0
- package/dist/environment/RoomEnvironmentScene.js.map +1 -0
- package/dist/environment/SphericalHarmonics.d.ts +32 -0
- package/dist/environment/SphericalHarmonics.d.ts.map +1 -0
- package/dist/environment/SphericalHarmonics.js +155 -0
- package/dist/environment/SphericalHarmonics.js.map +1 -0
- package/dist/environment/probeBuild.d.ts +97 -0
- package/dist/environment/probeBuild.d.ts.map +1 -0
- package/dist/environment/probeBuild.js +406 -0
- package/dist/environment/probeBuild.js.map +1 -0
- package/dist/environment/workers/cpuPrefilter.d.ts +58 -0
- package/dist/environment/workers/cpuPrefilter.d.ts.map +1 -0
- package/dist/environment/workers/cpuPrefilter.js +288 -0
- package/dist/environment/workers/cpuPrefilter.js.map +1 -0
- package/dist/forward/Deform.d.ts +56 -0
- package/dist/forward/Deform.d.ts.map +1 -0
- package/dist/forward/Deform.js +517 -0
- package/dist/forward/Deform.js.map +1 -0
- package/dist/forward/DrawSubmit.d.ts +32 -0
- package/dist/forward/DrawSubmit.d.ts.map +1 -0
- package/dist/forward/DrawSubmit.js +75 -0
- package/dist/forward/DrawSubmit.js.map +1 -0
- package/dist/forward/Lighting.d.ts +35 -0
- package/dist/forward/Lighting.d.ts.map +1 -0
- package/dist/forward/Lighting.js +477 -0
- package/dist/forward/Lighting.js.map +1 -0
- package/dist/forward/Transmission.d.ts +62 -0
- package/dist/forward/Transmission.d.ts.map +1 -0
- package/dist/forward/Transmission.js +299 -0
- package/dist/forward/Transmission.js.map +1 -0
- package/dist/forward/Velocity.d.ts +47 -0
- package/dist/forward/Velocity.d.ts.map +1 -0
- package/dist/forward/Velocity.js +153 -0
- package/dist/forward/Velocity.js.map +1 -0
- package/dist/forward/transmissionTargetStore.d.ts +21 -0
- package/dist/forward/transmissionTargetStore.d.ts.map +1 -0
- package/dist/forward/transmissionTargetStore.js +8 -0
- package/dist/forward/transmissionTargetStore.js.map +1 -0
- package/dist/geometry/Primitives.d.ts +28 -0
- package/dist/geometry/Primitives.d.ts.map +1 -0
- package/dist/geometry/Primitives.js +110 -0
- package/dist/geometry/Primitives.js.map +1 -0
- package/dist/index.d.ts +140 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -52
- package/dist/index.js.map +1 -1
- package/dist/lanes/index.d.ts +17 -0
- package/dist/lanes/index.d.ts.map +1 -0
- package/dist/lanes/index.js +17 -0
- package/dist/lanes/index.js.map +1 -0
- package/dist/lanes/prd01.d.ts +6 -0
- package/dist/lanes/prd01.d.ts.map +1 -0
- package/dist/lanes/prd01.js +19 -0
- package/dist/lanes/prd01.js.map +1 -0
- package/dist/lanes/prd02.d.ts +62 -0
- package/dist/lanes/prd02.d.ts.map +1 -0
- package/dist/lanes/prd02.js +117 -0
- package/dist/lanes/prd02.js.map +1 -0
- package/dist/lanes/prd03.d.ts +19 -0
- package/dist/lanes/prd03.d.ts.map +1 -0
- package/dist/lanes/prd03.js +55 -0
- package/dist/lanes/prd03.js.map +1 -0
- package/dist/lanes/prd04.d.ts +22 -0
- package/dist/lanes/prd04.d.ts.map +1 -0
- package/dist/lanes/prd04.js +35 -0
- package/dist/lanes/prd04.js.map +1 -0
- package/dist/lanes/prd05.d.ts +4 -0
- package/dist/lanes/prd05.d.ts.map +1 -0
- package/dist/lanes/prd05.js +31 -0
- package/dist/lanes/prd05.js.map +1 -0
- package/dist/lanes/prd06.d.ts +33 -0
- package/dist/lanes/prd06.d.ts.map +1 -0
- package/dist/lanes/prd06.js +217 -0
- package/dist/lanes/prd06.js.map +1 -0
- package/dist/lanes/prd07.d.ts +49 -0
- package/dist/lanes/prd07.d.ts.map +1 -0
- package/dist/lanes/prd07.js +112 -0
- package/dist/lanes/prd07.js.map +1 -0
- package/dist/lanes/prd08.d.ts +2 -0
- package/dist/lanes/prd08.d.ts.map +1 -0
- package/dist/lanes/prd08.js +17 -0
- package/dist/lanes/prd08.js.map +1 -0
- package/dist/lanes/prd09.d.ts +6 -0
- package/dist/lanes/prd09.d.ts.map +1 -0
- package/dist/lanes/prd09.js +6 -0
- package/dist/lanes/prd09.js.map +1 -0
- package/dist/lanes/prd10.d.ts +2 -0
- package/dist/lanes/prd10.d.ts.map +1 -0
- package/dist/lanes/prd10.js +10 -0
- package/dist/lanes/prd10.js.map +1 -0
- package/dist/lanes/prd11.d.ts +61 -0
- package/dist/lanes/prd11.d.ts.map +1 -0
- package/dist/lanes/prd11.js +244 -0
- package/dist/lanes/prd11.js.map +1 -0
- package/dist/lanes/prd12.d.ts +6 -0
- package/dist/lanes/prd12.d.ts.map +1 -0
- package/dist/lanes/prd12.js +6 -0
- package/dist/lanes/prd12.js.map +1 -0
- package/dist/lanes/prd13.d.ts +6 -0
- package/dist/lanes/prd13.d.ts.map +1 -0
- package/dist/lanes/prd13.js +6 -0
- package/dist/lanes/prd13.js.map +1 -0
- package/dist/lanes/prd14.d.ts +6 -0
- package/dist/lanes/prd14.d.ts.map +1 -0
- package/dist/lanes/prd14.js +6 -0
- package/dist/lanes/prd14.js.map +1 -0
- package/dist/lanes/prd15.d.ts +6 -0
- package/dist/lanes/prd15.d.ts.map +1 -0
- package/dist/lanes/prd15.js +6 -0
- package/dist/lanes/prd15.js.map +1 -0
- package/dist/materials/PhysicalFeatures.d.ts +71 -0
- package/dist/materials/PhysicalFeatures.d.ts.map +1 -0
- package/dist/materials/PhysicalFeatures.js +255 -0
- package/dist/materials/PhysicalFeatures.js.map +1 -0
- package/dist/materials/PhysicalMaterial.d.ts +85 -0
- package/dist/materials/PhysicalMaterial.d.ts.map +1 -1
- package/dist/materials/PhysicalMaterial.js +21 -0
- package/dist/materials/PhysicalMaterial.js.map +1 -1
- package/dist/materials/features.d.ts +47 -0
- package/dist/materials/features.d.ts.map +1 -0
- package/dist/materials/features.js +282 -0
- package/dist/materials/features.js.map +1 -0
- package/dist/materials/lobes.d.ts +3 -0
- package/dist/materials/lobes.d.ts.map +1 -0
- package/dist/materials/lobes.js +225 -0
- package/dist/materials/lobes.js.map +1 -0
- package/dist/output/HdrTarget.d.ts +27 -0
- package/dist/output/HdrTarget.d.ts.map +1 -0
- package/dist/output/HdrTarget.js +48 -0
- package/dist/output/HdrTarget.js.map +1 -0
- package/dist/output/OutputPass.d.ts +28 -0
- package/dist/output/OutputPass.d.ts.map +1 -0
- package/dist/output/OutputPass.js +142 -0
- package/dist/output/OutputPass.js.map +1 -0
- package/dist/output/ToneMappingOperators.glsl.d.ts +22 -0
- package/dist/output/ToneMappingOperators.glsl.d.ts.map +1 -0
- package/dist/output/ToneMappingOperators.glsl.js +217 -0
- package/dist/output/ToneMappingOperators.glsl.js.map +1 -0
- package/dist/passes/ContactShadowPass.d.ts +57 -0
- package/dist/passes/ContactShadowPass.d.ts.map +1 -0
- package/dist/passes/ContactShadowPass.js +151 -0
- package/dist/passes/ContactShadowPass.js.map +1 -0
- package/dist/passes/Prd02ContactShadowsContributor.d.ts +16 -0
- package/dist/passes/Prd02ContactShadowsContributor.d.ts.map +1 -0
- package/dist/passes/Prd02ContactShadowsContributor.js +133 -0
- package/dist/passes/Prd02ContactShadowsContributor.js.map +1 -0
- package/dist/passes/Prd02SubFlags.d.ts +22 -0
- package/dist/passes/Prd02SubFlags.d.ts.map +1 -0
- package/dist/passes/Prd02SubFlags.js +32 -0
- package/dist/passes/Prd02SubFlags.js.map +1 -0
- package/dist/performance/BVH.d.ts +46 -0
- package/dist/performance/BVH.d.ts.map +1 -1
- package/dist/performance/BVH.js +212 -0
- package/dist/performance/BVH.js.map +1 -1
- package/dist/performance/Batcher.d.ts +11 -0
- package/dist/performance/Batcher.d.ts.map +1 -1
- package/dist/performance/Batcher.js +10 -0
- package/dist/performance/Batcher.js.map +1 -1
- package/dist/performance/FrustumCuller.d.ts +29 -0
- package/dist/performance/FrustumCuller.d.ts.map +1 -1
- package/dist/performance/FrustumCuller.js +78 -1
- package/dist/performance/FrustumCuller.js.map +1 -1
- package/dist/performance/LOD.d.ts +6 -0
- package/dist/performance/LOD.d.ts.map +1 -1
- package/dist/performance/LOD.js +12 -0
- package/dist/performance/LOD.js.map +1 -1
- package/dist/performance/RenderItemSorting.d.ts +2 -0
- package/dist/performance/RenderItemSorting.d.ts.map +1 -1
- package/dist/performance/RenderItemSorting.js +5 -1
- package/dist/performance/RenderItemSorting.js.map +1 -1
- package/dist/post/CubeLut.d.ts +15 -0
- package/dist/post/CubeLut.d.ts.map +1 -0
- package/dist/post/CubeLut.js +86 -0
- package/dist/post/CubeLut.js.map +1 -0
- package/dist/post/DisplayLutCache.d.ts +31 -0
- package/dist/post/DisplayLutCache.d.ts.map +1 -0
- package/dist/post/DisplayLutCache.js +44 -0
- package/dist/post/DisplayLutCache.js.map +1 -0
- package/dist/post/PostAntiAlias.d.ts +49 -0
- package/dist/post/PostAntiAlias.d.ts.map +1 -0
- package/dist/post/PostAntiAlias.js +75 -0
- package/dist/post/PostAntiAlias.js.map +1 -0
- package/dist/post/PostGraph.d.ts +206 -0
- package/dist/post/PostGraph.d.ts.map +1 -0
- package/dist/post/PostGraph.js +234 -0
- package/dist/post/PostGraph.js.map +1 -0
- package/dist/post/PostQualityTiers.d.ts +95 -0
- package/dist/post/PostQualityTiers.d.ts.map +1 -0
- package/dist/post/PostQualityTiers.js +62 -0
- package/dist/post/PostQualityTiers.js.map +1 -0
- package/dist/post/PostResources.d.ts +49 -0
- package/dist/post/PostResources.d.ts.map +1 -0
- package/dist/post/PostResources.js +124 -0
- package/dist/post/PostResources.js.map +1 -0
- package/dist/post/PostTimer.d.ts +37 -0
- package/dist/post/PostTimer.d.ts.map +1 -0
- package/dist/post/PostTimer.js +88 -0
- package/dist/post/PostTimer.js.map +1 -0
- package/dist/post/ScreenFeelPass.d.ts +83 -0
- package/dist/post/ScreenFeelPass.d.ts.map +1 -0
- package/dist/post/ScreenFeelPass.js +197 -0
- package/dist/post/ScreenFeelPass.js.map +1 -0
- package/dist/post/ToneOperators.d.ts +42 -0
- package/dist/post/ToneOperators.d.ts.map +1 -0
- package/dist/post/ToneOperators.js +179 -0
- package/dist/post/ToneOperators.js.map +1 -0
- package/dist/post/chunks/indirectFraction.glsl.d.ts +50 -0
- package/dist/post/chunks/indirectFraction.glsl.d.ts.map +1 -0
- package/dist/post/chunks/indirectFraction.glsl.js +82 -0
- package/dist/post/chunks/indirectFraction.glsl.js.map +1 -0
- package/dist/post/chunks/velocity.glsl.d.ts +35 -0
- package/dist/post/chunks/velocity.glsl.d.ts.map +1 -0
- package/dist/post/chunks/velocity.glsl.js +86 -0
- package/dist/post/chunks/velocity.glsl.js.map +1 -0
- package/dist/post/shaders/bloom.glsl.d.ts +21 -0
- package/dist/post/shaders/bloom.glsl.d.ts.map +1 -0
- package/dist/post/shaders/bloom.glsl.js +120 -0
- package/dist/post/shaders/bloom.glsl.js.map +1 -0
- package/dist/post/shaders/bloom.wgsl.d.ts +10 -0
- package/dist/post/shaders/bloom.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/bloom.wgsl.js +121 -0
- package/dist/post/shaders/bloom.wgsl.js.map +1 -0
- package/dist/post/shaders/common.glsl.d.ts +11 -0
- package/dist/post/shaders/common.glsl.d.ts.map +1 -0
- package/dist/post/shaders/common.glsl.js +34 -0
- package/dist/post/shaders/common.glsl.js.map +1 -0
- package/dist/post/shaders/common.wgsl.d.ts +25 -0
- package/dist/post/shaders/common.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/common.wgsl.js +48 -0
- package/dist/post/shaders/common.wgsl.js.map +1 -0
- package/dist/post/shaders/composite.glsl.d.ts +25 -0
- package/dist/post/shaders/composite.glsl.d.ts.map +1 -0
- package/dist/post/shaders/composite.glsl.js +96 -0
- package/dist/post/shaders/composite.glsl.js.map +1 -0
- package/dist/post/shaders/composite.wgsl.d.ts +10 -0
- package/dist/post/shaders/composite.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/composite.wgsl.js +92 -0
- package/dist/post/shaders/composite.wgsl.js.map +1 -0
- package/dist/post/shaders/depthDownsample.glsl.d.ts +20 -0
- package/dist/post/shaders/depthDownsample.glsl.d.ts.map +1 -0
- package/dist/post/shaders/depthDownsample.glsl.js +78 -0
- package/dist/post/shaders/depthDownsample.glsl.js.map +1 -0
- package/dist/post/shaders/depthDownsample.wgsl.d.ts +17 -0
- package/dist/post/shaders/depthDownsample.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/depthDownsample.wgsl.js +87 -0
- package/dist/post/shaders/depthDownsample.wgsl.js.map +1 -0
- package/dist/post/shaders/displayGrade.glsl.d.ts +18 -0
- package/dist/post/shaders/displayGrade.glsl.d.ts.map +1 -0
- package/dist/post/shaders/displayGrade.glsl.js +80 -0
- package/dist/post/shaders/displayGrade.glsl.js.map +1 -0
- package/dist/post/shaders/displayGrade.wgsl.d.ts +9 -0
- package/dist/post/shaders/displayGrade.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/displayGrade.wgsl.js +75 -0
- package/dist/post/shaders/displayGrade.wgsl.js.map +1 -0
- package/dist/post/shaders/dof.glsl.d.ts +25 -0
- package/dist/post/shaders/dof.glsl.d.ts.map +1 -0
- package/dist/post/shaders/dof.glsl.js +129 -0
- package/dist/post/shaders/dof.glsl.js.map +1 -0
- package/dist/post/shaders/dof.wgsl.d.ts +11 -0
- package/dist/post/shaders/dof.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/dof.wgsl.js +119 -0
- package/dist/post/shaders/dof.wgsl.js.map +1 -0
- package/dist/post/shaders/exposure.glsl.d.ts +43 -0
- package/dist/post/shaders/exposure.glsl.d.ts.map +1 -0
- package/dist/post/shaders/exposure.glsl.js +115 -0
- package/dist/post/shaders/exposure.glsl.js.map +1 -0
- package/dist/post/shaders/exposure.wgsl.d.ts +16 -0
- package/dist/post/shaders/exposure.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/exposure.wgsl.js +97 -0
- package/dist/post/shaders/exposure.wgsl.js.map +1 -0
- package/dist/post/shaders/finalize.glsl.d.ts +17 -0
- package/dist/post/shaders/finalize.glsl.d.ts.map +1 -0
- package/dist/post/shaders/finalize.glsl.js +120 -0
- package/dist/post/shaders/finalize.glsl.js.map +1 -0
- package/dist/post/shaders/finalize.wgsl.d.ts +13 -0
- package/dist/post/shaders/finalize.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/finalize.wgsl.js +124 -0
- package/dist/post/shaders/finalize.wgsl.js.map +1 -0
- package/dist/post/shaders/fxaa.glsl.d.ts +26 -0
- package/dist/post/shaders/fxaa.glsl.d.ts.map +1 -0
- package/dist/post/shaders/fxaa.glsl.js +246 -0
- package/dist/post/shaders/fxaa.glsl.js.map +1 -0
- package/dist/post/shaders/fxaa.wgsl.d.ts +17 -0
- package/dist/post/shaders/fxaa.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/fxaa.wgsl.js +268 -0
- package/dist/post/shaders/fxaa.wgsl.js.map +1 -0
- package/dist/post/shaders/godrays.glsl.d.ts +16 -0
- package/dist/post/shaders/godrays.glsl.d.ts.map +1 -0
- package/dist/post/shaders/godrays.glsl.js +70 -0
- package/dist/post/shaders/godrays.glsl.js.map +1 -0
- package/dist/post/shaders/godrays.wgsl.d.ts +8 -0
- package/dist/post/shaders/godrays.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/godrays.wgsl.js +60 -0
- package/dist/post/shaders/godrays.wgsl.js.map +1 -0
- package/dist/post/shaders/gtao.glsl.d.ts +29 -0
- package/dist/post/shaders/gtao.glsl.d.ts.map +1 -0
- package/dist/post/shaders/gtao.glsl.js +190 -0
- package/dist/post/shaders/gtao.glsl.js.map +1 -0
- package/dist/post/shaders/gtao.wgsl.d.ts +13 -0
- package/dist/post/shaders/gtao.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/gtao.wgsl.js +163 -0
- package/dist/post/shaders/gtao.wgsl.js.map +1 -0
- package/dist/post/shaders/gtaoDenoise.glsl.d.ts +22 -0
- package/dist/post/shaders/gtaoDenoise.glsl.d.ts.map +1 -0
- package/dist/post/shaders/gtaoDenoise.glsl.js +121 -0
- package/dist/post/shaders/gtaoDenoise.glsl.js.map +1 -0
- package/dist/post/shaders/gtaoDenoise.wgsl.d.ts +11 -0
- package/dist/post/shaders/gtaoDenoise.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/gtaoDenoise.wgsl.js +117 -0
- package/dist/post/shaders/gtaoDenoise.wgsl.js.map +1 -0
- package/dist/post/shaders/motionBlur.glsl.d.ts +21 -0
- package/dist/post/shaders/motionBlur.glsl.d.ts.map +1 -0
- package/dist/post/shaders/motionBlur.glsl.js +110 -0
- package/dist/post/shaders/motionBlur.glsl.js.map +1 -0
- package/dist/post/shaders/motionBlur.wgsl.d.ts +10 -0
- package/dist/post/shaders/motionBlur.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/motionBlur.wgsl.js +102 -0
- package/dist/post/shaders/motionBlur.wgsl.js.map +1 -0
- package/dist/post/shaders/smaa.glsl.d.ts +28 -0
- package/dist/post/shaders/smaa.glsl.d.ts.map +1 -0
- package/dist/post/shaders/smaa.glsl.js +354 -0
- package/dist/post/shaders/smaa.glsl.js.map +1 -0
- package/dist/post/shaders/smaa.wgsl.d.ts +20 -0
- package/dist/post/shaders/smaa.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/smaa.wgsl.js +375 -0
- package/dist/post/shaders/smaa.wgsl.js.map +1 -0
- package/dist/post/shaders/taa.glsl.d.ts +23 -0
- package/dist/post/shaders/taa.glsl.d.ts.map +1 -0
- package/dist/post/shaders/taa.glsl.js +169 -0
- package/dist/post/shaders/taa.glsl.js.map +1 -0
- package/dist/post/shaders/taa.wgsl.d.ts +10 -0
- package/dist/post/shaders/taa.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/taa.wgsl.js +185 -0
- package/dist/post/shaders/taa.wgsl.js.map +1 -0
- package/dist/post/shaders/velocityDilate.glsl.d.ts +16 -0
- package/dist/post/shaders/velocityDilate.glsl.d.ts.map +1 -0
- package/dist/post/shaders/velocityDilate.glsl.js +45 -0
- package/dist/post/shaders/velocityDilate.glsl.js.map +1 -0
- package/dist/post/shaders/velocityDilate.wgsl.d.ts +8 -0
- package/dist/post/shaders/velocityDilate.wgsl.d.ts.map +1 -0
- package/dist/post/shaders/velocityDilate.wgsl.js +30 -0
- package/dist/post/shaders/velocityDilate.wgsl.js.map +1 -0
- package/dist/post/smaa/textures.d.ts +17 -0
- package/dist/post/smaa/textures.d.ts.map +1 -0
- package/dist/post/smaa/textures.js +17 -0
- package/dist/post/smaa/textures.js.map +1 -0
- package/dist/post/v2Entry.d.ts +25 -0
- package/dist/post/v2Entry.d.ts.map +1 -0
- package/dist/post/v2Entry.js +28 -0
- package/dist/post/v2Entry.js.map +1 -0
- package/dist/post/v2Stages.d.ts +156 -0
- package/dist/post/v2Stages.d.ts.map +1 -0
- package/dist/post/v2Stages.js +1189 -0
- package/dist/post/v2Stages.js.map +1 -0
- package/dist/postprocess/EffectComposer.d.ts +6 -109
- package/dist/postprocess/EffectComposer.d.ts.map +1 -1
- package/dist/postprocess/EffectComposer.js +6 -246
- package/dist/postprocess/EffectComposer.js.map +1 -1
- package/dist/postprocess/NativeBloomPyramid.d.ts +34 -0
- package/dist/postprocess/NativeBloomPyramid.d.ts.map +1 -1
- package/dist/postprocess/NativeBloomPyramid.js +57 -0
- package/dist/postprocess/NativeBloomPyramid.js.map +1 -1
- package/dist/postprocess/SSAOPass.d.ts +5 -5
- package/dist/postprocess/SSAOPass.d.ts.map +1 -1
- package/dist/postprocess/SSAOPass.js +5 -17
- package/dist/postprocess/SSAOPass.js.map +1 -1
- package/dist/probes/IrradianceVolume.d.ts +45 -0
- package/dist/probes/IrradianceVolume.d.ts.map +1 -0
- package/dist/probes/IrradianceVolume.js +230 -0
- package/dist/probes/IrradianceVolume.js.map +1 -0
- package/dist/probes/LtcLuts.d.ts +30 -0
- package/dist/probes/LtcLuts.d.ts.map +1 -0
- package/dist/probes/LtcLuts.js +120 -0
- package/dist/probes/LtcLuts.js.map +1 -0
- package/dist/probes/Prd02ProbesContributor.d.ts +53 -0
- package/dist/probes/Prd02ProbesContributor.d.ts.map +1 -0
- package/dist/probes/Prd02ProbesContributor.js +241 -0
- package/dist/probes/Prd02ProbesContributor.js.map +1 -0
- package/dist/probes/ProbeBoxProjection.d.ts +53 -0
- package/dist/probes/ProbeBoxProjection.d.ts.map +1 -0
- package/dist/probes/ProbeBoxProjection.js +99 -0
- package/dist/probes/ProbeBoxProjection.js.map +1 -0
- package/dist/probes/ReflectionProbeSystem.d.ts +64 -0
- package/dist/probes/ReflectionProbeSystem.d.ts.map +1 -0
- package/dist/probes/ReflectionProbeSystem.js +157 -0
- package/dist/probes/ReflectionProbeSystem.js.map +1 -0
- package/dist/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
- package/dist/production-runtime/PBRHDRPipeline.js +23 -9
- package/dist/production-runtime/PBRHDRPipeline.js.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.d.ts +16 -6
- package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts +4 -4
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.js +10 -45
- package/dist/production-runtime/ProductionWebGPURenderer.js.map +1 -1
- package/dist/production-runtime/backendSelection.d.ts +26 -0
- package/dist/production-runtime/backendSelection.d.ts.map +1 -0
- package/dist/production-runtime/backendSelection.js +46 -0
- package/dist/production-runtime/backendSelection.js.map +1 -0
- package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts +1 -1
- package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts.map +1 -1
- package/dist/production-runtime/backends/WebGL2RendererBackend.js +8 -4
- package/dist/production-runtime/backends/WebGL2RendererBackend.js.map +1 -1
- package/dist/production-runtime/backends/WebGPURendererBackend.d.ts +2 -19
- package/dist/production-runtime/backends/WebGPURendererBackend.d.ts.map +1 -1
- package/dist/production-runtime/backends/WebGPURendererBackend.js +2 -18
- package/dist/production-runtime/backends/WebGPURendererBackend.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts +1 -0
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js +1 -0
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUShader.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUShader.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.js.map +1 -1
- package/dist/production-runtime/index.d.ts +6 -6
- package/dist/production-runtime/index.d.ts.map +1 -1
- package/dist/production-runtime/index.js +9 -3
- package/dist/production-runtime/index.js.map +1 -1
- package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts +12 -13
- package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts.map +1 -1
- package/dist/production-runtime/materials/GLTFMaterialAdapter.js +10 -4
- package/dist/production-runtime/materials/GLTFMaterialAdapter.js.map +1 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts +9 -2
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts.map +1 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js +7 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js.map +1 -1
- package/dist/production-runtime/materials/MaterialCompiler.d.ts +10 -8
- package/dist/production-runtime/materials/MaterialCompiler.d.ts.map +1 -1
- package/dist/production-runtime/materials/MaterialCompiler.js +9 -4
- package/dist/production-runtime/materials/MaterialCompiler.js.map +1 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.d.ts.map +1 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.js +30 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.js.map +1 -1
- package/dist/production-runtime/passes/ContactShadowPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ContactShadowPass.js +14 -13
- package/dist/production-runtime/passes/ContactShadowPass.js.map +1 -1
- package/dist/production-runtime/renderProofs.d.ts +54 -0
- package/dist/production-runtime/renderProofs.d.ts.map +1 -0
- package/dist/production-runtime/renderProofs.js +245 -0
- package/dist/production-runtime/renderProofs.js.map +1 -0
- package/dist/program/DFGLut.d.ts +23 -0
- package/dist/program/DFGLut.d.ts.map +1 -0
- package/dist/program/DFGLut.js +58 -0
- package/dist/program/DFGLut.js.map +1 -0
- package/dist/program/DFGLutData.d.ts +35 -0
- package/dist/program/DFGLutData.d.ts.map +1 -0
- package/dist/program/DFGLutData.js +52 -0
- package/dist/program/DFGLutData.js.map +1 -0
- package/dist/program/FeatureSelect.d.ts +35 -0
- package/dist/program/FeatureSelect.d.ts.map +1 -0
- package/dist/program/FeatureSelect.js +88 -0
- package/dist/program/FeatureSelect.js.map +1 -0
- package/dist/program/MaterialFeatures.d.ts +66 -0
- package/dist/program/MaterialFeatures.d.ts.map +1 -0
- package/dist/program/MaterialFeatures.js +242 -0
- package/dist/program/MaterialFeatures.js.map +1 -0
- package/dist/program/ProgramCache.d.ts +83 -0
- package/dist/program/ProgramCache.d.ts.map +1 -0
- package/dist/program/ProgramCache.js +194 -0
- package/dist/program/ProgramCache.js.map +1 -0
- package/dist/program/ProgramFeatures.d.ts +21 -0
- package/dist/program/ProgramFeatures.d.ts.map +1 -0
- package/dist/program/ProgramFeatures.js +95 -0
- package/dist/program/ProgramFeatures.js.map +1 -0
- package/dist/program/ProgramGenerator.d.ts +60 -0
- package/dist/program/ProgramGenerator.d.ts.map +1 -0
- package/dist/program/ProgramGenerator.js +760 -0
- package/dist/program/ProgramGenerator.js.map +1 -0
- package/dist/program/ProgramKey.d.ts +10 -0
- package/dist/program/ProgramKey.d.ts.map +1 -0
- package/dist/program/ProgramKey.js +13 -0
- package/dist/program/ProgramKey.js.map +1 -0
- package/dist/program/ProgramWarmup.d.ts +37 -0
- package/dist/program/ProgramWarmup.d.ts.map +1 -0
- package/dist/program/ProgramWarmup.js +68 -0
- package/dist/program/ProgramWarmup.js.map +1 -0
- package/dist/program/UniformLayout.d.ts +40 -0
- package/dist/program/UniformLayout.d.ts.map +1 -0
- package/dist/program/UniformLayout.js +105 -0
- package/dist/program/UniformLayout.js.map +1 -0
- package/dist/program/chunks/alpha.glsl.d.ts +7 -0
- package/dist/program/chunks/alpha.glsl.d.ts.map +1 -0
- package/dist/program/chunks/alpha.glsl.js +17 -0
- package/dist/program/chunks/alpha.glsl.js.map +1 -0
- package/dist/program/chunks/brdf.glsl.d.ts +12 -0
- package/dist/program/chunks/brdf.glsl.d.ts.map +1 -0
- package/dist/program/chunks/brdf.glsl.js +144 -0
- package/dist/program/chunks/brdf.glsl.js.map +1 -0
- package/dist/program/chunks/colorspace.glsl.d.ts +8 -0
- package/dist/program/chunks/colorspace.glsl.d.ts.map +1 -0
- package/dist/program/chunks/colorspace.glsl.js +16 -0
- package/dist/program/chunks/colorspace.glsl.js.map +1 -0
- package/dist/program/chunks/common.glsl.d.ts +7 -0
- package/dist/program/chunks/common.glsl.d.ts.map +1 -0
- package/dist/program/chunks/common.glsl.js +25 -0
- package/dist/program/chunks/common.glsl.js.map +1 -0
- package/dist/program/chunks/depth.glsl.d.ts +9 -0
- package/dist/program/chunks/depth.glsl.d.ts.map +1 -0
- package/dist/program/chunks/depth.glsl.js +18 -0
- package/dist/program/chunks/depth.glsl.js.map +1 -0
- package/dist/program/chunks/drawId.wgsl.d.ts +9 -0
- package/dist/program/chunks/drawId.wgsl.d.ts.map +1 -0
- package/dist/program/chunks/drawId.wgsl.js +29 -0
- package/dist/program/chunks/drawId.wgsl.js.map +1 -0
- package/dist/program/chunks/fog_default.glsl.d.ts +8 -0
- package/dist/program/chunks/fog_default.glsl.d.ts.map +1 -0
- package/dist/program/chunks/fog_default.glsl.js +31 -0
- package/dist/program/chunks/fog_default.glsl.js.map +1 -0
- package/dist/program/chunks/indirect_default.glsl.d.ts +29 -0
- package/dist/program/chunks/indirect_default.glsl.d.ts.map +1 -0
- package/dist/program/chunks/indirect_default.glsl.js +113 -0
- package/dist/program/chunks/indirect_default.glsl.js.map +1 -0
- package/dist/program/chunks/instanceEmissive.wgsl.d.ts +10 -0
- package/dist/program/chunks/instanceEmissive.wgsl.d.ts.map +1 -0
- package/dist/program/chunks/instanceEmissive.wgsl.js +21 -0
- package/dist/program/chunks/instanceEmissive.wgsl.js.map +1 -0
- package/dist/program/chunks/instancing.glsl.d.ts +8 -0
- package/dist/program/chunks/instancing.glsl.d.ts.map +1 -0
- package/dist/program/chunks/instancing.glsl.js +25 -0
- package/dist/program/chunks/instancing.glsl.js.map +1 -0
- package/dist/program/chunks/lights_legacy.glsl.d.ts +15 -0
- package/dist/program/chunks/lights_legacy.glsl.d.ts.map +1 -0
- package/dist/program/chunks/lights_legacy.glsl.js +95 -0
- package/dist/program/chunks/lights_legacy.glsl.js.map +1 -0
- package/dist/program/chunks/manifest.d.ts +42 -0
- package/dist/program/chunks/manifest.d.ts.map +1 -0
- package/dist/program/chunks/manifest.js +48 -0
- package/dist/program/chunks/manifest.js.map +1 -0
- package/dist/program/chunks/normal.glsl.d.ts +8 -0
- package/dist/program/chunks/normal.glsl.d.ts.map +1 -0
- package/dist/program/chunks/normal.glsl.js +34 -0
- package/dist/program/chunks/normal.glsl.js.map +1 -0
- package/dist/program/chunks/shadow_forward.glsl.d.ts +23 -0
- package/dist/program/chunks/shadow_forward.glsl.d.ts.map +1 -0
- package/dist/program/chunks/shadow_forward.glsl.js +73 -0
- package/dist/program/chunks/shadow_forward.glsl.js.map +1 -0
- package/dist/quality/DeviceClasses.d.ts +31 -0
- package/dist/quality/DeviceClasses.d.ts.map +1 -0
- package/dist/quality/DeviceClasses.js +83 -0
- package/dist/quality/DeviceClasses.js.map +1 -0
- package/dist/quality/DeviceProbe.d.ts +42 -0
- package/dist/quality/DeviceProbe.d.ts.map +1 -0
- package/dist/quality/DeviceProbe.js +83 -0
- package/dist/quality/DeviceProbe.js.map +1 -0
- package/dist/quality/FrameStats.d.ts +62 -0
- package/dist/quality/FrameStats.d.ts.map +1 -0
- package/dist/quality/FrameStats.js +220 -0
- package/dist/quality/FrameStats.js.map +1 -0
- package/dist/quality/PostprocessGuard.d.ts +49 -0
- package/dist/quality/PostprocessGuard.d.ts.map +1 -0
- package/dist/quality/PostprocessGuard.js +92 -0
- package/dist/quality/PostprocessGuard.js.map +1 -0
- package/dist/quality/QualityController.d.ts +93 -0
- package/dist/quality/QualityController.d.ts.map +1 -0
- package/dist/quality/QualityController.js +248 -0
- package/dist/quality/QualityController.js.map +1 -0
- package/dist/quality/QualityGovernor.d.ts +78 -0
- package/dist/quality/QualityGovernor.d.ts.map +1 -0
- package/dist/quality/QualityGovernor.js +170 -0
- package/dist/quality/QualityGovernor.js.map +1 -0
- package/dist/quality/QualityTier.d.ts +17 -0
- package/dist/quality/QualityTier.d.ts.map +1 -0
- package/dist/quality/QualityTier.js +23 -0
- package/dist/quality/QualityTier.js.map +1 -0
- package/dist/quality/RenderScaleController.d.ts +35 -0
- package/dist/quality/RenderScaleController.d.ts.map +1 -0
- package/dist/quality/RenderScaleController.js +57 -0
- package/dist/quality/RenderScaleController.js.map +1 -0
- package/dist/quality/RetentionPolicy.d.ts +11 -0
- package/dist/quality/RetentionPolicy.d.ts.map +1 -0
- package/dist/quality/RetentionPolicy.js +12 -0
- package/dist/quality/RetentionPolicy.js.map +1 -0
- package/dist/quality/TierResolver.d.ts +52 -0
- package/dist/quality/TierResolver.d.ts.map +1 -0
- package/dist/quality/TierResolver.js +155 -0
- package/dist/quality/TierResolver.js.map +1 -0
- package/dist/quality/liveTier.d.ts +23 -0
- package/dist/quality/liveTier.d.ts.map +1 -0
- package/dist/quality/liveTier.js +16 -0
- package/dist/quality/liveTier.js.map +1 -0
- package/dist/reference/BloomPass.d.ts +10 -0
- package/dist/reference/BloomPass.d.ts.map +1 -0
- package/dist/reference/BloomPass.js +18 -0
- package/dist/reference/BloomPass.js.map +1 -0
- package/dist/reference/DepthHazePass.d.ts +12 -0
- package/dist/reference/DepthHazePass.d.ts.map +1 -0
- package/dist/reference/DepthHazePass.js +20 -0
- package/dist/reference/DepthHazePass.js.map +1 -0
- package/dist/reference/EffectComposer.d.ts +110 -0
- package/dist/reference/EffectComposer.d.ts.map +1 -0
- package/dist/reference/EffectComposer.js +247 -0
- package/dist/reference/EffectComposer.js.map +1 -0
- package/dist/reference/FilmGrainPass.d.ts +9 -0
- package/dist/reference/FilmGrainPass.d.ts.map +1 -0
- package/dist/reference/FilmGrainPass.js +17 -0
- package/dist/reference/FilmGrainPass.js.map +1 -0
- package/dist/reference/PostProcessPass.d.ts +511 -0
- package/dist/reference/PostProcessPass.d.ts.map +1 -0
- package/dist/reference/PostProcessPass.js +2023 -0
- package/dist/reference/PostProcessPass.js.map +1 -0
- package/dist/reference/SSAOPass.d.ts +6 -0
- package/dist/reference/SSAOPass.d.ts.map +1 -0
- package/dist/reference/SSAOPass.js +18 -0
- package/dist/reference/SSAOPass.js.map +1 -0
- package/dist/reference/VignettePass.d.ts +10 -0
- package/dist/reference/VignettePass.d.ts.map +1 -0
- package/dist/reference/VignettePass.js +17 -0
- package/dist/reference/VignettePass.js.map +1 -0
- package/dist/reference/index.d.ts +15 -0
- package/dist/reference/index.d.ts.map +1 -0
- package/dist/reference/index.js +15 -0
- package/dist/reference/index.js.map +1 -0
- package/dist/renderer/Background.d.ts +49 -0
- package/dist/renderer/Background.d.ts.map +1 -0
- package/dist/renderer/Background.js +259 -0
- package/dist/renderer/Background.js.map +1 -0
- package/dist/renderer/CullingBatching.d.ts +55 -0
- package/dist/renderer/CullingBatching.d.ts.map +1 -0
- package/dist/renderer/CullingBatching.js +362 -0
- package/dist/renderer/CullingBatching.js.map +1 -0
- package/dist/renderer/DeviceLifecycle.d.ts +29 -0
- package/dist/renderer/DeviceLifecycle.d.ts.map +1 -0
- package/dist/renderer/DeviceLifecycle.js +48 -0
- package/dist/renderer/DeviceLifecycle.js.map +1 -0
- package/dist/renderer/FrameGraph.d.ts +96 -0
- package/dist/renderer/FrameGraph.d.ts.map +1 -0
- package/dist/renderer/FrameGraph.js +301 -0
- package/dist/renderer/FrameGraph.js.map +1 -0
- package/dist/renderer/InterleavedTransparentPass.d.ts +31 -0
- package/dist/renderer/InterleavedTransparentPass.d.ts.map +1 -0
- package/dist/renderer/InterleavedTransparentPass.js +65 -0
- package/dist/renderer/InterleavedTransparentPass.js.map +1 -0
- package/dist/renderer/PixelRatio.d.ts +64 -0
- package/dist/renderer/PixelRatio.d.ts.map +1 -0
- package/dist/renderer/PixelRatio.js +81 -0
- package/dist/renderer/PixelRatio.js.map +1 -0
- package/dist/renderer/PostprocessExecution.d.ts +82 -0
- package/dist/renderer/PostprocessExecution.d.ts.map +1 -0
- package/dist/renderer/PostprocessExecution.js +745 -0
- package/dist/renderer/PostprocessExecution.js.map +1 -0
- package/dist/renderer/Prd06ShaderWarmup.d.ts +32 -0
- package/dist/renderer/Prd06ShaderWarmup.d.ts.map +1 -0
- package/dist/renderer/Prd06ShaderWarmup.js +45 -0
- package/dist/renderer/Prd06ShaderWarmup.js.map +1 -0
- package/dist/renderer/RenderShared.d.ts +11 -0
- package/dist/renderer/RenderShared.d.ts.map +1 -0
- package/dist/renderer/RenderShared.js +47 -0
- package/dist/renderer/RenderShared.js.map +1 -0
- package/dist/renderer/RendererFactory.d.ts +3 -0
- package/dist/renderer/RendererFactory.d.ts.map +1 -0
- package/dist/renderer/RendererFactory.js +19 -0
- package/dist/renderer/RendererFactory.js.map +1 -0
- package/dist/renderer/RendererHost.d.ts +25 -0
- package/dist/renderer/RendererHost.d.ts.map +1 -0
- package/dist/renderer/RendererHost.js +4 -0
- package/dist/renderer/RendererHost.js.map +1 -0
- package/dist/renderer/SceneDepthCopyPass.d.ts +50 -0
- package/dist/renderer/SceneDepthCopyPass.d.ts.map +1 -0
- package/dist/renderer/SceneDepthCopyPass.js +124 -0
- package/dist/renderer/SceneDepthCopyPass.js.map +1 -0
- package/dist/renderer/ShadowOrchestration.d.ts +32 -0
- package/dist/renderer/ShadowOrchestration.d.ts.map +1 -0
- package/dist/renderer/ShadowOrchestration.js +491 -0
- package/dist/renderer/ShadowOrchestration.js.map +1 -0
- package/dist/renderer/SkinnedBounds.d.ts +6 -0
- package/dist/renderer/SkinnedBounds.d.ts.map +1 -0
- package/dist/renderer/SkinnedBounds.js +74 -0
- package/dist/renderer/SkinnedBounds.js.map +1 -0
- package/dist/renderer/coreOutputPostRoute.d.ts +40 -0
- package/dist/renderer/coreOutputPostRoute.d.ts.map +1 -0
- package/dist/renderer/coreOutputPostRoute.js +46 -0
- package/dist/renderer/coreOutputPostRoute.js.map +1 -0
- package/dist/renderer/postSkipped.d.ts +12 -0
- package/dist/renderer/postSkipped.d.ts.map +1 -0
- package/dist/renderer/postSkipped.js +54 -0
- package/dist/renderer/postSkipped.js.map +1 -0
- package/dist/renderer/qrSubFlags.d.ts +45 -0
- package/dist/renderer/qrSubFlags.d.ts.map +1 -0
- package/dist/renderer/qrSubFlags.js +130 -0
- package/dist/renderer/qrSubFlags.js.map +1 -0
- package/dist/resources/InstanceBuffer.d.ts +34 -0
- package/dist/resources/InstanceBuffer.d.ts.map +1 -0
- package/dist/resources/InstanceBuffer.js +96 -0
- package/dist/resources/InstanceBuffer.js.map +1 -0
- package/dist/resources/MorphTargetTexture.d.ts +53 -0
- package/dist/resources/MorphTargetTexture.d.ts.map +1 -0
- package/dist/resources/MorphTargetTexture.js +135 -0
- package/dist/resources/MorphTargetTexture.js.map +1 -0
- package/dist/resources/RenderTargetPool.d.ts +47 -0
- package/dist/resources/RenderTargetPool.d.ts.map +1 -0
- package/dist/resources/RenderTargetPool.js +122 -0
- package/dist/resources/RenderTargetPool.js.map +1 -0
- package/dist/resources/ResourceRegistry.d.ts +48 -0
- package/dist/resources/ResourceRegistry.d.ts.map +1 -0
- package/dist/resources/ResourceRegistry.js +95 -0
- package/dist/resources/ResourceRegistry.js.map +1 -0
- package/dist/resources/UniformBlock.d.ts +90 -0
- package/dist/resources/UniformBlock.d.ts.map +1 -0
- package/dist/resources/UniformBlock.js +184 -0
- package/dist/resources/UniformBlock.js.map +1 -0
- package/dist/shaders/camera-fade.glsl.d.ts +26 -0
- package/dist/shaders/camera-fade.glsl.d.ts.map +1 -0
- package/dist/shaders/camera-fade.glsl.js +109 -0
- package/dist/shaders/camera-fade.glsl.js.map +1 -0
- package/dist/shaders/chunks/contact_shadow.glsl.d.ts +12 -0
- package/dist/shaders/chunks/contact_shadow.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/contact_shadow.glsl.js +53 -0
- package/dist/shaders/chunks/contact_shadow.glsl.js.map +1 -0
- package/dist/shaders/chunks/lighting_ibl.glsl.d.ts +29 -0
- package/dist/shaders/chunks/lighting_ibl.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/lighting_ibl.glsl.js +122 -0
- package/dist/shaders/chunks/lighting_ibl.glsl.js.map +1 -0
- package/dist/shaders/chunks/lighting_mirrors.d.ts +18 -0
- package/dist/shaders/chunks/lighting_mirrors.d.ts.map +1 -0
- package/dist/shaders/chunks/lighting_mirrors.js +35 -0
- package/dist/shaders/chunks/lighting_mirrors.js.map +1 -0
- package/dist/shaders/chunks/lighting_punctual.glsl.d.ts +17 -0
- package/dist/shaders/chunks/lighting_punctual.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/lighting_punctual.glsl.js +197 -0
- package/dist/shaders/chunks/lighting_punctual.glsl.js.map +1 -0
- package/dist/shaders/chunks/sh9.glsl.d.ts +9 -0
- package/dist/shaders/chunks/sh9.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/sh9.glsl.js +41 -0
- package/dist/shaders/chunks/sh9.glsl.js.map +1 -0
- package/dist/shaders/chunks/shadow_caster.glsl.d.ts +10 -0
- package/dist/shaders/chunks/shadow_caster.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/shadow_caster.glsl.js +32 -0
- package/dist/shaders/chunks/shadow_caster.glsl.js.map +1 -0
- package/dist/shaders/chunks/shadow_receive.glsl.d.ts +13 -0
- package/dist/shaders/chunks/shadow_receive.glsl.d.ts.map +1 -0
- package/dist/shaders/chunks/shadow_receive.glsl.js +136 -0
- package/dist/shaders/chunks/shadow_receive.glsl.js.map +1 -0
- package/dist/shaders/debug-view.glsl.d.ts +18 -0
- package/dist/shaders/debug-view.glsl.d.ts.map +1 -0
- package/dist/shaders/debug-view.glsl.js +153 -0
- package/dist/shaders/debug-view.glsl.js.map +1 -0
- package/dist/shaders/deform/deform.glsl.d.ts +17 -0
- package/dist/shaders/deform/deform.glsl.d.ts.map +1 -0
- package/dist/shaders/deform/deform.glsl.js +99 -0
- package/dist/shaders/deform/deform.glsl.js.map +1 -0
- package/dist/shaders/deform/deform.wgsl.d.ts +15 -0
- package/dist/shaders/deform/deform.wgsl.d.ts.map +1 -0
- package/dist/shaders/deform/deform.wgsl.js +89 -0
- package/dist/shaders/deform/deform.wgsl.js.map +1 -0
- package/dist/shaders/deform/depthFeature.d.ts +22 -0
- package/dist/shaders/deform/depthFeature.d.ts.map +1 -0
- package/dist/shaders/deform/depthFeature.js +44 -0
- package/dist/shaders/deform/depthFeature.js.map +1 -0
- package/dist/shaders/deform/forwardFeature.d.ts +114 -0
- package/dist/shaders/deform/forwardFeature.d.ts.map +1 -0
- package/dist/shaders/deform/forwardFeature.js +300 -0
- package/dist/shaders/deform/forwardFeature.js.map +1 -0
- package/dist/shaders/deform/morph.glsl.d.ts +14 -0
- package/dist/shaders/deform/morph.glsl.d.ts.map +1 -0
- package/dist/shaders/deform/morph.glsl.js +45 -0
- package/dist/shaders/deform/morph.glsl.js.map +1 -0
- package/dist/shaders/deform/morph.wgsl.d.ts +21 -0
- package/dist/shaders/deform/morph.wgsl.d.ts.map +1 -0
- package/dist/shaders/deform/morph.wgsl.js +73 -0
- package/dist/shaders/deform/morph.wgsl.js.map +1 -0
- package/dist/shaders/deform/skinning.glsl.d.ts +8 -0
- package/dist/shaders/deform/skinning.glsl.d.ts.map +1 -0
- package/dist/shaders/deform/skinning.glsl.js +37 -0
- package/dist/shaders/deform/skinning.glsl.js.map +1 -0
- package/dist/shaders/deform/skinning.wgsl.d.ts +26 -0
- package/dist/shaders/deform/skinning.wgsl.d.ts.map +1 -0
- package/dist/shaders/deform/skinning.wgsl.js +58 -0
- package/dist/shaders/deform/skinning.wgsl.js.map +1 -0
- package/dist/shaders/deform/twins.d.ts +8 -0
- package/dist/shaders/deform/twins.d.ts.map +1 -0
- package/dist/shaders/deform/twins.js +20 -0
- package/dist/shaders/deform/twins.js.map +1 -0
- package/dist/shaders/lod-dither.glsl.d.ts +12 -0
- package/dist/shaders/lod-dither.glsl.d.ts.map +1 -0
- package/dist/shaders/lod-dither.glsl.js +101 -0
- package/dist/shaders/lod-dither.glsl.js.map +1 -0
- package/dist/shaders/physical/alpha_a2c.glsl.d.ts +19 -0
- package/dist/shaders/physical/alpha_a2c.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/alpha_a2c.glsl.js +29 -0
- package/dist/shaders/physical/alpha_a2c.glsl.js.map +1 -0
- package/dist/shaders/physical/anisotropy.glsl.d.ts +23 -0
- package/dist/shaders/physical/anisotropy.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/anisotropy.glsl.js +116 -0
- package/dist/shaders/physical/anisotropy.glsl.js.map +1 -0
- package/dist/shaders/physical/bsdf_lobes_common.glsl.d.ts +25 -0
- package/dist/shaders/physical/bsdf_lobes_common.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/bsdf_lobes_common.glsl.js +95 -0
- package/dist/shaders/physical/bsdf_lobes_common.glsl.js.map +1 -0
- package/dist/shaders/physical/clearcoat.glsl.d.ts +23 -0
- package/dist/shaders/physical/clearcoat.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/clearcoat.glsl.js +70 -0
- package/dist/shaders/physical/clearcoat.glsl.js.map +1 -0
- package/dist/shaders/physical/debug_view.glsl.d.ts +19 -0
- package/dist/shaders/physical/debug_view.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/debug_view.glsl.js +76 -0
- package/dist/shaders/physical/debug_view.glsl.js.map +1 -0
- package/dist/shaders/physical/dispersion.glsl.d.ts +18 -0
- package/dist/shaders/physical/dispersion.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/dispersion.glsl.js +67 -0
- package/dist/shaders/physical/dispersion.glsl.js.map +1 -0
- package/dist/shaders/physical/emissive_strength.glsl.d.ts +18 -0
- package/dist/shaders/physical/emissive_strength.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/emissive_strength.glsl.js +20 -0
- package/dist/shaders/physical/emissive_strength.glsl.js.map +1 -0
- package/dist/shaders/physical/index.d.ts +27 -0
- package/dist/shaders/physical/index.d.ts.map +1 -0
- package/dist/shaders/physical/index.js +69 -0
- package/dist/shaders/physical/index.js.map +1 -0
- package/dist/shaders/physical/iridescence.glsl.d.ts +25 -0
- package/dist/shaders/physical/iridescence.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/iridescence.glsl.js +186 -0
- package/dist/shaders/physical/iridescence.glsl.js.map +1 -0
- package/dist/shaders/physical/lobe_calls.glsl.d.ts +83 -0
- package/dist/shaders/physical/lobe_calls.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/lobe_calls.glsl.js +397 -0
- package/dist/shaders/physical/lobe_calls.glsl.js.map +1 -0
- package/dist/shaders/physical/sheen.glsl.d.ts +24 -0
- package/dist/shaders/physical/sheen.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/sheen.glsl.js +108 -0
- package/dist/shaders/physical/sheen.glsl.js.map +1 -0
- package/dist/shaders/physical/specular_ior.glsl.d.ts +20 -0
- package/dist/shaders/physical/specular_ior.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/specular_ior.glsl.js +64 -0
- package/dist/shaders/physical/specular_ior.glsl.js.map +1 -0
- package/dist/shaders/physical/tangent_frame.glsl.d.ts +27 -0
- package/dist/shaders/physical/tangent_frame.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/tangent_frame.glsl.js +71 -0
- package/dist/shaders/physical/tangent_frame.glsl.js.map +1 -0
- package/dist/shaders/physical/transmission.glsl.d.ts +25 -0
- package/dist/shaders/physical/transmission.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/transmission.glsl.js +204 -0
- package/dist/shaders/physical/transmission.glsl.js.map +1 -0
- package/dist/shaders/physical/transmission_copy.glsl.d.ts +15 -0
- package/dist/shaders/physical/transmission_copy.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/transmission_copy.glsl.js +33 -0
- package/dist/shaders/physical/transmission_copy.glsl.js.map +1 -0
- package/dist/shaders/physical/unlit.glsl.d.ts +17 -0
- package/dist/shaders/physical/unlit.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/unlit.glsl.js +19 -0
- package/dist/shaders/physical/unlit.glsl.js.map +1 -0
- package/dist/shaders/physical/uv_transform.glsl.d.ts +18 -0
- package/dist/shaders/physical/uv_transform.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/uv_transform.glsl.js +30 -0
- package/dist/shaders/physical/uv_transform.glsl.js.map +1 -0
- package/dist/shaders/physical/volume.glsl.d.ts +19 -0
- package/dist/shaders/physical/volume.glsl.d.ts.map +1 -0
- package/dist/shaders/physical/volume.glsl.js +47 -0
- package/dist/shaders/physical/volume.glsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.d.ts +8 -0
- package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.js +26 -0
- package/dist/shaders/physical-wgsl/alpha_a2c.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/anisotropy.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/anisotropy.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/anisotropy.wgsl.js +97 -0
- package/dist/shaders/physical-wgsl/anisotropy.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.d.ts +11 -0
- package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.js +76 -0
- package/dist/shaders/physical-wgsl/bsdf_lobes_common.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/clearcoat.wgsl.d.ts +9 -0
- package/dist/shaders/physical-wgsl/clearcoat.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/clearcoat.wgsl.js +56 -0
- package/dist/shaders/physical-wgsl/clearcoat.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/debug_view.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/debug_view.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/debug_view.wgsl.js +71 -0
- package/dist/shaders/physical-wgsl/debug_view.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/dispersion.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/dispersion.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/dispersion.wgsl.js +51 -0
- package/dist/shaders/physical-wgsl/dispersion.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/emissive_strength.wgsl.d.ts +9 -0
- package/dist/shaders/physical-wgsl/emissive_strength.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/emissive_strength.wgsl.js +15 -0
- package/dist/shaders/physical-wgsl/emissive_strength.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/index.d.ts +35 -0
- package/dist/shaders/physical-wgsl/index.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/index.js +51 -0
- package/dist/shaders/physical-wgsl/index.js.map +1 -0
- package/dist/shaders/physical-wgsl/iridescence.wgsl.d.ts +9 -0
- package/dist/shaders/physical-wgsl/iridescence.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/iridescence.wgsl.js +162 -0
- package/dist/shaders/physical-wgsl/iridescence.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/sheen.wgsl.d.ts +9 -0
- package/dist/shaders/physical-wgsl/sheen.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/sheen.wgsl.js +85 -0
- package/dist/shaders/physical-wgsl/sheen.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/specular_ior.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/specular_ior.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/specular_ior.wgsl.js +47 -0
- package/dist/shaders/physical-wgsl/specular_ior.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/tangent_frame.wgsl.d.ts +11 -0
- package/dist/shaders/physical-wgsl/tangent_frame.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/tangent_frame.wgsl.js +57 -0
- package/dist/shaders/physical-wgsl/tangent_frame.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/transmission.wgsl.d.ts +14 -0
- package/dist/shaders/physical-wgsl/transmission.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/transmission.wgsl.js +159 -0
- package/dist/shaders/physical-wgsl/transmission.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/unlit.wgsl.d.ts +8 -0
- package/dist/shaders/physical-wgsl/unlit.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/unlit.wgsl.js +13 -0
- package/dist/shaders/physical-wgsl/unlit.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/uv_transform.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/uv_transform.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/uv_transform.wgsl.js +24 -0
- package/dist/shaders/physical-wgsl/uv_transform.wgsl.js.map +1 -0
- package/dist/shaders/physical-wgsl/volume.wgsl.d.ts +10 -0
- package/dist/shaders/physical-wgsl/volume.wgsl.d.ts.map +1 -0
- package/dist/shaders/physical-wgsl/volume.wgsl.js +35 -0
- package/dist/shaders/physical-wgsl/volume.wgsl.js.map +1 -0
- package/dist/shadows/DirectionalCascadeFitter.d.ts +97 -0
- package/dist/shadows/DirectionalCascadeFitter.d.ts.map +1 -0
- package/dist/shadows/DirectionalCascadeFitter.js +372 -0
- package/dist/shadows/DirectionalCascadeFitter.js.map +1 -0
- package/dist/shadows/Prd02DepthShaderLibrary.d.ts +77 -0
- package/dist/shadows/Prd02DepthShaderLibrary.d.ts.map +1 -0
- package/dist/shadows/Prd02DepthShaderLibrary.js +381 -0
- package/dist/shadows/Prd02DepthShaderLibrary.js.map +1 -0
- package/dist/shadows/Prd02ReceiveShadowContributor.d.ts +20 -0
- package/dist/shadows/Prd02ReceiveShadowContributor.d.ts.map +1 -0
- package/dist/shadows/Prd02ReceiveShadowContributor.js +20 -0
- package/dist/shadows/Prd02ReceiveShadowContributor.js.map +1 -0
- package/dist/shadows/Prd02ShadowBridge.d.ts +111 -0
- package/dist/shadows/Prd02ShadowBridge.d.ts.map +1 -0
- package/dist/shadows/Prd02ShadowBridge.js +267 -0
- package/dist/shadows/Prd02ShadowBridge.js.map +1 -0
- package/dist/shadows/Prd02ShadowFilter.d.ts +29 -0
- package/dist/shadows/Prd02ShadowFilter.d.ts.map +1 -0
- package/dist/shadows/Prd02ShadowFilter.js +35 -0
- package/dist/shadows/Prd02ShadowFilter.js.map +1 -0
- package/dist/shadows/Prd02ShadowsContributor.d.ts +44 -0
- package/dist/shadows/Prd02ShadowsContributor.d.ts.map +1 -0
- package/dist/shadows/Prd02ShadowsContributor.js +197 -0
- package/dist/shadows/Prd02ShadowsContributor.js.map +1 -0
- package/dist/shadows/ShadowAtlas.d.ts +59 -0
- package/dist/shadows/ShadowAtlas.d.ts.map +1 -0
- package/dist/shadows/ShadowAtlas.js +137 -0
- package/dist/shadows/ShadowAtlas.js.map +1 -0
- package/dist/shadows/ShadowDebugViews.d.ts +5 -0
- package/dist/shadows/ShadowDebugViews.d.ts.map +1 -1
- package/dist/shadows/ShadowDebugViews.js +15 -10
- package/dist/shadows/ShadowDebugViews.js.map +1 -1
- package/dist/shadows/ShadowFrameBinding.d.ts +18 -0
- package/dist/shadows/ShadowFrameBinding.d.ts.map +1 -0
- package/dist/shadows/ShadowFrameBinding.js +52 -0
- package/dist/shadows/ShadowFrameBinding.js.map +1 -0
- package/dist/shadows/ShadowSystem.d.ts +125 -0
- package/dist/shadows/ShadowSystem.d.ts.map +1 -0
- package/dist/shadows/ShadowSystem.js +293 -0
- package/dist/shadows/ShadowSystem.js.map +1 -0
- package/dist/textures/TextureBudget.d.ts +42 -0
- package/dist/textures/TextureBudget.d.ts.map +1 -0
- package/dist/textures/TextureBudget.js +180 -0
- package/dist/textures/TextureBudget.js.map +1 -0
- package/dist/vfx/BeamPass.d.ts +42 -0
- package/dist/vfx/BeamPass.d.ts.map +1 -0
- package/dist/vfx/BeamPass.js +249 -0
- package/dist/vfx/BeamPass.js.map +1 -0
- package/dist/vfx/BlendFallback.d.ts +19 -0
- package/dist/vfx/BlendFallback.d.ts.map +1 -0
- package/dist/vfx/BlendFallback.js +73 -0
- package/dist/vfx/BlendFallback.js.map +1 -0
- package/dist/vfx/DecalBatch.d.ts +120 -0
- package/dist/vfx/DecalBatch.d.ts.map +1 -0
- package/dist/vfx/DecalBatch.js +234 -0
- package/dist/vfx/DecalBatch.js.map +1 -0
- package/dist/vfx/DecalPass.d.ts +63 -0
- package/dist/vfx/DecalPass.d.ts.map +1 -0
- package/dist/vfx/DecalPass.js +159 -0
- package/dist/vfx/DecalPass.js.map +1 -0
- package/dist/vfx/LowResParticles.d.ts +31 -0
- package/dist/vfx/LowResParticles.d.ts.map +1 -0
- package/dist/vfx/LowResParticles.js +151 -0
- package/dist/vfx/LowResParticles.js.map +1 -0
- package/dist/vfx/MeshParticleBatch.d.ts +49 -0
- package/dist/vfx/MeshParticleBatch.d.ts.map +1 -0
- package/dist/vfx/MeshParticleBatch.js +184 -0
- package/dist/vfx/MeshParticleBatch.js.map +1 -0
- package/dist/vfx/MeshParticlePass.d.ts +28 -0
- package/dist/vfx/MeshParticlePass.d.ts.map +1 -0
- package/dist/vfx/MeshParticlePass.js +150 -0
- package/dist/vfx/MeshParticlePass.js.map +1 -0
- package/dist/vfx/ParticleBatchPass.d.ts +61 -0
- package/dist/vfx/ParticleBatchPass.d.ts.map +1 -0
- package/dist/vfx/ParticleBatchPass.js +320 -0
- package/dist/vfx/ParticleBatchPass.js.map +1 -0
- package/dist/vfx/ParticleGpuSim.d.ts +85 -0
- package/dist/vfx/ParticleGpuSim.d.ts.map +1 -0
- package/dist/vfx/ParticleGpuSim.js +301 -0
- package/dist/vfx/ParticleGpuSim.js.map +1 -0
- package/dist/vfx/ParticleInstanceLayout.d.ts +38 -0
- package/dist/vfx/ParticleInstanceLayout.d.ts.map +1 -0
- package/dist/vfx/ParticleInstanceLayout.js +105 -0
- package/dist/vfx/ParticleInstanceLayout.js.map +1 -0
- package/dist/vfx/ParticleSort.d.ts +21 -0
- package/dist/vfx/ParticleSort.d.ts.map +1 -0
- package/dist/vfx/ParticleSort.js +80 -0
- package/dist/vfx/ParticleSort.js.map +1 -0
- package/dist/vfx/ProceduralVolumeEmitter.d.ts +90 -0
- package/dist/vfx/ProceduralVolumeEmitter.d.ts.map +1 -0
- package/dist/vfx/ProceduralVolumeEmitter.js +155 -0
- package/dist/vfx/ProceduralVolumeEmitter.js.map +1 -0
- package/dist/vfx/RibbonBatch.d.ts +71 -0
- package/dist/vfx/RibbonBatch.d.ts.map +1 -0
- package/dist/vfx/RibbonBatch.js +234 -0
- package/dist/vfx/RibbonBatch.js.map +1 -0
- package/dist/vfx/RibbonPass.d.ts +21 -0
- package/dist/vfx/RibbonPass.d.ts.map +1 -0
- package/dist/vfx/RibbonPass.js +108 -0
- package/dist/vfx/RibbonPass.js.map +1 -0
- package/dist/vfx/SceneDepthAdapter.d.ts +28 -0
- package/dist/vfx/SceneDepthAdapter.d.ts.map +1 -0
- package/dist/vfx/SceneDepthAdapter.js +70 -0
- package/dist/vfx/SceneDepthAdapter.js.map +1 -0
- package/dist/vfx/VfxAtlas.d.ts +68 -0
- package/dist/vfx/VfxAtlas.d.ts.map +1 -0
- package/dist/vfx/VfxAtlas.js +106 -0
- package/dist/vfx/VfxAtlas.js.map +1 -0
- package/dist/vfx/contributors.d.ts +73 -0
- package/dist/vfx/contributors.d.ts.map +1 -0
- package/dist/vfx/contributors.js +615 -0
- package/dist/vfx/contributors.js.map +1 -0
- package/dist/vfx/decalLighting.d.ts +8 -0
- package/dist/vfx/decalLighting.d.ts.map +1 -0
- package/dist/vfx/decalLighting.js +53 -0
- package/dist/vfx/decalLighting.js.map +1 -0
- package/dist/vfx/depthSampler.d.ts +3 -0
- package/dist/vfx/depthSampler.d.ts.map +1 -0
- package/dist/vfx/depthSampler.js +10 -0
- package/dist/vfx/depthSampler.js.map +1 -0
- package/dist/vfx/prd07FeaturePars.d.ts +12 -0
- package/dist/vfx/prd07FeaturePars.d.ts.map +1 -0
- package/dist/vfx/prd07FeaturePars.js +54 -0
- package/dist/vfx/prd07FeaturePars.js.map +1 -0
- package/dist/vfx/shaders/beam.glsl.d.ts +11 -0
- package/dist/vfx/shaders/beam.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/beam.glsl.js +89 -0
- package/dist/vfx/shaders/beam.glsl.js.map +1 -0
- package/dist/vfx/shaders/decal.glsl.d.ts +14 -0
- package/dist/vfx/shaders/decal.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/decal.glsl.js +157 -0
- package/dist/vfx/shaders/decal.glsl.js.map +1 -0
- package/dist/vfx/shaders/gpu-sim.glsl.d.ts +5 -0
- package/dist/vfx/shaders/gpu-sim.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/gpu-sim.glsl.js +177 -0
- package/dist/vfx/shaders/gpu-sim.glsl.js.map +1 -0
- package/dist/vfx/shaders/lowresComposite.glsl.d.ts +9 -0
- package/dist/vfx/shaders/lowresComposite.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/lowresComposite.glsl.js +64 -0
- package/dist/vfx/shaders/lowresComposite.glsl.js.map +1 -0
- package/dist/vfx/shaders/mesh-particle.glsl.d.ts +4 -0
- package/dist/vfx/shaders/mesh-particle.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/mesh-particle.glsl.js +55 -0
- package/dist/vfx/shaders/mesh-particle.glsl.js.map +1 -0
- package/dist/vfx/shaders/particle.glsl.d.ts +24 -0
- package/dist/vfx/shaders/particle.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/particle.glsl.js +215 -0
- package/dist/vfx/shaders/particle.glsl.js.map +1 -0
- package/dist/vfx/shaders/ribbon.glsl.d.ts +9 -0
- package/dist/vfx/shaders/ribbon.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/ribbon.glsl.js +60 -0
- package/dist/vfx/shaders/ribbon.glsl.js.map +1 -0
- package/dist/vfx/shaders/volume.glsl.d.ts +5 -0
- package/dist/vfx/shaders/volume.glsl.d.ts.map +1 -0
- package/dist/vfx/shaders/volume.glsl.js +52 -0
- package/dist/vfx/shaders/volume.glsl.js.map +1 -0
- package/dist/webgl2/ContextLifecycle.d.ts +43 -0
- package/dist/webgl2/ContextLifecycle.d.ts.map +1 -0
- package/dist/webgl2/ContextLifecycle.js +189 -0
- package/dist/webgl2/ContextLifecycle.js.map +1 -0
- package/dist/webgl2/Counters.d.ts +58 -0
- package/dist/webgl2/Counters.d.ts.map +1 -0
- package/dist/webgl2/Counters.js +207 -0
- package/dist/webgl2/Counters.js.map +1 -0
- package/dist/webgl2/DeviceHost.d.ts +41 -0
- package/dist/webgl2/DeviceHost.d.ts.map +1 -0
- package/dist/webgl2/DeviceHost.js +3 -0
- package/dist/webgl2/DeviceHost.js.map +1 -0
- package/dist/webgl2/LegacyPost.d.ts +279 -0
- package/dist/webgl2/LegacyPost.d.ts.map +1 -0
- package/dist/webgl2/LegacyPost.js +2480 -0
- package/dist/webgl2/LegacyPost.js.map +1 -0
- package/dist/webgl2/MultiDraw.d.ts +96 -0
- package/dist/webgl2/MultiDraw.d.ts.map +1 -0
- package/dist/webgl2/MultiDraw.js +716 -0
- package/dist/webgl2/MultiDraw.js.map +1 -0
- package/dist/webgl2/Probe.d.ts +27 -0
- package/dist/webgl2/Probe.d.ts.map +1 -0
- package/dist/webgl2/Probe.js +329 -0
- package/dist/webgl2/Probe.js.map +1 -0
- package/dist/webgl2/Samplers.d.ts +20 -0
- package/dist/webgl2/Samplers.d.ts.map +1 -0
- package/dist/webgl2/Samplers.js +179 -0
- package/dist/webgl2/Samplers.js.map +1 -0
- package/dist/webgl2/TextureFormats.d.ts +48 -0
- package/dist/webgl2/TextureFormats.d.ts.map +1 -0
- package/dist/webgl2/TextureFormats.js +185 -0
- package/dist/webgl2/TextureFormats.js.map +1 -0
- package/dist/webgl2/TextureUpload.d.ts +38 -0
- package/dist/webgl2/TextureUpload.d.ts.map +1 -0
- package/dist/webgl2/TextureUpload.js +346 -0
- package/dist/webgl2/TextureUpload.js.map +1 -0
- package/dist/webgpu/WebGPUBuffer.d.ts +1 -0
- package/dist/webgpu/WebGPUBuffer.d.ts.map +1 -1
- package/dist/webgpu/WebGPUCompute.d.ts +1 -0
- package/dist/webgpu/WebGPUCompute.d.ts.map +1 -1
- package/dist/webgpu/WebGPUCompute.js +1 -0
- package/dist/webgpu/WebGPUCompute.js.map +1 -1
- package/dist/webgpu/WebGPUPipelineCache.d.ts +4 -0
- package/dist/webgpu/WebGPUPipelineCache.d.ts.map +1 -1
- package/dist/webgpu/WebGPUPipelineCache.js +4 -0
- package/dist/webgpu/WebGPUPipelineCache.js.map +1 -1
- package/dist/webgpu/WebGPUPostShaders.d.ts.map +1 -1
- package/dist/webgpu/WebGPUPostShaders.js +33 -2
- package/dist/webgpu/WebGPUPostShaders.js.map +1 -1
- package/dist/webgpu/WebGPUTexture.d.ts +1 -0
- package/dist/webgpu/WebGPUTexture.d.ts.map +1 -1
- package/dist/webgpu/WebGPUTexture.js.map +1 -1
- package/dist/world/chunks.d.ts +15 -0
- package/dist/world/chunks.d.ts.map +1 -0
- package/dist/world/chunks.js +56 -0
- package/dist/world/chunks.js.map +1 -0
- package/dist/world/index.d.ts +38 -0
- package/dist/world/index.d.ts.map +1 -0
- package/dist/world/index.js +39 -0
- package/dist/world/index.js.map +1 -0
- package/dist/world/shared/shaders/worldLightFallback.d.ts +12 -0
- package/dist/world/shared/shaders/worldLightFallback.d.ts.map +1 -0
- package/dist/world/shared/shaders/worldLightFallback.js +82 -0
- package/dist/world/shared/shaders/worldLightFallback.js.map +1 -0
- package/dist/world/space/PlanetMaterial.d.ts +24 -0
- package/dist/world/space/PlanetMaterial.d.ts.map +1 -0
- package/dist/world/space/PlanetMaterial.js +82 -0
- package/dist/world/space/PlanetMaterial.js.map +1 -0
- package/dist/world/space/SpaceSkyBake.d.ts +46 -0
- package/dist/world/space/SpaceSkyBake.d.ts.map +1 -0
- package/dist/world/space/SpaceSkyBake.js +145 -0
- package/dist/world/space/SpaceSkyBake.js.map +1 -0
- package/dist/world/space/shaders/planet.d.ts +8 -0
- package/dist/world/space/shaders/planet.d.ts.map +1 -0
- package/dist/world/space/shaders/planet.js +55 -0
- package/dist/world/space/shaders/planet.js.map +1 -0
- package/dist/world/space/shaders/spaceBake.d.ts +9 -0
- package/dist/world/space/shaders/spaceBake.d.ts.map +1 -0
- package/dist/world/space/shaders/spaceBake.js +102 -0
- package/dist/world/space/shaders/spaceBake.js.map +1 -0
- package/dist/world/terrain/SplatBake.d.ts +76 -0
- package/dist/world/terrain/SplatBake.d.ts.map +1 -0
- package/dist/world/terrain/SplatBake.js +308 -0
- package/dist/world/terrain/SplatBake.js.map +1 -0
- package/dist/world/terrain/TerrainCdlod.d.ts +67 -0
- package/dist/world/terrain/TerrainCdlod.d.ts.map +1 -0
- package/dist/world/terrain/TerrainCdlod.js +115 -0
- package/dist/world/terrain/TerrainCdlod.js.map +1 -0
- package/dist/world/terrain/TerrainHeightTexture.d.ts +44 -0
- package/dist/world/terrain/TerrainHeightTexture.d.ts.map +1 -0
- package/dist/world/terrain/TerrainHeightTexture.js +173 -0
- package/dist/world/terrain/TerrainHeightTexture.js.map +1 -0
- package/dist/world/terrain/TerrainPatchGeometry.d.ts +18 -0
- package/dist/world/terrain/TerrainPatchGeometry.d.ts.map +1 -0
- package/dist/world/terrain/TerrainPatchGeometry.js +40 -0
- package/dist/world/terrain/TerrainPatchGeometry.js.map +1 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts +19 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.js +162 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.js.map +1 -0
- package/dist/world/terrain/shaders/terrainCdlod.d.ts +23 -0
- package/dist/world/terrain/shaders/terrainCdlod.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrainCdlod.js +110 -0
- package/dist/world/terrain/shaders/terrainCdlod.js.map +1 -0
- package/dist/world/terrain/shaders/terrainSplat.d.ts +26 -0
- package/dist/world/terrain/shaders/terrainSplat.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrainSplat.js +181 -0
- package/dist/world/terrain/shaders/terrainSplat.js.map +1 -0
- package/dist/world/vegetation/FoliageMaterial.d.ts +14 -0
- package/dist/world/vegetation/FoliageMaterial.d.ts.map +1 -0
- package/dist/world/vegetation/FoliageMaterial.js +107 -0
- package/dist/world/vegetation/FoliageMaterial.js.map +1 -0
- package/dist/world/vegetation/GrassField.d.ts +43 -0
- package/dist/world/vegetation/GrassField.d.ts.map +1 -0
- package/dist/world/vegetation/GrassField.js +68 -0
- package/dist/world/vegetation/GrassField.js.map +1 -0
- package/dist/world/vegetation/ImpostorMaterial.d.ts +20 -0
- package/dist/world/vegetation/ImpostorMaterial.d.ts.map +1 -0
- package/dist/world/vegetation/ImpostorMaterial.js +80 -0
- package/dist/world/vegetation/ImpostorMaterial.js.map +1 -0
- package/dist/world/vegetation/InstanceChunkGrid.d.ts +67 -0
- package/dist/world/vegetation/InstanceChunkGrid.d.ts.map +1 -0
- package/dist/world/vegetation/InstanceChunkGrid.js +150 -0
- package/dist/world/vegetation/InstanceChunkGrid.js.map +1 -0
- package/dist/world/vegetation/WindCpu.d.ts +19 -0
- package/dist/world/vegetation/WindCpu.d.ts.map +1 -0
- package/dist/world/vegetation/WindCpu.js +43 -0
- package/dist/world/vegetation/WindCpu.js.map +1 -0
- package/dist/world/vegetation/WindField.d.ts +42 -0
- package/dist/world/vegetation/WindField.d.ts.map +1 -0
- package/dist/world/vegetation/WindField.js +154 -0
- package/dist/world/vegetation/WindField.js.map +1 -0
- package/dist/world/vegetation/shaders/foliage.d.ts +8 -0
- package/dist/world/vegetation/shaders/foliage.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/foliage.js +104 -0
- package/dist/world/vegetation/shaders/foliage.js.map +1 -0
- package/dist/world/vegetation/shaders/grass.d.ts +10 -0
- package/dist/world/vegetation/shaders/grass.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/grass.js +79 -0
- package/dist/world/vegetation/shaders/grass.js.map +1 -0
- package/dist/world/vegetation/shaders/impostor.d.ts +9 -0
- package/dist/world/vegetation/shaders/impostor.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/impostor.js +97 -0
- package/dist/world/vegetation/shaders/impostor.js.map +1 -0
- package/dist/world/vegetation/shaders/wind.d.ts +9 -0
- package/dist/world/vegetation/shaders/wind.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/wind.js +103 -0
- package/dist/world/vegetation/shaders/wind.js.map +1 -0
- package/dist/world/water/GerstnerWaves.d.ts +65 -0
- package/dist/world/water/GerstnerWaves.d.ts.map +1 -0
- package/dist/world/water/GerstnerWaves.js +182 -0
- package/dist/world/water/GerstnerWaves.js.map +1 -0
- package/dist/world/water/ReflectionViewPass.d.ts +46 -0
- package/dist/world/water/ReflectionViewPass.d.ts.map +1 -0
- package/dist/world/water/ReflectionViewPass.js +85 -0
- package/dist/world/water/ReflectionViewPass.js.map +1 -0
- package/dist/world/water/SceneCopyFallback.d.ts +21 -0
- package/dist/world/water/SceneCopyFallback.d.ts.map +1 -0
- package/dist/world/water/SceneCopyFallback.js +150 -0
- package/dist/world/water/SceneCopyFallback.js.map +1 -0
- package/dist/world/water/UnderwaterState.d.ts +25 -0
- package/dist/world/water/UnderwaterState.d.ts.map +1 -0
- package/dist/world/water/UnderwaterState.js +134 -0
- package/dist/world/water/UnderwaterState.js.map +1 -0
- package/dist/world/water/WaterMaterial.d.ts +23 -0
- package/dist/world/water/WaterMaterial.d.ts.map +1 -0
- package/dist/world/water/WaterMaterial.js +129 -0
- package/dist/world/water/WaterMaterial.js.map +1 -0
- package/dist/world/water/shaders/caustics.d.ts +13 -0
- package/dist/world/water/shaders/caustics.d.ts.map +1 -0
- package/dist/world/water/shaders/caustics.js +103 -0
- package/dist/world/water/shaders/caustics.js.map +1 -0
- package/dist/world/water/shaders/gerstner.d.ts +9 -0
- package/dist/world/water/shaders/gerstner.d.ts.map +1 -0
- package/dist/world/water/shaders/gerstner.js +100 -0
- package/dist/world/water/shaders/gerstner.js.map +1 -0
- package/dist/world/water/shaders/water.d.ts +12 -0
- package/dist/world/water/shaders/water.d.ts.map +1 -0
- package/dist/world/water/shaders/water.js +112 -0
- package/dist/world/water/shaders/water.js.map +1 -0
- package/package.json +32 -11
- package/dist/ArchitecturalMaterialCatalog.d.ts +0 -30
- package/dist/ArchitecturalMaterialCatalog.d.ts.map +0 -1
- package/dist/ArchitecturalMaterialCatalog.js +0 -90
- package/dist/ArchitecturalMaterialCatalog.js.map +0 -1
- package/dist/LeanWebGL2Device.d.ts +0 -265
- package/dist/LeanWebGL2Device.d.ts.map +0 -1
- package/dist/LeanWebGL2Device.js +0 -4001
- package/dist/LeanWebGL2Device.js.map +0 -1
- package/dist/advanced-runtime/AdvancedRenderer.d.ts +0 -23
- package/dist/advanced-runtime/AdvancedRenderer.d.ts.map +0 -1
- package/dist/advanced-runtime/AdvancedRenderer.js +0 -45
- package/dist/advanced-runtime/AdvancedRenderer.js.map +0 -1
- package/dist/animation/AnimationMaterialStyle.d.ts +0 -19
- package/dist/animation/AnimationMaterialStyle.d.ts.map +0 -1
- package/dist/animation/AnimationMaterialStyle.js +0 -13
- package/dist/animation/AnimationMaterialStyle.js.map +0 -1
- package/dist/cinematic/CinematicMaterialPresets.d.ts +0 -16
- package/dist/cinematic/CinematicMaterialPresets.d.ts.map +0 -1
- package/dist/cinematic/CinematicMaterialPresets.js +0 -114
- package/dist/cinematic/CinematicMaterialPresets.js.map +0 -1
- package/dist/lean/LeanProductRenderer.d.ts +0 -29
- package/dist/lean/LeanProductRenderer.d.ts.map +0 -1
- package/dist/lean/LeanProductRenderer.js +0 -38
- package/dist/lean/LeanProductRenderer.js.map +0 -1
- package/dist/lean/LeanProductionRenderer.d.ts +0 -38
- package/dist/lean/LeanProductionRenderer.d.ts.map +0 -1
- package/dist/lean/LeanProductionRenderer.js +0 -88
- package/dist/lean/LeanProductionRenderer.js.map +0 -1
- package/dist/lean-core-runtime.d.ts +0 -13
- package/dist/lean-core-runtime.d.ts.map +0 -1
- package/dist/lean-core-runtime.js +0 -10
- package/dist/lean-core-runtime.js.map +0 -1
- package/dist/lean-runtime.d.ts +0 -18
- package/dist/lean-runtime.d.ts.map +0 -1
- package/dist/lean-runtime.js +0 -13
- package/dist/lean-runtime.js.map +0 -1
- package/dist/materials/TransmissionPass.d.ts +0 -16
- package/dist/materials/TransmissionPass.d.ts.map +0 -1
- package/dist/materials/TransmissionPass.js +0 -30
- package/dist/materials/TransmissionPass.js.map +0 -1
- package/dist/production-runtime/ProductionEffectsPipeline.d.ts +0 -20
- package/dist/production-runtime/ProductionEffectsPipeline.d.ts.map +0 -1
- package/dist/production-runtime/ProductionEffectsPipeline.js +0 -65
- package/dist/production-runtime/ProductionEffectsPipeline.js.map +0 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +0 -44
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +0 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js +0 -179
- package/dist/production-runtime/ProductionRuntimeRenderer.js.map +0 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +0 -65
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +0 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.js +0 -305
- package/dist/production-runtime/ProductionWebGL2Renderer.js.map +0 -1
- package/dist/threejs-example-parity/index.d.ts +0 -57
- package/dist/threejs-example-parity/index.d.ts.map +0 -1
- package/dist/threejs-example-parity/index.js +0 -139
- package/dist/threejs-example-parity/index.js.map +0 -1
package/dist/PostProcessPass.js
CHANGED
|
@@ -1,2019 +1,9 @@
|
|
|
1
|
-
import { BaseRenderPass } from "./RenderPass.js";
|
|
2
|
-
import { RenderDeviceError } from "./RenderDevice.js";
|
|
3
|
-
import { OUTLINE_LUMA_SCALE, createOutlineGradientBound } from "./postprocess/NativeLdrEffectLuts.js";
|
|
4
|
-
export class ToneMappingPass extends BaseRenderPass {
|
|
5
|
-
options;
|
|
6
|
-
exposure;
|
|
7
|
-
whitePoint;
|
|
8
|
-
gamma;
|
|
9
|
-
operator;
|
|
10
|
-
inputColorSpace;
|
|
11
|
-
outputColorSpace;
|
|
12
|
-
lastResult = null;
|
|
13
|
-
constructor(options) {
|
|
14
|
-
super(options.name ?? "tone-mapping", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "backbuffer"]);
|
|
15
|
-
this.options = options;
|
|
16
|
-
this.exposure = options.exposure ?? 1;
|
|
17
|
-
this.whitePoint = options.whitePoint ?? 1;
|
|
18
|
-
this.gamma = options.gamma ?? 2.2;
|
|
19
|
-
this.operator = options.operator ?? "reinhard";
|
|
20
|
-
this.inputColorSpace = options.inputColorSpace ?? "linear";
|
|
21
|
-
this.outputColorSpace = options.outputColorSpace ?? "linear";
|
|
22
|
-
if (!Number.isFinite(this.exposure) || this.exposure < 0) {
|
|
23
|
-
throw new Error("ToneMappingPass exposure must be finite and non-negative.");
|
|
24
|
-
}
|
|
25
|
-
if (!Number.isFinite(this.whitePoint) || this.whitePoint <= 0) {
|
|
26
|
-
throw new Error("ToneMappingPass whitePoint must be finite and positive.");
|
|
27
|
-
}
|
|
28
|
-
if (!Number.isFinite(this.gamma) || this.gamma <= 0) {
|
|
29
|
-
throw new Error("ToneMappingPass gamma must be finite and positive.");
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
execute(context) {
|
|
33
|
-
context.device.setRenderTarget(this.options.source);
|
|
34
|
-
const mapped = this.options.source.colorTexture.format === "rgba16f" || this.options.source.colorTexture.format === "rgba32f"
|
|
35
|
-
? toneMapFloatPixels(context.device.readFloatPixels(0, 0, this.options.source.width, this.options.source.height), this.options.source.width, this.options.source.height, {
|
|
36
|
-
exposure: this.exposure,
|
|
37
|
-
whitePoint: this.whitePoint,
|
|
38
|
-
gamma: this.gamma,
|
|
39
|
-
operator: this.operator,
|
|
40
|
-
outputColorSpace: this.outputColorSpace
|
|
41
|
-
})
|
|
42
|
-
: toneMapPixels(context.device.readPixels(0, 0, this.options.source.width, this.options.source.height), this.options.source.width, this.options.source.height, {
|
|
43
|
-
exposure: this.exposure,
|
|
44
|
-
whitePoint: this.whitePoint,
|
|
45
|
-
gamma: this.gamma,
|
|
46
|
-
operator: this.operator,
|
|
47
|
-
inputColorSpace: this.inputColorSpace,
|
|
48
|
-
outputColorSpace: this.outputColorSpace
|
|
49
|
-
});
|
|
50
|
-
writeRenderTarget(context.device, this.options.source, this.options.target, mapped.pixels);
|
|
51
|
-
this.lastResult = mapped;
|
|
52
|
-
}
|
|
53
|
-
getLastResult() {
|
|
54
|
-
return this.lastResult ? { ...this.lastResult, pixels: new Uint8Array(this.lastResult.pixels) } : null;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
export class DepthVisualizationPass extends BaseRenderPass {
|
|
58
|
-
options;
|
|
59
|
-
edgeThreshold;
|
|
60
|
-
lastResult = null;
|
|
61
|
-
constructor(options) {
|
|
62
|
-
super(options.name ?? "depth-visualization", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "depth-visualization-output"]);
|
|
63
|
-
this.options = options;
|
|
64
|
-
this.edgeThreshold = options.edgeThreshold ?? 0.08;
|
|
65
|
-
if (!Number.isFinite(this.edgeThreshold) || this.edgeThreshold < 0 || this.edgeThreshold > 1) {
|
|
66
|
-
throw new Error("DepthVisualizationPass edgeThreshold must be finite and in [0, 1].");
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
execute(context) {
|
|
70
|
-
const visualized = visualizeDepthTexture(this.options.source, { edgeThreshold: this.edgeThreshold });
|
|
71
|
-
writeDepthTarget(this.options.target, this.options.source.width, this.options.source.height, visualized.pixels);
|
|
72
|
-
context.device.setRenderTarget(this.options.target ?? null);
|
|
73
|
-
this.lastResult = visualized;
|
|
74
|
-
}
|
|
75
|
-
getLastResult() {
|
|
76
|
-
return this.lastResult
|
|
77
|
-
? {
|
|
78
|
-
...this.lastResult,
|
|
79
|
-
pixels: new Uint8Array(this.lastResult.pixels),
|
|
80
|
-
stats: { ...this.lastResult.stats }
|
|
81
|
-
}
|
|
82
|
-
: null;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
export class BloomPass extends BaseRenderPass {
|
|
86
|
-
options;
|
|
87
|
-
threshold;
|
|
88
|
-
intensity;
|
|
89
|
-
radius;
|
|
90
|
-
lastResult = null;
|
|
91
|
-
constructor(options) {
|
|
92
|
-
super(options.name ?? "bloom", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "bloom-output"]);
|
|
93
|
-
this.options = options;
|
|
94
|
-
this.threshold = options.threshold ?? 0.75;
|
|
95
|
-
this.intensity = options.intensity ?? 0.35;
|
|
96
|
-
this.radius = options.radius ?? 1;
|
|
97
|
-
validateBloomOptions(this.threshold, this.intensity, this.radius);
|
|
98
|
-
}
|
|
99
|
-
execute(context) {
|
|
100
|
-
context.device.setRenderTarget(this.options.source);
|
|
101
|
-
const pixels = context.device.readPixels(0, 0, this.options.source.width, this.options.source.height);
|
|
102
|
-
const bloomed = bloomPixels(pixels, this.options.source.width, this.options.source.height, {
|
|
103
|
-
threshold: this.threshold,
|
|
104
|
-
intensity: this.intensity,
|
|
105
|
-
radius: this.radius
|
|
106
|
-
});
|
|
107
|
-
writeRenderTarget(context.device, this.options.source, this.options.target, bloomed.pixels);
|
|
108
|
-
this.lastResult = bloomed;
|
|
109
|
-
}
|
|
110
|
-
getLastResult() {
|
|
111
|
-
return this.lastResult
|
|
112
|
-
? {
|
|
113
|
-
...this.lastResult,
|
|
114
|
-
pixels: new Uint8Array(this.lastResult.pixels),
|
|
115
|
-
brightPixels: new Uint8Array(this.lastResult.brightPixels),
|
|
116
|
-
horizontalBlurPixels: new Uint8Array(this.lastResult.horizontalBlurPixels),
|
|
117
|
-
verticalBlurPixels: new Uint8Array(this.lastResult.verticalBlurPixels)
|
|
118
|
-
}
|
|
119
|
-
: null;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
export class FXAAPass extends BaseRenderPass {
|
|
123
|
-
options;
|
|
124
|
-
edgeThreshold;
|
|
125
|
-
subpixelBlend;
|
|
126
|
-
lastResult = null;
|
|
127
|
-
constructor(options) {
|
|
128
|
-
super(options.name ?? "fxaa", [options.readResource ?? options.source.label], [options.writeResource ?? options.target?.label ?? "fxaa-output"]);
|
|
129
|
-
this.options = options;
|
|
130
|
-
this.edgeThreshold = options.edgeThreshold ?? 0.125;
|
|
131
|
-
this.subpixelBlend = options.subpixelBlend ?? 0.75;
|
|
132
|
-
validateFXAAOptions(this.edgeThreshold, this.subpixelBlend);
|
|
133
|
-
}
|
|
134
|
-
execute(context) {
|
|
135
|
-
context.device.setRenderTarget(this.options.source);
|
|
136
|
-
const pixels = context.device.readPixels(0, 0, this.options.source.width, this.options.source.height);
|
|
137
|
-
const smoothed = fxaaPixels(pixels, this.options.source.width, this.options.source.height, {
|
|
138
|
-
edgeThreshold: this.edgeThreshold,
|
|
139
|
-
subpixelBlend: this.subpixelBlend
|
|
140
|
-
});
|
|
141
|
-
writeRenderTarget(context.device, this.options.source, this.options.target, smoothed.pixels);
|
|
142
|
-
this.lastResult = smoothed;
|
|
143
|
-
}
|
|
144
|
-
getLastResult() {
|
|
145
|
-
return this.lastResult
|
|
146
|
-
? {
|
|
147
|
-
...this.lastResult,
|
|
148
|
-
pixels: new Uint8Array(this.lastResult.pixels),
|
|
149
|
-
edgeMask: new Uint8Array(this.lastResult.edgeMask)
|
|
150
|
-
}
|
|
151
|
-
: null;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
export function toneMapPixels(pixels, width, height, options = {}) {
|
|
155
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
156
|
-
throw new Error("Tone mapping dimensions must be positive integers.");
|
|
157
|
-
}
|
|
158
|
-
if (pixels.byteLength !== width * height * 4) {
|
|
159
|
-
throw new Error("Tone mapping input must contain width * height * 4 RGBA bytes.");
|
|
160
|
-
}
|
|
161
|
-
const exposure = options.exposure ?? 1;
|
|
162
|
-
const whitePoint = options.whitePoint ?? 1;
|
|
163
|
-
const gamma = options.gamma ?? 2.2;
|
|
164
|
-
const operator = options.operator ?? "reinhard";
|
|
165
|
-
const inputColorSpace = options.inputColorSpace ?? "linear";
|
|
166
|
-
const outputColorSpace = options.outputColorSpace ?? "linear";
|
|
167
|
-
if (!Number.isFinite(exposure) || exposure < 0) {
|
|
168
|
-
throw new Error("Tone mapping exposure must be finite and non-negative.");
|
|
169
|
-
}
|
|
170
|
-
if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
|
|
171
|
-
throw new Error("Tone mapping whitePoint must be finite and positive.");
|
|
172
|
-
}
|
|
173
|
-
if (!Number.isFinite(gamma) || gamma <= 0) {
|
|
174
|
-
throw new Error("Tone mapping gamma must be finite and positive.");
|
|
175
|
-
}
|
|
176
|
-
const output = new Uint8Array(pixels.byteLength);
|
|
177
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
178
|
-
const decoded = [
|
|
179
|
-
decodeColorByte(pixels[index], inputColorSpace),
|
|
180
|
-
decodeColorByte(pixels[index + 1], inputColorSpace),
|
|
181
|
-
decodeColorByte(pixels[index + 2], inputColorSpace)
|
|
182
|
-
];
|
|
183
|
-
const mapped = operator === "aces" ? acesFilmicRgb(decoded, exposure, whitePoint) : undefined;
|
|
184
|
-
output[index] = mapped ? encodeColorByte(mapped[0], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[0], exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
185
|
-
output[index + 1] = mapped ? encodeColorByte(mapped[1], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[1], exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
186
|
-
output[index + 2] = mapped ? encodeColorByte(mapped[2], gamma, outputColorSpace) : encodeToneMappedChannel(decoded[2], exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
187
|
-
output[index + 3] = pixels[index + 3];
|
|
188
|
-
}
|
|
189
|
-
return {
|
|
190
|
-
width,
|
|
191
|
-
height,
|
|
192
|
-
pixels: output,
|
|
193
|
-
colorSpace: outputColorSpace,
|
|
194
|
-
calibration: createToneMappingCalibration({ exposure, whitePoint, gamma, operator, inputColorSpace, outputColorSpace })
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
export function toneMapFloatPixels(pixels, width, height, options = {}) {
|
|
198
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
199
|
-
throw new Error("HDR tone mapping dimensions must be positive integers.");
|
|
200
|
-
}
|
|
201
|
-
if (pixels.length !== width * height * 4) {
|
|
202
|
-
throw new Error("HDR tone mapping input must contain width * height * 4 RGBA float values.");
|
|
203
|
-
}
|
|
204
|
-
const exposure = options.exposure ?? 1;
|
|
205
|
-
const whitePoint = options.whitePoint ?? 1;
|
|
206
|
-
const gamma = options.gamma ?? 2.2;
|
|
207
|
-
const operator = options.operator ?? "reinhard";
|
|
208
|
-
const outputColorSpace = options.outputColorSpace ?? "linear";
|
|
209
|
-
if (!Number.isFinite(exposure) || exposure < 0) {
|
|
210
|
-
throw new Error("HDR tone mapping exposure must be finite and non-negative.");
|
|
211
|
-
}
|
|
212
|
-
if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
|
|
213
|
-
throw new Error("HDR tone mapping whitePoint must be finite and positive.");
|
|
214
|
-
}
|
|
215
|
-
if (!Number.isFinite(gamma) || gamma <= 0) {
|
|
216
|
-
throw new Error("HDR tone mapping gamma must be finite and positive.");
|
|
217
|
-
}
|
|
218
|
-
const output = new Uint8Array(pixels.length);
|
|
219
|
-
let inputOverbrightPixels = 0;
|
|
220
|
-
let maxInputValue = 0;
|
|
221
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
222
|
-
const r = finiteHdrChannel(pixels[index], index);
|
|
223
|
-
const g = finiteHdrChannel(pixels[index + 1], index + 1);
|
|
224
|
-
const b = finiteHdrChannel(pixels[index + 2], index + 2);
|
|
225
|
-
const a = finiteHdrChannel(pixels[index + 3], index + 3);
|
|
226
|
-
if (r > 1 || g > 1 || b > 1)
|
|
227
|
-
inputOverbrightPixels += 1;
|
|
228
|
-
maxInputValue = Math.max(maxInputValue, r, g, b);
|
|
229
|
-
const mapped = operator === "aces" ? acesFilmicRgb([r, g, b], exposure, whitePoint) : undefined;
|
|
230
|
-
output[index] = mapped ? encodeColorByte(mapped[0], gamma, outputColorSpace) : encodeToneMappedChannel(r, exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
231
|
-
output[index + 1] = mapped ? encodeColorByte(mapped[1], gamma, outputColorSpace) : encodeToneMappedChannel(g, exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
232
|
-
output[index + 2] = mapped ? encodeColorByte(mapped[2], gamma, outputColorSpace) : encodeToneMappedChannel(b, exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
233
|
-
output[index + 3] = clampByte(a * 255);
|
|
234
|
-
}
|
|
235
|
-
return {
|
|
236
|
-
width,
|
|
237
|
-
height,
|
|
238
|
-
pixels: output,
|
|
239
|
-
colorSpace: outputColorSpace,
|
|
240
|
-
calibration: createToneMappingCalibration({ exposure, whitePoint, gamma, operator, inputColorSpace: "linear", outputColorSpace }),
|
|
241
|
-
inputOverbrightPixels,
|
|
242
|
-
maxInputValue: Number(maxInputValue.toFixed(6))
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
export function colorGradePixels(pixels, width, height, options = {}) {
|
|
246
|
-
validatePixelBuffer(pixels, width, height, "Color grading");
|
|
247
|
-
const settings = {
|
|
248
|
-
contrast: options.contrast ?? 1,
|
|
249
|
-
temperature: options.temperature ?? 0,
|
|
250
|
-
tint: options.tint ?? 0,
|
|
251
|
-
saturation: options.saturation ?? 1,
|
|
252
|
-
vibrance: options.vibrance ?? 0,
|
|
253
|
-
vignette: options.vignette ?? 0,
|
|
254
|
-
sharpening: options.sharpening ?? 0
|
|
255
|
-
};
|
|
256
|
-
validateRange(settings.contrast, 0, 3, "Color grading contrast");
|
|
257
|
-
validateRange(settings.temperature, -1, 1, "Color grading temperature");
|
|
258
|
-
validateRange(settings.tint, -1, 1, "Color grading tint");
|
|
259
|
-
validateRange(settings.saturation, 0, 3, "Color grading saturation");
|
|
260
|
-
validateRange(settings.vibrance, -1, 1, "Color grading vibrance");
|
|
261
|
-
validateRange(settings.vignette, 0, 1, "Color grading vignette");
|
|
262
|
-
validateRange(settings.sharpening, 0, 2, "Color grading sharpening");
|
|
263
|
-
const graded = new Uint8Array(pixels.byteLength);
|
|
264
|
-
let changedPixels = 0;
|
|
265
|
-
let vignetteDarkenedPixels = 0;
|
|
266
|
-
for (let y = 0; y < height; y += 1) {
|
|
267
|
-
for (let x = 0; x < width; x += 1) {
|
|
268
|
-
const index = (y * width + x) * 4;
|
|
269
|
-
let r = (pixels[index] ?? 0) / 255;
|
|
270
|
-
let g = (pixels[index + 1] ?? 0) / 255;
|
|
271
|
-
let b = (pixels[index + 2] ?? 0) / 255;
|
|
272
|
-
const luma = 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
273
|
-
r = (r - 0.5) * settings.contrast + 0.5;
|
|
274
|
-
g = (g - 0.5) * settings.contrast + 0.5;
|
|
275
|
-
b = (b - 0.5) * settings.contrast + 0.5;
|
|
276
|
-
r += settings.temperature * 0.08 - settings.tint * 0.02;
|
|
277
|
-
g += settings.tint * 0.06;
|
|
278
|
-
b -= settings.temperature * 0.08 + settings.tint * 0.02;
|
|
279
|
-
const vibranceBoost = settings.vibrance * (1 - Math.min(1, Math.abs(r - luma) + Math.abs(g - luma) + Math.abs(b - luma)));
|
|
280
|
-
const saturation = settings.saturation + vibranceBoost;
|
|
281
|
-
r = luma + (r - luma) * saturation;
|
|
282
|
-
g = luma + (g - luma) * saturation;
|
|
283
|
-
b = luma + (b - luma) * saturation;
|
|
284
|
-
const centerX = width <= 1 ? 0 : (x / (width - 1)) * 2 - 1;
|
|
285
|
-
const centerY = height <= 1 ? 0 : (y / (height - 1)) * 2 - 1;
|
|
286
|
-
const vignette = 1 - settings.vignette * Math.min(1, Math.max(0, Math.hypot(centerX, centerY) - 0.28) / 1.12);
|
|
287
|
-
if (vignette < 0.98)
|
|
288
|
-
vignetteDarkenedPixels += 1;
|
|
289
|
-
r *= vignette;
|
|
290
|
-
g *= vignette;
|
|
291
|
-
b *= vignette;
|
|
292
|
-
graded[index] = clampByte(r * 255);
|
|
293
|
-
graded[index + 1] = clampByte(g * 255);
|
|
294
|
-
graded[index + 2] = clampByte(b * 255);
|
|
295
|
-
graded[index + 3] = pixels[index + 3] ?? 255;
|
|
296
|
-
if (Math.abs(graded[index] - (pixels[index] ?? 0)) + Math.abs(graded[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(graded[index + 2] - (pixels[index + 2] ?? 0)) > 3) {
|
|
297
|
-
changedPixels += 1;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
const sharpened = settings.sharpening > 0 ? sharpenPixels(graded, width, height, settings.sharpening) : { pixels: graded, sharpenedPixels: 0 };
|
|
302
|
-
return {
|
|
303
|
-
width,
|
|
304
|
-
height,
|
|
305
|
-
pixels: sharpened.pixels,
|
|
306
|
-
changedPixels: Math.max(changedPixels, countChangedRgb(pixels, sharpened.pixels)),
|
|
307
|
-
vignetteDarkenedPixels,
|
|
308
|
-
sharpenedPixels: sharpened.sharpenedPixels,
|
|
309
|
-
settings
|
|
310
|
-
};
|
|
311
|
-
}
|
|
312
|
-
export const toneMappingPresets = {
|
|
313
|
-
natural: createToneMappingPreset("natural", "Natural", {
|
|
314
|
-
operator: "neutral",
|
|
315
|
-
exposure: 1,
|
|
316
|
-
autoExposure: false
|
|
317
|
-
}),
|
|
318
|
-
cinematic: createToneMappingPreset("cinematic", "Cinematic", {
|
|
319
|
-
operator: "aces",
|
|
320
|
-
exposure: 1.2,
|
|
321
|
-
autoExposure: true,
|
|
322
|
-
adaptationSpeed: 0.3,
|
|
323
|
-
temperature: -0.1,
|
|
324
|
-
contrast: 1.1,
|
|
325
|
-
saturation: 0.95
|
|
326
|
-
}),
|
|
327
|
-
vibrant: createToneMappingPreset("vibrant", "Vibrant", {
|
|
328
|
-
operator: "uncharted2",
|
|
329
|
-
exposure: 1.3,
|
|
330
|
-
autoExposure: false,
|
|
331
|
-
temperature: 0.1,
|
|
332
|
-
contrast: 1.15,
|
|
333
|
-
saturation: 1.2
|
|
334
|
-
}),
|
|
335
|
-
realistic: createToneMappingPreset("realistic", "Realistic", {
|
|
336
|
-
operator: "agx",
|
|
337
|
-
exposure: 1,
|
|
338
|
-
autoExposure: true,
|
|
339
|
-
adaptationSpeed: 0.5
|
|
340
|
-
}),
|
|
341
|
-
stylized: createToneMappingPreset("stylized", "Stylized", {
|
|
342
|
-
operator: "filmic",
|
|
343
|
-
exposure: 1.4,
|
|
344
|
-
autoExposure: false,
|
|
345
|
-
temperature: 0.2,
|
|
346
|
-
contrast: 1.25,
|
|
347
|
-
saturation: 1.1
|
|
348
|
-
})
|
|
349
|
-
};
|
|
350
|
-
export function resolveToneMappingPreset(name, overrides = {}) {
|
|
351
|
-
const preset = toneMappingPresets[name];
|
|
352
|
-
return {
|
|
353
|
-
...preset,
|
|
354
|
-
toneMapping: {
|
|
355
|
-
...preset.toneMapping,
|
|
356
|
-
exposure: overrides.exposure ?? preset.toneMapping.exposure,
|
|
357
|
-
whitePoint: overrides.whitePoint ?? preset.toneMapping.whitePoint,
|
|
358
|
-
gamma: overrides.gamma ?? preset.toneMapping.gamma,
|
|
359
|
-
operator: overrides.operator ?? preset.toneMapping.operator,
|
|
360
|
-
inputColorSpace: overrides.inputColorSpace ?? preset.toneMapping.inputColorSpace,
|
|
361
|
-
outputColorSpace: overrides.outputColorSpace ?? preset.toneMapping.outputColorSpace
|
|
362
|
-
},
|
|
363
|
-
colorGrade: {
|
|
364
|
-
...preset.colorGrade,
|
|
365
|
-
contrast: overrides.contrast ?? preset.colorGrade.contrast,
|
|
366
|
-
temperature: overrides.temperature ?? preset.colorGrade.temperature,
|
|
367
|
-
tint: overrides.tint ?? preset.colorGrade.tint,
|
|
368
|
-
saturation: overrides.saturation ?? preset.colorGrade.saturation,
|
|
369
|
-
vibrance: overrides.vibrance ?? preset.colorGrade.vibrance,
|
|
370
|
-
vignette: overrides.vignette ?? preset.colorGrade.vignette,
|
|
371
|
-
sharpening: overrides.sharpening ?? preset.colorGrade.sharpening
|
|
372
|
-
},
|
|
373
|
-
autoExposure: overrides.autoExposure ?? preset.autoExposure,
|
|
374
|
-
adaptationSpeed: overrides.adaptationSpeed ?? preset.adaptationSpeed,
|
|
375
|
-
minExposure: overrides.minExposure ?? preset.minExposure,
|
|
376
|
-
maxExposure: overrides.maxExposure ?? preset.maxExposure
|
|
377
|
-
};
|
|
378
|
-
}
|
|
379
|
-
export function computeExposureHistogramFromPixels(pixels, width, height, options = {}) {
|
|
380
|
-
validatePixelBuffer(pixels, width, height, "Exposure histogram");
|
|
381
|
-
const inputColorSpace = options.inputColorSpace ?? "linear";
|
|
382
|
-
const binCount = options.binCount ?? 64;
|
|
383
|
-
const minLuminance = options.minLuminance ?? 0.001;
|
|
384
|
-
const maxLuminance = options.maxLuminance ?? 16;
|
|
385
|
-
validateHistogramOptions(binCount, minLuminance, maxLuminance);
|
|
386
|
-
const bins = Array.from({ length: binCount }, () => 0);
|
|
387
|
-
const logMin = Math.log2(minLuminance);
|
|
388
|
-
const logMax = Math.log2(maxLuminance);
|
|
389
|
-
let luminanceSum = 0;
|
|
390
|
-
let minObservedLuminance = Number.POSITIVE_INFINITY;
|
|
391
|
-
let maxObservedLuminance = 0;
|
|
392
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
393
|
-
const r = decodeColorByte(pixels[index] ?? 0, inputColorSpace);
|
|
394
|
-
const g = decodeColorByte(pixels[index + 1] ?? 0, inputColorSpace);
|
|
395
|
-
const b = decodeColorByte(pixels[index + 2] ?? 0, inputColorSpace);
|
|
396
|
-
const luminance = Math.max(0, 0.2126 * r + 0.7152 * g + 0.0722 * b);
|
|
397
|
-
luminanceSum += luminance;
|
|
398
|
-
minObservedLuminance = Math.min(minObservedLuminance, luminance);
|
|
399
|
-
maxObservedLuminance = Math.max(maxObservedLuminance, luminance);
|
|
400
|
-
const safeLuminance = Math.max(minLuminance, Math.min(maxLuminance, luminance));
|
|
401
|
-
const bin = clampInt(Math.round(((Math.log2(safeLuminance) - logMin) / (logMax - logMin)) * (binCount - 1)), 0, binCount - 1);
|
|
402
|
-
bins[bin] += 1;
|
|
403
|
-
}
|
|
404
|
-
const pixelCount = width * height;
|
|
405
|
-
return {
|
|
406
|
-
bins,
|
|
407
|
-
binCount,
|
|
408
|
-
minLuminance,
|
|
409
|
-
maxLuminance,
|
|
410
|
-
pixelCount,
|
|
411
|
-
averageLuminance: Number((luminanceSum / pixelCount).toFixed(6)),
|
|
412
|
-
minObservedLuminance: Number((minObservedLuminance === Number.POSITIVE_INFINITY ? 0 : minObservedLuminance).toFixed(6)),
|
|
413
|
-
maxObservedLuminance: Number(maxObservedLuminance.toFixed(6))
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
|
-
export function computeAutoExposureFromHistogram(histogram, options = {}) {
|
|
417
|
-
if (histogram.pixelCount <= 0 || histogram.bins.length !== histogram.binCount) {
|
|
418
|
-
throw new Error("Auto exposure histogram must contain bins and a positive pixel count.");
|
|
419
|
-
}
|
|
420
|
-
const targetLuminance = options.targetLuminance ?? 0.18;
|
|
421
|
-
const previousExposure = options.previousExposure ?? 1;
|
|
422
|
-
const adaptationSpeed = options.adaptationSpeed ?? 1;
|
|
423
|
-
const deltaTimeSeconds = options.deltaTimeSeconds ?? 1 / 60;
|
|
424
|
-
const minExposure = options.minExposure ?? 0.1;
|
|
425
|
-
const maxExposure = options.maxExposure ?? 10;
|
|
426
|
-
validateRange(targetLuminance, 0.001, 4, "Auto exposure targetLuminance");
|
|
427
|
-
validateRange(previousExposure, 0.001, 128, "Auto exposure previousExposure");
|
|
428
|
-
validateRange(adaptationSpeed, 0, 1, "Auto exposure adaptationSpeed");
|
|
429
|
-
validateRange(deltaTimeSeconds, 0, 10, "Auto exposure deltaTimeSeconds");
|
|
430
|
-
validateRange(minExposure, 0.001, 128, "Auto exposure minExposure");
|
|
431
|
-
validateRange(maxExposure, minExposure, 128, "Auto exposure maxExposure");
|
|
432
|
-
const averageLuminance = histogram.averageLuminance > 0 ? histogram.averageLuminance : histogramAverageFromBins(histogram);
|
|
433
|
-
const unclampedTarget = targetLuminance / Math.max(0.001, averageLuminance);
|
|
434
|
-
const targetExposure = Math.max(minExposure, Math.min(maxExposure, unclampedTarget));
|
|
435
|
-
const adaptationRate = 1 - Math.pow(1 - adaptationSpeed, deltaTimeSeconds * 60);
|
|
436
|
-
const exposure = previousExposure + (targetExposure - previousExposure) * adaptationRate;
|
|
437
|
-
return {
|
|
438
|
-
exposure: Number(exposure.toFixed(6)),
|
|
439
|
-
targetExposure: Number(targetExposure.toFixed(6)),
|
|
440
|
-
averageLuminance: Number(averageLuminance.toFixed(6)),
|
|
441
|
-
adaptationRate: Number(adaptationRate.toFixed(6)),
|
|
442
|
-
clamped: targetExposure !== unclampedTarget
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
export function applyToneMappingPreset(pixels, width, height, presetName, options = {}) {
|
|
446
|
-
const preset = resolveToneMappingPreset(presetName, options);
|
|
447
|
-
const histogram = computeExposureHistogramFromPixels(pixels, width, height, {
|
|
448
|
-
inputColorSpace: preset.toneMapping.inputColorSpace
|
|
449
|
-
});
|
|
450
|
-
const autoExposure = preset.autoExposure
|
|
451
|
-
? computeAutoExposureFromHistogram(histogram, {
|
|
452
|
-
targetLuminance: options.targetLuminance,
|
|
453
|
-
previousExposure: options.previousExposure ?? preset.toneMapping.exposure,
|
|
454
|
-
adaptationSpeed: options.adaptationSpeed ?? preset.adaptationSpeed,
|
|
455
|
-
deltaTimeSeconds: options.deltaTimeSeconds,
|
|
456
|
-
minExposure: options.minExposure ?? preset.minExposure,
|
|
457
|
-
maxExposure: options.maxExposure ?? preset.maxExposure
|
|
458
|
-
})
|
|
459
|
-
: undefined;
|
|
460
|
-
const toneMapped = toneMapPixels(pixels, width, height, {
|
|
461
|
-
...preset.toneMapping,
|
|
462
|
-
exposure: autoExposure?.exposure ?? preset.toneMapping.exposure
|
|
463
|
-
});
|
|
464
|
-
const colorGraded = colorGradePixels(toneMapped.pixels, width, height, preset.colorGrade);
|
|
465
|
-
return {
|
|
466
|
-
width,
|
|
467
|
-
height,
|
|
468
|
-
preset: presetName,
|
|
469
|
-
pixels: colorGraded.pixels,
|
|
470
|
-
toneMapped,
|
|
471
|
-
colorGraded,
|
|
472
|
-
histogram,
|
|
473
|
-
autoExposure
|
|
474
|
-
};
|
|
475
|
-
}
|
|
476
|
-
export function chromaticAberrationPixels(pixels, width, height, options = {}) {
|
|
477
|
-
validatePixelBuffer(pixels, width, height, "Chromatic aberration");
|
|
478
|
-
const strength = options.strength ?? 0.35;
|
|
479
|
-
validateRange(strength, 0, 2, "Chromatic aberration strength");
|
|
480
|
-
const output = new Uint8Array(pixels);
|
|
481
|
-
let changedPixels = 0;
|
|
482
|
-
let maxChannelOffsetPixels = 0;
|
|
483
|
-
const centerX = (width - 1) / 2;
|
|
484
|
-
const centerY = (height - 1) / 2;
|
|
485
|
-
const maxDistance = Math.max(1, Math.hypot(centerX, centerY));
|
|
486
|
-
for (let y = 0; y < height; y += 1) {
|
|
487
|
-
for (let x = 0; x < width; x += 1) {
|
|
488
|
-
const index = (y * width + x) * 4;
|
|
489
|
-
const directionX = centerX === 0 ? 0 : (x - centerX) / maxDistance;
|
|
490
|
-
const directionY = centerY === 0 ? 0 : (y - centerY) / maxDistance;
|
|
491
|
-
const radial = Math.min(1, Math.hypot(x - centerX, y - centerY) / maxDistance);
|
|
492
|
-
const offset = Math.round(strength * radial * 2);
|
|
493
|
-
maxChannelOffsetPixels = Math.max(maxChannelOffsetPixels, offset);
|
|
494
|
-
const redX = clampInt(Math.round(x + directionX * offset), 0, width - 1);
|
|
495
|
-
const redY = clampInt(Math.round(y + directionY * offset), 0, height - 1);
|
|
496
|
-
const blueX = clampInt(Math.round(x - directionX * offset), 0, width - 1);
|
|
497
|
-
const blueY = clampInt(Math.round(y - directionY * offset), 0, height - 1);
|
|
498
|
-
output[index] = channelAt(pixels, width, height, redX, redY, 0);
|
|
499
|
-
output[index + 1] = pixels[index + 1] ?? 0;
|
|
500
|
-
output[index + 2] = channelAt(pixels, width, height, blueX, blueY, 2);
|
|
501
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
502
|
-
if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 2) {
|
|
503
|
-
changedPixels += 1;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
}
|
|
507
|
-
return { width, height, pixels: output, changedPixels, maxChannelOffsetPixels };
|
|
508
|
-
}
|
|
509
|
-
export function outlinePixels(pixels, width, height, options = {}) {
|
|
510
|
-
validatePixelBuffer(pixels, width, height, "Outline");
|
|
511
|
-
const outlineWidth = options.width ?? 1;
|
|
512
|
-
const threshold = options.threshold ?? 0.22;
|
|
513
|
-
const opacity = options.opacity ?? 0.85;
|
|
514
|
-
const color = options.color ?? [255, 188, 64, 255];
|
|
515
|
-
if (!Number.isInteger(outlineWidth) || outlineWidth < 1 || outlineWidth > 6) {
|
|
516
|
-
throw new Error("Outline width must be an integer in [1, 6].");
|
|
517
|
-
}
|
|
518
|
-
validateRange(threshold, 0, 4, "Outline threshold");
|
|
519
|
-
validateRange(opacity, 0, 1, "Outline opacity");
|
|
520
|
-
validateOutlineColor(color);
|
|
521
|
-
const edgeMask = new Uint8Array(width * height);
|
|
522
|
-
const gradientBound = createOutlineGradientBound(threshold).numberValue;
|
|
523
|
-
let maxGradientNumerator = 0;
|
|
524
|
-
for (let y = 0; y < height; y += 1) {
|
|
525
|
-
for (let x = 0; x < width; x += 1) {
|
|
526
|
-
const { gx, gy } = sobelLumaNumeratorGradient(pixels, width, height, x, y);
|
|
527
|
-
const squared = gx * gx + gy * gy;
|
|
528
|
-
if (squared > maxGradientNumerator)
|
|
529
|
-
maxGradientNumerator = squared;
|
|
530
|
-
if (outlineEdgeExceedsBound(gx, gy, gradientBound)) {
|
|
531
|
-
edgeMask[y * width + x] = 255;
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}
|
|
535
|
-
const maxGradient = Math.sqrt(maxGradientNumerator) / OUTLINE_LUMA_SCALE;
|
|
536
|
-
const outlineMask = dilateMask(edgeMask, width, height, outlineWidth);
|
|
537
|
-
const output = new Uint8Array(pixels);
|
|
538
|
-
let outlinedPixels = 0;
|
|
539
|
-
let changedPixels = 0;
|
|
540
|
-
const colorAlpha = (color[3] ?? 255) / 255;
|
|
541
|
-
const alpha = opacity * colorAlpha;
|
|
542
|
-
for (let index = 0; index < outlineMask.length; index += 1) {
|
|
543
|
-
if (outlineMask[index] === 0)
|
|
544
|
-
continue;
|
|
545
|
-
outlinedPixels += 1;
|
|
546
|
-
const pixelIndex = index * 4;
|
|
547
|
-
const beforeRed = pixels[pixelIndex] ?? 0;
|
|
548
|
-
const beforeGreen = pixels[pixelIndex + 1] ?? 0;
|
|
549
|
-
const beforeBlue = pixels[pixelIndex + 2] ?? 0;
|
|
550
|
-
output[pixelIndex] = clampByte(beforeRed * (1 - alpha) + color[0] * alpha);
|
|
551
|
-
output[pixelIndex + 1] = clampByte(beforeGreen * (1 - alpha) + color[1] * alpha);
|
|
552
|
-
output[pixelIndex + 2] = clampByte(beforeBlue * (1 - alpha) + color[2] * alpha);
|
|
553
|
-
output[pixelIndex + 3] = pixels[pixelIndex + 3] ?? 255;
|
|
554
|
-
if (Math.abs(output[pixelIndex] - beforeRed) + Math.abs(output[pixelIndex + 1] - beforeGreen) + Math.abs(output[pixelIndex + 2] - beforeBlue) > 3) {
|
|
555
|
-
changedPixels += 1;
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
return {
|
|
559
|
-
width,
|
|
560
|
-
height,
|
|
561
|
-
pixels: output,
|
|
562
|
-
outlineMask,
|
|
563
|
-
outlinedPixels,
|
|
564
|
-
changedPixels,
|
|
565
|
-
maxGradient: Number(maxGradient.toFixed(6)),
|
|
566
|
-
method: "sobel-luma"
|
|
567
|
-
};
|
|
568
|
-
}
|
|
569
|
-
export function filmGrainPixels(pixels, width, height, options = {}) {
|
|
570
|
-
validatePixelBuffer(pixels, width, height, "Film grain");
|
|
571
|
-
const intensity = options.intensity ?? 0.08;
|
|
572
|
-
const seed = options.seed ?? 1;
|
|
573
|
-
const monochrome = options.monochrome ?? true;
|
|
574
|
-
validateRange(intensity, 0, 1, "Film grain intensity");
|
|
575
|
-
if (!Number.isInteger(seed)) {
|
|
576
|
-
throw new Error("Film grain seed must be an integer.");
|
|
577
|
-
}
|
|
578
|
-
const output = new Uint8Array(pixels);
|
|
579
|
-
let changedPixels = 0;
|
|
580
|
-
for (let y = 0; y < height; y += 1) {
|
|
581
|
-
for (let x = 0; x < width; x += 1) {
|
|
582
|
-
const index = (y * width + x) * 4;
|
|
583
|
-
const luma = ((pixels[index] ?? 0) * 0.2126 + (pixels[index + 1] ?? 0) * 0.7152 + (pixels[index + 2] ?? 0) * 0.0722) / 255;
|
|
584
|
-
const grain = (noise2d(x, y, seed) +
|
|
585
|
-
noise2d(Math.floor(x / 2), Math.floor(y / 2), seed + 97) +
|
|
586
|
-
noise2d(x + 19, y + 31, seed + 193)) / 3 * 2 - 1;
|
|
587
|
-
const amplitude = intensity * 84 * (0.35 + 0.65 * (1 - luma));
|
|
588
|
-
const redGrain = grain;
|
|
589
|
-
const greenGrain = monochrome ? grain : grain * 0.72 + (noise2d(x, y, seed + 17) * 2 - 1) * 0.28;
|
|
590
|
-
const blueGrain = monochrome ? grain : grain * 0.72 + (noise2d(x, y, seed + 31) * 2 - 1) * 0.28;
|
|
591
|
-
output[index] = clampByte((pixels[index] ?? 0) + redGrain * amplitude);
|
|
592
|
-
output[index + 1] = clampByte((pixels[index + 1] ?? 0) + greenGrain * amplitude);
|
|
593
|
-
output[index + 2] = clampByte((pixels[index + 2] ?? 0) + blueGrain * amplitude);
|
|
594
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
595
|
-
if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 0) {
|
|
596
|
-
changedPixels += 1;
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
return { width, height, pixels: output, changedPixels, seed, intensity, monochrome };
|
|
601
|
-
}
|
|
602
|
-
export function depthOfFieldPixels(pixels, width, height, options) {
|
|
603
|
-
validatePixelBuffer(pixels, width, height, "Depth of field");
|
|
604
|
-
const focusDepth = options.focusDepth ?? 0.5;
|
|
605
|
-
const focusRange = options.focusRange ?? 0.12;
|
|
606
|
-
const maxRadius = options.maxRadius ?? 2;
|
|
607
|
-
validateRange(focusDepth, 0, 1, "Depth of field focusDepth");
|
|
608
|
-
validateRange(focusRange, 0.001, 1, "Depth of field focusRange");
|
|
609
|
-
if (!Number.isInteger(maxRadius) || maxRadius < 0 || maxRadius > 8) {
|
|
610
|
-
throw new Error("Depth of field maxRadius must be an integer in [0, 8].");
|
|
611
|
-
}
|
|
612
|
-
const depthTexture = requireDepthTextureBinding(options.depth, "Depth of field");
|
|
613
|
-
if (depthTexture.width !== width || depthTexture.height !== height) {
|
|
614
|
-
throw new Error("Depth of field depth texture dimensions must match source pixels.");
|
|
615
|
-
}
|
|
616
|
-
const output = new Uint8Array(pixels);
|
|
617
|
-
let blurredPixels = 0;
|
|
618
|
-
for (let y = 0; y < height; y += 1) {
|
|
619
|
-
for (let x = 0; x < width; x += 1) {
|
|
620
|
-
const depth = depthAt(depthTexture, x, y);
|
|
621
|
-
const radius = Math.min(maxRadius, Math.round(Math.max(0, Math.abs(depth - focusDepth) - focusRange) / Math.max(focusRange, 0.001) * maxRadius));
|
|
622
|
-
if (radius === 0)
|
|
623
|
-
continue;
|
|
624
|
-
blurredPixels += 1;
|
|
625
|
-
const index = (y * width + x) * 4;
|
|
626
|
-
let red = 0;
|
|
627
|
-
let green = 0;
|
|
628
|
-
let blue = 0;
|
|
629
|
-
let samples = 0;
|
|
630
|
-
for (let offsetY = -radius; offsetY <= radius; offsetY += 1) {
|
|
631
|
-
for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
|
|
632
|
-
if (Math.hypot(offsetX, offsetY) > radius + 0.01)
|
|
633
|
-
continue;
|
|
634
|
-
const sampleX = clampInt(x + offsetX, 0, width - 1);
|
|
635
|
-
const sampleY = clampInt(y + offsetY, 0, height - 1);
|
|
636
|
-
const sampleIndex = (sampleY * width + sampleX) * 4;
|
|
637
|
-
red += pixels[sampleIndex] ?? 0;
|
|
638
|
-
green += pixels[sampleIndex + 1] ?? 0;
|
|
639
|
-
blue += pixels[sampleIndex + 2] ?? 0;
|
|
640
|
-
samples += 1;
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
output[index] = clampByte(red / samples);
|
|
644
|
-
output[index + 1] = clampByte(green / samples);
|
|
645
|
-
output[index + 2] = clampByte(blue / samples);
|
|
646
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
return { width, height, pixels: output, blurredPixels, maxBlurRadius: maxRadius, focusDepth, focusRange };
|
|
650
|
-
}
|
|
651
|
-
export function volumetricLightPixels(pixels, width, height, options = {}) {
|
|
652
|
-
validatePixelBuffer(pixels, width, height, "Volumetric light");
|
|
653
|
-
const depth = requireDepthTextureBinding(options.depth, "Volumetric light");
|
|
654
|
-
if (depth.width !== width || depth.height !== height) {
|
|
655
|
-
throw new Error("Volumetric light depth texture dimensions must match source pixels.");
|
|
656
|
-
}
|
|
657
|
-
const lightPosition = options.lightPosition ?? [0.5, 0.18];
|
|
658
|
-
if (lightPosition.length !== 2 || !lightPosition.every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
|
|
659
|
-
throw new RangeError("Volumetric light position must contain two finite normalized coordinates.");
|
|
660
|
-
}
|
|
661
|
-
const color = options.color ?? [1, 0.88, 0.62];
|
|
662
|
-
if (color.length !== 3 || !color.every((value) => Number.isFinite(value) && value >= 0 && value <= 1)) {
|
|
663
|
-
throw new RangeError("Volumetric light color must contain three finite values within [0, 1].");
|
|
664
|
-
}
|
|
665
|
-
const density = numberInRange(options.density ?? 0.9, 0.01, 2, "Volumetric light density");
|
|
666
|
-
const decay = numberInRange(options.decay ?? 0.96, 0, 1, "Volumetric light decay");
|
|
667
|
-
const weight = numberInRange(options.weight ?? 0.18, 0, 2, "Volumetric light weight");
|
|
668
|
-
const exposure = numberInRange(options.exposure ?? 0.72, 0, 4, "Volumetric light exposure");
|
|
669
|
-
const samples = integerNumberInRange(options.samples ?? 32, 4, 128, "Volumetric light samples");
|
|
670
|
-
const occlusionThreshold = numberInRange(options.occlusionThreshold ?? 0.985, 0, 1, "Volumetric light occlusionThreshold");
|
|
671
|
-
const output = new Uint8Array(pixels);
|
|
672
|
-
const lightX = lightPosition[0] * (width - 1);
|
|
673
|
-
const lightY = lightPosition[1] * (height - 1);
|
|
674
|
-
let changedPixels = 0;
|
|
675
|
-
let occludedSamples = 0;
|
|
676
|
-
let maxScattering = 0;
|
|
677
|
-
for (let y = 0; y < height; y += 1) {
|
|
678
|
-
for (let x = 0; x < width; x += 1) {
|
|
679
|
-
const deltaX = ((lightX - x) / samples) * density;
|
|
680
|
-
const deltaY = ((lightY - y) / samples) * density;
|
|
681
|
-
let sampleX = x;
|
|
682
|
-
let sampleY = y;
|
|
683
|
-
let illuminationDecay = 1;
|
|
684
|
-
let scattering = 0;
|
|
685
|
-
for (let sample = 0; sample < samples; sample += 1) {
|
|
686
|
-
sampleX += deltaX;
|
|
687
|
-
sampleY += deltaY;
|
|
688
|
-
const sx = clampInt(Math.round(sampleX), 0, width - 1);
|
|
689
|
-
const sy = clampInt(Math.round(sampleY), 0, height - 1);
|
|
690
|
-
const offset = (sy * width + sx) * 4;
|
|
691
|
-
const luminance = ((pixels[offset] ?? 0) * 0.2126 + (pixels[offset + 1] ?? 0) * 0.7152 + (pixels[offset + 2] ?? 0) * 0.0722) / 255;
|
|
692
|
-
const source = Math.max(0, luminance - 0.42) / 0.58;
|
|
693
|
-
const sampleDepth = depthAt(depth, sx, sy);
|
|
694
|
-
const visible = sampleDepth >= occlusionThreshold || source > 0.05 ? 1 : 0;
|
|
695
|
-
if (visible === 0)
|
|
696
|
-
occludedSamples += 1;
|
|
697
|
-
scattering += source * visible * illuminationDecay * weight;
|
|
698
|
-
illuminationDecay *= decay;
|
|
699
|
-
}
|
|
700
|
-
const boost = scattering * exposure;
|
|
701
|
-
maxScattering = Math.max(maxScattering, boost);
|
|
702
|
-
const offset = (y * width + x) * 4;
|
|
703
|
-
const beforeR = pixels[offset] ?? 0;
|
|
704
|
-
const beforeG = pixels[offset + 1] ?? 0;
|
|
705
|
-
const beforeB = pixels[offset + 2] ?? 0;
|
|
706
|
-
// A5: ordered Bayer dither (one LSB) so smooth inscatter gradients do
|
|
707
|
-
// not band in 8-bit output. Off by default to preserve legacy bytes.
|
|
708
|
-
const dither = options.dither === true ? bayer2(x, y) : 0;
|
|
709
|
-
output[offset] = clampByte(beforeR + color[0] * boost * 255 + dither);
|
|
710
|
-
output[offset + 1] = clampByte(beforeG + color[1] * boost * 255 + dither);
|
|
711
|
-
output[offset + 2] = clampByte(beforeB + color[2] * boost * 255 + dither);
|
|
712
|
-
if (output[offset] !== beforeR || output[offset + 1] !== beforeG || output[offset + 2] !== beforeB) {
|
|
713
|
-
changedPixels += 1;
|
|
714
|
-
}
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
return {
|
|
718
|
-
width,
|
|
719
|
-
height,
|
|
720
|
-
pixels: output,
|
|
721
|
-
changedPixels,
|
|
722
|
-
occludedSamples,
|
|
723
|
-
maxScattering: Number(maxScattering.toFixed(5)),
|
|
724
|
-
sampleCount: samples,
|
|
725
|
-
method: "depth-aware-radial-participating-media"
|
|
726
|
-
};
|
|
727
|
-
}
|
|
728
|
-
export function motionBlurPixels(pixels, width, height, options) {
|
|
729
|
-
validatePixelBuffer(pixels, width, height, "Motion blur");
|
|
730
|
-
const samples = options.samples ?? 5;
|
|
731
|
-
const scale = options.scale ?? 1;
|
|
732
|
-
if (!Number.isInteger(samples) || samples < 2 || samples > 16) {
|
|
733
|
-
throw new Error("Motion blur samples must be an integer in [2, 16].");
|
|
734
|
-
}
|
|
735
|
-
if (!Number.isFinite(scale) || scale < 0 || scale > 8) {
|
|
736
|
-
throw new Error("Motion blur scale must be finite in [0, 8].");
|
|
737
|
-
}
|
|
738
|
-
if (options.velocity.length !== width * height * 2) {
|
|
739
|
-
throw new Error("Motion blur velocity must contain width * height * 2 float samples.");
|
|
740
|
-
}
|
|
741
|
-
const output = new Uint8Array(pixels);
|
|
742
|
-
let blurredPixels = 0;
|
|
743
|
-
let maxVelocityPixels = 0;
|
|
744
|
-
for (let y = 0; y < height; y += 1) {
|
|
745
|
-
for (let x = 0; x < width; x += 1) {
|
|
746
|
-
const velocityIndex = (y * width + x) * 2;
|
|
747
|
-
const vx = (options.velocity[velocityIndex] ?? 0) * scale;
|
|
748
|
-
const vy = (options.velocity[velocityIndex + 1] ?? 0) * scale;
|
|
749
|
-
const velocityPixels = Math.hypot(vx, vy);
|
|
750
|
-
maxVelocityPixels = Math.max(maxVelocityPixels, velocityPixels);
|
|
751
|
-
if (velocityPixels < 0.01)
|
|
752
|
-
continue;
|
|
753
|
-
blurredPixels += 1;
|
|
754
|
-
const index = (y * width + x) * 4;
|
|
755
|
-
let red = 0;
|
|
756
|
-
let green = 0;
|
|
757
|
-
let blue = 0;
|
|
758
|
-
for (let sample = 0; sample < samples; sample += 1) {
|
|
759
|
-
const t = samples === 1 ? 0 : sample / (samples - 1) - 0.5;
|
|
760
|
-
const sampleX = clampInt(Math.round(x - vx * t), 0, width - 1);
|
|
761
|
-
const sampleY = clampInt(Math.round(y - vy * t), 0, height - 1);
|
|
762
|
-
const sampleIndex = (sampleY * width + sampleX) * 4;
|
|
763
|
-
red += pixels[sampleIndex] ?? 0;
|
|
764
|
-
green += pixels[sampleIndex + 1] ?? 0;
|
|
765
|
-
blue += pixels[sampleIndex + 2] ?? 0;
|
|
766
|
-
}
|
|
767
|
-
output[index] = clampByte(red / samples);
|
|
768
|
-
output[index + 1] = clampByte(green / samples);
|
|
769
|
-
output[index + 2] = clampByte(blue / samples);
|
|
770
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
771
|
-
}
|
|
772
|
-
}
|
|
773
|
-
return { width, height, pixels: output, blurredPixels, samples, maxVelocityPixels };
|
|
774
|
-
}
|
|
775
|
-
export function ssaoPixels(pixels, width, height, options) {
|
|
776
|
-
validatePixelBuffer(pixels, width, height, "SSAO");
|
|
777
|
-
const depthTexture = requireDepthTextureBinding(options.depth, "SSAO");
|
|
778
|
-
if (depthTexture.width !== width || depthTexture.height !== height) {
|
|
779
|
-
throw new Error("SSAO depth texture dimensions must match source pixels.");
|
|
780
|
-
}
|
|
781
|
-
const radius = options.radius ?? 2;
|
|
782
|
-
const intensity = options.intensity ?? 0.38;
|
|
783
|
-
const bias = options.bias ?? 0.015;
|
|
784
|
-
if (!Number.isInteger(radius) || radius < 1 || radius > 8) {
|
|
785
|
-
throw new Error("SSAO radius must be an integer in [1, 8].");
|
|
786
|
-
}
|
|
787
|
-
validateRange(intensity, 0, 2, "SSAO intensity");
|
|
788
|
-
validateRange(bias, 0, 0.25, "SSAO bias");
|
|
789
|
-
const output = new Uint8Array(pixels);
|
|
790
|
-
let occludedPixels = 0;
|
|
791
|
-
let occlusionTotal = 0;
|
|
792
|
-
for (let y = 0; y < height; y += 1) {
|
|
793
|
-
for (let x = 0; x < width; x += 1) {
|
|
794
|
-
const centerDepth = depthAt(depthTexture, x, y);
|
|
795
|
-
let occlusion = 0;
|
|
796
|
-
let samples = 0;
|
|
797
|
-
for (let offsetY = -radius; offsetY <= radius; offsetY += radius) {
|
|
798
|
-
for (let offsetX = -radius; offsetX <= radius; offsetX += radius) {
|
|
799
|
-
if (offsetX === 0 && offsetY === 0)
|
|
800
|
-
continue;
|
|
801
|
-
const sampleDepth = depthAt(depthTexture, clampInt(x + offsetX, 0, width - 1), clampInt(y + offsetY, 0, height - 1));
|
|
802
|
-
occlusion += Math.max(0, Math.min(1, (centerDepth - sampleDepth - bias) / (0.14 + radius * 0.04)));
|
|
803
|
-
samples += 1;
|
|
804
|
-
}
|
|
805
|
-
}
|
|
806
|
-
const factor = Math.max(0.18, 1 - (occlusion / Math.max(1, samples)) * intensity * 0.72);
|
|
807
|
-
if (factor < 0.995)
|
|
808
|
-
occludedPixels += 1;
|
|
809
|
-
occlusionTotal += 1 - factor;
|
|
810
|
-
const index = (y * width + x) * 4;
|
|
811
|
-
output[index] = clampByte((pixels[index] ?? 0) * factor);
|
|
812
|
-
output[index + 1] = clampByte((pixels[index + 1] ?? 0) * factor);
|
|
813
|
-
output[index + 2] = clampByte((pixels[index + 2] ?? 0) * factor);
|
|
814
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
return { width, height, pixels: output, occludedPixels, averageOcclusion: Number((occlusionTotal / (width * height)).toFixed(6)), radius, intensity };
|
|
818
|
-
}
|
|
819
|
-
export function contactShadowPixels(pixels, width, height, options) {
|
|
820
|
-
validatePixelBuffer(pixels, width, height, "Contact shadow");
|
|
821
|
-
const depthTexture = requireDepthTextureBinding(options.depth, "Contact shadow");
|
|
822
|
-
if (depthTexture.width !== width || depthTexture.height !== height) {
|
|
823
|
-
throw new Error("Contact shadow depth texture dimensions must match source pixels.");
|
|
824
|
-
}
|
|
825
|
-
const radius = options.radius ?? 4;
|
|
826
|
-
const intensity = options.intensity ?? 0.72;
|
|
827
|
-
const bias = options.bias ?? 0.008;
|
|
828
|
-
const thickness = options.thickness ?? 0.12;
|
|
829
|
-
if (!Number.isInteger(radius) || radius < 1 || radius > 16) {
|
|
830
|
-
throw new Error("Contact shadow radius must be an integer in [1, 16].");
|
|
831
|
-
}
|
|
832
|
-
validateRange(intensity, 0, 2, "Contact shadow intensity");
|
|
833
|
-
validateRange(bias, 0, 0.25, "Contact shadow bias");
|
|
834
|
-
validateRange(thickness, 0.005, 1, "Contact shadow thickness");
|
|
835
|
-
const direction = normalizeContactShadowDirection(options.direction ?? [0.35, 0.8]);
|
|
836
|
-
const output = new Uint8Array(pixels);
|
|
837
|
-
let contactPixels = 0;
|
|
838
|
-
let darkeningTotal = 0;
|
|
839
|
-
for (let y = 0; y < height; y += 1) {
|
|
840
|
-
for (let x = 0; x < width; x += 1) {
|
|
841
|
-
const receiverDepth = depthAt(depthTexture, x, y);
|
|
842
|
-
let contact = 0;
|
|
843
|
-
for (let step = 1; step <= radius; step += 1) {
|
|
844
|
-
const longitudinal = step / radius;
|
|
845
|
-
const lateralRadius = Math.max(1, Math.round(radius * 0.28 * (1 - longitudinal * 0.35)));
|
|
846
|
-
for (let side = -lateralRadius; side <= lateralRadius; side += 1) {
|
|
847
|
-
const offsetX = direction[0] * step + -direction[1] * side;
|
|
848
|
-
const offsetY = direction[1] * step + direction[0] * side;
|
|
849
|
-
const sampleX = clampInt(Math.round(x - offsetX), 0, width - 1);
|
|
850
|
-
const sampleY = clampInt(Math.round(y - offsetY), 0, height - 1);
|
|
851
|
-
const casterDepth = depthAt(depthTexture, sampleX, sampleY);
|
|
852
|
-
const depthGap = receiverDepth - casterDepth - bias;
|
|
853
|
-
if (depthGap <= 0 || depthGap > thickness)
|
|
854
|
-
continue;
|
|
855
|
-
const spatialFalloff = Math.max(0, 1 - longitudinal);
|
|
856
|
-
const lateralFalloff = Math.max(0, 1 - Math.abs(side) / (lateralRadius + 1));
|
|
857
|
-
const depthFalloff = 1 - depthGap / thickness;
|
|
858
|
-
contact = Math.max(contact, spatialFalloff * lateralFalloff * depthFalloff);
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
|
-
if (contact <= 0)
|
|
862
|
-
continue;
|
|
863
|
-
const shadow = Math.min(0.82, contact * intensity * 0.72);
|
|
864
|
-
const factor = 1 - shadow;
|
|
865
|
-
const index = (y * width + x) * 4;
|
|
866
|
-
output[index] = clampByte((pixels[index] ?? 0) * factor);
|
|
867
|
-
output[index + 1] = clampByte((pixels[index + 1] ?? 0) * factor);
|
|
868
|
-
output[index + 2] = clampByte((pixels[index + 2] ?? 0) * factor);
|
|
869
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
870
|
-
contactPixels += 1;
|
|
871
|
-
darkeningTotal += shadow;
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
return {
|
|
875
|
-
width,
|
|
876
|
-
height,
|
|
877
|
-
pixels: output,
|
|
878
|
-
contactPixels,
|
|
879
|
-
averageContactDarkening: Number((darkeningTotal / Math.max(1, contactPixels)).toFixed(6)),
|
|
880
|
-
radius,
|
|
881
|
-
intensity,
|
|
882
|
-
mode: "screen-space-depth-contact"
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
export function ssrPixels(pixels, width, height, options) {
|
|
886
|
-
validatePixelBuffer(pixels, width, height, "SSR");
|
|
887
|
-
const depthTexture = requireDepthTextureBinding(options.depth, "SSR");
|
|
888
|
-
if (depthTexture.width !== width || depthTexture.height !== height) {
|
|
889
|
-
throw new Error("SSR depth texture dimensions must match source pixels.");
|
|
890
|
-
}
|
|
891
|
-
const intensity = options.intensity ?? 0.32;
|
|
892
|
-
const maxDistance = options.maxDistance ?? 16;
|
|
893
|
-
validateRange(intensity, 0, 2, "SSR intensity");
|
|
894
|
-
if (!Number.isInteger(maxDistance) || maxDistance < 1 || maxDistance > 64) {
|
|
895
|
-
throw new Error("SSR maxDistance must be an integer in [1, 64].");
|
|
896
|
-
}
|
|
897
|
-
const output = new Uint8Array(pixels);
|
|
898
|
-
let reflectedPixels = 0;
|
|
899
|
-
let maxReflectionBoost = 0;
|
|
900
|
-
for (let y = 0; y < height; y += 1) {
|
|
901
|
-
for (let x = 0; x < width; x += 1) {
|
|
902
|
-
const depth = depthAt(depthTexture, x, y);
|
|
903
|
-
const rayDistance = Math.max(1, Math.round((1 - depth) * maxDistance));
|
|
904
|
-
const sampleX = clampInt(x + (x < width / 2 ? rayDistance : -rayDistance), 0, width - 1);
|
|
905
|
-
const sampleY = clampInt(height - 1 - y, 0, height - 1);
|
|
906
|
-
const sourceIndex = (sampleY * width + sampleX) * 4;
|
|
907
|
-
const targetIndex = (y * width + x) * 4;
|
|
908
|
-
const sourceLuma = ((pixels[sourceIndex] ?? 0) + (pixels[sourceIndex + 1] ?? 0) + (pixels[sourceIndex + 2] ?? 0)) / (3 * 255);
|
|
909
|
-
if (sourceLuma < 0.18 || depth > 0.92)
|
|
910
|
-
continue;
|
|
911
|
-
const boost = sourceLuma * intensity * (1 - depth);
|
|
912
|
-
maxReflectionBoost = Math.max(maxReflectionBoost, boost);
|
|
913
|
-
reflectedPixels += 1;
|
|
914
|
-
output[targetIndex] = clampByte((pixels[targetIndex] ?? 0) + (pixels[sourceIndex] ?? 0) * boost);
|
|
915
|
-
output[targetIndex + 1] = clampByte((pixels[targetIndex + 1] ?? 0) + (pixels[sourceIndex + 1] ?? 0) * boost);
|
|
916
|
-
output[targetIndex + 2] = clampByte((pixels[targetIndex + 2] ?? 0) + (pixels[sourceIndex + 2] ?? 0) * boost);
|
|
917
|
-
output[targetIndex + 3] = pixels[targetIndex + 3] ?? 255;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
return { width, height, pixels: output, reflectedPixels, maxReflectionBoost: Number(maxReflectionBoost.toFixed(6)), intensity, maxDistance };
|
|
921
|
-
}
|
|
922
|
-
export function taaPixels(pixels, width, height, options) {
|
|
923
|
-
validatePixelBuffer(pixels, width, height, "TAA");
|
|
924
|
-
if (options.history.byteLength !== pixels.byteLength) {
|
|
925
|
-
throw new Error("TAA history must contain width * height * 4 RGBA bytes.");
|
|
926
|
-
}
|
|
927
|
-
const blend = options.blend ?? 0.18;
|
|
928
|
-
validateRange(blend, 0, 0.95, "TAA blend");
|
|
929
|
-
const output = new Uint8Array(pixels.byteLength);
|
|
930
|
-
let blendedPixels = 0;
|
|
931
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
932
|
-
output[index] = clampByte((pixels[index] ?? 0) * (1 - blend) + (options.history[index] ?? 0) * blend);
|
|
933
|
-
output[index + 1] = clampByte((pixels[index + 1] ?? 0) * (1 - blend) + (options.history[index + 1] ?? 0) * blend);
|
|
934
|
-
output[index + 2] = clampByte((pixels[index + 2] ?? 0) * (1 - blend) + (options.history[index + 2] ?? 0) * blend);
|
|
935
|
-
output[index + 3] = pixels[index + 3] ?? 255;
|
|
936
|
-
if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 0) {
|
|
937
|
-
blendedPixels += 1;
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
return { width, height, pixels: output, blendedPixels, blend };
|
|
941
|
-
}
|
|
942
|
-
export function bloomPixels(pixels, width, height, options = {}) {
|
|
943
|
-
validatePixelBuffer(pixels, width, height, "Bloom");
|
|
944
|
-
const threshold = options.threshold ?? 0.75;
|
|
945
|
-
const intensity = options.intensity ?? 0.35;
|
|
946
|
-
const radius = options.radius ?? 1;
|
|
947
|
-
validateBloomOptions(threshold, intensity, radius);
|
|
948
|
-
const { pixels: brightPixels, brightPixelCount, brightEnergy } = extractBloomBrightPixels(pixels, width, height, threshold);
|
|
949
|
-
const horizontalBlurPixels = blurBloomPixelsHorizontal(brightPixels, width, height, radius);
|
|
950
|
-
const verticalBlurPixels = blurBloomPixelsVertical(horizontalBlurPixels, width, height, radius);
|
|
951
|
-
const composite = compositeBloomPixels(pixels, verticalBlurPixels, width, height, intensity, brightPixels);
|
|
952
|
-
return {
|
|
953
|
-
width,
|
|
954
|
-
height,
|
|
955
|
-
pixels: composite.pixels,
|
|
956
|
-
brightPixels,
|
|
957
|
-
horizontalBlurPixels,
|
|
958
|
-
verticalBlurPixels,
|
|
959
|
-
brightPixelCount,
|
|
960
|
-
brightEnergy,
|
|
961
|
-
maxNeighborBoost: composite.maxNeighborBoost,
|
|
962
|
-
changedPixels: composite.changedPixels,
|
|
963
|
-
maxChannelDelta: composite.maxChannelDelta,
|
|
964
|
-
pipeline: ["bright-extract", "horizontal-blur", "vertical-blur", "composite"]
|
|
965
|
-
};
|
|
966
|
-
}
|
|
967
|
-
export function extractBloomBrightPixels(pixels, width, height, threshold) {
|
|
968
|
-
validatePixelBuffer(pixels, width, height, "Bloom bright extraction");
|
|
969
|
-
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
970
|
-
throw new Error("Bloom threshold must be finite and in [0, 1].");
|
|
971
|
-
}
|
|
972
|
-
const brightPixels = new Uint8Array(pixels.byteLength);
|
|
973
|
-
let brightPixelCount = 0;
|
|
974
|
-
let brightEnergy = 0;
|
|
975
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
976
|
-
const luma = (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
|
|
977
|
-
if (luma >= threshold) {
|
|
978
|
-
brightPixelCount += 1;
|
|
979
|
-
brightEnergy += luma;
|
|
980
|
-
brightPixels[index] = pixels[index];
|
|
981
|
-
brightPixels[index + 1] = pixels[index + 1];
|
|
982
|
-
brightPixels[index + 2] = pixels[index + 2];
|
|
983
|
-
brightPixels[index + 3] = pixels[index + 3];
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
return { pixels: brightPixels, brightPixelCount, brightEnergy };
|
|
987
|
-
}
|
|
988
1
|
/**
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*
|
|
994
|
-
* the native pass to a separable Gaussian; the CPU mirror was left as a uniform
|
|
995
|
-
* box average, which made the native-vs-CPU equality proof in
|
|
996
|
-
* tests/browser/native-outline-pixel.spec.ts unsatisfiable. `sigma`,
|
|
997
|
-
* `coefficient` and the truncation at 16 taps are the same expressions the
|
|
998
|
-
* shader uses.
|
|
2
|
+
* @deprecated The CPU post-process kernels moved to `./reference` (PRD-03
|
|
3
|
+
* Phase 3): the v2 chain executes them on the GPU, so they are
|
|
4
|
+
* reference/test code now. This shim keeps the old path compiling; import
|
|
5
|
+
* `@aura3d/rendering/reference` or `./reference/PostProcessPass` directly.
|
|
6
|
+
* Dropping the root re-export is Q-15-4.
|
|
999
7
|
*/
|
|
1000
|
-
export
|
|
1001
|
-
const sigma = Math.max(radius / 3, 0.5);
|
|
1002
|
-
const coefficient = 0.39894 / sigma;
|
|
1003
|
-
const weights = [Math.fround(coefficient)];
|
|
1004
|
-
let weightSum = Math.fround(coefficient);
|
|
1005
|
-
for (let offset = 1; offset <= 16; offset += 1) {
|
|
1006
|
-
if (offset > radius) {
|
|
1007
|
-
weights.push(0);
|
|
1008
|
-
continue;
|
|
1009
|
-
}
|
|
1010
|
-
const weight = Math.fround(coefficient * Math.exp(-0.5 * offset * offset / (sigma * sigma)));
|
|
1011
|
-
weights.push(weight);
|
|
1012
|
-
weightSum = Math.fround(weightSum + Math.fround(2 * weight));
|
|
1013
|
-
}
|
|
1014
|
-
return { weights, weightSum: Math.max(weightSum, 0.000001) };
|
|
1015
|
-
}
|
|
1016
|
-
export function blurBloomPixelsHorizontal(pixels, width, height, radius) {
|
|
1017
|
-
validatePixelBuffer(pixels, width, height, "Bloom horizontal blur");
|
|
1018
|
-
validateBloomBlurRadius(radius);
|
|
1019
|
-
const { weights, weightSum } = bloomBlurWeights(radius);
|
|
1020
|
-
const output = new Uint8Array(pixels.byteLength);
|
|
1021
|
-
for (let y = 0; y < height; y += 1) {
|
|
1022
|
-
for (let x = 0; x < width; x += 1) {
|
|
1023
|
-
const targetIndex = (y * width + x) * 4;
|
|
1024
|
-
const centerIndex = (y * width + x) * 4;
|
|
1025
|
-
let red = pixels[centerIndex] * weights[0];
|
|
1026
|
-
let green = pixels[centerIndex + 1] * weights[0];
|
|
1027
|
-
let blue = pixels[centerIndex + 2] * weights[0];
|
|
1028
|
-
let alpha = pixels[centerIndex + 3] * weights[0];
|
|
1029
|
-
for (let offsetX = 1; offsetX <= radius; offsetX += 1) {
|
|
1030
|
-
const weight = weights[offsetX];
|
|
1031
|
-
const lowIndex = (y * width + clampInt(x - offsetX, 0, width - 1)) * 4;
|
|
1032
|
-
const highIndex = (y * width + clampInt(x + offsetX, 0, width - 1)) * 4;
|
|
1033
|
-
red += (pixels[lowIndex] + pixels[highIndex]) * weight;
|
|
1034
|
-
green += (pixels[lowIndex + 1] + pixels[highIndex + 1]) * weight;
|
|
1035
|
-
blue += (pixels[lowIndex + 2] + pixels[highIndex + 2]) * weight;
|
|
1036
|
-
alpha += (pixels[lowIndex + 3] + pixels[highIndex + 3]) * weight;
|
|
1037
|
-
}
|
|
1038
|
-
output[targetIndex] = clampByte(red / weightSum);
|
|
1039
|
-
output[targetIndex + 1] = clampByte(green / weightSum);
|
|
1040
|
-
output[targetIndex + 2] = clampByte(blue / weightSum);
|
|
1041
|
-
output[targetIndex + 3] = clampByte(alpha / weightSum);
|
|
1042
|
-
}
|
|
1043
|
-
}
|
|
1044
|
-
return output;
|
|
1045
|
-
}
|
|
1046
|
-
export function blurBloomPixelsVertical(pixels, width, height, radius) {
|
|
1047
|
-
validatePixelBuffer(pixels, width, height, "Bloom vertical blur");
|
|
1048
|
-
validateBloomBlurRadius(radius);
|
|
1049
|
-
const { weights, weightSum } = bloomBlurWeights(radius);
|
|
1050
|
-
const output = new Uint8Array(pixels.byteLength);
|
|
1051
|
-
for (let y = 0; y < height; y += 1) {
|
|
1052
|
-
for (let x = 0; x < width; x += 1) {
|
|
1053
|
-
const targetIndex = (y * width + x) * 4;
|
|
1054
|
-
const centerIndex = (y * width + x) * 4;
|
|
1055
|
-
let red = pixels[centerIndex] * weights[0];
|
|
1056
|
-
let green = pixels[centerIndex + 1] * weights[0];
|
|
1057
|
-
let blue = pixels[centerIndex + 2] * weights[0];
|
|
1058
|
-
let alpha = pixels[centerIndex + 3] * weights[0];
|
|
1059
|
-
for (let offsetY = 1; offsetY <= radius; offsetY += 1) {
|
|
1060
|
-
const weight = weights[offsetY];
|
|
1061
|
-
const lowIndex = (clampInt(y - offsetY, 0, height - 1) * width + x) * 4;
|
|
1062
|
-
const highIndex = (clampInt(y + offsetY, 0, height - 1) * width + x) * 4;
|
|
1063
|
-
red += (pixels[lowIndex] + pixels[highIndex]) * weight;
|
|
1064
|
-
green += (pixels[lowIndex + 1] + pixels[highIndex + 1]) * weight;
|
|
1065
|
-
blue += (pixels[lowIndex + 2] + pixels[highIndex + 2]) * weight;
|
|
1066
|
-
alpha += (pixels[lowIndex + 3] + pixels[highIndex + 3]) * weight;
|
|
1067
|
-
}
|
|
1068
|
-
output[targetIndex] = clampByte(red / weightSum);
|
|
1069
|
-
output[targetIndex + 1] = clampByte(green / weightSum);
|
|
1070
|
-
output[targetIndex + 2] = clampByte(blue / weightSum);
|
|
1071
|
-
output[targetIndex + 3] = clampByte(alpha / weightSum);
|
|
1072
|
-
}
|
|
1073
|
-
}
|
|
1074
|
-
return output;
|
|
1075
|
-
}
|
|
1076
|
-
export function compositeBloomPixels(sourcePixels, blurredPixels, width, height, intensity, brightPixels) {
|
|
1077
|
-
validatePixelBuffer(sourcePixels, width, height, "Bloom composite source");
|
|
1078
|
-
validatePixelBuffer(blurredPixels, width, height, "Bloom composite blur");
|
|
1079
|
-
if (brightPixels)
|
|
1080
|
-
validatePixelBuffer(brightPixels, width, height, "Bloom composite bright source");
|
|
1081
|
-
if (!Number.isFinite(intensity) || intensity < 0) {
|
|
1082
|
-
throw new Error("Bloom intensity must be finite and non-negative.");
|
|
1083
|
-
}
|
|
1084
|
-
const output = new Uint8Array(sourcePixels);
|
|
1085
|
-
let maxNeighborBoost = 0;
|
|
1086
|
-
let changedPixels = 0;
|
|
1087
|
-
let maxChannelDelta = 0;
|
|
1088
|
-
for (let index = 0; index < sourcePixels.length; index += 4) {
|
|
1089
|
-
const previousRed = output[index];
|
|
1090
|
-
const previousGreen = output[index + 1];
|
|
1091
|
-
const previousBlue = output[index + 2];
|
|
1092
|
-
const redBoost = blurredPixels[index] * intensity;
|
|
1093
|
-
const greenBoost = blurredPixels[index + 1] * intensity;
|
|
1094
|
-
const blueBoost = blurredPixels[index + 2] * intensity;
|
|
1095
|
-
output[index] = clampByte(output[index] + redBoost);
|
|
1096
|
-
output[index + 1] = clampByte(output[index + 1] + greenBoost);
|
|
1097
|
-
output[index + 2] = clampByte(output[index + 2] + blueBoost);
|
|
1098
|
-
output[index + 3] = sourcePixels[index + 3];
|
|
1099
|
-
const redDelta = Math.abs(output[index] - previousRed);
|
|
1100
|
-
const greenDelta = Math.abs(output[index + 1] - previousGreen);
|
|
1101
|
-
const blueDelta = Math.abs(output[index + 2] - previousBlue);
|
|
1102
|
-
const pixelDelta = Math.max(redDelta, greenDelta, blueDelta);
|
|
1103
|
-
if (pixelDelta > 0) {
|
|
1104
|
-
changedPixels += 1;
|
|
1105
|
-
maxChannelDelta = Math.max(maxChannelDelta, pixelDelta);
|
|
1106
|
-
}
|
|
1107
|
-
if (!brightPixels || (brightPixels[index] === 0 && brightPixels[index + 1] === 0 && brightPixels[index + 2] === 0)) {
|
|
1108
|
-
maxNeighborBoost = Math.max(maxNeighborBoost, redBoost, greenBoost, blueBoost);
|
|
1109
|
-
}
|
|
1110
|
-
}
|
|
1111
|
-
return { pixels: output, maxNeighborBoost, changedPixels, maxChannelDelta };
|
|
1112
|
-
}
|
|
1113
|
-
export function bloomFloatPixels(pixels, width, height, options = {}) {
|
|
1114
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
1115
|
-
throw new Error("HDR bloom dimensions must be positive integers.");
|
|
1116
|
-
}
|
|
1117
|
-
if (pixels.length !== width * height * 4) {
|
|
1118
|
-
throw new Error("HDR bloom input must contain width * height * 4 RGBA float values.");
|
|
1119
|
-
}
|
|
1120
|
-
const threshold = options.threshold ?? 0.75;
|
|
1121
|
-
const intensity = options.intensity ?? 0.35;
|
|
1122
|
-
const radius = options.radius ?? 1;
|
|
1123
|
-
validateBloomOptions(threshold, intensity, radius);
|
|
1124
|
-
const brightPixels = new Float32Array(pixels.length);
|
|
1125
|
-
let brightPixelCount = 0;
|
|
1126
|
-
let brightEnergy = 0;
|
|
1127
|
-
let maxInputValue = 0;
|
|
1128
|
-
for (let index = 0; index < pixels.length; index += 4) {
|
|
1129
|
-
const red = finiteHdrChannel(pixels[index], index);
|
|
1130
|
-
const green = finiteHdrChannel(pixels[index + 1], index + 1);
|
|
1131
|
-
const blue = finiteHdrChannel(pixels[index + 2], index + 2);
|
|
1132
|
-
const alpha = finiteHdrChannel(pixels[index + 3], index + 3);
|
|
1133
|
-
maxInputValue = Math.max(maxInputValue, red, green, blue);
|
|
1134
|
-
const luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
1135
|
-
if (luma >= threshold) {
|
|
1136
|
-
brightPixelCount += 1;
|
|
1137
|
-
brightEnergy += luma;
|
|
1138
|
-
brightPixels[index] = red;
|
|
1139
|
-
brightPixels[index + 1] = green;
|
|
1140
|
-
brightPixels[index + 2] = blue;
|
|
1141
|
-
brightPixels[index + 3] = alpha;
|
|
1142
|
-
}
|
|
1143
|
-
}
|
|
1144
|
-
const horizontalBlurPixels = blurBloomFloatPixelsHorizontal(brightPixels, width, height, radius);
|
|
1145
|
-
const verticalBlurPixels = blurBloomFloatPixelsVertical(horizontalBlurPixels, width, height, radius);
|
|
1146
|
-
const composite = compositeBloomFloatPixels(pixels, verticalBlurPixels, width, height, intensity, brightPixels);
|
|
1147
|
-
return {
|
|
1148
|
-
width,
|
|
1149
|
-
height,
|
|
1150
|
-
pixels: composite.pixels,
|
|
1151
|
-
brightPixels,
|
|
1152
|
-
horizontalBlurPixels,
|
|
1153
|
-
verticalBlurPixels,
|
|
1154
|
-
brightPixelCount,
|
|
1155
|
-
brightEnergy: Number(brightEnergy.toFixed(6)),
|
|
1156
|
-
maxNeighborBoost: Number(composite.maxNeighborBoost.toFixed(6)),
|
|
1157
|
-
changedPixels: composite.changedPixels,
|
|
1158
|
-
maxChannelDelta: Number(composite.maxChannelDelta.toFixed(6)),
|
|
1159
|
-
maxInputValue: Number(maxInputValue.toFixed(6)),
|
|
1160
|
-
pipeline: ["bright-extract", "horizontal-blur", "vertical-blur", "composite"]
|
|
1161
|
-
};
|
|
1162
|
-
}
|
|
1163
|
-
function blurBloomFloatPixelsHorizontal(pixels, width, height, radius) {
|
|
1164
|
-
validateFloatPixelBuffer(pixels, width, height, "HDR bloom horizontal blur");
|
|
1165
|
-
validateBloomBlurRadius(radius);
|
|
1166
|
-
const kernelSize = radius * 2 + 1;
|
|
1167
|
-
const output = new Float32Array(pixels.length);
|
|
1168
|
-
for (let y = 0; y < height; y += 1) {
|
|
1169
|
-
for (let x = 0; x < width; x += 1) {
|
|
1170
|
-
const targetIndex = (y * width + x) * 4;
|
|
1171
|
-
let red = 0;
|
|
1172
|
-
let green = 0;
|
|
1173
|
-
let blue = 0;
|
|
1174
|
-
let alpha = 0;
|
|
1175
|
-
for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
|
|
1176
|
-
const sampleX = clampInt(x + offsetX, 0, width - 1);
|
|
1177
|
-
const sampleIndex = (y * width + sampleX) * 4;
|
|
1178
|
-
red += finiteHdrChannel(pixels[sampleIndex], sampleIndex);
|
|
1179
|
-
green += finiteHdrChannel(pixels[sampleIndex + 1], sampleIndex + 1);
|
|
1180
|
-
blue += finiteHdrChannel(pixels[sampleIndex + 2], sampleIndex + 2);
|
|
1181
|
-
alpha += finiteHdrChannel(pixels[sampleIndex + 3], sampleIndex + 3);
|
|
1182
|
-
}
|
|
1183
|
-
output[targetIndex] = red / kernelSize;
|
|
1184
|
-
output[targetIndex + 1] = green / kernelSize;
|
|
1185
|
-
output[targetIndex + 2] = blue / kernelSize;
|
|
1186
|
-
output[targetIndex + 3] = alpha / kernelSize;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
return output;
|
|
1190
|
-
}
|
|
1191
|
-
function blurBloomFloatPixelsVertical(pixels, width, height, radius) {
|
|
1192
|
-
validateFloatPixelBuffer(pixels, width, height, "HDR bloom vertical blur");
|
|
1193
|
-
validateBloomBlurRadius(radius);
|
|
1194
|
-
const kernelSize = radius * 2 + 1;
|
|
1195
|
-
const output = new Float32Array(pixels.length);
|
|
1196
|
-
for (let y = 0; y < height; y += 1) {
|
|
1197
|
-
for (let x = 0; x < width; x += 1) {
|
|
1198
|
-
const targetIndex = (y * width + x) * 4;
|
|
1199
|
-
let red = 0;
|
|
1200
|
-
let green = 0;
|
|
1201
|
-
let blue = 0;
|
|
1202
|
-
let alpha = 0;
|
|
1203
|
-
for (let offsetY = -radius; offsetY <= radius; offsetY += 1) {
|
|
1204
|
-
const sampleY = clampInt(y + offsetY, 0, height - 1);
|
|
1205
|
-
const sampleIndex = (sampleY * width + x) * 4;
|
|
1206
|
-
red += finiteHdrChannel(pixels[sampleIndex], sampleIndex);
|
|
1207
|
-
green += finiteHdrChannel(pixels[sampleIndex + 1], sampleIndex + 1);
|
|
1208
|
-
blue += finiteHdrChannel(pixels[sampleIndex + 2], sampleIndex + 2);
|
|
1209
|
-
alpha += finiteHdrChannel(pixels[sampleIndex + 3], sampleIndex + 3);
|
|
1210
|
-
}
|
|
1211
|
-
output[targetIndex] = red / kernelSize;
|
|
1212
|
-
output[targetIndex + 1] = green / kernelSize;
|
|
1213
|
-
output[targetIndex + 2] = blue / kernelSize;
|
|
1214
|
-
output[targetIndex + 3] = alpha / kernelSize;
|
|
1215
|
-
}
|
|
1216
|
-
}
|
|
1217
|
-
return output;
|
|
1218
|
-
}
|
|
1219
|
-
function compositeBloomFloatPixels(sourcePixels, blurredPixels, width, height, intensity, brightPixels) {
|
|
1220
|
-
validateFloatPixelBuffer(sourcePixels, width, height, "HDR bloom composite source");
|
|
1221
|
-
validateFloatPixelBuffer(blurredPixels, width, height, "HDR bloom composite blur");
|
|
1222
|
-
if (brightPixels)
|
|
1223
|
-
validateFloatPixelBuffer(brightPixels, width, height, "HDR bloom composite bright source");
|
|
1224
|
-
if (!Number.isFinite(intensity) || intensity < 0) {
|
|
1225
|
-
throw new Error("Bloom intensity must be finite and non-negative.");
|
|
1226
|
-
}
|
|
1227
|
-
const output = new Float32Array(sourcePixels);
|
|
1228
|
-
let maxNeighborBoost = 0;
|
|
1229
|
-
let changedPixels = 0;
|
|
1230
|
-
let maxChannelDelta = 0;
|
|
1231
|
-
for (let index = 0; index < sourcePixels.length; index += 4) {
|
|
1232
|
-
const previousRed = finiteHdrChannel(output[index], index);
|
|
1233
|
-
const previousGreen = finiteHdrChannel(output[index + 1], index + 1);
|
|
1234
|
-
const previousBlue = finiteHdrChannel(output[index + 2], index + 2);
|
|
1235
|
-
const redBoost = finiteHdrChannel(blurredPixels[index], index) * intensity;
|
|
1236
|
-
const greenBoost = finiteHdrChannel(blurredPixels[index + 1], index + 1) * intensity;
|
|
1237
|
-
const blueBoost = finiteHdrChannel(blurredPixels[index + 2], index + 2) * intensity;
|
|
1238
|
-
output[index] = previousRed + redBoost;
|
|
1239
|
-
output[index + 1] = previousGreen + greenBoost;
|
|
1240
|
-
output[index + 2] = previousBlue + blueBoost;
|
|
1241
|
-
output[index + 3] = finiteHdrChannel(output[index + 3], index + 3);
|
|
1242
|
-
const pixelDelta = Math.max(Math.abs(output[index] - previousRed), Math.abs(output[index + 1] - previousGreen), Math.abs(output[index + 2] - previousBlue));
|
|
1243
|
-
if (pixelDelta > 0) {
|
|
1244
|
-
changedPixels += 1;
|
|
1245
|
-
maxChannelDelta = Math.max(maxChannelDelta, pixelDelta);
|
|
1246
|
-
}
|
|
1247
|
-
if (!brightPixels || (brightPixels[index] === 0 && brightPixels[index + 1] === 0 && brightPixels[index + 2] === 0)) {
|
|
1248
|
-
maxNeighborBoost = Math.max(maxNeighborBoost, redBoost, greenBoost, blueBoost);
|
|
1249
|
-
}
|
|
1250
|
-
}
|
|
1251
|
-
return { pixels: output, maxNeighborBoost, changedPixels, maxChannelDelta };
|
|
1252
|
-
}
|
|
1253
|
-
export function createDepthTextureBinding(options) {
|
|
1254
|
-
const { label, width, height } = options;
|
|
1255
|
-
if (!label)
|
|
1256
|
-
throw new Error("Depth texture label is required.");
|
|
1257
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
1258
|
-
throw new Error("Depth texture dimensions must be positive integers.");
|
|
1259
|
-
}
|
|
1260
|
-
const data = options.data ? new Float32Array(options.data) : new Float32Array(width * height);
|
|
1261
|
-
if (data.length !== width * height) {
|
|
1262
|
-
throw new Error("Depth texture data must contain width * height float samples.");
|
|
1263
|
-
}
|
|
1264
|
-
for (const value of data) {
|
|
1265
|
-
if (!Number.isFinite(value) || value < 0 || value > 1) {
|
|
1266
|
-
throw new Error("Depth texture samples must be finite normalized values in [0, 1].");
|
|
1267
|
-
}
|
|
1268
|
-
}
|
|
1269
|
-
return { label, width, height, format: "depth24", data };
|
|
1270
|
-
}
|
|
1271
|
-
export function createToneMappingCalibration(options) {
|
|
1272
|
-
const samples = [0, 0.18, 0.5, 1].map((inputLinear) => {
|
|
1273
|
-
const mappedLinear = applyToneMapping(inputLinear, options.exposure, options.whitePoint, options.operator);
|
|
1274
|
-
return {
|
|
1275
|
-
inputLinear,
|
|
1276
|
-
mappedLinear,
|
|
1277
|
-
encodedByte: encodeColorByte(mappedLinear, options.gamma, options.outputColorSpace)
|
|
1278
|
-
};
|
|
1279
|
-
});
|
|
1280
|
-
return {
|
|
1281
|
-
operator: options.operator,
|
|
1282
|
-
exposure: options.exposure,
|
|
1283
|
-
whitePoint: options.whitePoint,
|
|
1284
|
-
gamma: options.gamma,
|
|
1285
|
-
inputColorSpace: options.inputColorSpace,
|
|
1286
|
-
outputColorSpace: options.outputColorSpace,
|
|
1287
|
-
samples,
|
|
1288
|
-
monotonic: samples.every((sample, index) => index === 0 || sample.encodedByte >= samples[index - 1].encodedByte)
|
|
1289
|
-
};
|
|
1290
|
-
}
|
|
1291
|
-
export function visualizeDepthTexture(texture, options = {}) {
|
|
1292
|
-
const edgeThreshold = options.edgeThreshold ?? 0.08;
|
|
1293
|
-
if (!Number.isFinite(edgeThreshold) || edgeThreshold < 0 || edgeThreshold > 1) {
|
|
1294
|
-
throw new Error("Depth visualization edgeThreshold must be finite and in [0, 1].");
|
|
1295
|
-
}
|
|
1296
|
-
const stats = depthTextureStats(texture, edgeThreshold);
|
|
1297
|
-
const pixels = new Uint8Array(texture.width * texture.height * 4);
|
|
1298
|
-
for (let y = 0; y < texture.height; y += 1) {
|
|
1299
|
-
for (let x = 0; x < texture.width; x += 1) {
|
|
1300
|
-
const pixelIndex = (y * texture.width + x) * 4;
|
|
1301
|
-
const depth = depthAt(texture, x, y);
|
|
1302
|
-
const edge = isDepthEdge(texture, x, y, edgeThreshold);
|
|
1303
|
-
const shade = clampByte((1 - depth) * 255);
|
|
1304
|
-
pixels[pixelIndex] = edge ? 255 : shade;
|
|
1305
|
-
pixels[pixelIndex + 1] = edge ? 98 : shade;
|
|
1306
|
-
pixels[pixelIndex + 2] = edge ? 36 : shade;
|
|
1307
|
-
pixels[pixelIndex + 3] = 255;
|
|
1308
|
-
}
|
|
1309
|
-
}
|
|
1310
|
-
return { width: texture.width, height: texture.height, pixels, stats };
|
|
1311
|
-
}
|
|
1312
|
-
export function depthTextureStats(texture, edgeThreshold = 0.08) {
|
|
1313
|
-
if (texture.data.length !== texture.width * texture.height) {
|
|
1314
|
-
throw new Error("Depth texture data length does not match dimensions.");
|
|
1315
|
-
}
|
|
1316
|
-
let minDepth = Number.POSITIVE_INFINITY;
|
|
1317
|
-
let maxDepth = Number.NEGATIVE_INFINITY;
|
|
1318
|
-
let edgePixelCount = 0;
|
|
1319
|
-
for (let y = 0; y < texture.height; y += 1) {
|
|
1320
|
-
for (let x = 0; x < texture.width; x += 1) {
|
|
1321
|
-
const depth = depthAt(texture, x, y);
|
|
1322
|
-
minDepth = Math.min(minDepth, depth);
|
|
1323
|
-
maxDepth = Math.max(maxDepth, depth);
|
|
1324
|
-
if (isDepthEdge(texture, x, y, edgeThreshold))
|
|
1325
|
-
edgePixelCount += 1;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
return {
|
|
1329
|
-
label: texture.label,
|
|
1330
|
-
width: texture.width,
|
|
1331
|
-
height: texture.height,
|
|
1332
|
-
format: texture.format,
|
|
1333
|
-
byteLength: texture.data.byteLength,
|
|
1334
|
-
minDepth,
|
|
1335
|
-
maxDepth,
|
|
1336
|
-
centerDepth: depthAt(texture, Math.floor(texture.width / 2), Math.floor(texture.height / 2)),
|
|
1337
|
-
nearSample: depthAt(texture, Math.floor(texture.width * 0.48), Math.floor(texture.height * 0.44)),
|
|
1338
|
-
farSample: depthAt(texture, 1, 1),
|
|
1339
|
-
edgePixelCount
|
|
1340
|
-
};
|
|
1341
|
-
}
|
|
1342
|
-
export function fxaaPixels(pixels, width, height, options = {}) {
|
|
1343
|
-
validatePixelBuffer(pixels, width, height, "FXAA");
|
|
1344
|
-
const edgeThreshold = options.edgeThreshold ?? 0.125;
|
|
1345
|
-
const subpixelBlend = options.subpixelBlend ?? 0.75;
|
|
1346
|
-
validateFXAAOptions(edgeThreshold, subpixelBlend);
|
|
1347
|
-
const output = new Uint8Array(pixels);
|
|
1348
|
-
const edgeMask = new Uint8Array(width * height);
|
|
1349
|
-
for (let y = 0; y < height; y += 1) {
|
|
1350
|
-
for (let x = 0; x < width; x += 1) {
|
|
1351
|
-
const index = (y * width + x) * 4;
|
|
1352
|
-
const centerLuma = lumaAt(pixels, width, height, x, y);
|
|
1353
|
-
const northLuma = lumaAt(pixels, width, height, x, y - 1);
|
|
1354
|
-
const southLuma = lumaAt(pixels, width, height, x, y + 1);
|
|
1355
|
-
const westLuma = lumaAt(pixels, width, height, x - 1, y);
|
|
1356
|
-
const eastLuma = lumaAt(pixels, width, height, x + 1, y);
|
|
1357
|
-
const minLuma = Math.min(centerLuma, northLuma, southLuma, westLuma, eastLuma);
|
|
1358
|
-
const maxLuma = Math.max(centerLuma, northLuma, southLuma, westLuma, eastLuma);
|
|
1359
|
-
if (maxLuma - minLuma < edgeThreshold) {
|
|
1360
|
-
continue;
|
|
1361
|
-
}
|
|
1362
|
-
edgeMask[y * width + x] = 255;
|
|
1363
|
-
for (let channel = 0; channel < 3; channel += 1) {
|
|
1364
|
-
const average = (channelAt(pixels, width, height, x, y - 1, channel)
|
|
1365
|
-
+ channelAt(pixels, width, height, x, y + 1, channel)
|
|
1366
|
-
+ channelAt(pixels, width, height, x - 1, y, channel)
|
|
1367
|
-
+ channelAt(pixels, width, height, x + 1, y, channel)) / 4;
|
|
1368
|
-
output[index + channel] = clampByte(pixels[index + channel] * (1 - subpixelBlend) + average * subpixelBlend);
|
|
1369
|
-
}
|
|
1370
|
-
output[index + 3] = pixels[index + 3];
|
|
1371
|
-
}
|
|
1372
|
-
}
|
|
1373
|
-
return { width, height, pixels: output, edgeMask };
|
|
1374
|
-
}
|
|
1375
|
-
export function fusedLdrPostprocessPixels(pixels, width, height, passes, options = {}) {
|
|
1376
|
-
validatePixelBuffer(pixels, width, height, "Fused LDR postprocess");
|
|
1377
|
-
const bloom = passes.find((pass) => pass.name === "bloom");
|
|
1378
|
-
const toneMapping = passes.find((pass) => pass.name === "tone-mapping");
|
|
1379
|
-
const colorGrade = passes.find((pass) => pass.name === "color-grade");
|
|
1380
|
-
const fxaa = passes.find((pass) => pass.name === "fxaa");
|
|
1381
|
-
const toneMappingLookup = toneMapping
|
|
1382
|
-
? getToneMappingLookup({
|
|
1383
|
-
...(options.toneMappingDefaults ?? {}),
|
|
1384
|
-
...toneMapping.options
|
|
1385
|
-
}, options.scratch)
|
|
1386
|
-
: undefined;
|
|
1387
|
-
const colorGradeSettings = colorGrade ? normalizeColorGradeOptions(colorGrade.options) : undefined;
|
|
1388
|
-
const byteLength = pixels.byteLength;
|
|
1389
|
-
let current = bloom
|
|
1390
|
-
? bloomPixels(pixels, width, height, bloom.options).pixels
|
|
1391
|
-
: pixels;
|
|
1392
|
-
if (toneMappingLookup || colorGradeSettings) {
|
|
1393
|
-
const target = options.mutateInput
|
|
1394
|
-
? pixels
|
|
1395
|
-
: acquireFusedLdrBuffer(options.scratch, byteLength, 0);
|
|
1396
|
-
const vignetteFactors = colorGradeSettings && colorGradeSettings.vignette > 0
|
|
1397
|
-
? getVignetteFactors(width, height, colorGradeSettings.vignette, options.scratch)
|
|
1398
|
-
: undefined;
|
|
1399
|
-
applyToneMappingAndColorGrade(current, target, width, height, toneMappingLookup, colorGradeSettings, vignetteFactors);
|
|
1400
|
-
current = target;
|
|
1401
|
-
}
|
|
1402
|
-
if (colorGradeSettings && colorGradeSettings.sharpening > 0) {
|
|
1403
|
-
const target = acquireFusedLdrBuffer(options.scratch, byteLength, current === options.scratch?.bufferA ? 1 : 0);
|
|
1404
|
-
sharpenPixelsInto(current, target, width, height, colorGradeSettings.sharpening);
|
|
1405
|
-
current = target;
|
|
1406
|
-
}
|
|
1407
|
-
if (fxaa) {
|
|
1408
|
-
const settings = normalizeFXAAOptions(fxaa.options);
|
|
1409
|
-
const target = acquireFusedLdrBuffer(options.scratch, byteLength, current === options.scratch?.bufferA ? 1 : 0);
|
|
1410
|
-
fxaaPixelsInto(current, target, width, height, settings.edgeThreshold, settings.subpixelBlend);
|
|
1411
|
-
current = target;
|
|
1412
|
-
}
|
|
1413
|
-
return current;
|
|
1414
|
-
}
|
|
1415
|
-
function validatePixelBuffer(pixels, width, height, label) {
|
|
1416
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
1417
|
-
throw new Error(`${label} dimensions must be positive integers.`);
|
|
1418
|
-
}
|
|
1419
|
-
if (pixels.byteLength !== width * height * 4) {
|
|
1420
|
-
throw new Error(`${label} input must contain width * height * 4 RGBA bytes.`);
|
|
1421
|
-
}
|
|
1422
|
-
}
|
|
1423
|
-
function validateFloatPixelBuffer(pixels, width, height, label) {
|
|
1424
|
-
if (!Number.isInteger(width) || width <= 0 || !Number.isInteger(height) || height <= 0) {
|
|
1425
|
-
throw new Error(`${label} dimensions must be positive integers.`);
|
|
1426
|
-
}
|
|
1427
|
-
if (pixels.length !== width * height * 4) {
|
|
1428
|
-
throw new Error(`${label} input must contain width * height * 4 RGBA float values.`);
|
|
1429
|
-
}
|
|
1430
|
-
}
|
|
1431
|
-
function requireDepthTextureBinding(depth, label) {
|
|
1432
|
-
if (!depth) {
|
|
1433
|
-
throw new Error(`${label} requires a depth texture binding. Renderer-owned postprocess passes inject this automatically when the backend exposes depth readback.`);
|
|
1434
|
-
}
|
|
1435
|
-
return depth;
|
|
1436
|
-
}
|
|
1437
|
-
function validateFXAAOptions(edgeThreshold, subpixelBlend) {
|
|
1438
|
-
if (!Number.isFinite(edgeThreshold) || edgeThreshold < 0 || edgeThreshold > 1) {
|
|
1439
|
-
throw new Error("FXAA edgeThreshold must be finite and in [0, 1].");
|
|
1440
|
-
}
|
|
1441
|
-
if (!Number.isFinite(subpixelBlend) || subpixelBlend < 0 || subpixelBlend > 1) {
|
|
1442
|
-
throw new Error("FXAA subpixelBlend must be finite and in [0, 1].");
|
|
1443
|
-
}
|
|
1444
|
-
}
|
|
1445
|
-
function normalizeColorGradeOptions(options) {
|
|
1446
|
-
const settings = {
|
|
1447
|
-
contrast: options.contrast ?? 1,
|
|
1448
|
-
temperature: options.temperature ?? 0,
|
|
1449
|
-
tint: options.tint ?? 0,
|
|
1450
|
-
saturation: options.saturation ?? 1,
|
|
1451
|
-
vibrance: options.vibrance ?? 0,
|
|
1452
|
-
vignette: options.vignette ?? 0,
|
|
1453
|
-
sharpening: options.sharpening ?? 0
|
|
1454
|
-
};
|
|
1455
|
-
validateRange(settings.contrast, 0, 3, "Color grading contrast");
|
|
1456
|
-
validateRange(settings.temperature, -1, 1, "Color grading temperature");
|
|
1457
|
-
validateRange(settings.tint, -1, 1, "Color grading tint");
|
|
1458
|
-
validateRange(settings.saturation, 0, 3, "Color grading saturation");
|
|
1459
|
-
validateRange(settings.vibrance, -1, 1, "Color grading vibrance");
|
|
1460
|
-
validateRange(settings.vignette, 0, 1, "Color grading vignette");
|
|
1461
|
-
validateRange(settings.sharpening, 0, 2, "Color grading sharpening");
|
|
1462
|
-
return settings;
|
|
1463
|
-
}
|
|
1464
|
-
function normalizeFXAAOptions(options) {
|
|
1465
|
-
const settings = {
|
|
1466
|
-
edgeThreshold: options.edgeThreshold ?? 0.125,
|
|
1467
|
-
subpixelBlend: options.subpixelBlend ?? 0.75
|
|
1468
|
-
};
|
|
1469
|
-
validateFXAAOptions(settings.edgeThreshold, settings.subpixelBlend);
|
|
1470
|
-
return settings;
|
|
1471
|
-
}
|
|
1472
|
-
function acquireFusedLdrBuffer(scratch, byteLength, slot) {
|
|
1473
|
-
if (!scratch)
|
|
1474
|
-
return new Uint8Array(byteLength);
|
|
1475
|
-
if (slot === 0) {
|
|
1476
|
-
if (!scratch.bufferA || scratch.bufferA.byteLength !== byteLength) {
|
|
1477
|
-
scratch.bufferA = new Uint8Array(byteLength);
|
|
1478
|
-
}
|
|
1479
|
-
return scratch.bufferA;
|
|
1480
|
-
}
|
|
1481
|
-
if (!scratch.bufferB || scratch.bufferB.byteLength !== byteLength) {
|
|
1482
|
-
scratch.bufferB = new Uint8Array(byteLength);
|
|
1483
|
-
}
|
|
1484
|
-
return scratch.bufferB;
|
|
1485
|
-
}
|
|
1486
|
-
function getToneMappingLookup(options, scratch) {
|
|
1487
|
-
const exposure = options.exposure ?? 1;
|
|
1488
|
-
const whitePoint = options.whitePoint ?? 1;
|
|
1489
|
-
const gamma = options.gamma ?? 2.2;
|
|
1490
|
-
const operator = options.operator ?? "reinhard";
|
|
1491
|
-
const inputColorSpace = options.inputColorSpace ?? "linear";
|
|
1492
|
-
const outputColorSpace = options.outputColorSpace ?? "linear";
|
|
1493
|
-
if (!Number.isFinite(exposure) || exposure < 0) {
|
|
1494
|
-
throw new Error("Tone mapping exposure must be finite and non-negative.");
|
|
1495
|
-
}
|
|
1496
|
-
if (!Number.isFinite(whitePoint) || whitePoint <= 0) {
|
|
1497
|
-
throw new Error("Tone mapping whitePoint must be finite and positive.");
|
|
1498
|
-
}
|
|
1499
|
-
if (!Number.isFinite(gamma) || gamma <= 0) {
|
|
1500
|
-
throw new Error("Tone mapping gamma must be finite and positive.");
|
|
1501
|
-
}
|
|
1502
|
-
const key = `${exposure}|${whitePoint}|${gamma}|${operator}|${inputColorSpace}|${outputColorSpace}`;
|
|
1503
|
-
if (scratch?.toneMappingLookup && scratch.toneMappingLookupKey === key) {
|
|
1504
|
-
return scratch.toneMappingLookup;
|
|
1505
|
-
}
|
|
1506
|
-
const lookup = scratch?.toneMappingLookup ?? new Uint8Array(256);
|
|
1507
|
-
for (let value = 0; value < 256; value += 1) {
|
|
1508
|
-
lookup[value] = encodeToneMappedChannel(decodeColorByte(value, inputColorSpace), exposure, whitePoint, gamma, operator, outputColorSpace);
|
|
1509
|
-
}
|
|
1510
|
-
if (scratch) {
|
|
1511
|
-
scratch.toneMappingLookup = lookup;
|
|
1512
|
-
scratch.toneMappingLookupKey = key;
|
|
1513
|
-
}
|
|
1514
|
-
return lookup;
|
|
1515
|
-
}
|
|
1516
|
-
function getVignetteFactors(width, height, vignette, scratch) {
|
|
1517
|
-
const key = `${width}x${height}|${vignette}`;
|
|
1518
|
-
if (scratch?.vignetteFactors && scratch.vignetteFactorsKey === key) {
|
|
1519
|
-
return scratch.vignetteFactors;
|
|
1520
|
-
}
|
|
1521
|
-
const factors = scratch?.vignetteFactors && scratch.vignetteFactors.length === width * height
|
|
1522
|
-
? scratch.vignetteFactors
|
|
1523
|
-
: new Float32Array(width * height);
|
|
1524
|
-
for (let y = 0; y < height; y += 1) {
|
|
1525
|
-
const centerY = height <= 1 ? 0 : (y / (height - 1)) * 2 - 1;
|
|
1526
|
-
for (let x = 0; x < width; x += 1) {
|
|
1527
|
-
const centerX = width <= 1 ? 0 : (x / (width - 1)) * 2 - 1;
|
|
1528
|
-
factors[y * width + x] = 1 - vignette * Math.min(1, Math.max(0, Math.sqrt(centerX * centerX + centerY * centerY) - 0.28) / 1.12);
|
|
1529
|
-
}
|
|
1530
|
-
}
|
|
1531
|
-
if (scratch) {
|
|
1532
|
-
scratch.vignetteFactors = factors;
|
|
1533
|
-
scratch.vignetteFactorsKey = key;
|
|
1534
|
-
}
|
|
1535
|
-
return factors;
|
|
1536
|
-
}
|
|
1537
|
-
function applyToneMappingAndColorGrade(input, output, width, height, toneMappingLookup, colorGradeSettings, vignetteFactors) {
|
|
1538
|
-
const contrast = colorGradeSettings?.contrast ?? 1;
|
|
1539
|
-
const contrastOffset = 0.5 - 0.5 * contrast;
|
|
1540
|
-
const temperature = colorGradeSettings?.temperature ?? 0;
|
|
1541
|
-
const tint = colorGradeSettings?.tint ?? 0;
|
|
1542
|
-
const redShift = temperature * 0.08 - tint * 0.02;
|
|
1543
|
-
const greenShift = tint * 0.06;
|
|
1544
|
-
const blueShift = -temperature * 0.08 - tint * 0.02;
|
|
1545
|
-
const saturationBase = colorGradeSettings?.saturation ?? 1;
|
|
1546
|
-
const vibrance = colorGradeSettings?.vibrance ?? 0;
|
|
1547
|
-
const applyColorGrade = colorGradeSettings !== undefined;
|
|
1548
|
-
for (let pixel = 0, index = 0; pixel < width * height; pixel += 1, index += 4) {
|
|
1549
|
-
const toneRed = toneMappingLookup ? toneMappingLookup[input[index]] : input[index];
|
|
1550
|
-
const toneGreen = toneMappingLookup ? toneMappingLookup[input[index + 1]] : input[index + 1];
|
|
1551
|
-
const toneBlue = toneMappingLookup ? toneMappingLookup[input[index + 2]] : input[index + 2];
|
|
1552
|
-
if (!applyColorGrade) {
|
|
1553
|
-
output[index] = toneRed;
|
|
1554
|
-
output[index + 1] = toneGreen;
|
|
1555
|
-
output[index + 2] = toneBlue;
|
|
1556
|
-
output[index + 3] = input[index + 3] ?? 255;
|
|
1557
|
-
continue;
|
|
1558
|
-
}
|
|
1559
|
-
let red = toneRed / 255;
|
|
1560
|
-
let green = toneGreen / 255;
|
|
1561
|
-
let blue = toneBlue / 255;
|
|
1562
|
-
const luma = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
|
1563
|
-
red = red * contrast + contrastOffset + redShift;
|
|
1564
|
-
green = green * contrast + contrastOffset + greenShift;
|
|
1565
|
-
blue = blue * contrast + contrastOffset + blueShift;
|
|
1566
|
-
const vibranceBoost = vibrance === 0
|
|
1567
|
-
? 0
|
|
1568
|
-
: vibrance * (1 - Math.min(1, Math.abs(red - luma) + Math.abs(green - luma) + Math.abs(blue - luma)));
|
|
1569
|
-
const saturation = saturationBase + vibranceBoost;
|
|
1570
|
-
red = luma + (red - luma) * saturation;
|
|
1571
|
-
green = luma + (green - luma) * saturation;
|
|
1572
|
-
blue = luma + (blue - luma) * saturation;
|
|
1573
|
-
const vignette = vignetteFactors ? vignetteFactors[pixel] : 1;
|
|
1574
|
-
output[index] = clampByteFast(red * vignette * 255);
|
|
1575
|
-
output[index + 1] = clampByteFast(green * vignette * 255);
|
|
1576
|
-
output[index + 2] = clampByteFast(blue * vignette * 255);
|
|
1577
|
-
output[index + 3] = input[index + 3] ?? 255;
|
|
1578
|
-
}
|
|
1579
|
-
}
|
|
1580
|
-
function sharpenPixelsInto(input, output, width, height, amount) {
|
|
1581
|
-
output.set(input);
|
|
1582
|
-
const rowStride = width * 4;
|
|
1583
|
-
for (let y = 1; y < height - 1; y += 1) {
|
|
1584
|
-
const rowOffset = y * rowStride;
|
|
1585
|
-
for (let x = 1; x < width - 1; x += 1) {
|
|
1586
|
-
const index = rowOffset + x * 4;
|
|
1587
|
-
for (let channel = 0; channel < 3; channel += 1) {
|
|
1588
|
-
const center = input[index + channel] ?? 0;
|
|
1589
|
-
const blur = ((input[index - 4 + channel] ?? 0) +
|
|
1590
|
-
(input[index + 4 + channel] ?? 0) +
|
|
1591
|
-
(input[index - rowStride + channel] ?? 0) +
|
|
1592
|
-
(input[index + rowStride + channel] ?? 0)) / 4;
|
|
1593
|
-
output[index + channel] = clampByteFast(center + (center - blur) * amount);
|
|
1594
|
-
}
|
|
1595
|
-
}
|
|
1596
|
-
}
|
|
1597
|
-
}
|
|
1598
|
-
function fxaaPixelsInto(input, output, width, height, edgeThreshold, subpixelBlend) {
|
|
1599
|
-
output.set(input);
|
|
1600
|
-
const rowStride = width * 4;
|
|
1601
|
-
for (let y = 0; y < height; y += 1) {
|
|
1602
|
-
const rowOffset = y * rowStride;
|
|
1603
|
-
const northOffset = y > 0 ? rowOffset - rowStride : rowOffset;
|
|
1604
|
-
const southOffset = y < height - 1 ? rowOffset + rowStride : rowOffset;
|
|
1605
|
-
for (let x = 0; x < width; x += 1) {
|
|
1606
|
-
const index = rowOffset + x * 4;
|
|
1607
|
-
const westIndex = x > 0 ? index - 4 : index;
|
|
1608
|
-
const eastIndex = x < width - 1 ? index + 4 : index;
|
|
1609
|
-
const northIndex = northOffset + x * 4;
|
|
1610
|
-
const southIndex = southOffset + x * 4;
|
|
1611
|
-
const centerLuma = lumaAtIndex(input, index);
|
|
1612
|
-
const northLuma = lumaAtIndex(input, northIndex);
|
|
1613
|
-
const southLuma = lumaAtIndex(input, southIndex);
|
|
1614
|
-
const westLuma = lumaAtIndex(input, westIndex);
|
|
1615
|
-
const eastLuma = lumaAtIndex(input, eastIndex);
|
|
1616
|
-
const minLuma = Math.min(centerLuma, northLuma, southLuma, westLuma, eastLuma);
|
|
1617
|
-
const maxLuma = Math.max(centerLuma, northLuma, southLuma, westLuma, eastLuma);
|
|
1618
|
-
if (maxLuma - minLuma < edgeThreshold)
|
|
1619
|
-
continue;
|
|
1620
|
-
for (let channel = 0; channel < 3; channel += 1) {
|
|
1621
|
-
const average = ((input[northIndex + channel] ?? 0) +
|
|
1622
|
-
(input[southIndex + channel] ?? 0) +
|
|
1623
|
-
(input[westIndex + channel] ?? 0) +
|
|
1624
|
-
(input[eastIndex + channel] ?? 0)) / 4;
|
|
1625
|
-
output[index + channel] = clampByteFast(input[index + channel] * (1 - subpixelBlend) + average * subpixelBlend);
|
|
1626
|
-
}
|
|
1627
|
-
output[index + 3] = input[index + 3];
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
function lumaAtIndex(pixels, index) {
|
|
1632
|
-
return (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
|
|
1633
|
-
}
|
|
1634
|
-
function clampByteFast(value) {
|
|
1635
|
-
if (value <= 0)
|
|
1636
|
-
return 0;
|
|
1637
|
-
if (value >= 255)
|
|
1638
|
-
return 255;
|
|
1639
|
-
return Math.round(value);
|
|
1640
|
-
}
|
|
1641
|
-
function validateBloomOptions(threshold, intensity, radius) {
|
|
1642
|
-
if (!Number.isFinite(threshold) || threshold < 0 || threshold > 1) {
|
|
1643
|
-
throw new Error("Bloom threshold must be finite and in [0, 1].");
|
|
1644
|
-
}
|
|
1645
|
-
if (!Number.isFinite(intensity) || intensity < 0) {
|
|
1646
|
-
throw new Error("Bloom intensity must be finite and non-negative.");
|
|
1647
|
-
}
|
|
1648
|
-
validateBloomBlurRadius(radius);
|
|
1649
|
-
}
|
|
1650
|
-
function validateBloomBlurRadius(radius) {
|
|
1651
|
-
if (!Number.isInteger(radius) || radius < 0 || radius > 16) {
|
|
1652
|
-
throw new Error("Bloom radius must be an integer in [0, 16].");
|
|
1653
|
-
}
|
|
1654
|
-
}
|
|
1655
|
-
function validateOutlineColor(color) {
|
|
1656
|
-
for (let index = 0; index < color.length; index += 1) {
|
|
1657
|
-
const channel = color[index] ?? 0;
|
|
1658
|
-
if (!Number.isFinite(channel) || channel < 0 || channel > 255) {
|
|
1659
|
-
throw new Error(`Outline color channel ${index} must be finite and within [0, 255].`);
|
|
1660
|
-
}
|
|
1661
|
-
}
|
|
1662
|
-
}
|
|
1663
|
-
/**
|
|
1664
|
-
* Sobel response of the integer luma numerator `2126 * r + 7152 * g + 722 * b`.
|
|
1665
|
-
*
|
|
1666
|
-
* This is the same operator as {@link sobelLumaGradient} scaled by `OUTLINE_LUMA_SCALE`, but every
|
|
1667
|
-
* intermediate is an exact integer: each numerator is at most `2550000`, so a response is at most
|
|
1668
|
-
* `4 * 2550000` and the squared magnitude used by {@link outlineEdgeExceedsBound} stays below 2^48,
|
|
1669
|
-
* well inside the range where float64 represents integers exactly.
|
|
1670
|
-
*/
|
|
1671
|
-
function sobelLumaNumeratorGradient(pixels, width, height, x, y) {
|
|
1672
|
-
const nw = lumaNumeratorAt(pixels, width, height, x - 1, y - 1);
|
|
1673
|
-
const n = lumaNumeratorAt(pixels, width, height, x, y - 1);
|
|
1674
|
-
const ne = lumaNumeratorAt(pixels, width, height, x + 1, y - 1);
|
|
1675
|
-
const w = lumaNumeratorAt(pixels, width, height, x - 1, y);
|
|
1676
|
-
const e = lumaNumeratorAt(pixels, width, height, x + 1, y);
|
|
1677
|
-
const sw = lumaNumeratorAt(pixels, width, height, x - 1, y + 1);
|
|
1678
|
-
const s = lumaNumeratorAt(pixels, width, height, x, y + 1);
|
|
1679
|
-
const se = lumaNumeratorAt(pixels, width, height, x + 1, y + 1);
|
|
1680
|
-
return {
|
|
1681
|
-
gx: -nw - 2 * w - sw + ne + 2 * e + se,
|
|
1682
|
-
gy: -nw - 2 * n - ne + sw + 2 * s + se
|
|
1683
|
-
};
|
|
1684
|
-
}
|
|
1685
|
-
/**
|
|
1686
|
-
* Exact outline edge predicate shared by the CPU kernel and the WebGL2 shader.
|
|
1687
|
-
*
|
|
1688
|
-
* Equivalent to `hypot(gx, gy) >= threshold` on the real numbers, but decided with integers so
|
|
1689
|
-
* that it never depends on float rounding. `bound` comes from {@link createOutlineGradientBound},
|
|
1690
|
-
* which pre-squares the threshold as an exact rational and rounds up.
|
|
1691
|
-
*/
|
|
1692
|
-
function outlineEdgeExceedsBound(gx, gy, bound) {
|
|
1693
|
-
return gx * gx + gy * gy >= bound;
|
|
1694
|
-
}
|
|
1695
|
-
function dilateMask(mask, width, height, radius) {
|
|
1696
|
-
const output = new Uint8Array(mask.length);
|
|
1697
|
-
for (let y = 0; y < height; y += 1) {
|
|
1698
|
-
for (let x = 0; x < width; x += 1) {
|
|
1699
|
-
let outlined = false;
|
|
1700
|
-
for (let offsetY = -radius; offsetY <= radius && !outlined; offsetY += 1) {
|
|
1701
|
-
for (let offsetX = -radius; offsetX <= radius; offsetX += 1) {
|
|
1702
|
-
if (Math.hypot(offsetX, offsetY) > radius + 0.01)
|
|
1703
|
-
continue;
|
|
1704
|
-
const sampleX = clampInt(x + offsetX, 0, width - 1);
|
|
1705
|
-
const sampleY = clampInt(y + offsetY, 0, height - 1);
|
|
1706
|
-
if (mask[sampleY * width + sampleX] !== 0) {
|
|
1707
|
-
outlined = true;
|
|
1708
|
-
break;
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
if (outlined)
|
|
1713
|
-
output[y * width + x] = 255;
|
|
1714
|
-
}
|
|
1715
|
-
}
|
|
1716
|
-
return output;
|
|
1717
|
-
}
|
|
1718
|
-
export function writePostProcessPixels(device, source, target, pixels) {
|
|
1719
|
-
if (!target) {
|
|
1720
|
-
if (!device.presentRenderTarget) {
|
|
1721
|
-
throw new RenderDeviceError("Post-process presentation requires a render device with presentRenderTarget support", "POSTPROCESS_PRESENT_UNSUPPORTED", {
|
|
1722
|
-
source: source.label
|
|
1723
|
-
});
|
|
1724
|
-
}
|
|
1725
|
-
const presentationTarget = device.createRenderTarget({
|
|
1726
|
-
width: source.width,
|
|
1727
|
-
height: source.height,
|
|
1728
|
-
label: `${source.label}-postprocess-present`,
|
|
1729
|
-
format: "rgba8",
|
|
1730
|
-
depth: false
|
|
1731
|
-
});
|
|
1732
|
-
try {
|
|
1733
|
-
if (!device.writeRenderTargetPixels) {
|
|
1734
|
-
throw new RenderDeviceError("Post-process presentation requires a render device with writeRenderTargetPixels support", "POSTPROCESS_WRITE_UNSUPPORTED", {
|
|
1735
|
-
source: source.label
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
device.writeRenderTargetPixels(presentationTarget, pixels);
|
|
1739
|
-
device.presentRenderTarget(presentationTarget);
|
|
1740
|
-
}
|
|
1741
|
-
finally {
|
|
1742
|
-
presentationTarget.dispose();
|
|
1743
|
-
}
|
|
1744
|
-
return;
|
|
1745
|
-
}
|
|
1746
|
-
if (target.width !== source.width || target.height !== source.height) {
|
|
1747
|
-
throw new Error("Post-process source and target dimensions must match.");
|
|
1748
|
-
}
|
|
1749
|
-
if (device.writeRenderTargetPixels) {
|
|
1750
|
-
device.writeRenderTargetPixels(target, pixels);
|
|
1751
|
-
}
|
|
1752
|
-
else {
|
|
1753
|
-
const writable = target;
|
|
1754
|
-
if (writable.colorPixels) {
|
|
1755
|
-
writable.colorPixels.set(pixels);
|
|
1756
|
-
}
|
|
1757
|
-
else {
|
|
1758
|
-
throw new RenderDeviceError("Post-process target does not support byte pixel writes", "POSTPROCESS_WRITE_UNSUPPORTED", {
|
|
1759
|
-
target: target.label
|
|
1760
|
-
});
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
device.setRenderTarget(target);
|
|
1764
|
-
}
|
|
1765
|
-
function writeDepthTarget(target, width, height, pixels) {
|
|
1766
|
-
if (!target)
|
|
1767
|
-
return;
|
|
1768
|
-
if (target.width !== width || target.height !== height) {
|
|
1769
|
-
throw new Error("Depth visualization target dimensions must match source depth texture.");
|
|
1770
|
-
}
|
|
1771
|
-
const writable = target;
|
|
1772
|
-
if (writable.colorPixels) {
|
|
1773
|
-
writable.colorPixels.set(pixels);
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
function writeRenderTarget(device, source, target, pixels) {
|
|
1777
|
-
writePostProcessPixels(device, source, target, pixels);
|
|
1778
|
-
}
|
|
1779
|
-
function encodeToneMappedChannel(value, exposure, whitePoint, gamma, operator, outputColorSpace) {
|
|
1780
|
-
return encodeColorByte(applyToneMapping(value, exposure, whitePoint, operator), gamma, outputColorSpace);
|
|
1781
|
-
}
|
|
1782
|
-
function finiteHdrChannel(value, index) {
|
|
1783
|
-
if (!Number.isFinite(value)) {
|
|
1784
|
-
throw new Error(`HDR tone mapping input contains non-finite float value at channel ${index}.`);
|
|
1785
|
-
}
|
|
1786
|
-
return Math.max(0, value);
|
|
1787
|
-
}
|
|
1788
|
-
function applyToneMapping(value, exposure, whitePoint, operator) {
|
|
1789
|
-
const exposed = Math.max(0, value * exposure) / whitePoint;
|
|
1790
|
-
return operator === "linear"
|
|
1791
|
-
? Math.min(1, exposed)
|
|
1792
|
-
: operator === "reinhard"
|
|
1793
|
-
? exposed / (1 + exposed)
|
|
1794
|
-
: operator === "aces"
|
|
1795
|
-
? aces(exposed)
|
|
1796
|
-
: operator === "filmic"
|
|
1797
|
-
? filmic(exposed)
|
|
1798
|
-
: operator === "uncharted2"
|
|
1799
|
-
? uncharted2(exposed)
|
|
1800
|
-
: operator === "agx"
|
|
1801
|
-
? agx(exposed)
|
|
1802
|
-
: neutral(exposed);
|
|
1803
|
-
}
|
|
1804
|
-
function decodeColorByte(value, colorSpace) {
|
|
1805
|
-
const normalized = Math.max(0, Math.min(1, value / 255));
|
|
1806
|
-
if (colorSpace === "linear")
|
|
1807
|
-
return normalized;
|
|
1808
|
-
if (normalized <= 0.04045)
|
|
1809
|
-
return normalized / 12.92;
|
|
1810
|
-
return Math.pow((normalized + 0.055) / 1.055, 2.4);
|
|
1811
|
-
}
|
|
1812
|
-
function encodeColorByte(value, gamma, colorSpace) {
|
|
1813
|
-
const linear = Math.max(0, Math.min(1, value));
|
|
1814
|
-
if (colorSpace === "linear") {
|
|
1815
|
-
return clampByte(linear * 255);
|
|
1816
|
-
}
|
|
1817
|
-
const encoded = linear <= 0.0031308
|
|
1818
|
-
? linear * 12.92
|
|
1819
|
-
: 1.055 * Math.pow(linear, 1 / 2.4) - 0.055;
|
|
1820
|
-
return clampByte(encoded * 255);
|
|
1821
|
-
}
|
|
1822
|
-
function aces(value) {
|
|
1823
|
-
return (value * (2.51 * value + 0.03)) / (value * (2.43 * value + 0.59) + 0.14);
|
|
1824
|
-
}
|
|
1825
|
-
function acesFilmicRgb(color, exposure, whitePoint) {
|
|
1826
|
-
const scale = exposure / Math.max(0.0001, whitePoint) / 0.6;
|
|
1827
|
-
const input = [color[0] * scale, color[1] * scale, color[2] * scale];
|
|
1828
|
-
const aces = [
|
|
1829
|
-
0.59719 * input[0] + 0.35458 * input[1] + 0.04823 * input[2],
|
|
1830
|
-
0.07600 * input[0] + 0.90834 * input[1] + 0.01566 * input[2],
|
|
1831
|
-
0.02840 * input[0] + 0.13383 * input[1] + 0.83777 * input[2]
|
|
1832
|
-
].map(acesRrtAndOdtFit);
|
|
1833
|
-
return [
|
|
1834
|
-
Math.max(0, Math.min(1, 1.60475 * aces[0] - 0.53108 * aces[1] - 0.07367 * aces[2])),
|
|
1835
|
-
Math.max(0, Math.min(1, -0.10208 * aces[0] + 1.10813 * aces[1] - 0.00605 * aces[2])),
|
|
1836
|
-
Math.max(0, Math.min(1, -0.00327 * aces[0] - 0.07276 * aces[1] + 1.07602 * aces[2]))
|
|
1837
|
-
];
|
|
1838
|
-
}
|
|
1839
|
-
function acesRrtAndOdtFit(value) {
|
|
1840
|
-
return (value * (value + 0.0245786) - 0.000090537) / (value * (0.983729 * value + 0.4329510) + 0.238081);
|
|
1841
|
-
}
|
|
1842
|
-
function filmic(value) {
|
|
1843
|
-
const x = Math.max(0, value);
|
|
1844
|
-
const toe = Math.max(0, x - 0.004);
|
|
1845
|
-
const curve = (toe * (6.2 * toe + 0.5)) / (toe * (6.2 * toe + 1.7) + 0.06);
|
|
1846
|
-
return Math.min(curve, x * 1.08);
|
|
1847
|
-
}
|
|
1848
|
-
function uncharted2(value) {
|
|
1849
|
-
const a = 0.15;
|
|
1850
|
-
const b = 0.5;
|
|
1851
|
-
const c = 0.1;
|
|
1852
|
-
const d = 0.2;
|
|
1853
|
-
const e = 0.02;
|
|
1854
|
-
const f = 0.3;
|
|
1855
|
-
const w = 11.2;
|
|
1856
|
-
const curve = (x) => ((x * (a * x + c * b) + d * e) / (x * (a * x + b) + d * f)) - e / f;
|
|
1857
|
-
return Math.max(0, Math.min(1, curve(value * 2) / curve(w)));
|
|
1858
|
-
}
|
|
1859
|
-
function agx(value) {
|
|
1860
|
-
const x = Math.max(0, value);
|
|
1861
|
-
const logEncoded = Math.log2(1 + x) / Math.log2(1 + 16);
|
|
1862
|
-
const shaped = logEncoded * logEncoded * (3 - 2 * logEncoded);
|
|
1863
|
-
return Math.max(0, Math.min(1, shaped));
|
|
1864
|
-
}
|
|
1865
|
-
function neutral(value) {
|
|
1866
|
-
const x = Math.max(0, value);
|
|
1867
|
-
return Math.min(1, (x * (1 + x / 7.5)) / (1 + x));
|
|
1868
|
-
}
|
|
1869
|
-
function createToneMappingPreset(name, label, options) {
|
|
1870
|
-
return {
|
|
1871
|
-
name,
|
|
1872
|
-
label,
|
|
1873
|
-
toneMapping: {
|
|
1874
|
-
exposure: options.exposure ?? 1,
|
|
1875
|
-
whitePoint: options.whitePoint ?? 1,
|
|
1876
|
-
gamma: options.gamma ?? 2.2,
|
|
1877
|
-
operator: options.operator ?? "reinhard",
|
|
1878
|
-
inputColorSpace: options.inputColorSpace ?? "linear",
|
|
1879
|
-
// Display presets feed display-referred chains (public composer, parity
|
|
1880
|
-
// probes): linear-out crushed every preset to near-black (5 buckets on
|
|
1881
|
-
// the comprehensive fixture). Explicit overrides still win.
|
|
1882
|
-
outputColorSpace: options.outputColorSpace ?? "srgb"
|
|
1883
|
-
},
|
|
1884
|
-
colorGrade: {
|
|
1885
|
-
contrast: options.contrast ?? 1,
|
|
1886
|
-
temperature: options.temperature ?? 0,
|
|
1887
|
-
tint: options.tint ?? 0,
|
|
1888
|
-
saturation: options.saturation ?? 1,
|
|
1889
|
-
vibrance: options.vibrance ?? 0,
|
|
1890
|
-
vignette: options.vignette ?? 0,
|
|
1891
|
-
sharpening: options.sharpening ?? 0
|
|
1892
|
-
},
|
|
1893
|
-
autoExposure: options.autoExposure,
|
|
1894
|
-
adaptationSpeed: options.adaptationSpeed ?? 0.5,
|
|
1895
|
-
minExposure: options.minExposure ?? 0.1,
|
|
1896
|
-
maxExposure: options.maxExposure ?? 10
|
|
1897
|
-
};
|
|
1898
|
-
}
|
|
1899
|
-
function validateHistogramOptions(binCount, minLuminance, maxLuminance) {
|
|
1900
|
-
if (!Number.isInteger(binCount) || binCount < 4 || binCount > 1024) {
|
|
1901
|
-
throw new Error("Exposure histogram binCount must be an integer in [4, 1024].");
|
|
1902
|
-
}
|
|
1903
|
-
validateRange(minLuminance, 0.000001, 128, "Exposure histogram minLuminance");
|
|
1904
|
-
validateRange(maxLuminance, minLuminance, 1024, "Exposure histogram maxLuminance");
|
|
1905
|
-
}
|
|
1906
|
-
function histogramAverageFromBins(histogram) {
|
|
1907
|
-
const logMin = Math.log2(histogram.minLuminance);
|
|
1908
|
-
const logMax = Math.log2(histogram.maxLuminance);
|
|
1909
|
-
let weighted = 0;
|
|
1910
|
-
let count = 0;
|
|
1911
|
-
for (let index = 0; index < histogram.binCount; index += 1) {
|
|
1912
|
-
const binValue = histogram.bins[index] ?? 0;
|
|
1913
|
-
const t = histogram.binCount <= 1 ? 0 : index / (histogram.binCount - 1);
|
|
1914
|
-
const luminance = Math.pow(2, logMin + (logMax - logMin) * t);
|
|
1915
|
-
weighted += luminance * binValue;
|
|
1916
|
-
count += binValue;
|
|
1917
|
-
}
|
|
1918
|
-
return count > 0 ? weighted / count : 0.18;
|
|
1919
|
-
}
|
|
1920
|
-
function noise2d(x, y, seed) {
|
|
1921
|
-
let value = (x + 1) * 374761393 + (y + 1) * 668265263 + seed * 2147483647;
|
|
1922
|
-
value = (value ^ (value >>> 13)) * 1274126177;
|
|
1923
|
-
return ((value ^ (value >>> 16)) >>> 0) / 0xffffffff;
|
|
1924
|
-
}
|
|
1925
|
-
function sharpenPixels(pixels, width, height, amount) {
|
|
1926
|
-
const output = new Uint8Array(pixels);
|
|
1927
|
-
let sharpenedPixels = 0;
|
|
1928
|
-
for (let y = 1; y < height - 1; y += 1) {
|
|
1929
|
-
for (let x = 1; x < width - 1; x += 1) {
|
|
1930
|
-
const index = (y * width + x) * 4;
|
|
1931
|
-
for (let channel = 0; channel < 3; channel += 1) {
|
|
1932
|
-
const center = pixels[index + channel] ?? 0;
|
|
1933
|
-
const blur = ((pixels[index - 4 + channel] ?? 0) +
|
|
1934
|
-
(pixels[index + 4 + channel] ?? 0) +
|
|
1935
|
-
(pixels[index - width * 4 + channel] ?? 0) +
|
|
1936
|
-
(pixels[index + width * 4 + channel] ?? 0)) / 4;
|
|
1937
|
-
output[index + channel] = clampByte(center + (center - blur) * amount);
|
|
1938
|
-
}
|
|
1939
|
-
if (Math.abs(output[index] - (pixels[index] ?? 0)) + Math.abs(output[index + 1] - (pixels[index + 1] ?? 0)) + Math.abs(output[index + 2] - (pixels[index + 2] ?? 0)) > 3) {
|
|
1940
|
-
sharpenedPixels += 1;
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
}
|
|
1944
|
-
return { pixels: output, sharpenedPixels };
|
|
1945
|
-
}
|
|
1946
|
-
function countChangedRgb(before, after) {
|
|
1947
|
-
let count = 0;
|
|
1948
|
-
for (let index = 0; index < before.length; index += 4) {
|
|
1949
|
-
if (Math.abs((before[index] ?? 0) - (after[index] ?? 0)) + Math.abs((before[index + 1] ?? 0) - (after[index + 1] ?? 0)) + Math.abs((before[index + 2] ?? 0) - (after[index + 2] ?? 0)) > 3)
|
|
1950
|
-
count += 1;
|
|
1951
|
-
}
|
|
1952
|
-
return count;
|
|
1953
|
-
}
|
|
1954
|
-
function validateRange(value, min, max, label) {
|
|
1955
|
-
if (!Number.isFinite(value) || value < min || value > max) {
|
|
1956
|
-
throw new Error(`${label} must be finite and within [${min}, ${max}].`);
|
|
1957
|
-
}
|
|
1958
|
-
}
|
|
1959
|
-
function numberInRange(value, min, max, label) {
|
|
1960
|
-
validateRange(value, min, max, label);
|
|
1961
|
-
return value;
|
|
1962
|
-
}
|
|
1963
|
-
function integerNumberInRange(value, min, max, label) {
|
|
1964
|
-
validateRange(value, min, max, label);
|
|
1965
|
-
if (!Number.isInteger(value))
|
|
1966
|
-
throw new Error(`${label} must be an integer.`);
|
|
1967
|
-
return value;
|
|
1968
|
-
}
|
|
1969
|
-
function clampByte(value) {
|
|
1970
|
-
return Math.round(Math.max(0, Math.min(255, value)));
|
|
1971
|
-
}
|
|
1972
|
-
/** 2x2 Bayer ordered dither in [-0.5, 0.5]; A5 one-LSB anti-banding. */
|
|
1973
|
-
function bayer2(x, y) {
|
|
1974
|
-
const index = ((y & 1) << 1) | (x & 1);
|
|
1975
|
-
return (index === 0 ? -0.375 : index === 1 ? 0.375 : index === 2 ? -0.125 : 0.125);
|
|
1976
|
-
}
|
|
1977
|
-
function clampInt(value, min, max) {
|
|
1978
|
-
return Math.min(max, Math.max(min, value));
|
|
1979
|
-
}
|
|
1980
|
-
function lumaAt(pixels, width, height, x, y) {
|
|
1981
|
-
const sampleX = clampInt(x, 0, width - 1);
|
|
1982
|
-
const sampleY = clampInt(y, 0, height - 1);
|
|
1983
|
-
const index = (sampleY * width + sampleX) * 4;
|
|
1984
|
-
return (0.2126 * pixels[index] + 0.7152 * pixels[index + 1] + 0.0722 * pixels[index + 2]) / 255;
|
|
1985
|
-
}
|
|
1986
|
-
/** Integer luma numerator at a clamped coordinate, matching the outline shader exactly. */
|
|
1987
|
-
function lumaNumeratorAt(pixels, width, height, x, y) {
|
|
1988
|
-
const sampleX = clampInt(x, 0, width - 1);
|
|
1989
|
-
const sampleY = clampInt(y, 0, height - 1);
|
|
1990
|
-
const index = (sampleY * width + sampleX) * 4;
|
|
1991
|
-
return 2126 * pixels[index] + 7152 * pixels[index + 1] + 722 * pixels[index + 2];
|
|
1992
|
-
}
|
|
1993
|
-
function channelAt(pixels, width, height, x, y, channel) {
|
|
1994
|
-
const sampleX = clampInt(x, 0, width - 1);
|
|
1995
|
-
const sampleY = clampInt(y, 0, height - 1);
|
|
1996
|
-
return pixels[(sampleY * width + sampleX) * 4 + channel];
|
|
1997
|
-
}
|
|
1998
|
-
function normalizeContactShadowDirection(direction) {
|
|
1999
|
-
const [x, y] = direction;
|
|
2000
|
-
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
2001
|
-
throw new Error("Contact shadow direction must contain finite x/y values.");
|
|
2002
|
-
}
|
|
2003
|
-
const length = Math.hypot(x, y);
|
|
2004
|
-
if (length < 0.0001) {
|
|
2005
|
-
throw new Error("Contact shadow direction must not be zero length.");
|
|
2006
|
-
}
|
|
2007
|
-
return [x / length, y / length];
|
|
2008
|
-
}
|
|
2009
|
-
function depthAt(texture, x, y) {
|
|
2010
|
-
const sampleX = clampInt(x, 0, texture.width - 1);
|
|
2011
|
-
const sampleY = clampInt(y, 0, texture.height - 1);
|
|
2012
|
-
return texture.data[sampleY * texture.width + sampleX];
|
|
2013
|
-
}
|
|
2014
|
-
function isDepthEdge(texture, x, y, edgeThreshold) {
|
|
2015
|
-
const center = depthAt(texture, x, y);
|
|
2016
|
-
const delta = Math.max(Math.abs(center - depthAt(texture, x + 1, y)), Math.abs(center - depthAt(texture, x - 1, y)), Math.abs(center - depthAt(texture, x, y + 1)), Math.abs(center - depthAt(texture, x, y - 1)));
|
|
2017
|
-
return delta >= edgeThreshold;
|
|
2018
|
-
}
|
|
8
|
+
export * from "./reference/PostProcessPass.js";
|
|
2019
9
|
//# sourceMappingURL=PostProcessPass.js.map
|