@aura3d/rendering 3.0.0 → 4.0.0
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/CascadedShadowMaps.d.ts.map +1 -1
- package/dist/CascadedShadowMaps.js +3 -1
- package/dist/CascadedShadowMaps.js.map +1 -1
- 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/ExtensionScalarAtlas.d.ts +18 -0
- package/dist/ExtensionScalarAtlas.d.ts.map +1 -0
- package/dist/ExtensionScalarAtlas.js +107 -0
- package/dist/ExtensionScalarAtlas.js.map +1 -0
- package/dist/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/LeanWebGL2Device.d.ts +265 -0
- package/dist/LeanWebGL2Device.d.ts.map +1 -0
- package/dist/LeanWebGL2Device.js +4001 -0
- package/dist/LeanWebGL2Device.js.map +1 -0
- package/dist/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 +92 -2
- 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/PlanarReflection.d.ts +2 -2
- package/dist/PlanarReflection.js +3 -3
- package/dist/PlanarReflection.js.map +1 -1
- package/dist/PostProcessPass.d.ts +8 -473
- package/dist/PostProcessPass.d.ts.map +1 -1
- package/dist/PostProcessPass.js +6 -1984
- 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/ProjectionMath.d.ts +3 -0
- package/dist/ProjectionMath.d.ts.map +1 -0
- package/dist/ProjectionMath.js +26 -0
- package/dist/ProjectionMath.js.map +1 -0
- package/dist/ReflectionProbe.d.ts.map +1 -1
- package/dist/ReflectionProbe.js +4 -1
- package/dist/ReflectionProbe.js.map +1 -1
- package/dist/ReflectionSurfaces.d.ts +4 -1
- package/dist/ReflectionSurfaces.d.ts.map +1 -1
- package/dist/ReflectionSurfaces.js +10 -1
- package/dist/ReflectionSurfaces.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 +97 -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 +270 -66
- package/dist/Renderer.d.ts.map +1 -1
- package/dist/Renderer.js +970 -1249
- package/dist/Renderer.js.map +1 -1
- package/dist/RendererPostprocessPlan.d.ts +20 -3
- package/dist/RendererPostprocessPlan.d.ts.map +1 -1
- package/dist/RendererPostprocessPlan.js +32 -4
- 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/ScreenSpaceReflectionPass.d.ts +43 -0
- package/dist/ScreenSpaceReflectionPass.d.ts.map +1 -0
- package/dist/ScreenSpaceReflectionPass.js +58 -0
- package/dist/ScreenSpaceReflectionPass.js.map +1 -0
- package/dist/ShaderLibrary.d.ts.map +1 -1
- package/dist/ShaderLibrary.js +183 -207
- package/dist/ShaderLibrary.js.map +1 -1
- package/dist/ShaderLibraryCore.d.ts +3 -0
- package/dist/ShaderLibraryCore.d.ts.map +1 -1
- package/dist/ShaderLibraryCore.js +6 -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 +70 -0
- package/dist/TemporalHistory.d.ts.map +1 -0
- package/dist/TemporalHistory.js +218 -0
- package/dist/TemporalHistory.js.map +1 -0
- package/dist/TemporalMath.d.ts +3 -0
- package/dist/TemporalMath.d.ts.map +1 -0
- package/dist/TemporalMath.js +9 -0
- package/dist/TemporalMath.js.map +1 -0
- package/dist/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 +27 -0
- package/dist/TexturedPBRMaterial.d.ts.map +1 -1
- package/dist/TexturedPBRMaterial.js +137 -23
- 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 +159 -198
- package/dist/WebGL2Device.d.ts.map +1 -1
- package/dist/WebGL2Device.js +797 -3443
- 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 +16 -9
- package/dist/WebGPUDevice.d.ts.map +1 -1
- package/dist/WebGPUDevice.js +343 -618
- package/dist/WebGPUDevice.js.map +1 -1
- package/dist/WebGPUExtensionAtlas.d.ts +6 -0
- package/dist/WebGPUExtensionAtlas.d.ts.map +1 -0
- package/dist/WebGPUExtensionAtlas.js +225 -0
- package/dist/WebGPUExtensionAtlas.js.map +1 -0
- package/dist/WebGPUSkinningLimits.d.ts +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/GPUParticleBackend.d.ts +4 -2
- package/dist/effects/GPUParticleBackend.d.ts.map +1 -1
- package/dist/effects/GPUParticleBackend.js +20 -2
- package/dist/effects/GPUParticleBackend.js.map +1 -1
- package/dist/effects/ResidentGPUParticleRenderer.d.ts +158 -0
- package/dist/effects/ResidentGPUParticleRenderer.d.ts.map +1 -0
- package/dist/effects/ResidentGPUParticleRenderer.js +576 -0
- package/dist/effects/ResidentGPUParticleRenderer.js.map +1 -0
- package/dist/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/extension-scalar-atlas.d.ts +3 -0
- package/dist/extension-scalar-atlas.d.ts.map +1 -0
- package/dist/extension-scalar-atlas.js +2 -0
- package/dist/extension-scalar-atlas.js.map +1 -0
- package/dist/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 -57
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -51
- 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/lean/LeanProductionRenderer.d.ts.map +1 -1
- package/dist/lean/LeanProductionRenderer.js +2 -2
- package/dist/lean/LeanProductionRenderer.js.map +1 -1
- package/dist/lean-core-runtime.d.ts +13 -0
- package/dist/lean-core-runtime.d.ts.map +1 -0
- package/dist/lean-core-runtime.js +10 -0
- package/dist/lean-core-runtime.js.map +1 -0
- package/dist/materials/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 +119 -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 +51 -1
- package/dist/postprocess/NativeBloomPyramid.d.ts.map +1 -1
- package/dist/postprocess/NativeBloomPyramid.js +88 -1
- 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 +17 -6
- package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts +3 -0
- package/dist/production-runtime/ProductionRuntimeRenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js +8 -1
- package/dist/production-runtime/ProductionRuntimeRenderer.js.map +1 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts +4 -0
- package/dist/production-runtime/ProductionWebGL2Renderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGL2Renderer.js +15 -0
- package/dist/production-runtime/ProductionWebGL2Renderer.js.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts +11 -5
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.js +38 -47
- 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/framegraph/FrameGraph.d.ts +4 -2
- package/dist/production-runtime/framegraph/FrameGraph.d.ts.map +1 -1
- package/dist/production-runtime/framegraph/FrameGraph.js +62 -4
- package/dist/production-runtime/framegraph/FrameGraph.js.map +1 -1
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts +32 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.d.ts.map +1 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js +111 -0
- package/dist/production-runtime/framegraph/NativeFrameGraphBindings.js.map +1 -0
- package/dist/production-runtime/framegraph/RenderPass.d.ts +23 -0
- package/dist/production-runtime/framegraph/RenderPass.d.ts.map +1 -1
- package/dist/production-runtime/framegraph/RenderPass.js +87 -1
- package/dist/production-runtime/framegraph/RenderPass.js.map +1 -1
- package/dist/production-runtime/index.d.ts +8 -6
- package/dist/production-runtime/index.d.ts.map +1 -1
- package/dist/production-runtime/index.js +10 -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/DepthPrepass.d.ts +4 -12
- package/dist/production-runtime/passes/DepthPrepass.d.ts.map +1 -1
- package/dist/production-runtime/passes/DepthPrepass.js +3 -11
- package/dist/production-runtime/passes/DepthPrepass.js.map +1 -1
- package/dist/production-runtime/passes/FramegraphTopology.js +1 -1
- package/dist/production-runtime/passes/FramegraphTopology.js.map +1 -1
- package/dist/production-runtime/passes/OpaquePass.d.ts +3 -8
- package/dist/production-runtime/passes/OpaquePass.d.ts.map +1 -1
- package/dist/production-runtime/passes/OpaquePass.js +3 -1
- package/dist/production-runtime/passes/OpaquePass.js.map +1 -1
- package/dist/production-runtime/passes/ShadowPass.d.ts +3 -8
- package/dist/production-runtime/passes/ShadowPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ShadowPass.js +2 -0
- package/dist/production-runtime/passes/ShadowPass.js.map +1 -1
- package/dist/production-runtime/passes/SkyboxPass.d.ts +3 -7
- package/dist/production-runtime/passes/SkyboxPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/SkyboxPass.js +2 -0
- package/dist/production-runtime/passes/SkyboxPass.js.map +1 -1
- package/dist/production-runtime/passes/ToneMappingPass.d.ts +7 -10
- package/dist/production-runtime/passes/ToneMappingPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/ToneMappingPass.js +9 -0
- package/dist/production-runtime/passes/ToneMappingPass.js.map +1 -1
- package/dist/production-runtime/passes/TransparentPass.d.ts +4 -9
- package/dist/production-runtime/passes/TransparentPass.d.ts.map +1 -1
- package/dist/production-runtime/passes/TransparentPass.js +6 -1
- package/dist/production-runtime/passes/TransparentPass.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 +2020 -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/reflection-surfaces.d.ts +5 -0
- package/dist/reflection-surfaces.d.ts.map +1 -0
- package/dist/reflection-surfaces.js +3 -0
- package/dist/reflection-surfaces.js.map +1 -0
- package/dist/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 +741 -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 +113 -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 +2477 -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 +303 -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 +2 -3
- package/dist/webgpu/WebGPUPostShaders.d.ts.map +1 -1
- package/dist/webgpu/WebGPUPostShaders.js +35 -5
- package/dist/webgpu/WebGPUPostShaders.js.map +1 -1
- package/dist/webgpu/WebGPUTemporal.d.ts +17 -0
- package/dist/webgpu/WebGPUTemporal.d.ts.map +1 -0
- package/dist/webgpu/WebGPUTemporal.js +64 -0
- package/dist/webgpu/WebGPUTemporal.js.map +1 -0
- package/dist/webgpu/WebGPUTexture.d.ts +1 -0
- package/dist/webgpu/WebGPUTexture.d.ts.map +1 -1
- package/dist/webgpu/WebGPUTexture.js.map +1 -1
- package/dist/webgpu.d.ts +6 -0
- package/dist/webgpu.d.ts.map +1 -1
- package/dist/webgpu.js +4 -0
- package/dist/webgpu.js.map +1 -1
- package/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 +40 -7
package/dist/Renderer.js
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import { collectEnvironmentBackground, collectEnvironmentFog, collectEnvironmentLighting } from "./renderer/Background.js";
|
|
2
|
+
import { applyRendererOwnedStaticBatching, applyRendererOwnedStaticMeshConsolidation, cullExplicitRenderItems, culledCastersReachingView, explicitCullingFrustum } from "./renderer/CullingBatching.js";
|
|
3
|
+
import { rendererDeviceIsLost, subscribeRendererDeviceLost, subscribeRendererDeviceRestored } from "./renderer/DeviceLifecycle.js";
|
|
4
|
+
import { createRendererFrameHooks, toFrameCamera } from "./renderer/FrameGraph.js";
|
|
5
|
+
import { RendererPostprocessPipeline, collectPostprocess, createPostprocessDiagnostics, defaultPostprocessTargetFormat, postGraphV2LastOutcome, postprocessRequiresDepthTexture } from "./renderer/PostprocessExecution.js";
|
|
6
|
+
import { createRenderer } from "./renderer/RendererFactory.js";
|
|
7
|
+
import { collectItemBounds, isIterable, renderableWorldBounds, sceneFromSource, toMat4 } from "./renderer/RenderShared.js";
|
|
8
|
+
import { RendererShadowOrchestrator, collectForwardShadowMap, collectRendererShadowOptions } from "./renderer/ShadowOrchestration.js";
|
|
9
|
+
import { shadowFrameCamera } from "./shadows/Prd02ShadowBridge.js";
|
|
10
|
+
import {} from "./contracts/renderSource.js";
|
|
1
11
|
import { Bounds3 as SceneBounds3, Camera, DirectionalLight, Light, PerspectiveCamera, PointLight, Scene, SpotLight, identityMat4, invertMat4, multiplyMat4, orthographicMat4, perspectiveMat4, transformPoint, toMathMat4 } from "@aura3d/scene";
|
|
2
12
|
import { Frustum } from "@aura3d/math";
|
|
3
13
|
import { createRenderDevice } from "./RenderBackend.js";
|
|
@@ -11,16 +21,42 @@ import {} from "./MorphTarget.js";
|
|
|
11
21
|
import { computeSkinnedGeometryBounds, computeSkinnedMorphTargetWeightedBounds } from "./SkinningBounds.js";
|
|
12
22
|
import { RenderGraph } from "./RenderGraph.js";
|
|
13
23
|
import { BloomPass, FXAAPass, ToneMappingPass, bloomFloatPixels, bloomPixels, chromaticAberrationPixels, colorGradePixels, contactShadowPixels, createDepthTextureBinding, depthOfFieldPixels, filmGrainPixels, fusedLdrPostprocessPixels, fxaaPixels, motionBlurPixels, outlinePixels, ssaoPixels, ssrPixels, taaPixels, toneMapFloatPixels, toneMapPixels, volumetricLightPixels, writePostProcessPixels } from "./PostProcessPass.js";
|
|
14
|
-
import { createRendererPostprocessPasses, createRendererPostprocessPlanDiagnostics } from "./RendererPostprocessPlan.js";
|
|
24
|
+
import { bindRendererSsrProjection, createRendererPostprocessPasses, createRendererPostprocessPlanDiagnostics } from "./RendererPostprocessPlan.js";
|
|
15
25
|
import { ShadowMap } from "./ShadowMap.js";
|
|
16
26
|
import { ShadowPass } from "./ShadowPass.js";
|
|
17
27
|
import { Sampler } from "./Sampler.js";
|
|
18
28
|
import {} from "./Texture.js";
|
|
19
29
|
import { TextureBinding } from "./TextureBinding.js";
|
|
20
30
|
import { computeOrthographicCameraFrame, computePerspectiveCameraFrame } from "./CameraFraming.js";
|
|
31
|
+
import { ResolutionGovernor } from "./ResolutionGovernor.js";
|
|
32
|
+
import { frameStatsSlot } from "./contracts/device.js";
|
|
33
|
+
import { resolveCanvasPixelRatio, watchDevicePixelRatio } from "./renderer/PixelRatio.js";
|
|
34
|
+
import { QUALITY_TIERS } from "./contracts/quality.js";
|
|
35
|
+
import { prd11LiveQualityTier } from "./quality/liveTier.js";
|
|
36
|
+
import { MaterialInstance } from "./MaterialInstance.js";
|
|
37
|
+
import { featuresForGeometry, materialRoutesToGeneratedProgram } from "./program/MaterialFeatures.js";
|
|
38
|
+
import { selectShaderFeatureBits } from "./program/FeatureSelect.js";
|
|
39
|
+
import { collectWarmupFeatures, ProgramWarmup } from "./program/ProgramWarmup.js";
|
|
40
|
+
import { PRD03_EXPOSURE, rendererQrFlags, setRendererQrFlags, withRendererQrFlags } from "./renderer/FrameGraph.js";
|
|
41
|
+
import { consumeTaaHistoryWritten } from "./renderer/postSkipped.js";
|
|
42
|
+
import { qrCoreGeneratorOn, qrCoreOutputOn, qrGeneratedProgramsOn, qrMaterialsLobeProgramsOn, rendererOutputPass, rendererProgramCache } from "./renderer/qrSubFlags.js";
|
|
43
|
+
import { resolveCoreOutputPostRoute, withCoreOutputOff } from "./renderer/coreOutputPostRoute.js";
|
|
44
|
+
import { forwardPassFeatureAxes, prd02IblEnvironmentAvailable, splitForwardItems } from "./ForwardPass.js";
|
|
45
|
+
import { PRD02_IBL_FEATURE } from "./contracts/environment.js";
|
|
46
|
+
import { InterleavedTransparentPass } from "./renderer/InterleavedTransparentPass.js";
|
|
47
|
+
import { ensureSceneDepthCopyTarget, SceneDepthCopyPass } from "./renderer/SceneDepthCopyPass.js";
|
|
48
|
+
import { probeHdrTargetFormat, DEFAULT_TONE_MAPPING } from "./contracts/output.js";
|
|
49
|
+
import { resolveForwardClusteredLighting } from "./forward/Lighting.js";
|
|
21
50
|
import { assertRendererFeatures, createRendererFeatureReport } from "./RendererFeatureGates.js";
|
|
22
51
|
import { batchStaticRenderItems } from "./SceneOptimization.js";
|
|
23
52
|
import { createStaticMeshConsolidationCache } from "./MeshConsolidation.js";
|
|
53
|
+
/**
|
|
54
|
+
* C-05 (PRD-01 §8.4-§8.6): output configuration applied by the OutputPass
|
|
55
|
+
* under `A3D_QR_CORE_OUTPUT`. Flag-off: recorded but never applied (legacy
|
|
56
|
+
* present path is untouched).
|
|
57
|
+
*/
|
|
58
|
+
/** #1140: OutputPass dithering default (three.js parity); `output.dithering` overrides. */
|
|
59
|
+
export const DEFAULT_OUTPUT_DITHERING = false;
|
|
24
60
|
export const DEFAULT_RENDERER_AUTO_FRAME_OPTIONS = {
|
|
25
61
|
paddingRatio: 0.14,
|
|
26
62
|
yawRadians: -0.38,
|
|
@@ -28,32 +64,6 @@ export const DEFAULT_RENDERER_AUTO_FRAME_OPTIONS = {
|
|
|
28
64
|
nearPadding: 0.2,
|
|
29
65
|
farPadding: 2.4
|
|
30
66
|
};
|
|
31
|
-
export const DEFAULT_RENDERER_ENVIRONMENT_LIGHTING = {
|
|
32
|
-
color: [0.78, 0.8, 0.84],
|
|
33
|
-
intensity: 0.42,
|
|
34
|
-
proceduralMap: {
|
|
35
|
-
skyColor: [0.64, 0.76, 0.94],
|
|
36
|
-
horizonColor: [0.94, 0.82, 0.62],
|
|
37
|
-
groundColor: [0.12, 0.13, 0.15],
|
|
38
|
-
specularColor: [1, 0.94, 0.78],
|
|
39
|
-
intensity: 0.5,
|
|
40
|
-
specularIntensity: 0.82
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
const DISABLED_RENDERER_ENVIRONMENT_LIGHTING = {
|
|
44
|
-
color: [0, 0, 0],
|
|
45
|
-
intensity: 0,
|
|
46
|
-
proceduralMap: {
|
|
47
|
-
skyColor: [0, 0, 0],
|
|
48
|
-
horizonColor: [0, 0, 0],
|
|
49
|
-
groundColor: [0, 0, 0],
|
|
50
|
-
specularColor: [0, 0, 0],
|
|
51
|
-
intensity: 0,
|
|
52
|
-
specularIntensity: 0
|
|
53
|
-
},
|
|
54
|
-
environmentMapIntensity: 0,
|
|
55
|
-
environmentMapSpecularIntensity: 0
|
|
56
|
-
};
|
|
57
67
|
export const DEFAULT_RENDERER_DIRECT_LIGHTING = {
|
|
58
68
|
key: {
|
|
59
69
|
color: [1, 0.92, 0.78],
|
|
@@ -66,10 +76,12 @@ export const DEFAULT_RENDERER_DIRECT_LIGHTING = {
|
|
|
66
76
|
direction: [-0.35, -0.22, -0.91]
|
|
67
77
|
}
|
|
68
78
|
};
|
|
79
|
+
export { DEFAULT_RENDERER_ENVIRONMENT_LIGHTING } from "./renderer/Background.js";
|
|
69
80
|
export class Renderer {
|
|
70
81
|
device;
|
|
71
82
|
graph = new RenderGraph();
|
|
72
83
|
shaderLibrary;
|
|
84
|
+
host;
|
|
73
85
|
/**
|
|
74
86
|
* Depth target reused by the renderer-owned shadow pass across frames.
|
|
75
87
|
*
|
|
@@ -78,6 +90,10 @@ export class Renderer {
|
|
|
78
90
|
* still reallocates exactly once.
|
|
79
91
|
*/
|
|
80
92
|
shadowDepthTarget = null;
|
|
93
|
+
lastShadowEvidence = null;
|
|
94
|
+
submittedShadowFrameId = 0;
|
|
95
|
+
/** Actual shadow resources selected for the most recent submitted forward pass. */
|
|
96
|
+
getShadowEvidence() { return this.lastShadowEvidence; }
|
|
81
97
|
/**
|
|
82
98
|
* Forward-color target reused by the postprocess path across frames.
|
|
83
99
|
*
|
|
@@ -91,35 +107,197 @@ export class Renderer {
|
|
|
91
107
|
width;
|
|
92
108
|
height;
|
|
93
109
|
clearColor;
|
|
110
|
+
outputClearColor;
|
|
94
111
|
disposed = false;
|
|
95
112
|
animationLoop = null;
|
|
96
113
|
fusedLdrPostprocessScratch = {};
|
|
97
|
-
|
|
114
|
+
// §6.9 resolution policy state (present only when `options.resolution` is set).
|
|
115
|
+
resolutionOptions;
|
|
116
|
+
qualityTier;
|
|
117
|
+
qualityTierName;
|
|
118
|
+
programWarmup;
|
|
119
|
+
/** C-05 state: requested output options, the resolved HDR scene target, and the depth copy. */
|
|
120
|
+
outputOptions;
|
|
121
|
+
hdrSceneTarget = null;
|
|
122
|
+
hdrMsaaMrtDegraded = false;
|
|
123
|
+
sceneDepthCopyTarget = null;
|
|
124
|
+
lastAppliedOutput = null;
|
|
125
|
+
warnedV2Postprocess = false;
|
|
126
|
+
/** T0-07: C-36-shaped record of the last legacy postprocess chain skipped
|
|
127
|
+
* under A3D_QR_CORE_OUTPUT (`null` when nothing was skipped). Read by the
|
|
128
|
+
* engine's C-31 `output.postSkipped` section; routing through PostGraph v2
|
|
129
|
+
* is lane 03's Q-03-2/Q-03-3. */
|
|
130
|
+
lastPostSkipped = null;
|
|
131
|
+
get postSkipped() {
|
|
132
|
+
return this.lastPostSkipped;
|
|
133
|
+
}
|
|
134
|
+
warnPostLegacyRoute(record) {
|
|
135
|
+
if (this.warnedV2Postprocess)
|
|
136
|
+
return;
|
|
137
|
+
this.warnedV2Postprocess = true;
|
|
138
|
+
if (typeof console !== "undefined")
|
|
139
|
+
console.warn(`POSTPROCESS_V2_UNMIGRATED: ${record.message}`);
|
|
140
|
+
}
|
|
141
|
+
resolutionGovernor;
|
|
142
|
+
renderScaleCeiling = 1;
|
|
143
|
+
unsubscribeDprWatch;
|
|
144
|
+
/** C-28 FrameStats feeding the governor (intervalMs until lane 11's gpuMs lands). */
|
|
145
|
+
frameStatsMonitor;
|
|
146
|
+
/** PRD-02 S12: private graph for `renderProbeFace` (never the main frame graph). */
|
|
147
|
+
probeGraph;
|
|
148
|
+
constructor(device, options, temporalHistory) {
|
|
98
149
|
this.device = device;
|
|
150
|
+
if (options.qrFlags)
|
|
151
|
+
setRendererQrFlags(options.qrFlags, device);
|
|
152
|
+
this.temporalHistory = temporalHistory;
|
|
153
|
+
this.unsubscribeTemporalDeviceLoss = device.onDeviceLost?.(() => this.temporalHistory.dispose());
|
|
99
154
|
this.canvas = options.canvas;
|
|
100
155
|
this.width = options.width ?? inferInitialCanvasDimension(options.canvas, "width");
|
|
101
156
|
this.height = options.height ?? inferInitialCanvasDimension(options.canvas, "height");
|
|
102
157
|
this.clearColor = options.clearColor ?? [0, 0, 0, 1];
|
|
158
|
+
this.outputClearColor = options.outputClearColor;
|
|
159
|
+
this.outputOptions = options.output ?? {};
|
|
103
160
|
this.shaderLibrary = options.shaderLibrary;
|
|
161
|
+
this.host = {
|
|
162
|
+
device,
|
|
163
|
+
shaderLibrary: options.shaderLibrary,
|
|
164
|
+
fusedLdrPostprocessScratch: this.fusedLdrPostprocessScratch,
|
|
165
|
+
frameIndex: 0
|
|
166
|
+
};
|
|
167
|
+
const host = this.host;
|
|
168
|
+
Object.defineProperty(host, "width", { enumerable: true, get: () => this.width, set: (value) => { this.width = value; } });
|
|
169
|
+
Object.defineProperty(host, "height", { enumerable: true, get: () => this.height, set: (value) => { this.height = value; } });
|
|
170
|
+
Object.defineProperty(host, "shadowDepthTarget", { enumerable: true, get: () => this.shadowDepthTarget, set: (value) => { this.shadowDepthTarget = value; } });
|
|
171
|
+
this.host.post = new RendererPostprocessPipeline(this.host);
|
|
172
|
+
this.host.shadows = new RendererShadowOrchestrator(this.host);
|
|
173
|
+
this.resolutionOptions = options.resolution;
|
|
174
|
+
this.qualityTier = options.qualityTier;
|
|
175
|
+
this.qualityTierName = options.qualityTierName;
|
|
176
|
+
if (options.resolution !== undefined && options.resolution.dynamic !== false) {
|
|
177
|
+
this.resolutionGovernor = new ResolutionGovernor({
|
|
178
|
+
targetFrameMs: options.resolution.targetFrameMs ?? 16.7,
|
|
179
|
+
minRenderScale: options.resolution.minRenderScale ?? options.qualityTier?.minRenderScale ?? 0.5,
|
|
180
|
+
maxRenderScale: 1,
|
|
181
|
+
devicePixelRatio: typeof globalThis !== "undefined" ? globalThis.devicePixelRatio : undefined,
|
|
182
|
+
allowSubCssResolution: options.resolution.allowSubCssResolution
|
|
183
|
+
});
|
|
184
|
+
// C-28 slot: the default impl is a real FrameStats (gpuMs stays null
|
|
185
|
+
// until prd11's timer queries land); flags would pick prd11's provider.
|
|
186
|
+
this.frameStatsMonitor = frameStatsSlot.get({ values: {}, on: () => false })(240);
|
|
187
|
+
}
|
|
188
|
+
// §6.9: re-evaluate the canvas pixel ratio when the display DPR changes.
|
|
189
|
+
this.unsubscribeDprWatch = options.resolution !== undefined && this.canvas
|
|
190
|
+
? watchDevicePixelRatio(() => {
|
|
191
|
+
if (this.disposed)
|
|
192
|
+
return;
|
|
193
|
+
try {
|
|
194
|
+
this.resizeToDisplay();
|
|
195
|
+
}
|
|
196
|
+
catch { /* keep the current backing size on transient reads */ }
|
|
197
|
+
})
|
|
198
|
+
: undefined;
|
|
104
199
|
this.resizeCanvas(this.width, this.height);
|
|
105
200
|
}
|
|
106
|
-
static
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
201
|
+
static create(options = {}) {
|
|
202
|
+
return createRenderer(options);
|
|
203
|
+
}
|
|
204
|
+
/** C-28 monitor (PRD-01 Phase 6): lane capture reads cpuSubmitMs percentiles. */
|
|
205
|
+
get frameStats() {
|
|
206
|
+
return this.frameStatsMonitor;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* PRD-02 S12 (lane-01 half): render `source` into one reflection-probe face.
|
|
210
|
+
* Signature matches `ReflectionFaceRenderer` (probes/ReflectionProbeSystem.ts)
|
|
211
|
+
* so it can be passed straight to the probe system:
|
|
212
|
+
* new ReflectionProbeSystem(..., (face, target, vp) => renderer.renderProbeFace(scene, face, target, vp))
|
|
213
|
+
* - `target` may be any size (128/256 px faces): the probe frame is sized to
|
|
214
|
+
* it, so RENDER_TARGET_VIEWPORT_MISMATCH does not apply.
|
|
215
|
+
* - Call it OUTSIDE a frame (before `render`): it opens and closes its own
|
|
216
|
+
* device frame and throws FRAME_ALREADY_ACTIVE if one is open (no nesting).
|
|
217
|
+
* - It uses a private RenderGraph, so the main frame's graph is not cleared.
|
|
218
|
+
* - Linear output, scene lights + environment, no shadows / post / output
|
|
219
|
+
* encode / frame contributors (a probe is radiance input to shading).
|
|
220
|
+
* Flag-independent; nothing calls it unless a probe system does.
|
|
221
|
+
*/
|
|
222
|
+
renderProbeFace(source, face, target, viewProjection) {
|
|
223
|
+
if (target.disposed) {
|
|
224
|
+
throw new RenderDeviceError("Probe face target is disposed", "RENDER_TARGET_DISPOSED", { face });
|
|
225
|
+
}
|
|
226
|
+
const vp = toMat4(viewProjection, "viewProjection", `probe face ${face}`);
|
|
227
|
+
sceneFromSource(source)?.updateWorldTransforms();
|
|
228
|
+
const items = collectRenderItems(source, vp).filter((item) => !item.environmentCube);
|
|
229
|
+
const split = splitForwardItems(items, undefined);
|
|
230
|
+
const shared = {
|
|
231
|
+
items: split.opaque,
|
|
232
|
+
lights: collectRenderLights(source),
|
|
233
|
+
environmentLighting: collectEnvironmentLighting(source),
|
|
234
|
+
environmentFog: collectEnvironmentFog(source),
|
|
235
|
+
cameraViewProjectionMatrix: vp,
|
|
236
|
+
outputColorSpace: "linear",
|
|
237
|
+
qualityTier: this.liveQualityTier()?.settings
|
|
238
|
+
};
|
|
239
|
+
const graph = (this.probeGraph ??= new RenderGraph());
|
|
240
|
+
graph.clear();
|
|
241
|
+
// A probe face has no screen-space transmission input: transmission items
|
|
242
|
+
// draw with the opaque set; transparent items keep splitForwardItems' sort order.
|
|
243
|
+
graph.addPass(new ForwardPass({ ...shared, items: [...split.opaque, ...split.transmission], framePass: { name: "prd01.probe.opaque", writes: ["aura.probe.color"] } }));
|
|
244
|
+
if (split.transparent.length > 0) {
|
|
245
|
+
graph.addPass(new ForwardPass({ ...shared, items: split.transparent.map((entry) => entry.item), framePass: { name: "prd01.probe.transparent", reads: ["aura.probe.color"], writes: ["aura.probe.color"] } }));
|
|
246
|
+
}
|
|
247
|
+
const previous = this.device.getRenderTarget?.() ?? null;
|
|
248
|
+
this.device.beginFrame(target.width, target.height);
|
|
249
|
+
try {
|
|
250
|
+
this.device.setRenderTarget(target);
|
|
251
|
+
this.device.clear(this.clearColor);
|
|
252
|
+
graph.execute({ device: this.device, width: target.width, height: target.height });
|
|
253
|
+
}
|
|
254
|
+
finally {
|
|
255
|
+
this.device.setRenderTarget(previous);
|
|
256
|
+
this.device.endFrame();
|
|
257
|
+
graph.clear();
|
|
110
258
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
259
|
+
return this.device.getDiagnostics();
|
|
260
|
+
}
|
|
261
|
+
/** C-28 (#91): run `fn` under the frameStats "post" scope when a monitor exists. */
|
|
262
|
+
scopePost(fn) {
|
|
263
|
+
return this.frameStatsMonitor ? this.frameStatsMonitor.scope("post", fn) : fn();
|
|
264
|
+
}
|
|
265
|
+
/** C-05: current output configuration (`app.setOutput` / `renderer.output` seam). */
|
|
266
|
+
get output() {
|
|
267
|
+
return this.outputOptions;
|
|
268
|
+
}
|
|
269
|
+
/** C-05: merge output options; takes effect on the next frame under `A3D_QR_CORE_OUTPUT`. */
|
|
270
|
+
setOutput(options) {
|
|
271
|
+
this.outputOptions = { ...this.outputOptions, ...options };
|
|
272
|
+
}
|
|
273
|
+
/** C-05: install/replace the juice overlay (pass `null` to clear). */
|
|
274
|
+
setOutputOverlay(overlay) {
|
|
275
|
+
this.outputOptions = { ...this.outputOptions, overlay: overlay ?? undefined };
|
|
276
|
+
}
|
|
277
|
+
/** What the last OutputPass call actually applied (C-05 diagnostics; null flag-off). */
|
|
278
|
+
get appliedOutput() {
|
|
279
|
+
return this.lastAppliedOutput;
|
|
114
280
|
}
|
|
115
281
|
getFeatureReport() {
|
|
116
282
|
return createRendererFeatureReport(this.device);
|
|
117
283
|
}
|
|
284
|
+
/** C-29 seam (PR 0b): renderer-side device-lifecycle delegates. */
|
|
285
|
+
onDeviceLost(listener) {
|
|
286
|
+
return subscribeRendererDeviceLost(this.device, listener);
|
|
287
|
+
}
|
|
288
|
+
onDeviceRestored(listener) {
|
|
289
|
+
return subscribeRendererDeviceRestored(this.device, listener);
|
|
290
|
+
}
|
|
291
|
+
isDeviceLost() {
|
|
292
|
+
return rendererDeviceIsLost(this.device);
|
|
293
|
+
}
|
|
118
294
|
resize(width, height) {
|
|
119
295
|
this.assertAlive();
|
|
120
296
|
if (width <= 0 || height <= 0 || !Number.isInteger(width) || !Number.isInteger(height)) {
|
|
121
297
|
throw new RenderDeviceError("Renderer dimensions must be positive integers", "INVALID_FRAME_SIZE", { width, height });
|
|
122
298
|
}
|
|
299
|
+
if (this.width !== width || this.height !== height)
|
|
300
|
+
this.temporalHistory.dispose();
|
|
123
301
|
this.width = width;
|
|
124
302
|
this.height = height;
|
|
125
303
|
this.resizeCanvas(width, height);
|
|
@@ -131,7 +309,14 @@ export class Renderer {
|
|
|
131
309
|
}
|
|
132
310
|
const cssWidth = options.cssWidth ?? readCanvasCssSize(this.canvas, "width");
|
|
133
311
|
const cssHeight = options.cssHeight ?? readCanvasCssSize(this.canvas, "height");
|
|
134
|
-
|
|
312
|
+
// §6.9: explicit override ?? resolution.pixelRatio ?? min(dpr, tier cap) —
|
|
313
|
+
// identical to `globalThis.devicePixelRatio` while `resolution`/`tier` are unset.
|
|
314
|
+
const devicePixelRatio = resolveCanvasPixelRatio({
|
|
315
|
+
devicePixelRatio: globalThis.devicePixelRatio ?? 1,
|
|
316
|
+
tier: this.qualityTier ?? this.liveQualityTier()?.settings ?? { maxPixelRatio: Number.POSITIVE_INFINITY },
|
|
317
|
+
explicit: options.devicePixelRatio,
|
|
318
|
+
resolution: this.resolutionOptions
|
|
319
|
+
});
|
|
135
320
|
if (![cssWidth, cssHeight, devicePixelRatio].every(Number.isFinite) || cssWidth <= 0 || cssHeight <= 0 || devicePixelRatio <= 0) {
|
|
136
321
|
throw new RenderDeviceError("Display size and DPR must be finite positive values", "INVALID_DISPLAY_SIZE", {
|
|
137
322
|
cssWidth,
|
|
@@ -147,6 +332,43 @@ export class Renderer {
|
|
|
147
332
|
}
|
|
148
333
|
return { resized, cssWidth, cssHeight, devicePixelRatio, width, height };
|
|
149
334
|
}
|
|
335
|
+
/**
|
|
336
|
+
* §6.9 manual render-scale ceiling (AuraPerformanceQuality.resolutionScale,
|
|
337
|
+
* request Q-15-1). Caps the scene target only; the canvas backing size is
|
|
338
|
+
* untouched. `renderScale` reports `min(ceiling, governor)`.
|
|
339
|
+
*/
|
|
340
|
+
setRenderScaleCeiling(scale) {
|
|
341
|
+
this.assertAlive();
|
|
342
|
+
if (!Number.isFinite(scale) || scale <= 0) {
|
|
343
|
+
throw new RenderDeviceError("Render-scale ceiling must be a positive finite value", "INVALID_RENDER_SCALE", { scale });
|
|
344
|
+
}
|
|
345
|
+
this.renderScaleCeiling = Math.min(scale, 1);
|
|
346
|
+
}
|
|
347
|
+
get renderScaleCeilingValue() {
|
|
348
|
+
return this.renderScaleCeiling;
|
|
349
|
+
}
|
|
350
|
+
/** Effective render scale: `min(setRenderScaleCeiling, ResolutionGovernor)`. */
|
|
351
|
+
get renderScale() {
|
|
352
|
+
return Math.min(this.renderScaleCeiling, this.resolutionGovernor?.scale ?? 1);
|
|
353
|
+
}
|
|
354
|
+
/** C-31 `resolution` section values observed by the renderer. */
|
|
355
|
+
get resolutionReport() {
|
|
356
|
+
const cssWidth = this.canvas ? readCanvasCssSize(this.canvas, "width") : this.width;
|
|
357
|
+
return {
|
|
358
|
+
pixelRatio: cssWidth > 0 ? this.width / cssWidth : 1,
|
|
359
|
+
renderScale: this.renderScale,
|
|
360
|
+
renderScaleCeiling: this.renderScaleCeiling,
|
|
361
|
+
backingWidth: this.width,
|
|
362
|
+
backingHeight: this.height
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
/**
|
|
366
|
+
* Feeds one frame's timings to the resolution governor (C-28 `gpuMs` wins
|
|
367
|
+
* over the CPU interval when lane 11's timer queries provide it).
|
|
368
|
+
*/
|
|
369
|
+
sampleResolutionGovernor(frameMs, gpuMs) {
|
|
370
|
+
return this.resolutionGovernor?.sample(frameMs, gpuMs) ?? this.renderScale;
|
|
371
|
+
}
|
|
150
372
|
startAnimationLoop(callback) {
|
|
151
373
|
this.assertAlive();
|
|
152
374
|
this.animationLoop?.stop();
|
|
@@ -155,8 +377,43 @@ export class Renderer {
|
|
|
155
377
|
loop.start();
|
|
156
378
|
return loop;
|
|
157
379
|
}
|
|
380
|
+
temporalHistory;
|
|
381
|
+
/** PRD-03 Phase 4: camera position at the last temporal frame — the >5 m
|
|
382
|
+
* auto-cut detector. */
|
|
383
|
+
lastTemporalCameraPosition;
|
|
384
|
+
unsubscribeTemporalDeviceLoss;
|
|
385
|
+
/**
|
|
386
|
+
* PRD-03 §8.6 (flag-on): the v2 S5/S7 stages own the history ping-pong.
|
|
387
|
+
* When a frame was served by another chain (v2 modules still loading, an
|
|
388
|
+
* unfusable pass list), the legacy native TAA wrote its own bytes (alpha =
|
|
389
|
+
* depth, presentation-tuned) into the history target; promoting that seeded
|
|
390
|
+
* the v2 resolve with garbage. Such frames — and TAA frames on which S5
|
|
391
|
+
* did not resolve (`markTaaHistoryWritten`) — reset the history instead.
|
|
392
|
+
*/
|
|
393
|
+
commitTemporalHistory(taa) {
|
|
394
|
+
const written = consumeTaaHistoryWritten();
|
|
395
|
+
if (rendererQrFlags(this.device).on("A3D_QR_POST") && (postGraphV2LastOutcome() !== "v2" || (taa && !written))) {
|
|
396
|
+
this.temporalHistory.reset();
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
this.temporalHistory.commit();
|
|
400
|
+
}
|
|
401
|
+
resetTemporalHistory(_reason = "explicit-reset") { this.temporalHistory.reset(); this.lastTemporalCameraPosition = undefined; }
|
|
158
402
|
render(sourceOrInput, camera) {
|
|
403
|
+
// T0-28: ambient `rendererQrFlags()` readers (Lighting, Background, post…)
|
|
404
|
+
// see this renderer's flags for the duration of the synchronous frame.
|
|
405
|
+
return withRendererQrFlags(this.device, () => this.renderFrame(sourceOrInput, camera));
|
|
406
|
+
}
|
|
407
|
+
renderFrame(sourceOrInput, camera) {
|
|
159
408
|
this.assertAlive();
|
|
409
|
+
// §6.9: FrameStats samples every render while a governor exists (resolution opt-in).
|
|
410
|
+
this.frameStatsMonitor?.begin(typeof performance !== "undefined" ? performance.now() : Date.now());
|
|
411
|
+
// T0-06: reset the per-frame sync-compile bound for this render.
|
|
412
|
+
{
|
|
413
|
+
const flags = rendererQrFlags(this.device);
|
|
414
|
+
if (qrGeneratedProgramsOn(flags))
|
|
415
|
+
rendererProgramCache(this.device, flags).beginFrame?.();
|
|
416
|
+
}
|
|
160
417
|
const { source, camera: inputCamera } = normalizeRendererInput(sourceOrInput, camera);
|
|
161
418
|
sceneFromSource(source)?.updateWorldTransforms();
|
|
162
419
|
const cameraPolicy = collectCameraPolicy(source);
|
|
@@ -169,7 +426,7 @@ export class Renderer {
|
|
|
169
426
|
throw new RenderDeviceError("RenderSource requires an explicit camera but none was supplied or found in the scene.", "CAMERA_REQUIRED");
|
|
170
427
|
}
|
|
171
428
|
let cameraViewProjection = resolvedCamera?.viewProjectionMatrix;
|
|
172
|
-
const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera);
|
|
429
|
+
const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera, rendererQrFlags().on("A3D_QR_LIGHTING"));
|
|
173
430
|
const collectionDiagnostics = collectedItems.diagnostics;
|
|
174
431
|
let items = collectedItems.items;
|
|
175
432
|
const lights = collectRenderLights(source);
|
|
@@ -178,10 +435,26 @@ export class Renderer {
|
|
|
178
435
|
const environmentFog = collectEnvironmentFog(source);
|
|
179
436
|
const explicitShadowMap = collectForwardShadowMap(source);
|
|
180
437
|
const shadowOptions = collectRendererShadowOptions(source);
|
|
438
|
+
// C-02/T0-06: sync-path warm — kick generated-program compiles for the
|
|
439
|
+
// exact draw feature records before the pass runs (bounded per frame).
|
|
440
|
+
this.warmGeneratedProgramsSync(items, lights, environmentLighting, environmentFog, explicitShadowMap, cameraViewProjection);
|
|
181
441
|
const sourceCameraPosition = collectSourceCameraPosition(source);
|
|
182
442
|
const explicitRenderTarget = collectRenderTarget(source);
|
|
183
443
|
validateExplicitRenderTarget(explicitRenderTarget, this.width, this.height);
|
|
184
444
|
let cameraPosition = sourceCameraPosition ?? resolvedCamera?.cameraPosition;
|
|
445
|
+
// C-05/T0-07: decide the frame's output route before the hooks exist, so
|
|
446
|
+
// contributors see the same v2/legacy resource names the graph writes.
|
|
447
|
+
const route = resolveCoreOutputPostRoute(qrCoreOutputOn(rendererQrFlags(this.device)), collectPostprocess(source));
|
|
448
|
+
const frameHooks = createRendererFrameHooks({
|
|
449
|
+
device: this.device,
|
|
450
|
+
width: this.width,
|
|
451
|
+
height: this.height,
|
|
452
|
+
source,
|
|
453
|
+
camera: toFrameCamera(resolvedCamera, cameraViewProjection, cameraPosition),
|
|
454
|
+
// PRD 11: the app's live C-27 tier (A3D_QR_TIERS); undefined → high.
|
|
455
|
+
tier: this.liveQualityTier()?.settings,
|
|
456
|
+
...(route.skipped ? { flags: withCoreOutputOff(rendererQrFlags(this.device)) } : {})
|
|
457
|
+
});
|
|
185
458
|
if (!resolvedCamera && cameraPolicy === "auto-frame") {
|
|
186
459
|
const autoFrame = createAutoFrameCamera(source, items, this.width, this.height);
|
|
187
460
|
if (autoFrame) {
|
|
@@ -190,10 +463,25 @@ export class Renderer {
|
|
|
190
463
|
cameraPosition = sourceCameraPosition ?? autoFrame.cameraPosition;
|
|
191
464
|
}
|
|
192
465
|
}
|
|
193
|
-
|
|
466
|
+
let postprocess = collectPostprocess(source);
|
|
467
|
+
if (!postprocess?.temporal || (!postprocess.motionBlur && !postprocess.taa)) {
|
|
468
|
+
this.temporalHistory.reset();
|
|
469
|
+
this.lastTemporalCameraPosition = undefined;
|
|
470
|
+
}
|
|
194
471
|
const ownedTargets = [];
|
|
195
472
|
const ownedShadowPasses = [];
|
|
196
473
|
this.graph.clear();
|
|
474
|
+
// C-05 (§8.4): under A3D_QR_CORE_OUTPUT encode happens once, in OutputPass.
|
|
475
|
+
// A configured legacy post chain still encodes itself (lane 03 migrates it
|
|
476
|
+
// into post-hdr contributors, Q-03-2/Q-03-3), so the frame takes the legacy
|
|
477
|
+
// chain and bypasses OutputPass: encode stays single, and the authored
|
|
478
|
+
// effects (bloom) are kept instead of dropped. The bypass is reported.
|
|
479
|
+
const qrOutput = route.qrOutput;
|
|
480
|
+
// §6.2.7: lane passes encode in-shader only on the legacy LDR path.
|
|
481
|
+
frameHooks.setOutputColorSpace(postprocess || qrOutput ? "linear" : "srgb");
|
|
482
|
+
this.lastPostSkipped = route.skipped;
|
|
483
|
+
if (route.skipped)
|
|
484
|
+
this.warnPostLegacyRoute(route.skipped);
|
|
197
485
|
let postprocessTargetFormat;
|
|
198
486
|
if (postprocess) {
|
|
199
487
|
const format = postprocess.targetFormat ?? defaultPostprocessTargetFormat(this.device, postprocess);
|
|
@@ -221,25 +509,70 @@ export class Renderer {
|
|
|
221
509
|
backend: this.device.kind
|
|
222
510
|
});
|
|
223
511
|
}
|
|
224
|
-
|
|
512
|
+
// Temporal AA owns subpixel coverage. Pre-resolving MSAA before tone
|
|
513
|
+
// mapping gives it nonlinear mixed-coverage colors while velocity remains
|
|
514
|
+
// single-sample, biasing moving silhouettes and filtering them twice.
|
|
515
|
+
const sampleCount = postprocess.sampleCount ?? (postprocess.taa && postprocess.temporal ? 1 : this.device.kind === "webgpu" && requiresDepthTexture ? 1 : 4);
|
|
225
516
|
// Reused across frames. It still occupies `ownedTargets[0]`, because the postprocess chain and
|
|
226
517
|
// the diagnostics builder both read the forward target from that slot; the end-of-frame
|
|
227
518
|
// disposal loop skips it via `isReusedTarget` so the reuse is safe.
|
|
228
519
|
const forwardTarget = this.ensureForwardColorTarget(format, requiresDepthTexture, sampleCount);
|
|
229
520
|
ownedTargets.push(forwardTarget);
|
|
230
521
|
this.device.setRenderTarget(forwardTarget);
|
|
522
|
+
frameHooks.setForwardTarget(forwardTarget);
|
|
523
|
+
}
|
|
524
|
+
else if (qrOutput) {
|
|
525
|
+
// C-05: the v2 scene always renders into the HDR target — also on the
|
|
526
|
+
// no-effects route (§8.4: encode once, in OutputPass). The governor's
|
|
527
|
+
// renderScale applies to this target only; OutputPass upsamples.
|
|
528
|
+
const probed = probeHdrTargetFormat(this.device);
|
|
529
|
+
const format = probed === "rgba8" ? "rgba8" : "rgba16f";
|
|
530
|
+
const hdrTarget = this.ensureHdrSceneTarget(format, this.outputOptions.backgroundCoverage === true);
|
|
531
|
+
ownedTargets.push(hdrTarget);
|
|
532
|
+
this.device.setRenderTarget(hdrTarget);
|
|
533
|
+
frameHooks.setForwardTarget(hdrTarget);
|
|
231
534
|
}
|
|
232
535
|
this.device.beginFrame(this.width, this.height);
|
|
233
536
|
try {
|
|
234
|
-
|
|
537
|
+
this.lastShadowEvidence = null;
|
|
538
|
+
items = frameHooks.collect(items);
|
|
539
|
+
// C-28 (#90): scope the shadow-phase CPU submission for frameStats.
|
|
540
|
+
// 02-S5: under A3D_QR_LIGHTING casters come from the pre-cull set
|
|
541
|
+
// (frustum-culled casters rejoin); flag-off keeps the visible items only.
|
|
542
|
+
const shadowCasterItems = rendererQrFlags().on("A3D_QR_LIGHTING")
|
|
543
|
+
? [
|
|
544
|
+
...items,
|
|
545
|
+
...culledCastersReachingView(collectedItems.culledShadowCasters, items, collectedItems.cullingFrustum, shadowSunTravel(lights))
|
|
546
|
+
].filter((item) => item.castShadow !== false)
|
|
547
|
+
: items.filter((item) => item.castShadow !== false);
|
|
548
|
+
const rendererShadowMap = this.frameStatsMonitor?.scope("shadow", () => explicitShadowMap ?? this.executeRendererShadowMap({
|
|
549
|
+
shadowOptions,
|
|
550
|
+
source,
|
|
551
|
+
items: shadowCasterItems,
|
|
552
|
+
lights,
|
|
553
|
+
ownedTargets,
|
|
554
|
+
ownedShadowPasses,
|
|
555
|
+
camera: resolvedCamera?.camera,
|
|
556
|
+
frameCamera: shadowFrameCamera(cameraViewProjection, cameraPosition)
|
|
557
|
+
})) ?? explicitShadowMap ?? this.executeRendererShadowMap({
|
|
235
558
|
shadowOptions,
|
|
236
559
|
source,
|
|
237
|
-
items:
|
|
560
|
+
items: shadowCasterItems,
|
|
238
561
|
lights,
|
|
239
562
|
ownedTargets,
|
|
240
563
|
ownedShadowPasses,
|
|
241
|
-
camera: resolvedCamera?.camera
|
|
564
|
+
camera: resolvedCamera?.camera,
|
|
565
|
+
frameCamera: shadowFrameCamera(cameraViewProjection, cameraPosition)
|
|
242
566
|
});
|
|
567
|
+
frameHooks.addPasses(this.graph, "shadows", items);
|
|
568
|
+
this.lastShadowEvidence = rendererShadowMap ? {
|
|
569
|
+
lightMatrix: Array.from(rendererShadowMap.lightMatrix),
|
|
570
|
+
cascades: rendererShadowMap.cascades?.map(c => ({ index: c.index, near: c.near, far: c.far, lightMatrix: Array.from(c.shadowMap.lightMatrix) })) ?? [],
|
|
571
|
+
pointFaceMatrices: rendererShadowMap.pointLight ? Array.from(rendererShadowMap.pointLight.faceMatrices) : [],
|
|
572
|
+
pointFaceRects: rendererShadowMap.pointLight ? Array.from(rendererShadowMap.pointLight.faceRects) : [],
|
|
573
|
+
stabilize: shadowOptions?.stabilize !== false,
|
|
574
|
+
shadowRenderTargetsAllocated: this.device.getDiagnostics().shadowRenderTargetsAllocated ?? null,
|
|
575
|
+
} : null;
|
|
243
576
|
if (postprocess) {
|
|
244
577
|
const forwardTarget = ownedTargets[0];
|
|
245
578
|
if (!forwardTarget) {
|
|
@@ -247,38 +580,175 @@ export class Renderer {
|
|
|
247
580
|
}
|
|
248
581
|
this.device.setRenderTarget(forwardTarget);
|
|
249
582
|
}
|
|
583
|
+
else if (qrOutput) {
|
|
584
|
+
// §9.1: clear the HDR target to the linear background color (no ACES
|
|
585
|
+
// pre-inversion — OutputPass owns the whole encode).
|
|
586
|
+
this.device.setRenderTarget(ownedTargets[0] ?? null);
|
|
587
|
+
}
|
|
250
588
|
else {
|
|
251
589
|
this.device.setRenderTarget(explicitRenderTarget ?? null);
|
|
252
590
|
}
|
|
253
|
-
this.device.clear(this.clearColor);
|
|
591
|
+
this.device.clear(qrOutput && !postprocess ? this.outputClearColor ?? this.clearColor : this.clearColor);
|
|
254
592
|
if (environmentBackground) {
|
|
255
593
|
this.graph.addPass(new EnvironmentBackgroundPass({
|
|
256
594
|
...environmentBackground,
|
|
257
|
-
outputColorSpace: postprocess ? "linear" : environmentBackground.outputColorSpace,
|
|
595
|
+
outputColorSpace: postprocess || qrOutput ? "linear" : environmentBackground.outputColorSpace,
|
|
258
596
|
inverseViewProjectionMatrix: environmentBackground.inverseViewProjectionMatrix ?? invertMat4(cameraViewProjection ?? identityMat4()),
|
|
259
597
|
shaderLibrary: this.shaderLibrary
|
|
260
598
|
}));
|
|
599
|
+
frameHooks.addPasses(this.graph, "background", items);
|
|
600
|
+
}
|
|
601
|
+
// PRD-03 Phase 4 (flag-on): >5 m of camera translation within one frame
|
|
602
|
+
// is a cut — reprojection would smear everything, so seed fresh history.
|
|
603
|
+
let temporalPrevVp;
|
|
604
|
+
let rasterViewProjection = cameraViewProjection;
|
|
605
|
+
let temporalAutoReset = false;
|
|
606
|
+
if (postprocess?.temporal && (postprocess.motionBlur || postprocess.taa) && cameraPosition && rendererQrFlags(this.device).on("A3D_QR_POST")) {
|
|
607
|
+
const prev = this.lastTemporalCameraPosition;
|
|
608
|
+
if (prev) {
|
|
609
|
+
const dx = cameraPosition[0] - prev[0];
|
|
610
|
+
const dy = cameraPosition[1] - prev[1];
|
|
611
|
+
const dz = cameraPosition[2] - prev[2];
|
|
612
|
+
temporalAutoReset = dx * dx + dy * dy + dz * dz > 25;
|
|
613
|
+
}
|
|
614
|
+
this.lastTemporalCameraPosition = [cameraPosition[0], cameraPosition[1], cameraPosition[2]];
|
|
615
|
+
}
|
|
616
|
+
if (postprocess?.temporal && (postprocess.motionBlur || postprocess.taa)) {
|
|
617
|
+
if (postprocess.execution === "cpu-deterministic" || !this.device.presentLdrPostprocess)
|
|
618
|
+
throw new RenderDeviceError("Renderer temporal effects require native GPU presentation", "TEMPORAL_NATIVE_REQUIRED");
|
|
619
|
+
const temporal = this.temporalHistory.prepare(this.device, this.width, this.height, items, cameraViewProjection, { ...postprocess.temporal, jitter: Boolean(postprocess.taa), ...(temporalAutoReset ? { reset: true } : {}) });
|
|
620
|
+
temporalPrevVp = temporal.v2?.previous;
|
|
621
|
+
// PRD-03 §8.6 (flag-on): generated programs project through the
|
|
622
|
+
// AuraFrame `u_viewProjection`, not the per-item MVP, so the TAA
|
|
623
|
+
// sub-pixel jitter has to ride the camera matrix too — otherwise the
|
|
624
|
+
// raster never moves and S5 has nothing to resolve.
|
|
625
|
+
if (temporal.v2)
|
|
626
|
+
rasterViewProjection = temporal.v2.jittered;
|
|
627
|
+
items = this.temporalHistory.renderItems;
|
|
628
|
+
postprocess = { ...postprocess, ...(postprocess.motionBlur ? { motionBlur: { ...postprocess.motionBlur, temporal } } : {}), ...(postprocess.taa ? { taa: { ...postprocess.taa, temporal } } : {}) };
|
|
629
|
+
this.device.setRenderTarget(ownedTargets[0]);
|
|
630
|
+
}
|
|
631
|
+
if (qrOutput) {
|
|
632
|
+
// §9.1 v2 frame order: opaque → after-opaque (scene-depth copy,
|
|
633
|
+
// contributors) → transmission → transmissive → transparent (engine
|
|
634
|
+
// items + contributor TransparentQueueItems interleaved by sortDepth)
|
|
635
|
+
// → after-transparent.
|
|
636
|
+
const hdrTarget = ownedTargets[0] ?? null;
|
|
637
|
+
const coverage = this.outputOptions.backgroundCoverage === true;
|
|
638
|
+
const split = splitForwardItems(items, cameraPosition ?? undefined);
|
|
639
|
+
const shared = {
|
|
640
|
+
items: split.opaque,
|
|
641
|
+
lights,
|
|
642
|
+
environmentLighting,
|
|
643
|
+
environmentFog,
|
|
644
|
+
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
645
|
+
shadowMap: rendererShadowMap,
|
|
646
|
+
cameraPosition,
|
|
647
|
+
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
648
|
+
cameraViewProjectionMatrix: rasterViewProjection,
|
|
649
|
+
outputColorSpace: "linear",
|
|
650
|
+
shaderLibrary: this.shaderLibrary,
|
|
651
|
+
backgroundCoverage: coverage,
|
|
652
|
+
qualityTier: this.liveQualityTier()?.settings
|
|
653
|
+
};
|
|
654
|
+
// The graph enforces unique names + single-producer writes; per-phase
|
|
655
|
+
// resources chain the order, and `aura.scene.color` is written once —
|
|
656
|
+
// by the final interleaved transparent pass.
|
|
657
|
+
this.graph.addPass(new ForwardPass({ ...shared, framePass: { name: "prd01.opaque", writes: ["aura.scene.color.opaque"] } }));
|
|
658
|
+
if (hdrTarget?.depthTexture) {
|
|
659
|
+
const depthCopy = this.ensureSceneDepthCopy();
|
|
660
|
+
frameHooks.setSceneDepthCopy(depthCopy);
|
|
661
|
+
this.graph.addPass(new SceneDepthCopyPass(hdrTarget, depthCopy));
|
|
662
|
+
}
|
|
663
|
+
frameHooks.addPasses(this.graph, "after-opaque", items);
|
|
664
|
+
frameHooks.addPasses(this.graph, "transmission", items);
|
|
665
|
+
let lastColorResource = "aura.scene.color.opaque";
|
|
666
|
+
if (split.transmission.length > 0) {
|
|
667
|
+
lastColorResource = "aura.scene.color.transmission";
|
|
668
|
+
this.graph.addPass(new ForwardPass({
|
|
669
|
+
...shared,
|
|
670
|
+
items: split.transmission,
|
|
671
|
+
framePass: { name: "prd01.transmission", reads: ["aura.scene.color.opaque"], writes: [lastColorResource] }
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
frameHooks.addTransparentContributorPasses(this.graph, items);
|
|
675
|
+
const { ctx: contributorCtx, queues } = frameHooks.transparentQueues(items);
|
|
676
|
+
this.graph.addPass(new InterleavedTransparentPass({ ...shared, items: [] }, split.transparent, queues, contributorCtx, [lastColorResource]));
|
|
677
|
+
frameHooks.addPasses(this.graph, "after-transparent", items);
|
|
678
|
+
}
|
|
679
|
+
else {
|
|
680
|
+
this.graph.addPass(new ForwardPass({
|
|
681
|
+
items,
|
|
682
|
+
lights,
|
|
683
|
+
environmentLighting,
|
|
684
|
+
environmentFog,
|
|
685
|
+
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
686
|
+
shadowMap: rendererShadowMap,
|
|
687
|
+
cameraPosition,
|
|
688
|
+
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
689
|
+
cameraViewProjectionMatrix: rasterViewProjection,
|
|
690
|
+
outputColorSpace: postprocess ? "linear" : "srgb",
|
|
691
|
+
shaderLibrary: this.shaderLibrary
|
|
692
|
+
}));
|
|
693
|
+
frameHooks.addPasses(this.graph, "after-opaque", items);
|
|
694
|
+
frameHooks.addPasses(this.graph, "transmission", items);
|
|
695
|
+
frameHooks.addPasses(this.graph, "transparent", items);
|
|
696
|
+
frameHooks.addPasses(this.graph, "after-transparent", items);
|
|
697
|
+
}
|
|
698
|
+
// C-28 (#90): scope the forward-phase CPU submission for frameStats.
|
|
699
|
+
if (this.frameStatsMonitor) {
|
|
700
|
+
this.frameStatsMonitor.scope("forward", () => this.graph.execute({ device: this.device, width: this.width, height: this.height }));
|
|
701
|
+
}
|
|
702
|
+
else {
|
|
703
|
+
this.graph.execute({ device: this.device, width: this.width, height: this.height });
|
|
261
704
|
}
|
|
262
|
-
this.graph.addPass(new ForwardPass({
|
|
263
|
-
items,
|
|
264
|
-
lights,
|
|
265
|
-
environmentLighting,
|
|
266
|
-
environmentFog,
|
|
267
|
-
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
268
|
-
shadowMap: rendererShadowMap,
|
|
269
|
-
cameraPosition,
|
|
270
|
-
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
271
|
-
cameraViewProjectionMatrix: cameraViewProjection,
|
|
272
|
-
outputColorSpace: postprocess ? "linear" : "srgb",
|
|
273
|
-
shaderLibrary: this.shaderLibrary
|
|
274
|
-
}));
|
|
275
|
-
this.graph.execute({ device: this.device, width: this.width, height: this.height });
|
|
276
705
|
if (postprocess) {
|
|
277
|
-
|
|
706
|
+
postprocess = bindRendererSsrProjection(postprocess, cameraViewProjection ?? identityMat4());
|
|
707
|
+
const frameCamera = toFrameCamera(resolvedCamera, cameraViewProjection, cameraPosition);
|
|
708
|
+
postprocess = {
|
|
709
|
+
...postprocess,
|
|
710
|
+
cameraFrame: frameCamera && temporalPrevVp ? { ...frameCamera, previousViewProjectionMatrix: temporalPrevVp } : frameCamera,
|
|
711
|
+
postFrameContext: {
|
|
712
|
+
source,
|
|
713
|
+
items,
|
|
714
|
+
sceneDepth: {
|
|
715
|
+
texture: ownedTargets[0]?.depthTexture ?? null,
|
|
716
|
+
available: (ownedTargets[0]?.depthTexture ?? null) !== null,
|
|
717
|
+
linearize: {
|
|
718
|
+
near: frameCamera?.near ?? 0.1,
|
|
719
|
+
far: frameCamera?.far ?? 1000,
|
|
720
|
+
orthographic: frameCamera?.projection === "orthographic"
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
};
|
|
725
|
+
// C-28 (#91): the post-hdr contributors and the postprocess chain report
|
|
726
|
+
// under the "post" scope (lane 03 owns the chain internals).
|
|
727
|
+
this.scopePost(() => {
|
|
728
|
+
frameHooks.runPhase("post-hdr", items, postprocess !== undefined);
|
|
729
|
+
this.executePostprocess(postprocess, ownedTargets, explicitRenderTarget);
|
|
730
|
+
});
|
|
731
|
+
if (postprocess.temporal && (postprocess.motionBlur || postprocess.taa))
|
|
732
|
+
this.commitTemporalHistory(Boolean(postprocess.taa));
|
|
278
733
|
}
|
|
734
|
+
else if (qrOutput) {
|
|
735
|
+
this.scopePost(() => frameHooks.runPhase("post-hdr", items, true));
|
|
736
|
+
this.executeOutputPass(frameHooks, items, ownedTargets[0] ?? null, explicitRenderTarget);
|
|
737
|
+
}
|
|
738
|
+
frameHooks.runPhase("after-output", items);
|
|
739
|
+
}
|
|
740
|
+
catch (error) {
|
|
741
|
+
this.lastShadowEvidence = null;
|
|
742
|
+
if (postprocess?.temporal)
|
|
743
|
+
this.temporalHistory.reset();
|
|
744
|
+
throw error;
|
|
279
745
|
}
|
|
280
746
|
finally {
|
|
281
747
|
this.device.endFrame();
|
|
748
|
+
if (this.resolutionGovernor && this.frameStatsMonitor) {
|
|
749
|
+
const frameSample = this.frameStatsMonitor.end();
|
|
750
|
+
this.resolutionGovernor.sample(frameSample.intervalMs, frameSample.gpuMs);
|
|
751
|
+
}
|
|
282
752
|
for (const shadowPass of ownedShadowPasses) {
|
|
283
753
|
shadowPass.dispose();
|
|
284
754
|
}
|
|
@@ -290,6 +760,9 @@ export class Renderer {
|
|
|
290
760
|
target.dispose();
|
|
291
761
|
}
|
|
292
762
|
}
|
|
763
|
+
this.submittedShadowFrameId += 1;
|
|
764
|
+
if (this.lastShadowEvidence)
|
|
765
|
+
this.lastShadowEvidence = { ...this.lastShadowEvidence, submissionFrameId: this.submittedShadowFrameId };
|
|
293
766
|
return withRendererFrameDiagnostics(this.device.getDiagnostics(), collectionDiagnostics, createPostprocessDiagnostics(postprocess, ownedTargets, this.width, this.height, {
|
|
294
767
|
targetFormat: postprocessTargetFormat,
|
|
295
768
|
nativeLdrPostprocess: Boolean(this.device.presentLdrPostprocess),
|
|
@@ -298,6 +771,13 @@ export class Renderer {
|
|
|
298
771
|
}
|
|
299
772
|
async renderAsync(sourceOrInput, camera) {
|
|
300
773
|
this.assertAlive();
|
|
774
|
+
this.frameStatsMonitor?.begin(typeof performance !== "undefined" ? performance.now() : Date.now());
|
|
775
|
+
// T0-06: reset the per-frame sync-compile bound for this render.
|
|
776
|
+
{
|
|
777
|
+
const flags = rendererQrFlags(this.device);
|
|
778
|
+
if (qrGeneratedProgramsOn(flags))
|
|
779
|
+
rendererProgramCache(this.device, flags).beginFrame?.();
|
|
780
|
+
}
|
|
301
781
|
const { source, camera: inputCamera } = normalizeRendererInput(sourceOrInput, camera);
|
|
302
782
|
sceneFromSource(source)?.updateWorldTransforms();
|
|
303
783
|
const cameraPolicy = collectCameraPolicy(source);
|
|
@@ -310,7 +790,7 @@ export class Renderer {
|
|
|
310
790
|
throw new RenderDeviceError("RenderSource requires an explicit camera but none was supplied or found in the scene.", "CAMERA_REQUIRED");
|
|
311
791
|
}
|
|
312
792
|
let cameraViewProjection = resolvedCamera?.viewProjectionMatrix;
|
|
313
|
-
const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera);
|
|
793
|
+
const collectedItems = collectRenderItemsWithDiagnostics(source, cameraViewProjection, resolvedCamera?.camera, rendererQrFlags().on("A3D_QR_LIGHTING"));
|
|
314
794
|
const collectionDiagnostics = collectedItems.diagnostics;
|
|
315
795
|
let items = collectedItems.items;
|
|
316
796
|
const lights = collectRenderLights(source);
|
|
@@ -319,10 +799,26 @@ export class Renderer {
|
|
|
319
799
|
const environmentFog = collectEnvironmentFog(source);
|
|
320
800
|
const explicitShadowMap = collectForwardShadowMap(source);
|
|
321
801
|
const shadowOptions = collectRendererShadowOptions(source);
|
|
802
|
+
// C-02 (PRD-01 §403): pre-render warm-then-block compile of the generated
|
|
803
|
+
// programs this scene needs. Flag-off: nothing (sync path untouched).
|
|
804
|
+
await this.warmGeneratedPrograms(items, lights, environmentLighting, environmentFog, explicitShadowMap, cameraViewProjection);
|
|
322
805
|
const sourceCameraPosition = collectSourceCameraPosition(source);
|
|
323
806
|
const explicitRenderTarget = collectRenderTarget(source);
|
|
324
807
|
validateExplicitRenderTarget(explicitRenderTarget, this.width, this.height);
|
|
325
808
|
let cameraPosition = sourceCameraPosition ?? resolvedCamera?.cameraPosition;
|
|
809
|
+
// C-05/T0-07: decide the frame's output route before the hooks exist, so
|
|
810
|
+
// contributors see the same v2/legacy resource names the graph writes.
|
|
811
|
+
const route = resolveCoreOutputPostRoute(qrCoreOutputOn(rendererQrFlags(this.device)), collectPostprocess(source));
|
|
812
|
+
const frameHooks = createRendererFrameHooks({
|
|
813
|
+
device: this.device,
|
|
814
|
+
width: this.width,
|
|
815
|
+
height: this.height,
|
|
816
|
+
source,
|
|
817
|
+
camera: toFrameCamera(resolvedCamera, cameraViewProjection, cameraPosition),
|
|
818
|
+
// PRD 11: the app's live C-27 tier (A3D_QR_TIERS); undefined → high.
|
|
819
|
+
tier: this.liveQualityTier()?.settings,
|
|
820
|
+
...(route.skipped ? { flags: withCoreOutputOff(rendererQrFlags(this.device)) } : {})
|
|
821
|
+
});
|
|
326
822
|
if (!resolvedCamera && cameraPolicy === "auto-frame") {
|
|
327
823
|
const autoFrame = createAutoFrameCamera(source, items, this.width, this.height);
|
|
328
824
|
if (autoFrame) {
|
|
@@ -331,10 +827,25 @@ export class Renderer {
|
|
|
331
827
|
cameraPosition = sourceCameraPosition ?? autoFrame.cameraPosition;
|
|
332
828
|
}
|
|
333
829
|
}
|
|
334
|
-
|
|
830
|
+
let postprocess = collectPostprocess(source);
|
|
831
|
+
if (!postprocess?.temporal || (!postprocess.motionBlur && !postprocess.taa)) {
|
|
832
|
+
this.temporalHistory.reset();
|
|
833
|
+
this.lastTemporalCameraPosition = undefined;
|
|
834
|
+
}
|
|
335
835
|
const ownedTargets = [];
|
|
336
836
|
const ownedShadowPasses = [];
|
|
337
837
|
this.graph.clear();
|
|
838
|
+
// C-05 (§8.4): under A3D_QR_CORE_OUTPUT encode happens once, in OutputPass.
|
|
839
|
+
// A configured legacy post chain still encodes itself (lane 03 migrates it
|
|
840
|
+
// into post-hdr contributors, Q-03-2/Q-03-3), so the frame takes the legacy
|
|
841
|
+
// chain and bypasses OutputPass: encode stays single, and the authored
|
|
842
|
+
// effects (bloom) are kept instead of dropped. The bypass is reported.
|
|
843
|
+
const qrOutput = route.qrOutput;
|
|
844
|
+
// §6.2.7: lane passes encode in-shader only on the legacy LDR path.
|
|
845
|
+
frameHooks.setOutputColorSpace(postprocess || qrOutput ? "linear" : "srgb");
|
|
846
|
+
this.lastPostSkipped = route.skipped;
|
|
847
|
+
if (route.skipped)
|
|
848
|
+
this.warnPostLegacyRoute(route.skipped);
|
|
338
849
|
let postprocessTargetFormat;
|
|
339
850
|
if (postprocess) {
|
|
340
851
|
const format = postprocess.targetFormat ?? defaultPostprocessTargetFormat(this.device, postprocess);
|
|
@@ -362,25 +873,70 @@ export class Renderer {
|
|
|
362
873
|
backend: this.device.kind
|
|
363
874
|
});
|
|
364
875
|
}
|
|
365
|
-
|
|
876
|
+
// Temporal AA owns subpixel coverage. Pre-resolving MSAA before tone
|
|
877
|
+
// mapping gives it nonlinear mixed-coverage colors while velocity remains
|
|
878
|
+
// single-sample, biasing moving silhouettes and filtering them twice.
|
|
879
|
+
const sampleCount = postprocess.sampleCount ?? (postprocess.taa && postprocess.temporal ? 1 : this.device.kind === "webgpu" && requiresDepthTexture ? 1 : 4);
|
|
366
880
|
// Reused across frames. It still occupies `ownedTargets[0]`, because the postprocess chain and
|
|
367
881
|
// the diagnostics builder both read the forward target from that slot; the end-of-frame
|
|
368
882
|
// disposal loop skips it via `isReusedTarget` so the reuse is safe.
|
|
369
883
|
const forwardTarget = this.ensureForwardColorTarget(format, requiresDepthTexture, sampleCount);
|
|
370
884
|
ownedTargets.push(forwardTarget);
|
|
371
885
|
this.device.setRenderTarget(forwardTarget);
|
|
886
|
+
frameHooks.setForwardTarget(forwardTarget);
|
|
887
|
+
}
|
|
888
|
+
else if (qrOutput) {
|
|
889
|
+
// C-05: the v2 scene always renders into the HDR target — also on the
|
|
890
|
+
// no-effects route (§8.4: encode once, in OutputPass). The governor's
|
|
891
|
+
// renderScale applies to this target only; OutputPass upsamples.
|
|
892
|
+
const probed = probeHdrTargetFormat(this.device);
|
|
893
|
+
const format = probed === "rgba8" ? "rgba8" : "rgba16f";
|
|
894
|
+
const hdrTarget = this.ensureHdrSceneTarget(format, this.outputOptions.backgroundCoverage === true);
|
|
895
|
+
ownedTargets.push(hdrTarget);
|
|
896
|
+
this.device.setRenderTarget(hdrTarget);
|
|
897
|
+
frameHooks.setForwardTarget(hdrTarget);
|
|
372
898
|
}
|
|
373
899
|
this.device.beginFrame(this.width, this.height);
|
|
374
900
|
try {
|
|
375
|
-
|
|
901
|
+
this.lastShadowEvidence = null;
|
|
902
|
+
items = frameHooks.collect(items);
|
|
903
|
+
// C-28 (#90): scope the shadow-phase CPU submission for frameStats.
|
|
904
|
+
// 02-S5: under A3D_QR_LIGHTING casters come from the pre-cull set
|
|
905
|
+
// (frustum-culled casters rejoin); flag-off keeps the visible items only.
|
|
906
|
+
const shadowCasterItems = rendererQrFlags().on("A3D_QR_LIGHTING")
|
|
907
|
+
? [
|
|
908
|
+
...items,
|
|
909
|
+
...culledCastersReachingView(collectedItems.culledShadowCasters, items, collectedItems.cullingFrustum, shadowSunTravel(lights))
|
|
910
|
+
].filter((item) => item.castShadow !== false)
|
|
911
|
+
: items.filter((item) => item.castShadow !== false);
|
|
912
|
+
const rendererShadowMap = this.frameStatsMonitor?.scope("shadow", () => explicitShadowMap ?? this.executeRendererShadowMap({
|
|
913
|
+
shadowOptions,
|
|
914
|
+
source,
|
|
915
|
+
items: shadowCasterItems,
|
|
916
|
+
lights,
|
|
917
|
+
ownedTargets,
|
|
918
|
+
ownedShadowPasses,
|
|
919
|
+
camera: resolvedCamera?.camera,
|
|
920
|
+
frameCamera: shadowFrameCamera(cameraViewProjection, cameraPosition)
|
|
921
|
+
})) ?? explicitShadowMap ?? this.executeRendererShadowMap({
|
|
376
922
|
shadowOptions,
|
|
377
923
|
source,
|
|
378
|
-
items:
|
|
924
|
+
items: shadowCasterItems,
|
|
379
925
|
lights,
|
|
380
926
|
ownedTargets,
|
|
381
927
|
ownedShadowPasses,
|
|
382
|
-
camera: resolvedCamera?.camera
|
|
928
|
+
camera: resolvedCamera?.camera,
|
|
929
|
+
frameCamera: shadowFrameCamera(cameraViewProjection, cameraPosition)
|
|
383
930
|
});
|
|
931
|
+
frameHooks.addPasses(this.graph, "shadows", items);
|
|
932
|
+
this.lastShadowEvidence = rendererShadowMap ? {
|
|
933
|
+
lightMatrix: Array.from(rendererShadowMap.lightMatrix),
|
|
934
|
+
cascades: rendererShadowMap.cascades?.map(c => ({ index: c.index, near: c.near, far: c.far, lightMatrix: Array.from(c.shadowMap.lightMatrix) })) ?? [],
|
|
935
|
+
pointFaceMatrices: rendererShadowMap.pointLight ? Array.from(rendererShadowMap.pointLight.faceMatrices) : [],
|
|
936
|
+
pointFaceRects: rendererShadowMap.pointLight ? Array.from(rendererShadowMap.pointLight.faceRects) : [],
|
|
937
|
+
stabilize: shadowOptions?.stabilize !== false,
|
|
938
|
+
shadowRenderTargetsAllocated: this.device.getDiagnostics().shadowRenderTargetsAllocated ?? null,
|
|
939
|
+
} : null;
|
|
384
940
|
if (postprocess) {
|
|
385
941
|
const forwardTarget = ownedTargets[0];
|
|
386
942
|
if (!forwardTarget) {
|
|
@@ -388,38 +944,175 @@ export class Renderer {
|
|
|
388
944
|
}
|
|
389
945
|
this.device.setRenderTarget(forwardTarget);
|
|
390
946
|
}
|
|
947
|
+
else if (qrOutput) {
|
|
948
|
+
// §9.1: clear the HDR target to the linear background color (no ACES
|
|
949
|
+
// pre-inversion — OutputPass owns the whole encode).
|
|
950
|
+
this.device.setRenderTarget(ownedTargets[0] ?? null);
|
|
951
|
+
}
|
|
391
952
|
else {
|
|
392
953
|
this.device.setRenderTarget(explicitRenderTarget ?? null);
|
|
393
954
|
}
|
|
394
|
-
this.device.clear(this.clearColor);
|
|
955
|
+
this.device.clear(qrOutput && !postprocess ? this.outputClearColor ?? this.clearColor : this.clearColor);
|
|
395
956
|
if (environmentBackground) {
|
|
396
957
|
this.graph.addPass(new EnvironmentBackgroundPass({
|
|
397
958
|
...environmentBackground,
|
|
398
|
-
outputColorSpace: postprocess ? "linear" : environmentBackground.outputColorSpace,
|
|
959
|
+
outputColorSpace: postprocess || qrOutput ? "linear" : environmentBackground.outputColorSpace,
|
|
399
960
|
inverseViewProjectionMatrix: environmentBackground.inverseViewProjectionMatrix ?? invertMat4(cameraViewProjection ?? identityMat4()),
|
|
400
961
|
shaderLibrary: this.shaderLibrary
|
|
401
962
|
}));
|
|
963
|
+
frameHooks.addPasses(this.graph, "background", items);
|
|
964
|
+
}
|
|
965
|
+
// PRD-03 Phase 4 (flag-on): >5 m of camera translation within one frame
|
|
966
|
+
// is a cut — reprojection would smear everything, so seed fresh history.
|
|
967
|
+
let temporalPrevVp;
|
|
968
|
+
let rasterViewProjection = cameraViewProjection;
|
|
969
|
+
let temporalAutoReset = false;
|
|
970
|
+
if (postprocess?.temporal && (postprocess.motionBlur || postprocess.taa) && cameraPosition && rendererQrFlags(this.device).on("A3D_QR_POST")) {
|
|
971
|
+
const prev = this.lastTemporalCameraPosition;
|
|
972
|
+
if (prev) {
|
|
973
|
+
const dx = cameraPosition[0] - prev[0];
|
|
974
|
+
const dy = cameraPosition[1] - prev[1];
|
|
975
|
+
const dz = cameraPosition[2] - prev[2];
|
|
976
|
+
temporalAutoReset = dx * dx + dy * dy + dz * dz > 25;
|
|
977
|
+
}
|
|
978
|
+
this.lastTemporalCameraPosition = [cameraPosition[0], cameraPosition[1], cameraPosition[2]];
|
|
979
|
+
}
|
|
980
|
+
if (postprocess?.temporal && (postprocess.motionBlur || postprocess.taa)) {
|
|
981
|
+
if (postprocess.execution === "cpu-deterministic" || !this.device.presentLdrPostprocess)
|
|
982
|
+
throw new RenderDeviceError("Renderer temporal effects require native GPU presentation", "TEMPORAL_NATIVE_REQUIRED");
|
|
983
|
+
const temporal = this.temporalHistory.prepare(this.device, this.width, this.height, items, cameraViewProjection, { ...postprocess.temporal, jitter: Boolean(postprocess.taa), ...(temporalAutoReset ? { reset: true } : {}) });
|
|
984
|
+
temporalPrevVp = temporal.v2?.previous;
|
|
985
|
+
// PRD-03 §8.6 (flag-on): generated programs project through the
|
|
986
|
+
// AuraFrame `u_viewProjection`, not the per-item MVP, so the TAA
|
|
987
|
+
// sub-pixel jitter has to ride the camera matrix too — otherwise the
|
|
988
|
+
// raster never moves and S5 has nothing to resolve.
|
|
989
|
+
if (temporal.v2)
|
|
990
|
+
rasterViewProjection = temporal.v2.jittered;
|
|
991
|
+
items = this.temporalHistory.renderItems;
|
|
992
|
+
postprocess = { ...postprocess, ...(postprocess.motionBlur ? { motionBlur: { ...postprocess.motionBlur, temporal } } : {}), ...(postprocess.taa ? { taa: { ...postprocess.taa, temporal } } : {}) };
|
|
993
|
+
this.device.setRenderTarget(ownedTargets[0]);
|
|
994
|
+
}
|
|
995
|
+
if (qrOutput) {
|
|
996
|
+
// §9.1 v2 frame order: opaque → after-opaque (scene-depth copy,
|
|
997
|
+
// contributors) → transmission → transmissive → transparent (engine
|
|
998
|
+
// items + contributor TransparentQueueItems interleaved by sortDepth)
|
|
999
|
+
// → after-transparent.
|
|
1000
|
+
const hdrTarget = ownedTargets[0] ?? null;
|
|
1001
|
+
const coverage = this.outputOptions.backgroundCoverage === true;
|
|
1002
|
+
const split = splitForwardItems(items, cameraPosition ?? undefined);
|
|
1003
|
+
const shared = {
|
|
1004
|
+
items: split.opaque,
|
|
1005
|
+
lights,
|
|
1006
|
+
environmentLighting,
|
|
1007
|
+
environmentFog,
|
|
1008
|
+
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
1009
|
+
shadowMap: rendererShadowMap,
|
|
1010
|
+
cameraPosition,
|
|
1011
|
+
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
1012
|
+
cameraViewProjectionMatrix: rasterViewProjection,
|
|
1013
|
+
outputColorSpace: "linear",
|
|
1014
|
+
shaderLibrary: this.shaderLibrary,
|
|
1015
|
+
backgroundCoverage: coverage,
|
|
1016
|
+
qualityTier: this.liveQualityTier()?.settings
|
|
1017
|
+
};
|
|
1018
|
+
// The graph enforces unique names + single-producer writes; per-phase
|
|
1019
|
+
// resources chain the order, and `aura.scene.color` is written once —
|
|
1020
|
+
// by the final interleaved transparent pass.
|
|
1021
|
+
this.graph.addPass(new ForwardPass({ ...shared, framePass: { name: "prd01.opaque", writes: ["aura.scene.color.opaque"] } }));
|
|
1022
|
+
if (hdrTarget?.depthTexture) {
|
|
1023
|
+
const depthCopy = this.ensureSceneDepthCopy();
|
|
1024
|
+
frameHooks.setSceneDepthCopy(depthCopy);
|
|
1025
|
+
this.graph.addPass(new SceneDepthCopyPass(hdrTarget, depthCopy));
|
|
1026
|
+
}
|
|
1027
|
+
frameHooks.addPasses(this.graph, "after-opaque", items);
|
|
1028
|
+
frameHooks.addPasses(this.graph, "transmission", items);
|
|
1029
|
+
let lastColorResource = "aura.scene.color.opaque";
|
|
1030
|
+
if (split.transmission.length > 0) {
|
|
1031
|
+
lastColorResource = "aura.scene.color.transmission";
|
|
1032
|
+
this.graph.addPass(new ForwardPass({
|
|
1033
|
+
...shared,
|
|
1034
|
+
items: split.transmission,
|
|
1035
|
+
framePass: { name: "prd01.transmission", reads: ["aura.scene.color.opaque"], writes: [lastColorResource] }
|
|
1036
|
+
}));
|
|
1037
|
+
}
|
|
1038
|
+
frameHooks.addTransparentContributorPasses(this.graph, items);
|
|
1039
|
+
const { ctx: contributorCtx, queues } = frameHooks.transparentQueues(items);
|
|
1040
|
+
this.graph.addPass(new InterleavedTransparentPass({ ...shared, items: [] }, split.transparent, queues, contributorCtx, [lastColorResource]));
|
|
1041
|
+
frameHooks.addPasses(this.graph, "after-transparent", items);
|
|
1042
|
+
}
|
|
1043
|
+
else {
|
|
1044
|
+
this.graph.addPass(new ForwardPass({
|
|
1045
|
+
items,
|
|
1046
|
+
lights,
|
|
1047
|
+
environmentLighting,
|
|
1048
|
+
environmentFog,
|
|
1049
|
+
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
1050
|
+
shadowMap: rendererShadowMap,
|
|
1051
|
+
cameraPosition,
|
|
1052
|
+
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
1053
|
+
cameraViewProjectionMatrix: rasterViewProjection,
|
|
1054
|
+
outputColorSpace: postprocess ? "linear" : "srgb",
|
|
1055
|
+
shaderLibrary: this.shaderLibrary
|
|
1056
|
+
}));
|
|
1057
|
+
frameHooks.addPasses(this.graph, "after-opaque", items);
|
|
1058
|
+
frameHooks.addPasses(this.graph, "transmission", items);
|
|
1059
|
+
frameHooks.addPasses(this.graph, "transparent", items);
|
|
1060
|
+
frameHooks.addPasses(this.graph, "after-transparent", items);
|
|
1061
|
+
}
|
|
1062
|
+
// C-28 (#90): scope the forward-phase CPU submission for frameStats.
|
|
1063
|
+
if (this.frameStatsMonitor) {
|
|
1064
|
+
this.frameStatsMonitor.scope("forward", () => this.graph.execute({ device: this.device, width: this.width, height: this.height }));
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
this.graph.execute({ device: this.device, width: this.width, height: this.height });
|
|
402
1068
|
}
|
|
403
|
-
this.graph.addPass(new ForwardPass({
|
|
404
|
-
items,
|
|
405
|
-
lights,
|
|
406
|
-
environmentLighting,
|
|
407
|
-
environmentFog,
|
|
408
|
-
inputColorResource: environmentBackground ? ENVIRONMENT_BACKGROUND_COLOR_RESOURCE : undefined,
|
|
409
|
-
shadowMap: rendererShadowMap,
|
|
410
|
-
cameraPosition,
|
|
411
|
-
cameraViewMatrix: resolvedCamera?.viewMatrix,
|
|
412
|
-
cameraViewProjectionMatrix: cameraViewProjection,
|
|
413
|
-
outputColorSpace: postprocess ? "linear" : "srgb",
|
|
414
|
-
shaderLibrary: this.shaderLibrary
|
|
415
|
-
}));
|
|
416
|
-
this.graph.execute({ device: this.device, width: this.width, height: this.height });
|
|
417
1069
|
if (postprocess) {
|
|
418
|
-
|
|
1070
|
+
postprocess = bindRendererSsrProjection(postprocess, cameraViewProjection ?? identityMat4());
|
|
1071
|
+
const frameCamera = toFrameCamera(resolvedCamera, cameraViewProjection, cameraPosition);
|
|
1072
|
+
postprocess = {
|
|
1073
|
+
...postprocess,
|
|
1074
|
+
cameraFrame: frameCamera && temporalPrevVp ? { ...frameCamera, previousViewProjectionMatrix: temporalPrevVp } : frameCamera,
|
|
1075
|
+
postFrameContext: {
|
|
1076
|
+
source,
|
|
1077
|
+
items,
|
|
1078
|
+
sceneDepth: {
|
|
1079
|
+
texture: ownedTargets[0]?.depthTexture ?? null,
|
|
1080
|
+
available: (ownedTargets[0]?.depthTexture ?? null) !== null,
|
|
1081
|
+
linearize: {
|
|
1082
|
+
near: frameCamera?.near ?? 0.1,
|
|
1083
|
+
far: frameCamera?.far ?? 1000,
|
|
1084
|
+
orthographic: frameCamera?.projection === "orthographic"
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
};
|
|
1089
|
+
// C-28 (#91): "post" scope. FrameStats.scope is synchronous, so on the
|
|
1090
|
+
// async path it times the CPU submission up to the first await.
|
|
1091
|
+
await this.scopePost(async () => {
|
|
1092
|
+
await frameHooks.runPhaseAsync("post-hdr", items, postprocess !== undefined);
|
|
1093
|
+
await this.executePostprocessAsync(postprocess, ownedTargets, explicitRenderTarget);
|
|
1094
|
+
});
|
|
1095
|
+
if (postprocess.temporal && (postprocess.motionBlur || postprocess.taa))
|
|
1096
|
+
this.commitTemporalHistory(Boolean(postprocess.taa));
|
|
419
1097
|
}
|
|
1098
|
+
else if (qrOutput) {
|
|
1099
|
+
await this.scopePost(() => frameHooks.runPhaseAsync("post-hdr", items, true));
|
|
1100
|
+
this.executeOutputPass(frameHooks, items, ownedTargets[0] ?? null, explicitRenderTarget);
|
|
1101
|
+
}
|
|
1102
|
+
await frameHooks.runPhaseAsync("after-output", items);
|
|
1103
|
+
}
|
|
1104
|
+
catch (error) {
|
|
1105
|
+
this.lastShadowEvidence = null;
|
|
1106
|
+
if (postprocess?.temporal)
|
|
1107
|
+
this.temporalHistory.reset();
|
|
1108
|
+
throw error;
|
|
420
1109
|
}
|
|
421
1110
|
finally {
|
|
422
1111
|
this.device.endFrame();
|
|
1112
|
+
if (this.resolutionGovernor && this.frameStatsMonitor) {
|
|
1113
|
+
const frameSample = this.frameStatsMonitor.end();
|
|
1114
|
+
this.resolutionGovernor.sample(frameSample.intervalMs, frameSample.gpuMs);
|
|
1115
|
+
}
|
|
423
1116
|
for (const shadowPass of ownedShadowPasses) {
|
|
424
1117
|
shadowPass.dispose();
|
|
425
1118
|
}
|
|
@@ -431,12 +1124,98 @@ export class Renderer {
|
|
|
431
1124
|
target.dispose();
|
|
432
1125
|
}
|
|
433
1126
|
}
|
|
1127
|
+
this.submittedShadowFrameId += 1;
|
|
1128
|
+
if (this.lastShadowEvidence)
|
|
1129
|
+
this.lastShadowEvidence = { ...this.lastShadowEvidence, submissionFrameId: this.submittedShadowFrameId };
|
|
434
1130
|
return withRendererFrameDiagnostics(this.device.getDiagnostics(), collectionDiagnostics, createPostprocessDiagnostics(postprocess, ownedTargets, this.width, this.height, {
|
|
435
1131
|
targetFormat: postprocessTargetFormat,
|
|
436
1132
|
nativeLdrPostprocess: Boolean(this.device.presentLdrPostprocess),
|
|
437
1133
|
rendererDepthAvailable: Boolean(postprocess && postprocessRequiresDepthTexture(postprocess) && this.device.info.capabilities?.includes("depth-textures"))
|
|
438
1134
|
}));
|
|
439
1135
|
}
|
|
1136
|
+
/**
|
|
1137
|
+
* C-02 (PRD-01 §8.2/§403): warm-then-block. Under `A3D_QR_CORE_GENERATOR`
|
|
1138
|
+
* (default-on under `A3D_QR_CORE`), precompiles the generated programs for
|
|
1139
|
+
* every allow-listed material in the frame — at the current tier and the
|
|
1140
|
+
* next-lower one — before the first draw, so the pass never async-skips in
|
|
1141
|
+
* steady state. Flag-off and non-generated materials are no-ops.
|
|
1142
|
+
*/
|
|
1143
|
+
/**
|
|
1144
|
+
* Shared T0-06 warm input: the exact draw feature records the frame's
|
|
1145
|
+
* generated-program materials need (lights/shadow/environment axes at the
|
|
1146
|
+
* current tier). Returns `materials: []` early when nothing generated.
|
|
1147
|
+
*/
|
|
1148
|
+
collectWarmupInput(items, lights, environmentLighting, environmentFog, shadowMap, cameraViewProjection, flags, tier) {
|
|
1149
|
+
const ctx = { flags, tier: QUALITY_TIERS[tier] };
|
|
1150
|
+
// T0-05: one record per (material revision, selected feature bits) — the
|
|
1151
|
+
// draw key carries `ShaderFeature.select` bits per item, so the warm list
|
|
1152
|
+
// must too or warmed keys never match draw keys.
|
|
1153
|
+
const records = new Map();
|
|
1154
|
+
const route = { core: qrCoreGeneratorOn(flags), lobes: qrMaterialsLobeProgramsOn(flags) };
|
|
1155
|
+
for (const item of items) {
|
|
1156
|
+
const m = item.material instanceof MaterialInstance ? item.material.baseMaterial : item.material;
|
|
1157
|
+
if (!m || !materialRoutesToGeneratedProgram(m, route, ctx))
|
|
1158
|
+
continue;
|
|
1159
|
+
const mf = m.programFeatures(ctx);
|
|
1160
|
+
const selected = selectShaderFeatureBits({ item, pass: "forward", tier: ctx.tier, flags });
|
|
1161
|
+
// E3 stage-2b: same probe-availability gate ForwardPass applies, so
|
|
1162
|
+
// warmed keys match draw keys for the `prd02.ibl` bit.
|
|
1163
|
+
if (selected[PRD02_IBL_FEATURE] !== undefined && !prd02IblEnvironmentAvailable(environmentLighting, item)) {
|
|
1164
|
+
delete selected[PRD02_IBL_FEATURE];
|
|
1165
|
+
}
|
|
1166
|
+
// #867 (games): same geometry-driven feature mask ForwardPass applies.
|
|
1167
|
+
const attrs = item.geometry.vertexBuffer.format.attributes;
|
|
1168
|
+
const has = (name) => attrs.some((a) => a.semantic === name || a.shaderName === name);
|
|
1169
|
+
const record = featuresForGeometry({ ...mf, features: { ...mf.features, ...selected } }, has);
|
|
1170
|
+
const geometryMask = ["a_uv", "a_uv1", "a_color", "a_joints", "a_weights", "a_joints1", "a_weights1"].map((n) => (has(n) ? 1 : 0)).join("");
|
|
1171
|
+
const key = `${m.shaderKey}:${m.getRevision()}:${geometryMask}:${JSON.stringify(Object.entries(record.features).sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)))}`;
|
|
1172
|
+
if (!records.has(key))
|
|
1173
|
+
records.set(key, record);
|
|
1174
|
+
}
|
|
1175
|
+
if (records.size === 0)
|
|
1176
|
+
return { materials: [] };
|
|
1177
|
+
const clustered = resolveForwardClusteredLighting(lights, this.width, this.height, cameraViewProjection);
|
|
1178
|
+
const axes = forwardPassFeatureAxes({ lights, shadowMap, environmentLighting, environmentFog }, clustered !== null);
|
|
1179
|
+
clustered?.dispose();
|
|
1180
|
+
return {
|
|
1181
|
+
materials: [...records.values()],
|
|
1182
|
+
lights: [axes.lights],
|
|
1183
|
+
shadows: axes.shadows ? [axes.shadows] : [],
|
|
1184
|
+
environments: [axes.environment]
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
async warmGeneratedPrograms(items, lights, environmentLighting, environmentFog, shadowMap, cameraViewProjection) {
|
|
1188
|
+
const flags = rendererQrFlags(this.device);
|
|
1189
|
+
if (!qrGeneratedProgramsOn(flags))
|
|
1190
|
+
return;
|
|
1191
|
+
const tier = this.qualityTierName ?? prd11LiveQualityTier(flags)?.tier ?? "high";
|
|
1192
|
+
const cache = rendererProgramCache(this.device, flags);
|
|
1193
|
+
const input = this.collectWarmupInput(items, lights, environmentLighting, environmentFog, shadowMap, cameraViewProjection, flags, tier);
|
|
1194
|
+
if (input.materials.length > 0) {
|
|
1195
|
+
const warmup = (this.programWarmup ??= new ProgramWarmup(cache));
|
|
1196
|
+
await warmup.warm(input, tier);
|
|
1197
|
+
}
|
|
1198
|
+
// T0-06: the ready barrier for `programsCompiledSinceReady` — compiles
|
|
1199
|
+
// completing after the first warm count as steady-state leaks.
|
|
1200
|
+
cache.markReady?.();
|
|
1201
|
+
}
|
|
1202
|
+
/**
|
|
1203
|
+
* T0-06: the sync `render` half of warm-then-block. Kicks `acquire` for the
|
|
1204
|
+
* exact draw feature records — async-compile devices start pending entries
|
|
1205
|
+
* (`precompile`/`app.ready` settle them); sync-compile devices compile under
|
|
1206
|
+
* the per-frame bound and converge over the next frames.
|
|
1207
|
+
*/
|
|
1208
|
+
warmGeneratedProgramsSync(items, lights, environmentLighting, environmentFog, shadowMap, cameraViewProjection) {
|
|
1209
|
+
const flags = rendererQrFlags(this.device);
|
|
1210
|
+
if (!qrGeneratedProgramsOn(flags))
|
|
1211
|
+
return;
|
|
1212
|
+
const tier = this.qualityTierName ?? prd11LiveQualityTier(flags)?.tier ?? "high";
|
|
1213
|
+
const cache = rendererProgramCache(this.device, flags);
|
|
1214
|
+
const input = this.collectWarmupInput(items, lights, environmentLighting, environmentFog, shadowMap, cameraViewProjection, flags, tier);
|
|
1215
|
+
for (const features of collectWarmupFeatures(input, tier))
|
|
1216
|
+
cache.acquire(features);
|
|
1217
|
+
cache.markReady?.();
|
|
1218
|
+
}
|
|
440
1219
|
renderScene(scene, camera) {
|
|
441
1220
|
return this.render(scene, camera);
|
|
442
1221
|
}
|
|
@@ -465,18 +1244,90 @@ export class Renderer {
|
|
|
465
1244
|
return this.device.getDiagnostics();
|
|
466
1245
|
}
|
|
467
1246
|
dispose() {
|
|
1247
|
+
this.lastShadowEvidence = null;
|
|
468
1248
|
this.animationLoop?.stop();
|
|
469
1249
|
this.animationLoop = null;
|
|
470
1250
|
this.shadowDepthTarget?.dispose();
|
|
471
1251
|
this.shadowDepthTarget = null;
|
|
472
1252
|
this.forwardColorTarget?.target.dispose();
|
|
473
1253
|
this.forwardColorTarget = null;
|
|
1254
|
+
this.hdrSceneTarget?.target.dispose();
|
|
1255
|
+
this.hdrSceneTarget = null;
|
|
1256
|
+
this.sceneDepthCopyTarget?.dispose();
|
|
1257
|
+
this.sceneDepthCopyTarget = null;
|
|
1258
|
+
this.unsubscribeTemporalDeviceLoss?.();
|
|
1259
|
+
this.unsubscribeDprWatch?.();
|
|
1260
|
+
this.temporalHistory.dispose();
|
|
474
1261
|
this.device.dispose();
|
|
475
1262
|
this.disposed = true;
|
|
476
1263
|
}
|
|
477
1264
|
/** True for renderer-lifetime targets that must survive end-of-frame disposal. */
|
|
478
1265
|
isReusedTarget(target) {
|
|
479
|
-
return target === this.forwardColorTarget?.target || target === this.shadowDepthTarget;
|
|
1266
|
+
return target === this.forwardColorTarget?.target || target === this.shadowDepthTarget || target === this.hdrSceneTarget?.target || target === this.sceneDepthCopyTarget;
|
|
1267
|
+
}
|
|
1268
|
+
/**
|
|
1269
|
+
* C-05 HDR scene target under `A3D_QR_CORE_OUTPUT` — always a sampleable
|
|
1270
|
+
* depth texture (sceneDepth / after-opaque copy), renderScale-sized, MSAA 4x,
|
|
1271
|
+
* plus the BACKGROUND_COVERAGE rgba8 attachment when the option is on.
|
|
1272
|
+
*/
|
|
1273
|
+
ensureHdrSceneTarget(format, coverage) {
|
|
1274
|
+
const scale = Math.min(Math.max(this.renderScale, 0.01), 1);
|
|
1275
|
+
const width = Math.max(1, Math.round(this.width * scale));
|
|
1276
|
+
const height = Math.max(1, Math.round(this.height * scale));
|
|
1277
|
+
// C-36: WebGL2 does not support multisample MRT — coverage forces a
|
|
1278
|
+
// non-MSAA target and is declared via `hdr-msaa-mrt-unsupported`.
|
|
1279
|
+
const sampleCount = coverage ? 1 : 4;
|
|
1280
|
+
const key = `${width}x${height}:${format}:depth-texture:${sampleCount}:${coverage ? "cov" : "std"}`;
|
|
1281
|
+
const cached = this.hdrSceneTarget;
|
|
1282
|
+
if (cached && cached.key === key && !cached.target.disposed)
|
|
1283
|
+
return cached.target;
|
|
1284
|
+
cached?.target.dispose();
|
|
1285
|
+
const target = this.device.createRenderTarget({
|
|
1286
|
+
width,
|
|
1287
|
+
height,
|
|
1288
|
+
label: "renderer-hdr-scene",
|
|
1289
|
+
format,
|
|
1290
|
+
...(coverage ? { colorAttachments: [{ format }, { format: "rgba8" }] } : {}),
|
|
1291
|
+
depth: "texture",
|
|
1292
|
+
sampleCount
|
|
1293
|
+
});
|
|
1294
|
+
this.hdrMsaaMrtDegraded = coverage;
|
|
1295
|
+
this.hdrSceneTarget = { target, key };
|
|
1296
|
+
return target;
|
|
1297
|
+
}
|
|
1298
|
+
ensureSceneDepthCopy() {
|
|
1299
|
+
this.sceneDepthCopyTarget = ensureSceneDepthCopyTarget(this.device, this.sceneDepthCopyTarget, this.width, this.height);
|
|
1300
|
+
return this.sceneDepthCopyTarget;
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* C-05 OutputPass invocation (§8.4 step "output"): `u_exposure` =
|
|
1304
|
+
* `output.exposure × blackboard["prd03.exposure"]` (upstream defaults to 1
|
|
1305
|
+
* until lane 03 publishes it — Q-03-1).
|
|
1306
|
+
*/
|
|
1307
|
+
executeOutputPass(frameHooks, _items, hdrTarget, explicitRenderTarget) {
|
|
1308
|
+
if (!hdrTarget)
|
|
1309
|
+
return;
|
|
1310
|
+
const o = this.outputOptions;
|
|
1311
|
+
const upstream = frameHooks.blackboardValue(PRD03_EXPOSURE);
|
|
1312
|
+
const appliedExposure = (o.exposure ?? 1) * (typeof upstream === "number" && Number.isFinite(upstream) ? upstream : 1);
|
|
1313
|
+
const format = probeHdrTargetFormat(this.device);
|
|
1314
|
+
const targetFormat = format === "rgba8" ? "rgba8" : "rgba16f";
|
|
1315
|
+
const coverage = o.backgroundCoverage === true;
|
|
1316
|
+
this.device.setRenderTarget(explicitRenderTarget ?? null);
|
|
1317
|
+
rendererOutputPass(this.device).execute(hdrTarget, coverage ? hdrTarget : null, {
|
|
1318
|
+
toneMapping: o.toneMapping ?? DEFAULT_TONE_MAPPING,
|
|
1319
|
+
exposure: appliedExposure,
|
|
1320
|
+
dithering: o.dithering ?? DEFAULT_OUTPUT_DITHERING,
|
|
1321
|
+
backgroundCoverage: coverage,
|
|
1322
|
+
overlay: o.overlay
|
|
1323
|
+
}, explicitRenderTarget ?? "canvas");
|
|
1324
|
+
this.lastAppliedOutput = {
|
|
1325
|
+
toneMapping: o.toneMapping ?? DEFAULT_TONE_MAPPING,
|
|
1326
|
+
exposure: { applied: appliedExposure, source: upstream !== undefined ? "grade" : "output" },
|
|
1327
|
+
dithering: o.dithering ?? DEFAULT_OUTPUT_DITHERING,
|
|
1328
|
+
targetFormat,
|
|
1329
|
+
degraded: targetFormat === "rgba8" ? "rgba8-no-float-target" : this.hdrMsaaMrtDegraded ? "hdr-msaa-mrt-unsupported" : undefined
|
|
1330
|
+
};
|
|
480
1331
|
}
|
|
481
1332
|
/** Allocates the shared forward-color target once per distinct configuration. */
|
|
482
1333
|
ensureForwardColorTarget(format, requiresDepthTexture, sampleCount) {
|
|
@@ -496,21 +1347,9 @@ export class Renderer {
|
|
|
496
1347
|
this.forwardColorTarget = { target, key };
|
|
497
1348
|
return target;
|
|
498
1349
|
}
|
|
499
|
-
/**
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
if (existing && !existing.disposed && existing.width === size && existing.height === size)
|
|
503
|
-
return existing;
|
|
504
|
-
existing?.dispose();
|
|
505
|
-
const target = this.device.createRenderTarget({
|
|
506
|
-
width: size,
|
|
507
|
-
height: size,
|
|
508
|
-
label: "renderer-shadow-depth-color",
|
|
509
|
-
format: "rgba8",
|
|
510
|
-
depth: this.device.info.capabilities?.includes("depth-textures") ? "texture" : true
|
|
511
|
-
});
|
|
512
|
-
this.shadowDepthTarget = target;
|
|
513
|
-
return target;
|
|
1350
|
+
/** PRD 11: this device's app-bound live C-27 tier (A3D_QR_TIERS on), else undefined. */
|
|
1351
|
+
liveQualityTier() {
|
|
1352
|
+
return prd11LiveQualityTier(rendererQrFlags(this.device));
|
|
514
1353
|
}
|
|
515
1354
|
assertAlive() {
|
|
516
1355
|
if (this.disposed || this.device.disposed) {
|
|
@@ -528,584 +1367,13 @@ export class Renderer {
|
|
|
528
1367
|
}
|
|
529
1368
|
}
|
|
530
1369
|
executePostprocess(postprocess, ownedTargets, outputTarget) {
|
|
531
|
-
|
|
532
|
-
let current = forwardTarget;
|
|
533
|
-
if (!current) {
|
|
534
|
-
throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
|
|
535
|
-
}
|
|
536
|
-
const passes = createRendererPostprocessPasses(postprocess);
|
|
537
|
-
if (passes.length === 0) {
|
|
538
|
-
if (outputTarget) {
|
|
539
|
-
this.device.setRenderTarget(current);
|
|
540
|
-
writePostProcessPixels(this.device, current, outputTarget, this.device.readPixels(0, 0, current.width, current.height));
|
|
541
|
-
}
|
|
542
|
-
else {
|
|
543
|
-
this.device.presentRenderTarget?.(current);
|
|
544
|
-
}
|
|
545
|
-
return;
|
|
546
|
-
}
|
|
547
|
-
if (this.executeFusedLdrPostprocess(current, passes, outputTarget, postprocess.execution === "cpu-deterministic"))
|
|
548
|
-
return;
|
|
549
|
-
for (let index = 0; index < passes.length; index += 1) {
|
|
550
|
-
const pass = passes[index];
|
|
551
|
-
const nextPass = passes[index + 1];
|
|
552
|
-
if (pass.name === "bloom" && isHdrRenderTarget(current)) {
|
|
553
|
-
if (nextPass?.name !== "tone-mapping") {
|
|
554
|
-
throw new RenderDeviceError("Renderer HDR bloom requires tone mapping immediately after the float bloom pass.", "HDR_BLOOM_TONEMAPPING_REQUIRED", {
|
|
555
|
-
source: current.label
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
|
-
const isCombinedLast = index + 1 === passes.length - 1;
|
|
559
|
-
const target = isCombinedLast ? outputTarget : this.device.createRenderTarget({
|
|
560
|
-
width: this.width,
|
|
561
|
-
height: this.height,
|
|
562
|
-
label: "renderer-postprocess-tone-mapping",
|
|
563
|
-
format: "rgba8",
|
|
564
|
-
depth: false
|
|
565
|
-
});
|
|
566
|
-
if (target)
|
|
567
|
-
ownedTargets.push(target);
|
|
568
|
-
this.device.setRenderTarget(current);
|
|
569
|
-
const bloomed = bloomFloatPixels(this.device.readFloatPixels(0, 0, current.width, current.height), current.width, current.height, pass.options);
|
|
570
|
-
const mapped = toneMapFloatPixels(bloomed.pixels, current.width, current.height, {
|
|
571
|
-
outputColorSpace: "srgb",
|
|
572
|
-
...nextPass.options
|
|
573
|
-
});
|
|
574
|
-
writePostProcessPixels(this.device, current, target, mapped.pixels);
|
|
575
|
-
if (target)
|
|
576
|
-
current = target;
|
|
577
|
-
index += 1;
|
|
578
|
-
continue;
|
|
579
|
-
}
|
|
580
|
-
const isLast = index === passes.length - 1;
|
|
581
|
-
const target = isLast ? outputTarget : this.device.createRenderTarget({
|
|
582
|
-
width: this.width,
|
|
583
|
-
height: this.height,
|
|
584
|
-
label: `renderer-postprocess-${pass.name}`,
|
|
585
|
-
format: "rgba8",
|
|
586
|
-
depth: false
|
|
587
|
-
});
|
|
588
|
-
if (target)
|
|
589
|
-
ownedTargets.push(target);
|
|
590
|
-
if (pass.name === "tone-mapping") {
|
|
591
|
-
new ToneMappingPass({
|
|
592
|
-
source: current,
|
|
593
|
-
target,
|
|
594
|
-
outputColorSpace: "srgb",
|
|
595
|
-
...pass.options
|
|
596
|
-
}).execute({ device: this.device, width: this.width, height: this.height });
|
|
597
|
-
}
|
|
598
|
-
else if (pass.name === "bloom") {
|
|
599
|
-
new BloomPass({
|
|
600
|
-
source: current,
|
|
601
|
-
target,
|
|
602
|
-
...pass.options
|
|
603
|
-
}).execute({ device: this.device, width: this.width, height: this.height });
|
|
604
|
-
}
|
|
605
|
-
else if (pass.name === "fxaa") {
|
|
606
|
-
new FXAAPass({
|
|
607
|
-
source: current,
|
|
608
|
-
target,
|
|
609
|
-
...pass.options
|
|
610
|
-
}).execute({ device: this.device, width: this.width, height: this.height });
|
|
611
|
-
}
|
|
612
|
-
else {
|
|
613
|
-
this.executePixelPostprocessPass(pass, current, target, forwardTarget);
|
|
614
|
-
}
|
|
615
|
-
if (target)
|
|
616
|
-
current = target;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
executeFusedLdrPostprocess(current, passes, outputTarget, forceCpuDeterministic = false) {
|
|
620
|
-
const nativeHdrBloom = isHdrRenderTarget(current) && passes[0]?.name === "bloom" && passes[1]?.name === "tone-mapping";
|
|
621
|
-
if (nativeHdrBloom && (forceCpuDeterministic || !this.device.presentLdrPostprocess))
|
|
622
|
-
return false;
|
|
623
|
-
if (!canFuseLdrPostprocess(current, passes))
|
|
624
|
-
return false;
|
|
625
|
-
if (!forceCpuDeterministic && !this.device.presentLdrPostprocess && passes.some((pass) => pass.name === "depth-of-field" || pass.name === "motion-blur" || pass.name === "ssao" || pass.name === "ssr" || pass.name === "taa"))
|
|
626
|
-
return false;
|
|
627
|
-
// A caller that supplies its own `depth` array for depth-of-field/SSAO/SSR gets a plain
|
|
628
|
-
// depth renderbuffer, because `postprocessRequiresDepthTexture` only requests a
|
|
629
|
-
// sampleable depth texture when the renderer has to generate the depth itself. The
|
|
630
|
-
// backend's fused path samples `depthTextureHandle` regardless and used to throw
|
|
631
|
-
// `WEBGL_LDR_POSTPROCESS_DEPTH_REQUIRED`, failing the whole render rather than falling
|
|
632
|
-
// back. Declining fusion here routes those passes through the per-pass CPU path, which
|
|
633
|
-
// consumes the caller's depth directly and is the behaviour the options already imply.
|
|
634
|
-
if (!forceCpuDeterministic && !current.depthTexture && passes.some((pass) => pass.name === "depth-of-field" || pass.name === "ssao" || pass.name === "ssr"))
|
|
635
|
-
return false;
|
|
636
|
-
if (!forceCpuDeterministic && this.device.presentLdrPostprocess) {
|
|
637
|
-
this.device.presentLdrPostprocess(current, {
|
|
638
|
-
passes: passes.map((pass) => ({
|
|
639
|
-
name: pass.name,
|
|
640
|
-
options: pass.options
|
|
641
|
-
})),
|
|
642
|
-
...(outputTarget ? { outputTarget } : {}),
|
|
643
|
-
toneMappingDefaults: { outputColorSpace: "srgb" }
|
|
644
|
-
});
|
|
645
|
-
return true;
|
|
646
|
-
}
|
|
647
|
-
this.device.setRenderTarget(current);
|
|
648
|
-
const pixels = fusedLdrPostprocessPixels(this.device.readPixels(0, 0, current.width, current.height), current.width, current.height, passes, {
|
|
649
|
-
mutateInput: true,
|
|
650
|
-
scratch: this.fusedLdrPostprocessScratch,
|
|
651
|
-
toneMappingDefaults: { outputColorSpace: "srgb" }
|
|
652
|
-
});
|
|
653
|
-
writePostProcessPixels(this.device, current, outputTarget, pixels);
|
|
654
|
-
return true;
|
|
1370
|
+
return this.host.post.executePostprocess(postprocess, ownedTargets, outputTarget);
|
|
655
1371
|
}
|
|
656
1372
|
async executePostprocessAsync(postprocess, ownedTargets, outputTarget) {
|
|
657
|
-
|
|
658
|
-
let current = forwardTarget;
|
|
659
|
-
if (!current) {
|
|
660
|
-
throw new RenderDeviceError("Renderer postprocess missing forward render target", "POSTPROCESS_TARGET_MISSING");
|
|
661
|
-
}
|
|
662
|
-
const passes = createRendererPostprocessPasses(postprocess);
|
|
663
|
-
if (passes.length === 0) {
|
|
664
|
-
if (outputTarget) {
|
|
665
|
-
this.device.setRenderTarget(current);
|
|
666
|
-
writePostProcessPixels(this.device, current, outputTarget, await this.readRenderTargetPixelsAsync(current));
|
|
667
|
-
}
|
|
668
|
-
else {
|
|
669
|
-
this.device.presentRenderTarget?.(current);
|
|
670
|
-
}
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
if (await this.executeFusedLdrPostprocessAsync(current, passes, outputTarget, postprocess.execution === "cpu-deterministic"))
|
|
674
|
-
return;
|
|
675
|
-
for (let index = 0; index < passes.length; index += 1) {
|
|
676
|
-
const pass = passes[index];
|
|
677
|
-
const nextPass = passes[index + 1];
|
|
678
|
-
if (pass.name === "bloom" && isHdrRenderTarget(current)) {
|
|
679
|
-
if (nextPass?.name !== "tone-mapping") {
|
|
680
|
-
throw new RenderDeviceError("Renderer HDR bloom requires tone mapping immediately after the float bloom pass.", "HDR_BLOOM_TONEMAPPING_REQUIRED", {
|
|
681
|
-
source: current.label
|
|
682
|
-
});
|
|
683
|
-
}
|
|
684
|
-
const isCombinedLast = index + 1 === passes.length - 1;
|
|
685
|
-
const target = isCombinedLast ? outputTarget : this.device.createRenderTarget({
|
|
686
|
-
width: this.width,
|
|
687
|
-
height: this.height,
|
|
688
|
-
label: "renderer-postprocess-tone-mapping",
|
|
689
|
-
format: "rgba8",
|
|
690
|
-
depth: false
|
|
691
|
-
});
|
|
692
|
-
if (target)
|
|
693
|
-
ownedTargets.push(target);
|
|
694
|
-
const bloomed = bloomFloatPixels(await this.readRenderTargetFloatPixelsAsync(current), current.width, current.height, pass.options);
|
|
695
|
-
const mapped = toneMapFloatPixels(bloomed.pixels, current.width, current.height, {
|
|
696
|
-
outputColorSpace: "srgb",
|
|
697
|
-
...nextPass.options
|
|
698
|
-
});
|
|
699
|
-
writePostProcessPixels(this.device, current, target, mapped.pixels);
|
|
700
|
-
if (target)
|
|
701
|
-
current = target;
|
|
702
|
-
index += 1;
|
|
703
|
-
continue;
|
|
704
|
-
}
|
|
705
|
-
const isLast = index === passes.length - 1;
|
|
706
|
-
const target = isLast ? outputTarget : this.device.createRenderTarget({
|
|
707
|
-
width: this.width,
|
|
708
|
-
height: this.height,
|
|
709
|
-
label: `renderer-postprocess-${pass.name}`,
|
|
710
|
-
format: "rgba8",
|
|
711
|
-
depth: false
|
|
712
|
-
});
|
|
713
|
-
if (target)
|
|
714
|
-
ownedTargets.push(target);
|
|
715
|
-
if (pass.name === "tone-mapping") {
|
|
716
|
-
const mapped = isHdrRenderTarget(current)
|
|
717
|
-
? toneMapFloatPixels(await this.readRenderTargetFloatPixelsAsync(current), current.width, current.height, {
|
|
718
|
-
outputColorSpace: "srgb",
|
|
719
|
-
...pass.options
|
|
720
|
-
})
|
|
721
|
-
: toneMapPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, {
|
|
722
|
-
outputColorSpace: "srgb",
|
|
723
|
-
...pass.options
|
|
724
|
-
});
|
|
725
|
-
writePostProcessPixels(this.device, current, target, mapped.pixels);
|
|
726
|
-
}
|
|
727
|
-
else if (pass.name === "bloom") {
|
|
728
|
-
const bloomed = bloomPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, pass.options);
|
|
729
|
-
writePostProcessPixels(this.device, current, target, bloomed.pixels);
|
|
730
|
-
}
|
|
731
|
-
else if (pass.name === "fxaa") {
|
|
732
|
-
const smoothed = fxaaPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, pass.options);
|
|
733
|
-
writePostProcessPixels(this.device, current, target, smoothed.pixels);
|
|
734
|
-
}
|
|
735
|
-
else {
|
|
736
|
-
await this.executePixelPostprocessPassAsync(pass, current, target, forwardTarget);
|
|
737
|
-
}
|
|
738
|
-
if (target)
|
|
739
|
-
current = target;
|
|
740
|
-
}
|
|
741
|
-
}
|
|
742
|
-
async executeFusedLdrPostprocessAsync(current, passes, outputTarget, forceCpuDeterministic = false) {
|
|
743
|
-
const nativeHdrBloom = isHdrRenderTarget(current) && passes[0]?.name === "bloom" && passes[1]?.name === "tone-mapping";
|
|
744
|
-
if (nativeHdrBloom && (forceCpuDeterministic || !this.device.presentLdrPostprocess))
|
|
745
|
-
return false;
|
|
746
|
-
if (!canFuseLdrPostprocess(current, passes))
|
|
747
|
-
return false;
|
|
748
|
-
if (!forceCpuDeterministic && !this.device.presentLdrPostprocess && passes.some((pass) => pass.name === "depth-of-field" || pass.name === "motion-blur" || pass.name === "ssao" || pass.name === "ssr" || pass.name === "taa"))
|
|
749
|
-
return false;
|
|
750
|
-
// A caller that supplies its own `depth` array for depth-of-field/SSAO/SSR gets a plain
|
|
751
|
-
// depth renderbuffer, because `postprocessRequiresDepthTexture` only requests a
|
|
752
|
-
// sampleable depth texture when the renderer has to generate the depth itself. The
|
|
753
|
-
// backend's fused path samples `depthTextureHandle` regardless and used to throw
|
|
754
|
-
// `WEBGL_LDR_POSTPROCESS_DEPTH_REQUIRED`, failing the whole render rather than falling
|
|
755
|
-
// back. Declining fusion here routes those passes through the per-pass CPU path, which
|
|
756
|
-
// consumes the caller's depth directly and is the behaviour the options already imply.
|
|
757
|
-
if (!forceCpuDeterministic && !current.depthTexture && passes.some((pass) => pass.name === "depth-of-field" || pass.name === "ssao" || pass.name === "ssr"))
|
|
758
|
-
return false;
|
|
759
|
-
if (!forceCpuDeterministic && this.device.presentLdrPostprocess) {
|
|
760
|
-
this.device.presentLdrPostprocess(current, {
|
|
761
|
-
passes: passes.map((pass) => ({
|
|
762
|
-
name: pass.name,
|
|
763
|
-
options: pass.options
|
|
764
|
-
})),
|
|
765
|
-
...(outputTarget ? { outputTarget } : {}),
|
|
766
|
-
toneMappingDefaults: { outputColorSpace: "srgb" }
|
|
767
|
-
});
|
|
768
|
-
return true;
|
|
769
|
-
}
|
|
770
|
-
const pixels = fusedLdrPostprocessPixels(await this.readRenderTargetPixelsAsync(current), current.width, current.height, passes, {
|
|
771
|
-
mutateInput: true,
|
|
772
|
-
scratch: this.fusedLdrPostprocessScratch,
|
|
773
|
-
toneMappingDefaults: { outputColorSpace: "srgb" }
|
|
774
|
-
});
|
|
775
|
-
writePostProcessPixels(this.device, current, outputTarget, pixels);
|
|
776
|
-
return true;
|
|
777
|
-
}
|
|
778
|
-
executePixelPostprocessPass(pass, source, target, forwardTarget) {
|
|
779
|
-
this.device.setRenderTarget(source);
|
|
780
|
-
const input = this.device.readPixels(0, 0, source.width, source.height);
|
|
781
|
-
const rendererDepth = isDepthPostprocessPass(pass.name) && !postprocessPassHasDepth(pass.options)
|
|
782
|
-
? this.readRendererOwnedDepthTexture(forwardTarget)
|
|
783
|
-
: undefined;
|
|
784
|
-
const result = pass.name === "color-grade"
|
|
785
|
-
? colorGradePixels(input, source.width, source.height, pass.options).pixels
|
|
786
|
-
: pass.name === "chromatic-aberration"
|
|
787
|
-
? chromaticAberrationPixels(input, source.width, source.height, pass.options).pixels
|
|
788
|
-
: pass.name === "film-grain"
|
|
789
|
-
? filmGrainPixels(input, source.width, source.height, pass.options).pixels
|
|
790
|
-
: pass.name === "depth-of-field"
|
|
791
|
-
? depthOfFieldPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
792
|
-
: pass.name === "volumetric-light"
|
|
793
|
-
? volumetricLightPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
794
|
-
: pass.name === "motion-blur"
|
|
795
|
-
? motionBlurPixels(input, source.width, source.height, pass.options).pixels
|
|
796
|
-
: pass.name === "contact-shadow"
|
|
797
|
-
? contactShadowPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
798
|
-
: pass.name === "ssao"
|
|
799
|
-
? ssaoPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
800
|
-
: pass.name === "ssr"
|
|
801
|
-
? ssrPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
802
|
-
: pass.name === "taa"
|
|
803
|
-
? taaPixels(input, source.width, source.height, pass.options).pixels
|
|
804
|
-
: pass.name === "outline"
|
|
805
|
-
? outlinePixels(input, source.width, source.height, pass.options).pixels
|
|
806
|
-
: undefined;
|
|
807
|
-
if (!result) {
|
|
808
|
-
throw new RenderDeviceError("Renderer postprocess pass is outside the supported renderer pass catalog", "POSTPROCESS_PASS_UNKNOWN", {
|
|
809
|
-
pass: pass.name
|
|
810
|
-
});
|
|
811
|
-
}
|
|
812
|
-
writePostProcessPixels(this.device, source, target, result);
|
|
813
|
-
}
|
|
814
|
-
async executePixelPostprocessPassAsync(pass, source, target, forwardTarget) {
|
|
815
|
-
const input = await this.readRenderTargetPixelsAsync(source);
|
|
816
|
-
const rendererDepth = isDepthPostprocessPass(pass.name) && !postprocessPassHasDepth(pass.options)
|
|
817
|
-
? this.readRendererOwnedDepthTexture(forwardTarget)
|
|
818
|
-
: undefined;
|
|
819
|
-
const result = pass.name === "color-grade"
|
|
820
|
-
? colorGradePixels(input, source.width, source.height, pass.options).pixels
|
|
821
|
-
: pass.name === "chromatic-aberration"
|
|
822
|
-
? chromaticAberrationPixels(input, source.width, source.height, pass.options).pixels
|
|
823
|
-
: pass.name === "film-grain"
|
|
824
|
-
? filmGrainPixels(input, source.width, source.height, pass.options).pixels
|
|
825
|
-
: pass.name === "depth-of-field"
|
|
826
|
-
? depthOfFieldPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
827
|
-
: pass.name === "volumetric-light"
|
|
828
|
-
? volumetricLightPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
829
|
-
: pass.name === "motion-blur"
|
|
830
|
-
? motionBlurPixels(input, source.width, source.height, pass.options).pixels
|
|
831
|
-
: pass.name === "contact-shadow"
|
|
832
|
-
? contactShadowPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
833
|
-
: pass.name === "ssao"
|
|
834
|
-
? ssaoPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
835
|
-
: pass.name === "ssr"
|
|
836
|
-
? ssrPixels(input, source.width, source.height, withRendererDepth(pass.options, rendererDepth)).pixels
|
|
837
|
-
: pass.name === "taa"
|
|
838
|
-
? taaPixels(input, source.width, source.height, pass.options).pixels
|
|
839
|
-
: pass.name === "outline"
|
|
840
|
-
? outlinePixels(input, source.width, source.height, pass.options).pixels
|
|
841
|
-
: undefined;
|
|
842
|
-
if (!result) {
|
|
843
|
-
throw new RenderDeviceError("Renderer postprocess pass is outside the supported renderer pass catalog", "POSTPROCESS_PASS_UNKNOWN", {
|
|
844
|
-
pass: pass.name
|
|
845
|
-
});
|
|
846
|
-
}
|
|
847
|
-
writePostProcessPixels(this.device, source, target, result);
|
|
848
|
-
}
|
|
849
|
-
async readRenderTargetPixelsAsync(target) {
|
|
850
|
-
this.device.setRenderTarget(target);
|
|
851
|
-
if (this.device.readPixelsAsync && target.colorTexture.format === "rgba8") {
|
|
852
|
-
return this.device.readPixelsAsync(0, 0, target.width, target.height);
|
|
853
|
-
}
|
|
854
|
-
return this.device.readPixels(0, 0, target.width, target.height);
|
|
855
|
-
}
|
|
856
|
-
async readRenderTargetFloatPixelsAsync(target) {
|
|
857
|
-
this.device.setRenderTarget(target);
|
|
858
|
-
if (this.device.readFloatPixelsAsync && isHdrRenderTarget(target)) {
|
|
859
|
-
return this.device.readFloatPixelsAsync(0, 0, target.width, target.height);
|
|
860
|
-
}
|
|
861
|
-
return this.device.readFloatPixels(0, 0, target.width, target.height);
|
|
862
|
-
}
|
|
863
|
-
readRendererOwnedDepthTexture(forwardTarget) {
|
|
864
|
-
if (!forwardTarget.depthTexture) {
|
|
865
|
-
throw new RenderDeviceError("Renderer-owned depth postprocess requires the forward target to expose a depth texture.", "POSTPROCESS_DEPTH_TARGET_MISSING", {
|
|
866
|
-
renderTarget: forwardTarget.label
|
|
867
|
-
});
|
|
868
|
-
}
|
|
869
|
-
if (!this.device.readDepthPixels) {
|
|
870
|
-
throw new RenderDeviceError("Renderer-owned depth postprocess requires backend depth readback.", "DEPTH_READBACK_UNSUPPORTED", {
|
|
871
|
-
backend: this.device.kind
|
|
872
|
-
});
|
|
873
|
-
}
|
|
874
|
-
this.device.setRenderTarget(forwardTarget);
|
|
875
|
-
return createDepthTextureBinding({
|
|
876
|
-
label: forwardTarget.depthTexture.label,
|
|
877
|
-
width: forwardTarget.width,
|
|
878
|
-
height: forwardTarget.height,
|
|
879
|
-
data: this.device.readDepthPixels(0, 0, forwardTarget.width, forwardTarget.height)
|
|
880
|
-
});
|
|
1373
|
+
return this.host.post.executePostprocessAsync(postprocess, ownedTargets, outputTarget);
|
|
881
1374
|
}
|
|
882
1375
|
executeRendererShadowMap(options) {
|
|
883
|
-
|
|
884
|
-
return undefined;
|
|
885
|
-
}
|
|
886
|
-
if (!this.device.info.capabilities?.includes("render-targets")) {
|
|
887
|
-
throw new RenderDeviceError("Renderer-owned shadows require render targets", "SHADOW_RENDER_TARGET_UNSUPPORTED", {
|
|
888
|
-
backend: this.device.kind
|
|
889
|
-
});
|
|
890
|
-
}
|
|
891
|
-
const light = options.shadowOptions.light ?? firstShadowCastingLight(options.source, options.lights);
|
|
892
|
-
if (light instanceof PointLight) {
|
|
893
|
-
return this.executeRendererPointShadowMap({
|
|
894
|
-
shadowOptions: options.shadowOptions,
|
|
895
|
-
items: options.items,
|
|
896
|
-
ownedTargets: options.ownedTargets,
|
|
897
|
-
ownedShadowPasses: options.ownedShadowPasses,
|
|
898
|
-
light
|
|
899
|
-
});
|
|
900
|
-
}
|
|
901
|
-
if (light && !(light instanceof DirectionalLight) && !(light instanceof SpotLight)) {
|
|
902
|
-
throw new RenderDeviceError("Renderer-owned shadow maps require directional, spot, or point lights.", "SHADOW_LIGHT_TYPE_UNSUPPORTED", {
|
|
903
|
-
lightName: light.name,
|
|
904
|
-
lightType: light.constructor.name
|
|
905
|
-
});
|
|
906
|
-
}
|
|
907
|
-
if (light instanceof DirectionalLight
|
|
908
|
-
&& options.camera instanceof PerspectiveCamera
|
|
909
|
-
&& (options.shadowOptions.cascadeCount ?? 1) > 1) {
|
|
910
|
-
return this.executeRendererCascadedShadowMap({
|
|
911
|
-
shadowOptions: options.shadowOptions,
|
|
912
|
-
items: options.items,
|
|
913
|
-
ownedShadowPasses: options.ownedShadowPasses,
|
|
914
|
-
light,
|
|
915
|
-
camera: options.camera
|
|
916
|
-
});
|
|
917
|
-
}
|
|
918
|
-
const lightMatrix = options.shadowOptions.lightMatrix
|
|
919
|
-
? toMat4(options.shadowOptions.lightMatrix, "shadow.lightMatrix")
|
|
920
|
-
: createRendererOwnedShadowMatrix(light, options.items, firstShadowCastingCollectedLight(options.lights));
|
|
921
|
-
const shadowMap = new ShadowMap({
|
|
922
|
-
size: options.shadowOptions.size,
|
|
923
|
-
bias: options.shadowOptions.bias,
|
|
924
|
-
filter: options.shadowOptions.filter,
|
|
925
|
-
pcfRadius: options.shadowOptions.pcfRadius,
|
|
926
|
-
pcfSamples: options.shadowOptions.pcfSamples,
|
|
927
|
-
pcfDistribution: options.shadowOptions.pcfDistribution,
|
|
928
|
-
label: options.shadowOptions.label ?? "renderer-shadow-map"
|
|
929
|
-
});
|
|
930
|
-
const shadowPass = new ShadowPass({
|
|
931
|
-
light,
|
|
932
|
-
casters: options.items,
|
|
933
|
-
shadowMap,
|
|
934
|
-
viewProjectionMatrix: lightMatrix,
|
|
935
|
-
shaderLibrary: this.shaderLibrary,
|
|
936
|
-
renderTarget: this.ensureShadowDepthTarget(shadowMap.size)
|
|
937
|
-
});
|
|
938
|
-
options.ownedShadowPasses.push(shadowPass);
|
|
939
|
-
const result = shadowPass.execute({ device: this.device, width: this.width, height: this.height });
|
|
940
|
-
if (!result.rendered) {
|
|
941
|
-
if (result.reason === "no-light" || result.reason === "light-disabled" || result.reason === "not-shadow-casting") {
|
|
942
|
-
throw new RenderDeviceError("Renderer-owned shadows require an enabled shadow-casting light.", "SHADOW_LIGHT_REQUIRED", {
|
|
943
|
-
reason: result.reason
|
|
944
|
-
});
|
|
945
|
-
}
|
|
946
|
-
return undefined;
|
|
947
|
-
}
|
|
948
|
-
return shadowPass.getForwardShadowMap({
|
|
949
|
-
lightMatrix,
|
|
950
|
-
strength: options.shadowOptions.strength,
|
|
951
|
-
slopeBias: options.shadowOptions.slopeBias,
|
|
952
|
-
texelSize: options.shadowOptions.texelSize,
|
|
953
|
-
bias: options.shadowOptions.bias,
|
|
954
|
-
filterKernel: options.shadowOptions.filterKernel
|
|
955
|
-
}) ?? undefined;
|
|
956
|
-
}
|
|
957
|
-
executeRendererCascadedShadowMap(options) {
|
|
958
|
-
const cascadeCount = options.shadowOptions.cascadeCount ?? 4;
|
|
959
|
-
if (!Number.isInteger(cascadeCount) || cascadeCount < 2 || cascadeCount > 4) {
|
|
960
|
-
throw new RenderDeviceError("Renderer cascadeCount must be an integer in [2, 4].", "SHADOW_CASCADE_CONTRACT", { cascadeCount });
|
|
961
|
-
}
|
|
962
|
-
options.camera.transform.updateWorld(undefined, true);
|
|
963
|
-
const position = cameraWorldPosition(options.camera);
|
|
964
|
-
const world = options.camera.transform.worldMatrix;
|
|
965
|
-
const target = [
|
|
966
|
-
position[0] - (world[8] ?? 0),
|
|
967
|
-
position[1] - (world[9] ?? 0),
|
|
968
|
-
position[2] - (world[10] ?? 1)
|
|
969
|
-
];
|
|
970
|
-
const cascades = new CascadedShadowMaps({
|
|
971
|
-
cascadeCount,
|
|
972
|
-
near: options.camera.near,
|
|
973
|
-
far: options.camera.far,
|
|
974
|
-
lambda: options.shadowOptions.cascadeLambda ?? 0.6,
|
|
975
|
-
size: options.shadowOptions.size,
|
|
976
|
-
bias: options.shadowOptions.bias,
|
|
977
|
-
filter: options.shadowOptions.filter,
|
|
978
|
-
pcfRadius: options.shadowOptions.pcfRadius,
|
|
979
|
-
pcfSamples: options.shadowOptions.pcfSamples,
|
|
980
|
-
label: options.shadowOptions.label ?? "renderer-csm"
|
|
981
|
-
});
|
|
982
|
-
const fits = cascades.computeStableCameraFits({
|
|
983
|
-
camera: {
|
|
984
|
-
position,
|
|
985
|
-
target,
|
|
986
|
-
fovYRadians: options.camera.fovYRadians,
|
|
987
|
-
aspect: options.camera.aspect
|
|
988
|
-
},
|
|
989
|
-
lightDirection: options.light.getDirection(),
|
|
990
|
-
casters: [],
|
|
991
|
-
receivers: [],
|
|
992
|
-
padding: options.shadowOptions.cascadePadding ?? 0.25,
|
|
993
|
-
stabilize: true
|
|
994
|
-
});
|
|
995
|
-
const lightMatrices = fits.map(shadowCameraFitViewProjectionMatrix);
|
|
996
|
-
const cascadePass = new CascadedShadowPass({
|
|
997
|
-
light: options.light,
|
|
998
|
-
casters: options.items,
|
|
999
|
-
cascades,
|
|
1000
|
-
viewProjectionMatrices: lightMatrices,
|
|
1001
|
-
shaderLibrary: this.shaderLibrary
|
|
1002
|
-
});
|
|
1003
|
-
const result = cascadePass.execute({ device: this.device, width: this.width, height: this.height });
|
|
1004
|
-
options.ownedShadowPasses.push(cascadePass);
|
|
1005
|
-
if (!result.rendered)
|
|
1006
|
-
return undefined;
|
|
1007
|
-
const maps = cascadePass.getForwardShadowMaps({
|
|
1008
|
-
lightMatrices,
|
|
1009
|
-
strength: options.shadowOptions.strength,
|
|
1010
|
-
slopeBias: options.shadowOptions.slopeBias,
|
|
1011
|
-
texelSize: options.shadowOptions.texelSize,
|
|
1012
|
-
bias: options.shadowOptions.bias,
|
|
1013
|
-
filterKernel: options.shadowOptions.filterKernel
|
|
1014
|
-
});
|
|
1015
|
-
const first = maps[0];
|
|
1016
|
-
if (!first || maps.length !== result.cascades.length)
|
|
1017
|
-
return undefined;
|
|
1018
|
-
return {
|
|
1019
|
-
...first,
|
|
1020
|
-
cascades: result.cascades.map((cascade, index) => ({
|
|
1021
|
-
index: cascade.index,
|
|
1022
|
-
near: cascade.split.near,
|
|
1023
|
-
far: cascade.split.far,
|
|
1024
|
-
shadowMap: maps[index]
|
|
1025
|
-
}))
|
|
1026
|
-
};
|
|
1027
|
-
}
|
|
1028
|
-
executeRendererPointShadowMap(options) {
|
|
1029
|
-
if (!this.device.writeRenderTargetPixels) {
|
|
1030
|
-
throw new RenderDeviceError("Renderer-owned point shadows require render-target pixel upload for the point-light atlas.", "POINT_SHADOW_ATLAS_UPLOAD_UNSUPPORTED", {
|
|
1031
|
-
backend: this.device.kind
|
|
1032
|
-
});
|
|
1033
|
-
}
|
|
1034
|
-
options.light.transform.updateWorld(undefined, true);
|
|
1035
|
-
const size = options.shadowOptions.size ?? 512;
|
|
1036
|
-
const faceMatrices = createPointShadowFaceMatrices(options.light);
|
|
1037
|
-
const faceRects = createPointShadowFaceRects();
|
|
1038
|
-
const shadowMapOptions = {
|
|
1039
|
-
size,
|
|
1040
|
-
bias: options.shadowOptions.bias,
|
|
1041
|
-
filter: options.shadowOptions.filter,
|
|
1042
|
-
pcfRadius: options.shadowOptions.pcfRadius,
|
|
1043
|
-
pcfSamples: options.shadowOptions.pcfSamples,
|
|
1044
|
-
pcfDistribution: options.shadowOptions.pcfDistribution
|
|
1045
|
-
};
|
|
1046
|
-
const atlasPixels = new Uint8Array(size * 3 * size * 2 * 4);
|
|
1047
|
-
for (let face = 0; face < 6; face += 1) {
|
|
1048
|
-
const faceMatrix = faceMatrices.slice(face * 16, face * 16 + 16);
|
|
1049
|
-
const shadowPass = new ShadowPass({
|
|
1050
|
-
light: options.light,
|
|
1051
|
-
casters: options.items,
|
|
1052
|
-
shadowMap: new ShadowMap({ ...shadowMapOptions, label: `${options.shadowOptions.label ?? "renderer-point-shadow"}-face-${face}` }),
|
|
1053
|
-
viewProjectionMatrix: faceMatrix,
|
|
1054
|
-
shaderLibrary: this.shaderLibrary
|
|
1055
|
-
});
|
|
1056
|
-
options.ownedShadowPasses.push(shadowPass);
|
|
1057
|
-
const result = shadowPass.execute({ device: this.device, width: this.width, height: this.height });
|
|
1058
|
-
if (!result.rendered) {
|
|
1059
|
-
return undefined;
|
|
1060
|
-
}
|
|
1061
|
-
const target = shadowPass.getRenderTarget();
|
|
1062
|
-
if (!target) {
|
|
1063
|
-
throw new RenderDeviceError("Renderer-owned point shadow face did not expose a render target.", "POINT_SHADOW_FACE_TARGET_MISSING", { face });
|
|
1064
|
-
}
|
|
1065
|
-
const facePixels = readShadowFacePixels(this.device, target);
|
|
1066
|
-
blitPointShadowFace(atlasPixels, size * 3, size * 2, facePixels, size, faceRects, face);
|
|
1067
|
-
}
|
|
1068
|
-
const atlasTarget = this.device.createRenderTarget({
|
|
1069
|
-
width: size * 3,
|
|
1070
|
-
height: size * 2,
|
|
1071
|
-
label: `${options.shadowOptions.label ?? "renderer-point-shadow"}-atlas`,
|
|
1072
|
-
format: "rgba8",
|
|
1073
|
-
depth: false
|
|
1074
|
-
});
|
|
1075
|
-
options.ownedTargets.push(atlasTarget);
|
|
1076
|
-
this.device.writeRenderTargetPixels(atlasTarget, atlasPixels);
|
|
1077
|
-
const texture = new TextureBinding({
|
|
1078
|
-
name: "u_pointShadowMapTexture",
|
|
1079
|
-
texture: atlasTarget.colorTexture,
|
|
1080
|
-
sampler: new Sampler({ minFilter: "nearest", magFilter: "nearest", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
1081
|
-
required: true
|
|
1082
|
-
});
|
|
1083
|
-
return {
|
|
1084
|
-
texture: new TextureBinding({
|
|
1085
|
-
name: "u_shadowMapTexture",
|
|
1086
|
-
texture: atlasTarget.colorTexture,
|
|
1087
|
-
sampler: new Sampler({ minFilter: "nearest", magFilter: "nearest", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
1088
|
-
required: true
|
|
1089
|
-
}),
|
|
1090
|
-
lightMatrix: identityMat4(),
|
|
1091
|
-
strength: options.shadowOptions.strength,
|
|
1092
|
-
slopeBias: options.shadowOptions.slopeBias,
|
|
1093
|
-
texelSize: options.shadowOptions.texelSize,
|
|
1094
|
-
bias: options.shadowOptions.bias,
|
|
1095
|
-
filterKernel: options.shadowOptions.filterKernel,
|
|
1096
|
-
pointLight: {
|
|
1097
|
-
texture,
|
|
1098
|
-
lightPosition: [options.light.transform.worldMatrix[12], options.light.transform.worldMatrix[13], options.light.transform.worldMatrix[14]],
|
|
1099
|
-
range: options.light.range,
|
|
1100
|
-
faceMatrices,
|
|
1101
|
-
faceRects,
|
|
1102
|
-
strength: options.shadowOptions.strength,
|
|
1103
|
-
slopeBias: options.shadowOptions.slopeBias,
|
|
1104
|
-
texelSize: [1 / Math.max(1, size * 3), 1 / Math.max(1, size * 2)],
|
|
1105
|
-
bias: options.shadowOptions.bias,
|
|
1106
|
-
filterKernel: options.shadowOptions.filterKernel
|
|
1107
|
-
}
|
|
1108
|
-
};
|
|
1376
|
+
return this.host.shadows.executeRendererShadowMap(options);
|
|
1109
1377
|
}
|
|
1110
1378
|
}
|
|
1111
1379
|
export function pickSceneRenderables(source, ray, options = {}) {
|
|
@@ -1266,28 +1534,6 @@ function inferInitialCanvasDimension(canvas, axis) {
|
|
|
1266
1534
|
const displaySize = Math.round(cssSize * dpr);
|
|
1267
1535
|
return Math.max(1, displaySize || (axis === "width" ? canvas.width : canvas.height) || 1);
|
|
1268
1536
|
}
|
|
1269
|
-
function collectEnvironmentLighting(source) {
|
|
1270
|
-
if (source instanceof Scene || isIterable(source))
|
|
1271
|
-
return undefined;
|
|
1272
|
-
if (source.environmentLighting === false)
|
|
1273
|
-
return cloneEnvironmentLighting(DISABLED_RENDERER_ENVIRONMENT_LIGHTING);
|
|
1274
|
-
if (source.environmentLighting)
|
|
1275
|
-
return source.environmentLighting;
|
|
1276
|
-
return cloneEnvironmentLighting(DEFAULT_RENDERER_ENVIRONMENT_LIGHTING);
|
|
1277
|
-
}
|
|
1278
|
-
function collectEnvironmentBackground(source) {
|
|
1279
|
-
if (source instanceof Scene || isIterable(source) || source.environmentBackground === false)
|
|
1280
|
-
return undefined;
|
|
1281
|
-
return source.environmentBackground;
|
|
1282
|
-
}
|
|
1283
|
-
function collectEnvironmentFog(source) {
|
|
1284
|
-
if (source instanceof Scene || isIterable(source))
|
|
1285
|
-
return undefined;
|
|
1286
|
-
return source.environmentFog;
|
|
1287
|
-
}
|
|
1288
|
-
function collectForwardShadowMap(source) {
|
|
1289
|
-
return source instanceof Scene || isIterable(source) ? undefined : source.shadowMap;
|
|
1290
|
-
}
|
|
1291
1537
|
function collectRenderTarget(source) {
|
|
1292
1538
|
return source instanceof Scene || isIterable(source) ? undefined : source.renderTarget;
|
|
1293
1539
|
}
|
|
@@ -1309,206 +1555,6 @@ function validateExplicitRenderTarget(target, width, height) {
|
|
|
1309
1555
|
});
|
|
1310
1556
|
}
|
|
1311
1557
|
}
|
|
1312
|
-
function collectRendererShadowOptions(source) {
|
|
1313
|
-
if (source instanceof Scene || isIterable(source))
|
|
1314
|
-
return undefined;
|
|
1315
|
-
if (source.shadow === true)
|
|
1316
|
-
return {};
|
|
1317
|
-
if (!source.shadow)
|
|
1318
|
-
return undefined;
|
|
1319
|
-
return source.shadow;
|
|
1320
|
-
}
|
|
1321
|
-
function firstShadowCastingLight(source, lights) {
|
|
1322
|
-
const explicit = lights.find((light) => light.castsShadow && light.source.visible)?.source;
|
|
1323
|
-
if (explicit)
|
|
1324
|
-
return explicit;
|
|
1325
|
-
const scene = sceneFromSource(source);
|
|
1326
|
-
return scene?.collectLights().find((light) => light.visible && light.castsShadow) ?? null;
|
|
1327
|
-
}
|
|
1328
|
-
function firstShadowCastingCollectedLight(lights) {
|
|
1329
|
-
return lights.find((light) => light.castsShadow && light.source.visible);
|
|
1330
|
-
}
|
|
1331
|
-
function lightDirectionFromLight(light) {
|
|
1332
|
-
if (!light)
|
|
1333
|
-
return [0, -1, -1];
|
|
1334
|
-
const direction = light instanceof DirectionalLight ? light.getDirection() : undefined;
|
|
1335
|
-
return normalizeVec3([
|
|
1336
|
-
Number(direction?.[0] ?? 0),
|
|
1337
|
-
Number(direction?.[1] ?? -1),
|
|
1338
|
-
Number(direction?.[2] ?? -1)
|
|
1339
|
-
]);
|
|
1340
|
-
}
|
|
1341
|
-
function createRendererOwnedShadowMatrix(light, items, collectedLight) {
|
|
1342
|
-
if (light instanceof SpotLight) {
|
|
1343
|
-
light.transform.updateWorld(undefined, true);
|
|
1344
|
-
const near = 0.01;
|
|
1345
|
-
const far = Math.max(near + 0.01, light.range);
|
|
1346
|
-
const projectionMatrix = perspectiveMat4(light.angle * 2, 1, near, far);
|
|
1347
|
-
return multiplyMat4(projectionMatrix, light.transform.inverseWorldMatrix);
|
|
1348
|
-
}
|
|
1349
|
-
return createDirectionalShadowMatrix(items, collectedLight?.direction ?? lightDirectionFromLight(light));
|
|
1350
|
-
}
|
|
1351
|
-
function createPointShadowFaceMatrices(light) {
|
|
1352
|
-
light.transform.updateWorld(undefined, true);
|
|
1353
|
-
const position = [
|
|
1354
|
-
light.transform.worldMatrix[12],
|
|
1355
|
-
light.transform.worldMatrix[13],
|
|
1356
|
-
light.transform.worldMatrix[14]
|
|
1357
|
-
];
|
|
1358
|
-
const projection = perspectiveMat4(Math.PI / 2, 1, 0.01, Math.max(0.02, light.range));
|
|
1359
|
-
const faces = [
|
|
1360
|
-
{ direction: [1, 0, 0], up: [0, -1, 0] },
|
|
1361
|
-
{ direction: [-1, 0, 0], up: [0, -1, 0] },
|
|
1362
|
-
{ direction: [0, 1, 0], up: [0, 0, 1] },
|
|
1363
|
-
{ direction: [0, -1, 0], up: [0, 0, -1] },
|
|
1364
|
-
{ direction: [0, 0, 1], up: [0, -1, 0] },
|
|
1365
|
-
{ direction: [0, 0, -1], up: [0, -1, 0] }
|
|
1366
|
-
];
|
|
1367
|
-
const matrices = new Float32Array(6 * 16);
|
|
1368
|
-
for (const [index, face] of faces.entries()) {
|
|
1369
|
-
const view = lookAtMatrix(position, addVec3(position, face.direction), face.up);
|
|
1370
|
-
matrices.set(multiplyMat4(projection, view), index * 16);
|
|
1371
|
-
}
|
|
1372
|
-
return matrices;
|
|
1373
|
-
}
|
|
1374
|
-
function createPointShadowFaceRects() {
|
|
1375
|
-
const rects = new Float32Array(6 * 4);
|
|
1376
|
-
for (let face = 0; face < 6; face += 1) {
|
|
1377
|
-
const column = face % 3;
|
|
1378
|
-
const row = Math.floor(face / 3);
|
|
1379
|
-
rects.set([column / 3, row / 2, 1 / 3, 1 / 2], face * 4);
|
|
1380
|
-
}
|
|
1381
|
-
return rects;
|
|
1382
|
-
}
|
|
1383
|
-
function readShadowFacePixels(device, target) {
|
|
1384
|
-
device.setRenderTarget(target);
|
|
1385
|
-
if (target.depthTexture && device.readDepthPixels) {
|
|
1386
|
-
const depth = device.readDepthPixels(0, 0, target.width, target.height);
|
|
1387
|
-
const pixels = new Uint8Array(target.width * target.height * 4);
|
|
1388
|
-
for (let index = 0; index < depth.length; index += 1) {
|
|
1389
|
-
const byte = Math.max(0, Math.min(255, Math.round((depth[index] ?? 1) * 255)));
|
|
1390
|
-
const offset = index * 4;
|
|
1391
|
-
pixels[offset] = byte;
|
|
1392
|
-
pixels[offset + 1] = byte;
|
|
1393
|
-
pixels[offset + 2] = byte;
|
|
1394
|
-
pixels[offset + 3] = 255;
|
|
1395
|
-
}
|
|
1396
|
-
return pixels;
|
|
1397
|
-
}
|
|
1398
|
-
return device.readPixels(0, 0, target.width, target.height);
|
|
1399
|
-
}
|
|
1400
|
-
function blitPointShadowFace(atlasPixels, atlasWidth, atlasHeight, facePixels, faceSize, faceRects, face) {
|
|
1401
|
-
const rectOffset = face * 4;
|
|
1402
|
-
const destX = Math.round((faceRects[rectOffset] ?? 0) * atlasWidth);
|
|
1403
|
-
const destY = Math.round((faceRects[rectOffset + 1] ?? 0) * atlasHeight);
|
|
1404
|
-
for (let row = 0; row < faceSize; row += 1) {
|
|
1405
|
-
const sourceOffset = row * faceSize * 4;
|
|
1406
|
-
const targetOffset = ((destY + row) * atlasWidth + destX) * 4;
|
|
1407
|
-
atlasPixels.set(facePixels.subarray(sourceOffset, sourceOffset + faceSize * 4), targetOffset);
|
|
1408
|
-
}
|
|
1409
|
-
}
|
|
1410
|
-
function lookAtMatrix(eye, target, up) {
|
|
1411
|
-
const forward = normalizeVec3(subtractVec3(target, eye));
|
|
1412
|
-
const right = normalizeVec3(crossVec3(forward, up));
|
|
1413
|
-
const correctedUp = crossVec3(right, forward);
|
|
1414
|
-
return [
|
|
1415
|
-
right[0], correctedUp[0], -forward[0], 0,
|
|
1416
|
-
right[1], correctedUp[1], -forward[1], 0,
|
|
1417
|
-
right[2], correctedUp[2], -forward[2], 0,
|
|
1418
|
-
-dotVec3(right, eye), -dotVec3(correctedUp, eye), dotVec3(forward, eye), 1
|
|
1419
|
-
];
|
|
1420
|
-
}
|
|
1421
|
-
function createDirectionalShadowMatrix(items, lightDirection) {
|
|
1422
|
-
const bounds = collectShadowCoverageBounds(items);
|
|
1423
|
-
if (!bounds || bounds.isEmpty()) {
|
|
1424
|
-
return identityMat4();
|
|
1425
|
-
}
|
|
1426
|
-
const basis = directionalLightBasis(lightDirection);
|
|
1427
|
-
const points = boundsCorners(bounds).map((point) => projectPointToLightSpace(point, basis));
|
|
1428
|
-
const lightBounds = boundsFromVec3(points);
|
|
1429
|
-
const width = Math.max(0.01, lightBounds.max[0] - lightBounds.min[0]);
|
|
1430
|
-
const height = Math.max(0.01, lightBounds.max[1] - lightBounds.min[1]);
|
|
1431
|
-
const depth = Math.max(0.01, lightBounds.max[2] - lightBounds.min[2]);
|
|
1432
|
-
const padding = Math.max(width, height, depth) * 0.08 + 0.05;
|
|
1433
|
-
const viewMatrix = lightViewMatrix(basis);
|
|
1434
|
-
const projectionMatrix = orthographicMat4(lightBounds.min[0] - padding, lightBounds.max[0] + padding, lightBounds.min[1] - padding, lightBounds.max[1] + padding, lightBounds.min[2] - padding, lightBounds.max[2] + padding);
|
|
1435
|
-
return multiplyMat4(projectionMatrix, viewMatrix);
|
|
1436
|
-
}
|
|
1437
|
-
function directionalLightBasis(lightDirection) {
|
|
1438
|
-
const forward = normalizeVec3(scaleVec3(normalizeVec3(lightDirection), -1));
|
|
1439
|
-
const fallbackUp = Math.abs(forward[1]) > 0.94 ? [0, 0, 1] : [0, 1, 0];
|
|
1440
|
-
const right = normalizeVec3(crossVec3(fallbackUp, forward));
|
|
1441
|
-
const up = normalizeVec3(crossVec3(forward, right));
|
|
1442
|
-
return { right, up, forward };
|
|
1443
|
-
}
|
|
1444
|
-
function lightViewMatrix(basis) {
|
|
1445
|
-
return [
|
|
1446
|
-
basis.right[0], basis.up[0], basis.forward[0], 0,
|
|
1447
|
-
basis.right[1], basis.up[1], basis.forward[1], 0,
|
|
1448
|
-
basis.right[2], basis.up[2], basis.forward[2], 0,
|
|
1449
|
-
0, 0, 0, 1
|
|
1450
|
-
];
|
|
1451
|
-
}
|
|
1452
|
-
function projectPointToLightSpace(point, basis) {
|
|
1453
|
-
return [dotVec3(point, basis.right), dotVec3(point, basis.up), dotVec3(point, basis.forward)];
|
|
1454
|
-
}
|
|
1455
|
-
function boundsCorners(bounds) {
|
|
1456
|
-
return [
|
|
1457
|
-
[bounds.min[0], bounds.min[1], bounds.min[2]],
|
|
1458
|
-
[bounds.max[0], bounds.min[1], bounds.min[2]],
|
|
1459
|
-
[bounds.min[0], bounds.max[1], bounds.min[2]],
|
|
1460
|
-
[bounds.min[0], bounds.min[1], bounds.max[2]],
|
|
1461
|
-
[bounds.max[0], bounds.max[1], bounds.min[2]],
|
|
1462
|
-
[bounds.max[0], bounds.min[1], bounds.max[2]],
|
|
1463
|
-
[bounds.min[0], bounds.max[1], bounds.max[2]],
|
|
1464
|
-
[bounds.max[0], bounds.max[1], bounds.max[2]]
|
|
1465
|
-
];
|
|
1466
|
-
}
|
|
1467
|
-
function boundsFromVec3(points) {
|
|
1468
|
-
const min = [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY];
|
|
1469
|
-
const max = [Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY, Number.NEGATIVE_INFINITY];
|
|
1470
|
-
for (const point of points) {
|
|
1471
|
-
for (let axis = 0; axis < 3; axis += 1) {
|
|
1472
|
-
min[axis] = Math.min(min[axis], point[axis]);
|
|
1473
|
-
max[axis] = Math.max(max[axis], point[axis]);
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
return { min, max };
|
|
1477
|
-
}
|
|
1478
|
-
function normalizeVec3(value) {
|
|
1479
|
-
const length = Math.hypot(value[0], value[1], value[2]);
|
|
1480
|
-
if (!Number.isFinite(length) || length <= 1e-8)
|
|
1481
|
-
return [0, -1 / Math.SQRT2, -1 / Math.SQRT2];
|
|
1482
|
-
return [value[0] / length, value[1] / length, value[2] / length];
|
|
1483
|
-
}
|
|
1484
|
-
function scaleVec3(value, amount) {
|
|
1485
|
-
return [value[0] * amount, value[1] * amount, value[2] * amount];
|
|
1486
|
-
}
|
|
1487
|
-
function addVec3(left, right) {
|
|
1488
|
-
return [left[0] + right[0], left[1] + right[1], left[2] + right[2]];
|
|
1489
|
-
}
|
|
1490
|
-
function subtractVec3(left, right) {
|
|
1491
|
-
return [left[0] - right[0], left[1] - right[1], left[2] - right[2]];
|
|
1492
|
-
}
|
|
1493
|
-
function crossVec3(left, right) {
|
|
1494
|
-
return [
|
|
1495
|
-
left[1] * right[2] - left[2] * right[1],
|
|
1496
|
-
left[2] * right[0] - left[0] * right[2],
|
|
1497
|
-
left[0] * right[1] - left[1] * right[0]
|
|
1498
|
-
];
|
|
1499
|
-
}
|
|
1500
|
-
function dotVec3(left, right) {
|
|
1501
|
-
return left[0] * right[0] + left[1] * right[1] + left[2] * right[2];
|
|
1502
|
-
}
|
|
1503
|
-
function collectPostprocess(source) {
|
|
1504
|
-
if (source instanceof Scene || isIterable(source))
|
|
1505
|
-
return undefined;
|
|
1506
|
-
if (source.postprocess === true)
|
|
1507
|
-
return {};
|
|
1508
|
-
if (!source.postprocess)
|
|
1509
|
-
return undefined;
|
|
1510
|
-
return source.postprocess;
|
|
1511
|
-
}
|
|
1512
1558
|
function normalizeRendererInput(sourceOrInput, camera) {
|
|
1513
1559
|
if (isRendererInput(sourceOrInput)) {
|
|
1514
1560
|
return { source: sourceOrInput.source, camera: camera ?? sourceOrInput.camera };
|
|
@@ -1532,63 +1578,6 @@ function collectCameraPolicy(source) {
|
|
|
1532
1578
|
return "auto-frame";
|
|
1533
1579
|
return "identity";
|
|
1534
1580
|
}
|
|
1535
|
-
function postprocessRequiresDepthTexture(postprocess) {
|
|
1536
|
-
return Boolean((postprocess.volumetricLight && !postprocess.volumetricLight.depth) ||
|
|
1537
|
-
(postprocess.depthOfField && !postprocess.depthOfField.depth) ||
|
|
1538
|
-
(postprocess.contactShadow && !postprocess.contactShadow.depth) ||
|
|
1539
|
-
(postprocess.ssao && !postprocess.ssao.depth) ||
|
|
1540
|
-
(postprocess.ssr && !postprocess.ssr.depth));
|
|
1541
|
-
}
|
|
1542
|
-
function canFuseLdrPostprocess(source, passes) {
|
|
1543
|
-
const sourceIsHdr = isHdrRenderTarget(source);
|
|
1544
|
-
return passes.length > 0
|
|
1545
|
-
&& (!sourceIsHdr || passes[0]?.name === "tone-mapping" || (passes[0]?.name === "bloom" && passes[1]?.name === "tone-mapping"))
|
|
1546
|
-
&& passes.every((pass) => pass.name === "bloom" || pass.name === "tone-mapping" || pass.name === "color-grade" || pass.name === "depth-of-field" || pass.name === "motion-blur" || pass.name === "ssao" || pass.name === "ssr" || pass.name === "taa" || pass.name === "outline" || pass.name === "fxaa")
|
|
1547
|
-
&& passes.every((pass, index) => {
|
|
1548
|
-
const previousRank = index === 0 ? -1 : ldrFusionPassRank(passes[index - 1].name);
|
|
1549
|
-
return ldrFusionPassRank(pass.name) >= previousRank;
|
|
1550
|
-
});
|
|
1551
|
-
}
|
|
1552
|
-
function ldrFusionPassRank(name) {
|
|
1553
|
-
if (name === "bloom")
|
|
1554
|
-
return -1;
|
|
1555
|
-
if (name === "tone-mapping")
|
|
1556
|
-
return 0;
|
|
1557
|
-
if (name === "color-grade")
|
|
1558
|
-
return 1;
|
|
1559
|
-
if (name === "depth-of-field")
|
|
1560
|
-
return 2;
|
|
1561
|
-
if (name === "motion-blur")
|
|
1562
|
-
return 3;
|
|
1563
|
-
if (name === "ssao")
|
|
1564
|
-
return 4;
|
|
1565
|
-
if (name === "ssr")
|
|
1566
|
-
return 5;
|
|
1567
|
-
if (name === "taa")
|
|
1568
|
-
return 6;
|
|
1569
|
-
if (name === "outline")
|
|
1570
|
-
return 7;
|
|
1571
|
-
if (name === "fxaa")
|
|
1572
|
-
return 8;
|
|
1573
|
-
return Number.POSITIVE_INFINITY;
|
|
1574
|
-
}
|
|
1575
|
-
function isDepthPostprocessPass(name) {
|
|
1576
|
-
return name === "volumetric-light" || name === "depth-of-field" || name === "contact-shadow" || name === "ssao" || name === "ssr";
|
|
1577
|
-
}
|
|
1578
|
-
function postprocessPassHasDepth(options) {
|
|
1579
|
-
return typeof options === "object" && options !== null && "depth" in options && Boolean(options.depth);
|
|
1580
|
-
}
|
|
1581
|
-
function withRendererDepth(options, depth) {
|
|
1582
|
-
return depth && !options.depth ? { ...options, depth } : options;
|
|
1583
|
-
}
|
|
1584
|
-
function defaultPostprocessTargetFormat(device, postprocess) {
|
|
1585
|
-
if (postprocess.toneMapping === false)
|
|
1586
|
-
return "rgba8";
|
|
1587
|
-
return device.info.capabilities?.includes("hdr-render-targets") ? "rgba16f" : "rgba8";
|
|
1588
|
-
}
|
|
1589
|
-
function isHdrRenderTarget(target) {
|
|
1590
|
-
return target.colorTexture.format === "rgba16f" || target.colorTexture.format === "rgba32f";
|
|
1591
|
-
}
|
|
1592
1581
|
function collectSourceCameraPosition(source) {
|
|
1593
1582
|
if (source instanceof Scene || isIterable(source))
|
|
1594
1583
|
return undefined;
|
|
@@ -1605,21 +1594,28 @@ function collectSourceCameraPosition(source) {
|
|
|
1605
1594
|
export function collectRenderItems(source, cameraViewProjection, camera) {
|
|
1606
1595
|
return collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera).items;
|
|
1607
1596
|
}
|
|
1608
|
-
function collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera) {
|
|
1597
|
+
function collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera, keepCulledShadowCasters = false) {
|
|
1609
1598
|
const diagnostics = createRenderCollectionDiagnostics();
|
|
1599
|
+
// 02-S5 (A3D_QR_LIGHTING): frustum-culled items that still cast. A caster
|
|
1600
|
+
// outside the view (a pole behind the camera under a low sun) must reach
|
|
1601
|
+
// the shadow pass. Flag-off collects nothing extra.
|
|
1602
|
+
const culledShadowCasters = keepCulledShadowCasters ? [] : undefined;
|
|
1610
1603
|
if (isIterable(source)) {
|
|
1611
1604
|
const items = applyViewProjection([...source], cameraViewProjection);
|
|
1612
1605
|
diagnostics.submittedObjects += items.length;
|
|
1613
1606
|
diagnostics.visibleObjects += items.length;
|
|
1614
|
-
return { items, diagnostics };
|
|
1607
|
+
return { items, diagnostics, culledShadowCasters: culledShadowCasters ?? [] };
|
|
1615
1608
|
}
|
|
1616
1609
|
if (source instanceof Scene) {
|
|
1617
|
-
const items = collectSceneRenderItems(source, {}, cameraViewProjection, camera, diagnostics);
|
|
1618
|
-
return { items, diagnostics };
|
|
1610
|
+
const items = collectSceneRenderItems(source, {}, cameraViewProjection, camera, diagnostics, culledShadowCasters);
|
|
1611
|
+
return { items, diagnostics, culledShadowCasters: culledShadowCasters ?? [], ...(camera ? { cullingFrustum: camera.frustum } : {}) };
|
|
1619
1612
|
}
|
|
1620
1613
|
const items = [];
|
|
1614
|
+
let cullingFrustum;
|
|
1621
1615
|
if (source.scene) {
|
|
1622
|
-
|
|
1616
|
+
if (source.frustumCulling !== false && camera)
|
|
1617
|
+
cullingFrustum = camera.frustum;
|
|
1618
|
+
items.push(...collectSceneRenderItems(source.scene, source, cameraViewProjection, source.frustumCulling === false ? undefined : camera, diagnostics, culledShadowCasters));
|
|
1623
1619
|
}
|
|
1624
1620
|
const explicitItems = [];
|
|
1625
1621
|
if (source.collectRenderItems) {
|
|
@@ -1629,193 +1625,16 @@ function collectRenderItemsWithDiagnostics(source, cameraViewProjection, camera)
|
|
|
1629
1625
|
explicitItems.push(...source.renderItems);
|
|
1630
1626
|
}
|
|
1631
1627
|
if (explicitItems.length > 0) {
|
|
1632
|
-
const
|
|
1633
|
-
|
|
1628
|
+
const explicitFrustum = explicitCullingFrustum(source, cameraViewProjection, camera);
|
|
1629
|
+
cullingFrustum ??= explicitFrustum;
|
|
1630
|
+
const visibleItems = cullExplicitRenderItems(explicitItems, explicitFrustum, diagnostics, culledShadowCasters);
|
|
1634
1631
|
const optimizedItems = applyRendererOwnedStaticBatching(source, applyRendererOwnedStaticMeshConsolidation(source, visibleItems));
|
|
1635
1632
|
const projectedItems = applyViewProjection(optimizedItems, cameraViewProjection);
|
|
1636
1633
|
items.push(...projectedItems);
|
|
1637
1634
|
}
|
|
1638
|
-
return { items, diagnostics };
|
|
1639
|
-
}
|
|
1640
|
-
function explicitCullingFrustum(source, cameraViewProjection, camera) {
|
|
1641
|
-
// Explicit render-item sources were historically never culled, so culling
|
|
1642
|
-
// stays opt-in: only an explicit `frustumCulling: true` turns it on.
|
|
1643
|
-
if (source.frustumCulling !== true)
|
|
1644
|
-
return undefined;
|
|
1645
|
-
if (camera)
|
|
1646
|
-
return camera.frustum;
|
|
1647
|
-
if (!cameraViewProjection)
|
|
1648
|
-
return undefined;
|
|
1649
|
-
return Frustum.fromMatrix(toMathMat4(cameraViewProjection));
|
|
1650
|
-
}
|
|
1651
|
-
function cullExplicitRenderItems(items, frustum, diagnostics) {
|
|
1652
|
-
if (!frustum) {
|
|
1653
|
-
diagnostics.submittedObjects += items.length;
|
|
1654
|
-
diagnostics.visibleObjects += items.length;
|
|
1655
|
-
return items;
|
|
1656
|
-
}
|
|
1657
|
-
const visible = [];
|
|
1658
|
-
for (const item of items) {
|
|
1659
|
-
diagnostics.submittedObjects += 1;
|
|
1660
|
-
if (!isFrustumCullableRenderItem(item)) {
|
|
1661
|
-
diagnostics.visibleObjects += 1;
|
|
1662
|
-
visible.push(item);
|
|
1663
|
-
continue;
|
|
1664
|
-
}
|
|
1665
|
-
diagnostics.frustumTestedObjects += 1;
|
|
1666
|
-
const bounds = explicitRenderItemWorldBounds(item);
|
|
1667
|
-
if (!frustum.intersectsBox(bounds.toMathBox())) {
|
|
1668
|
-
diagnostics.culledObjects += 1;
|
|
1669
|
-
continue;
|
|
1670
|
-
}
|
|
1671
|
-
diagnostics.visibleObjects += 1;
|
|
1672
|
-
visible.push(item);
|
|
1673
|
-
}
|
|
1674
|
-
return visible;
|
|
1675
|
-
}
|
|
1676
|
-
function isFrustumCullableRenderItem(item) {
|
|
1677
|
-
if (item.drawRange !== undefined)
|
|
1678
|
-
return false;
|
|
1679
|
-
if (item.morphTargets !== undefined || item.morphWeights !== undefined)
|
|
1680
|
-
return false;
|
|
1681
|
-
return true;
|
|
1682
|
-
}
|
|
1683
|
-
function explicitRenderItemWorldBounds(item) {
|
|
1684
|
-
const modelMatrix = toMat4(item.modelMatrix ?? identityMat4(), "modelMatrix", item.label);
|
|
1685
|
-
if (item.skinning) {
|
|
1686
|
-
const local = skinnedItemLocalBounds(item.geometry, item.skinning);
|
|
1687
|
-
return boundsFromLocal(local, modelMatrix, item.instanceTransforms);
|
|
1688
|
-
}
|
|
1689
|
-
return boundsFromLocal(item.geometry.bounds, modelMatrix, item.instanceTransforms);
|
|
1690
|
-
}
|
|
1691
|
-
function boundsFromLocal(envelope, modelMatrix, instanceTransforms) {
|
|
1692
|
-
const local = new SceneBounds3([envelope.min[0], envelope.min[1], envelope.min[2]], [envelope.max[0], envelope.max[1], envelope.max[2]]);
|
|
1693
|
-
if (!instanceTransforms || instanceTransforms.length < 16) {
|
|
1694
|
-
return local.transform(modelMatrix);
|
|
1695
|
-
}
|
|
1696
|
-
let bounds = new SceneBounds3();
|
|
1697
|
-
for (let offset = 0; offset + 16 <= instanceTransforms.length; offset += 16) {
|
|
1698
|
-
const instanceMatrix = toMat4(instanceTransforms.slice(offset, offset + 16), "instanceTransforms");
|
|
1699
|
-
bounds = bounds.union(local.transform(multiplyMat4(modelMatrix, instanceMatrix)));
|
|
1700
|
-
}
|
|
1701
|
-
return bounds;
|
|
1635
|
+
return { items, diagnostics, culledShadowCasters: culledShadowCasters ?? [], ...(cullingFrustum ? { cullingFrustum } : {}) };
|
|
1702
1636
|
}
|
|
1703
|
-
|
|
1704
|
-
function skinnedItemLocalBounds(geometry, skinning) {
|
|
1705
|
-
const cached = skinnedCullingBoundsCache.get(geometry);
|
|
1706
|
-
if (cached && float32ArraysEqual(cached.matrices, skinning.matrices)) {
|
|
1707
|
-
return cached.bounds;
|
|
1708
|
-
}
|
|
1709
|
-
const bounds = computeSkinnedGeometryBounds(geometry, skinning);
|
|
1710
|
-
skinnedCullingBoundsCache.set(geometry, { matrices: new Float32Array(skinning.matrices), bounds });
|
|
1711
|
-
return bounds;
|
|
1712
|
-
}
|
|
1713
|
-
function float32ArraysEqual(left, right) {
|
|
1714
|
-
if (left.length !== right.length)
|
|
1715
|
-
return false;
|
|
1716
|
-
for (let index = 0; index < left.length; index += 1) {
|
|
1717
|
-
if (left[index] !== right[index])
|
|
1718
|
-
return false;
|
|
1719
|
-
}
|
|
1720
|
-
return true;
|
|
1721
|
-
}
|
|
1722
|
-
const staticBatchGeometryIds = new WeakMap();
|
|
1723
|
-
const staticBatchMaterialIds = new WeakMap();
|
|
1724
|
-
let nextStaticBatchResourceId = 1;
|
|
1725
|
-
/**
|
|
1726
|
-
* Merges shared-material static geometry, then hands the result to batching.
|
|
1727
|
-
*
|
|
1728
|
-
* Consolidation runs first because it reduces distinct geometries; whatever it leaves unmerged (single
|
|
1729
|
-
* items, oversized meshes, non-indexed topology) can still be instanced by batching afterwards.
|
|
1730
|
-
*/
|
|
1731
|
-
const staticMeshConsolidationCaches = new WeakMap();
|
|
1732
|
-
function applyRendererOwnedStaticMeshConsolidation(source, items) {
|
|
1733
|
-
if (!source.staticMeshConsolidation)
|
|
1734
|
-
return items;
|
|
1735
|
-
const mergeable = [];
|
|
1736
|
-
const passthrough = [];
|
|
1737
|
-
for (const item of items) {
|
|
1738
|
-
// The same eligibility rule as batching: anything skinned, morphed, instanced, or draw-ranged is
|
|
1739
|
-
// not static geometry and must not have a transform baked into it.
|
|
1740
|
-
if (isStaticBatchCandidate(item)) {
|
|
1741
|
-
mergeable.push({
|
|
1742
|
-
geometry: item.geometry,
|
|
1743
|
-
material: item.material,
|
|
1744
|
-
modelMatrix: item.modelMatrix ?? identityMat4(),
|
|
1745
|
-
...(item.label ? { label: item.label } : {})
|
|
1746
|
-
});
|
|
1747
|
-
}
|
|
1748
|
-
else {
|
|
1749
|
-
passthrough.push(item);
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
if (mergeable.length === 0)
|
|
1753
|
-
return items;
|
|
1754
|
-
const options = source.staticMeshConsolidation === true ? {} : source.staticMeshConsolidation;
|
|
1755
|
-
// Cached per render source: merging walks every vertex, so repeating it each frame costs far more
|
|
1756
|
-
// than the draw calls it saves.
|
|
1757
|
-
let cache = staticMeshConsolidationCaches.get(source);
|
|
1758
|
-
if (!cache) {
|
|
1759
|
-
cache = createStaticMeshConsolidationCache();
|
|
1760
|
-
staticMeshConsolidationCaches.set(source, cache);
|
|
1761
|
-
}
|
|
1762
|
-
const consolidated = cache.consolidate(mergeable, {
|
|
1763
|
-
labelPrefix: "renderer-consolidated-mesh",
|
|
1764
|
-
...options
|
|
1765
|
-
});
|
|
1766
|
-
return [...passthrough, ...consolidated.renderItems];
|
|
1767
|
-
}
|
|
1768
|
-
function applyRendererOwnedStaticBatching(source, items) {
|
|
1769
|
-
if (!source.staticBatching)
|
|
1770
|
-
return items;
|
|
1771
|
-
const batchable = [];
|
|
1772
|
-
const passthrough = [];
|
|
1773
|
-
for (const item of items) {
|
|
1774
|
-
if (isStaticBatchCandidate(item)) {
|
|
1775
|
-
batchable.push({
|
|
1776
|
-
geometry: item.geometry,
|
|
1777
|
-
material: item.material,
|
|
1778
|
-
modelMatrix: item.modelMatrix ?? identityMat4(),
|
|
1779
|
-
batchKey: staticBatchKey(item),
|
|
1780
|
-
label: item.label,
|
|
1781
|
-
castShadow: item.castShadow
|
|
1782
|
-
});
|
|
1783
|
-
}
|
|
1784
|
-
else {
|
|
1785
|
-
passthrough.push(item);
|
|
1786
|
-
}
|
|
1787
|
-
}
|
|
1788
|
-
if (batchable.length === 0)
|
|
1789
|
-
return items;
|
|
1790
|
-
const options = source.staticBatching === true ? {} : source.staticBatching;
|
|
1791
|
-
const batched = batchStaticRenderItems(batchable, {
|
|
1792
|
-
labelPrefix: "renderer-static-batch",
|
|
1793
|
-
...options
|
|
1794
|
-
});
|
|
1795
|
-
return [...passthrough, ...batched.renderItems];
|
|
1796
|
-
}
|
|
1797
|
-
function isStaticBatchCandidate(item) {
|
|
1798
|
-
return item.material !== undefined &&
|
|
1799
|
-
item.drawRange === undefined &&
|
|
1800
|
-
item.skinning === undefined &&
|
|
1801
|
-
item.morphTargets === undefined &&
|
|
1802
|
-
item.morphWeights === undefined &&
|
|
1803
|
-
item.instanceTransforms === undefined &&
|
|
1804
|
-
item.instanceColors === undefined &&
|
|
1805
|
-
item.instanceAttributes === undefined;
|
|
1806
|
-
}
|
|
1807
|
-
function staticBatchKey(item) {
|
|
1808
|
-
return `${resourceId(staticBatchGeometryIds, item.geometry)}:${resourceId(staticBatchMaterialIds, item.material)}:shadow-${item.castShadow !== false ? "on" : "off"}`;
|
|
1809
|
-
}
|
|
1810
|
-
function resourceId(ids, resource) {
|
|
1811
|
-
const existing = ids.get(resource);
|
|
1812
|
-
if (existing !== undefined)
|
|
1813
|
-
return existing;
|
|
1814
|
-
const next = nextStaticBatchResourceId++;
|
|
1815
|
-
ids.set(resource, next);
|
|
1816
|
-
return next;
|
|
1817
|
-
}
|
|
1818
|
-
function collectSceneRenderItems(scene, source, cameraViewProjection, camera, diagnostics) {
|
|
1637
|
+
function collectSceneRenderItems(scene, source, cameraViewProjection, camera, diagnostics, culledShadowCasters) {
|
|
1819
1638
|
scene.updateWorldTransforms();
|
|
1820
1639
|
const renderables = scene.collectRenderables();
|
|
1821
1640
|
if (renderables.length === 0) {
|
|
@@ -1857,14 +1676,14 @@ function collectSceneRenderItems(scene, source, cameraViewProjection, camera, di
|
|
|
1857
1676
|
if (camera)
|
|
1858
1677
|
diagnostics.frustumTestedObjects += 1;
|
|
1859
1678
|
}
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1679
|
+
const culled = camera !== undefined && !camera.frustum.intersectsBox(bounds.toMathBox());
|
|
1680
|
+
if (culled && diagnostics)
|
|
1681
|
+
diagnostics.culledObjects += 1;
|
|
1682
|
+
if (culled && !culledShadowCasters)
|
|
1863
1683
|
continue;
|
|
1864
|
-
|
|
1865
|
-
if (diagnostics)
|
|
1684
|
+
if (!culled && diagnostics)
|
|
1866
1685
|
diagnostics.visibleObjects += 1;
|
|
1867
|
-
items.push({
|
|
1686
|
+
(culled ? culledShadowCasters : items).push({
|
|
1868
1687
|
geometry,
|
|
1869
1688
|
material,
|
|
1870
1689
|
label: node.name,
|
|
@@ -1879,7 +1698,12 @@ function collectSceneRenderItems(scene, source, cameraViewProjection, camera, di
|
|
|
1879
1698
|
}
|
|
1880
1699
|
return items;
|
|
1881
1700
|
}
|
|
1882
|
-
|
|
1701
|
+
/** Travel direction of the first shadow-casting directional light (02-S5). */
|
|
1702
|
+
function shadowSunTravel(lights) {
|
|
1703
|
+
const sun = lights.find((light) => light.kind === "directional" && light.castsShadow);
|
|
1704
|
+
return sun ? [sun.direction[0], sun.direction[1], sun.direction[2]] : undefined;
|
|
1705
|
+
}
|
|
1706
|
+
export function createRenderCollectionDiagnostics() {
|
|
1883
1707
|
return {
|
|
1884
1708
|
submittedObjects: 0,
|
|
1885
1709
|
visibleObjects: 0,
|
|
@@ -1887,29 +1711,6 @@ function createRenderCollectionDiagnostics() {
|
|
|
1887
1711
|
frustumTestedObjects: 0
|
|
1888
1712
|
};
|
|
1889
1713
|
}
|
|
1890
|
-
function createPostprocessDiagnostics(postprocess, ownedTargets, width, height, context = {}) {
|
|
1891
|
-
if (!postprocess)
|
|
1892
|
-
return undefined;
|
|
1893
|
-
const passes = createRendererPostprocessPasses(postprocess);
|
|
1894
|
-
const targetFormat = context.targetFormat ?? postprocess.targetFormat ?? "rgba8";
|
|
1895
|
-
return {
|
|
1896
|
-
postprocessPasses: passes.length,
|
|
1897
|
-
postprocessPassNames: passes.map((pass) => pass.name),
|
|
1898
|
-
postprocessTargetFormat: targetFormat,
|
|
1899
|
-
postprocessRenderTargets: ownedTargets.length,
|
|
1900
|
-
postprocessTextures: ownedTargets.reduce((total, target) => total + 1 + (target.depthTexture ? 1 : 0), 0),
|
|
1901
|
-
postprocessTargetWidth: width,
|
|
1902
|
-
postprocessTargetHeight: height,
|
|
1903
|
-
postprocessPlan: createRendererPostprocessPlanDiagnostics(postprocess, {
|
|
1904
|
-
sourceTargetFormat: targetFormat,
|
|
1905
|
-
targetFormat,
|
|
1906
|
-
nativeLdrPostprocess: context.nativeLdrPostprocess,
|
|
1907
|
-
rendererDepthAvailable: context.rendererDepthAvailable,
|
|
1908
|
-
width,
|
|
1909
|
-
height
|
|
1910
|
-
})
|
|
1911
|
-
};
|
|
1912
|
-
}
|
|
1913
1714
|
const CAPTURE_NON_BLANK_LUMINANCE_THRESHOLD = 1 / 255;
|
|
1914
1715
|
const CAPTURE_UNDEREXPOSED_LUMINANCE_THRESHOLD = 5 / 255;
|
|
1915
1716
|
const CAPTURE_OVEREXPOSED_LUMINANCE_THRESHOLD = 250 / 255;
|
|
@@ -2169,19 +1970,6 @@ function withRendererFrameDiagnostics(diagnostics, collection, postprocess) {
|
|
|
2169
1970
|
...(postprocess ?? {})
|
|
2170
1971
|
};
|
|
2171
1972
|
}
|
|
2172
|
-
function renderableWorldBounds(geometry, modelMatrix, instanceTransforms, morphTargets, morphWeights, skinning) {
|
|
2173
|
-
const envelope = computeSkinnedMorphTargetWeightedBounds(geometry, skinning, morphTargets, morphWeights);
|
|
2174
|
-
const local = new SceneBounds3([envelope.min[0], envelope.min[1], envelope.min[2]], [envelope.max[0], envelope.max[1], envelope.max[2]]);
|
|
2175
|
-
if (!instanceTransforms) {
|
|
2176
|
-
return local.transform(modelMatrix);
|
|
2177
|
-
}
|
|
2178
|
-
let bounds = new SceneBounds3();
|
|
2179
|
-
for (let offset = 0; offset < instanceTransforms.length; offset += 16) {
|
|
2180
|
-
const instanceMatrix = toMat4(instanceTransforms.slice(offset, offset + 16), "instanceTransforms");
|
|
2181
|
-
bounds = bounds.union(local.transform(multiplyMat4(modelMatrix, instanceMatrix)));
|
|
2182
|
-
}
|
|
2183
|
-
return bounds;
|
|
2184
|
-
}
|
|
2185
1973
|
function applyViewProjection(items, cameraViewProjection) {
|
|
2186
1974
|
const hasCameraViewProjection = cameraViewProjection !== undefined;
|
|
2187
1975
|
const viewProjection = cameraViewProjection ?? identityMat4();
|
|
@@ -2220,30 +2008,6 @@ function createAutoFrameCamera(source, items, width, height) {
|
|
|
2220
2008
|
function collectRenderItemBounds(items) {
|
|
2221
2009
|
return collectItemBounds(items, true);
|
|
2222
2010
|
}
|
|
2223
|
-
/**
|
|
2224
|
-
* Bounds over every render item, including those excluded from camera
|
|
2225
|
-
* auto-framing.
|
|
2226
|
-
*
|
|
2227
|
-
* `includeInAutoFrame` answers "should the camera frame this?", which is a
|
|
2228
|
-
* composition choice. It must not decide which geometry a shadow frustum covers:
|
|
2229
|
-
* a large ground plane or backdrop is commonly excluded from auto-framing while
|
|
2230
|
-
* still being the surface that receives shadows. Fitting the light frustum to the
|
|
2231
|
-
* auto-frame subset shrinks it to the caster alone, so the receiver falls outside
|
|
2232
|
-
* the shadow map and no shadow is ever visible.
|
|
2233
|
-
*/
|
|
2234
|
-
function collectShadowCoverageBounds(items) {
|
|
2235
|
-
return collectItemBounds(items, false);
|
|
2236
|
-
}
|
|
2237
|
-
function collectItemBounds(items, respectAutoFrameExclusion) {
|
|
2238
|
-
let bounds;
|
|
2239
|
-
for (const item of items) {
|
|
2240
|
-
if (respectAutoFrameExclusion && item.includeInAutoFrame === false)
|
|
2241
|
-
continue;
|
|
2242
|
-
const itemBounds = renderableWorldBounds(item.geometry, toMat4(item.modelMatrix ?? identityMat4(), "modelMatrix", item.label), item.instanceTransforms, item.morphTargets, item.morphWeights, item.skinning);
|
|
2243
|
-
bounds = bounds ? bounds.union(itemBounds) : itemBounds;
|
|
2244
|
-
}
|
|
2245
|
-
return bounds;
|
|
2246
|
-
}
|
|
2247
2011
|
function collectCameraFrameOptions(source) {
|
|
2248
2012
|
if (source instanceof Scene || isIterable(source) || !source.cameraFrameOptions)
|
|
2249
2013
|
return {};
|
|
@@ -2312,7 +2076,7 @@ function resolveCamera(source, camera, viewport, options = {}) {
|
|
|
2312
2076
|
function hasExplicitAutoFrameCameraPolicy(source) {
|
|
2313
2077
|
return !(source instanceof Scene) && !isIterable(source) && source.cameraPolicy === "auto-frame";
|
|
2314
2078
|
}
|
|
2315
|
-
function cameraWorldPosition(camera) {
|
|
2079
|
+
export function cameraWorldPosition(camera) {
|
|
2316
2080
|
const matrix = camera.transform.worldMatrix;
|
|
2317
2081
|
return [matrix[12] ?? 0, matrix[13] ?? 0, matrix[14] ?? 0];
|
|
2318
2082
|
}
|
|
@@ -2327,9 +2091,6 @@ function maybeCameraResize(camera) {
|
|
|
2327
2091
|
function resolveSceneCamera(source) {
|
|
2328
2092
|
return sceneFromSource(source)?.collectCameras()[0];
|
|
2329
2093
|
}
|
|
2330
|
-
function sceneFromSource(source) {
|
|
2331
|
-
return source instanceof Scene ? source : isIterable(source) ? undefined : source.scene;
|
|
2332
|
-
}
|
|
2333
2094
|
function normalMatrixFromModel(modelMatrix) {
|
|
2334
2095
|
let matrix;
|
|
2335
2096
|
try {
|
|
@@ -2360,17 +2121,6 @@ function transposeMat4(matrix) {
|
|
|
2360
2121
|
matrix[3], matrix[7], matrix[11], matrix[15]
|
|
2361
2122
|
];
|
|
2362
2123
|
}
|
|
2363
|
-
function toMat4(value, field, label) {
|
|
2364
|
-
const values = Array.from(value);
|
|
2365
|
-
if (values.length !== 16 || !values.every(Number.isFinite)) {
|
|
2366
|
-
throw new RenderDeviceError("Renderer matrix inputs must be finite mat4 values", "RENDERER_MATRIX_CONTRACT", {
|
|
2367
|
-
field,
|
|
2368
|
-
label,
|
|
2369
|
-
scalars: values.length
|
|
2370
|
-
});
|
|
2371
|
-
}
|
|
2372
|
-
return values;
|
|
2373
|
-
}
|
|
2374
2124
|
function lookupRenderResource(lookup, key) {
|
|
2375
2125
|
if (isReadonlyMap(lookup)) {
|
|
2376
2126
|
return lookup.get(key);
|
|
@@ -2438,33 +2188,4 @@ function normalizeDefaultLightDirection(direction) {
|
|
|
2438
2188
|
}
|
|
2439
2189
|
return [direction[0] / length, direction[1] / length, direction[2] / length];
|
|
2440
2190
|
}
|
|
2441
|
-
function cloneEnvironmentLighting(environment) {
|
|
2442
|
-
return {
|
|
2443
|
-
color: [...environment.color],
|
|
2444
|
-
intensity: environment.intensity,
|
|
2445
|
-
...(environment.proceduralMap
|
|
2446
|
-
? {
|
|
2447
|
-
proceduralMap: {
|
|
2448
|
-
skyColor: [...environment.proceduralMap.skyColor],
|
|
2449
|
-
horizonColor: [...environment.proceduralMap.horizonColor],
|
|
2450
|
-
groundColor: [...environment.proceduralMap.groundColor],
|
|
2451
|
-
specularColor: [...environment.proceduralMap.specularColor],
|
|
2452
|
-
intensity: environment.proceduralMap.intensity,
|
|
2453
|
-
specularIntensity: environment.proceduralMap.specularIntensity
|
|
2454
|
-
}
|
|
2455
|
-
}
|
|
2456
|
-
: {}),
|
|
2457
|
-
...(environment.environmentMapTexture ? { environmentMapTexture: environment.environmentMapTexture } : {}),
|
|
2458
|
-
...(environment.environmentCubeMapTexture ? { environmentCubeMapTexture: environment.environmentCubeMapTexture } : {}),
|
|
2459
|
-
...(environment.environmentMapIntensity !== undefined ? { environmentMapIntensity: environment.environmentMapIntensity } : {}),
|
|
2460
|
-
...(environment.environmentMapSpecularIntensity !== undefined ? { environmentMapSpecularIntensity: environment.environmentMapSpecularIntensity } : {}),
|
|
2461
|
-
...(environment.environmentMapRotation !== undefined ? { environmentMapRotation: environment.environmentMapRotation } : {}),
|
|
2462
|
-
...(environment.environmentMapMipCount !== undefined ? { environmentMapMipCount: environment.environmentMapMipCount } : {}),
|
|
2463
|
-
...(environment.environmentMapEncoding ? { environmentMapEncoding: environment.environmentMapEncoding } : {}),
|
|
2464
|
-
...(environment.environmentBrdfLutTexture ? { environmentBrdfLutTexture: environment.environmentBrdfLutTexture } : {})
|
|
2465
|
-
};
|
|
2466
|
-
}
|
|
2467
|
-
function isIterable(value) {
|
|
2468
|
-
return typeof value[Symbol.iterator] === "function";
|
|
2469
|
-
}
|
|
2470
2191
|
//# sourceMappingURL=Renderer.js.map
|