@aura3d/rendering 3.0.1 → 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/DepthPass.d.ts +18 -0
- package/dist/DepthPass.d.ts.map +1 -1
- package/dist/DepthPass.js +103 -20
- package/dist/DepthPass.js.map +1 -1
- package/dist/EnvironmentBackgroundPass.d.ts +7 -0
- package/dist/EnvironmentBackgroundPass.d.ts.map +1 -1
- package/dist/EnvironmentBackgroundPass.js +39 -14
- package/dist/EnvironmentBackgroundPass.js.map +1 -1
- package/dist/EnvironmentMapResources.d.ts +1 -1
- package/dist/EnvironmentMapResources.d.ts.map +1 -1
- package/dist/EnvironmentMapResources.js +19 -8
- package/dist/EnvironmentMapResources.js.map +1 -1
- package/dist/EnvironmentPlatform.d.ts +6 -0
- package/dist/EnvironmentPlatform.d.ts.map +1 -1
- package/dist/EnvironmentPlatform.js +3 -1
- package/dist/EnvironmentPlatform.js.map +1 -1
- package/dist/EnvironmentPreset.d.ts +7 -0
- package/dist/EnvironmentPreset.d.ts.map +1 -1
- package/dist/EnvironmentPreset.js +11 -11
- package/dist/EnvironmentPreset.js.map +1 -1
- package/dist/EnvironmentPresetPack.d.ts +16 -0
- package/dist/EnvironmentPresetPack.d.ts.map +1 -1
- package/dist/EnvironmentPresetPack.js +28 -0
- package/dist/EnvironmentPresetPack.js.map +1 -1
- package/dist/ExternalParityRenderPreset.d.ts +15 -1
- package/dist/ExternalParityRenderPreset.d.ts.map +1 -1
- package/dist/ExternalParityRenderPreset.js +52 -7
- package/dist/ExternalParityRenderPreset.js.map +1 -1
- package/dist/ForwardPass.d.ts +240 -50
- package/dist/ForwardPass.d.ts.map +1 -1
- package/dist/ForwardPass.js +845 -866
- package/dist/ForwardPass.js.map +1 -1
- package/dist/Geometry.d.ts +44 -1
- package/dist/Geometry.d.ts.map +1 -1
- package/dist/Geometry.js +174 -24
- package/dist/Geometry.js.map +1 -1
- package/dist/InstancedPBRMaterial.d.ts +5 -0
- package/dist/InstancedPBRMaterial.d.ts.map +1 -1
- package/dist/InstancedPBRMaterial.js +7 -0
- package/dist/InstancedPBRMaterial.js.map +1 -1
- package/dist/LightCollector.d.ts +8 -0
- package/dist/LightCollector.d.ts.map +1 -1
- package/dist/LightCollector.js +1 -1
- package/dist/LightCollector.js.map +1 -1
- package/dist/LightUniforms.d.ts +78 -0
- package/dist/LightUniforms.d.ts.map +1 -1
- package/dist/LightUniforms.js +100 -0
- package/dist/LightUniforms.js.map +1 -1
- package/dist/Material.d.ts +15 -0
- package/dist/Material.d.ts.map +1 -1
- package/dist/Material.js +19 -2
- package/dist/Material.js.map +1 -1
- package/dist/MaterialBinding.d.ts +10 -0
- package/dist/MaterialBinding.d.ts.map +1 -1
- package/dist/MaterialBinding.js +91 -1
- package/dist/MaterialBinding.js.map +1 -1
- package/dist/MaterialPresets.d.ts +60 -0
- package/dist/MaterialPresets.d.ts.map +1 -1
- package/dist/MaterialPresets.js +212 -0
- package/dist/MaterialPresets.js.map +1 -1
- package/dist/NormalMappedPBRMaterial.d.ts +5 -0
- package/dist/NormalMappedPBRMaterial.d.ts.map +1 -1
- package/dist/NormalMappedPBRMaterial.js +7 -0
- package/dist/NormalMappedPBRMaterial.js.map +1 -1
- package/dist/OceanSurface.d.ts +8 -0
- package/dist/OceanSurface.d.ts.map +1 -1
- package/dist/OceanSurface.js +10 -79
- package/dist/OceanSurface.js.map +1 -1
- package/dist/PBRLightingDefaults.d.ts +8 -0
- package/dist/PBRLightingDefaults.d.ts.map +1 -1
- package/dist/PBRLightingDefaults.js +8 -0
- package/dist/PBRLightingDefaults.js.map +1 -1
- package/dist/PBRMaterial.d.ts +5 -0
- package/dist/PBRMaterial.d.ts.map +1 -1
- package/dist/PBRMaterial.js +7 -0
- package/dist/PBRMaterial.js.map +1 -1
- package/dist/PostProcessPass.d.ts +6 -490
- package/dist/PostProcessPass.d.ts.map +1 -1
- package/dist/PostProcessPass.js +6 -2016
- package/dist/PostProcessPass.js.map +1 -1
- package/dist/ProceduralMaterialTextures.d.ts +28 -0
- package/dist/ProceduralMaterialTextures.d.ts.map +1 -0
- package/dist/ProceduralMaterialTextures.js +217 -0
- package/dist/ProceduralMaterialTextures.js.map +1 -0
- package/dist/ReflectionProbe.d.ts.map +1 -1
- package/dist/ReflectionProbe.js +4 -1
- package/dist/ReflectionProbe.js.map +1 -1
- package/dist/RenderBackend.d.ts +2 -0
- package/dist/RenderBackend.d.ts.map +1 -1
- package/dist/RenderBackend.js +3 -0
- package/dist/RenderBackend.js.map +1 -1
- package/dist/RenderDevice.d.ts +92 -5
- package/dist/RenderDevice.d.ts.map +1 -1
- package/dist/RenderDevice.js +166 -9
- package/dist/RenderDevice.js.map +1 -1
- package/dist/RenderGraph.d.ts.map +1 -1
- package/dist/RenderGraph.js +17 -0
- package/dist/RenderGraph.js.map +1 -1
- package/dist/RenderPass.d.ts +7 -0
- package/dist/RenderPass.d.ts.map +1 -1
- package/dist/RenderPass.js.map +1 -1
- package/dist/RenderPipeline.d.ts +5 -0
- package/dist/RenderPipeline.d.ts.map +1 -1
- package/dist/RenderPipeline.js +6 -0
- package/dist/RenderPipeline.js.map +1 -1
- package/dist/Renderer.d.ts +261 -66
- package/dist/Renderer.d.ts.map +1 -1
- package/dist/Renderer.js +889 -1254
- package/dist/Renderer.js.map +1 -1
- package/dist/RendererPostprocessPlan.d.ts +4 -0
- package/dist/RendererPostprocessPlan.d.ts.map +1 -1
- package/dist/RendererPostprocessPlan.js +16 -2
- package/dist/RendererPostprocessPlan.js.map +1 -1
- package/dist/RendererTiming.d.ts +27 -0
- package/dist/RendererTiming.d.ts.map +1 -1
- package/dist/RendererTiming.js +179 -12
- package/dist/RendererTiming.js.map +1 -1
- package/dist/ResolutionGovernor.d.ts +56 -0
- package/dist/ResolutionGovernor.d.ts.map +1 -0
- package/dist/ResolutionGovernor.js +87 -0
- package/dist/ResolutionGovernor.js.map +1 -0
- package/dist/Sampler.d.ts +34 -1
- package/dist/Sampler.d.ts.map +1 -1
- package/dist/Sampler.js +55 -2
- package/dist/Sampler.js.map +1 -1
- package/dist/ShaderLibrary.d.ts.map +1 -1
- package/dist/ShaderLibrary.js +15 -10
- package/dist/ShaderLibrary.js.map +1 -1
- package/dist/ShaderLibraryCore.d.ts.map +1 -1
- package/dist/ShaderLibraryCore.js +3 -2
- package/dist/ShaderLibraryCore.js.map +1 -1
- package/dist/ShaderModule.d.ts +7 -1
- package/dist/ShaderModule.d.ts.map +1 -1
- package/dist/ShaderModule.js +20 -5
- package/dist/ShaderModule.js.map +1 -1
- package/dist/ShadowPass.d.ts.map +1 -1
- package/dist/ShadowPass.js +14 -7
- package/dist/ShadowPass.js.map +1 -1
- package/dist/SkinnedLitMaterial.d.ts +5 -0
- package/dist/SkinnedLitMaterial.d.ts.map +1 -1
- package/dist/SkinnedLitMaterial.js +13 -0
- package/dist/SkinnedLitMaterial.js.map +1 -1
- package/dist/SkinningBounds.d.ts +18 -0
- package/dist/SkinningBounds.d.ts.map +1 -1
- package/dist/SkinningBounds.js +78 -0
- package/dist/SkinningBounds.js.map +1 -1
- package/dist/SkinningPaletteTextureCache.d.ts +117 -0
- package/dist/SkinningPaletteTextureCache.d.ts.map +1 -0
- package/dist/SkinningPaletteTextureCache.js +205 -0
- package/dist/SkinningPaletteTextureCache.js.map +1 -0
- package/dist/SkinningUniforms.d.ts +56 -0
- package/dist/SkinningUniforms.d.ts.map +1 -0
- package/dist/SkinningUniforms.js +262 -0
- package/dist/SkinningUniforms.js.map +1 -0
- package/dist/TemporalHistory.d.ts +33 -0
- package/dist/TemporalHistory.d.ts.map +1 -1
- package/dist/TemporalHistory.js +84 -1
- package/dist/TemporalHistory.js.map +1 -1
- package/dist/TerrainHeightfield.d.ts +12 -0
- package/dist/TerrainHeightfield.d.ts.map +1 -1
- package/dist/TerrainHeightfield.js +29 -6
- package/dist/TerrainHeightfield.js.map +1 -1
- package/dist/TerrainTiles.d.ts +40 -10
- package/dist/TerrainTiles.d.ts.map +1 -1
- package/dist/TerrainTiles.js +18 -57
- package/dist/TerrainTiles.js.map +1 -1
- package/dist/Texture.d.ts +47 -2
- package/dist/Texture.d.ts.map +1 -1
- package/dist/Texture.js +119 -3
- package/dist/Texture.js.map +1 -1
- package/dist/TexturedPBRMaterial.d.ts +24 -0
- package/dist/TexturedPBRMaterial.d.ts.map +1 -1
- package/dist/TexturedPBRMaterial.js +72 -20
- package/dist/TexturedPBRMaterial.js.map +1 -1
- package/dist/TransmissionRenderTarget.d.ts +33 -0
- package/dist/TransmissionRenderTarget.d.ts.map +1 -0
- package/dist/TransmissionRenderTarget.js +61 -0
- package/dist/TransmissionRenderTarget.js.map +1 -0
- package/dist/VegetationScatter.js +1 -1
- package/dist/VegetationScatter.js.map +1 -1
- package/dist/VolumetricFog.d.ts +42 -0
- package/dist/VolumetricFog.d.ts.map +1 -1
- package/dist/VolumetricFog.js +52 -1
- package/dist/VolumetricFog.js.map +1 -1
- package/dist/WaterSurface.d.ts +5 -0
- package/dist/WaterSurface.d.ts.map +1 -1
- package/dist/WaterSurface.js +5 -0
- package/dist/WaterSurface.js.map +1 -1
- package/dist/WebGL2Device.d.ts +153 -207
- package/dist/WebGL2Device.d.ts.map +1 -1
- package/dist/WebGL2Device.js +822 -3706
- package/dist/WebGL2Device.js.map +1 -1
- package/dist/WebGL2StateCache.d.ts +15 -1
- package/dist/WebGL2StateCache.d.ts.map +1 -1
- package/dist/WebGL2StateCache.js +31 -2
- package/dist/WebGL2StateCache.js.map +1 -1
- package/dist/WebGPUDevice.d.ts +0 -4
- package/dist/WebGPUDevice.d.ts.map +1 -1
- package/dist/WebGPUDevice.js +31 -605
- package/dist/WebGPUDevice.js.map +1 -1
- package/dist/WebGPUSkinningLimits.d.ts +10 -1
- package/dist/WebGPUSkinningLimits.d.ts.map +1 -1
- package/dist/WebGPUSkinningLimits.js +15 -1
- package/dist/WebGPUSkinningLimits.js.map +1 -1
- package/dist/advanced-runtime/index.d.ts +6 -2
- package/dist/advanced-runtime/index.d.ts.map +1 -1
- package/dist/advanced-runtime/index.js +0 -1
- package/dist/advanced-runtime/index.js.map +1 -1
- package/dist/animation/AnimationRenderPreset.d.ts +1 -1
- package/dist/animation/AnimationRenderPreset.d.ts.map +1 -1
- package/dist/animation/AnimationRenderPreset.js +1 -1
- package/dist/animation/AnimationRenderPreset.js.map +1 -1
- package/dist/animation/applyAnimationRenderPreset.d.ts +1 -1
- package/dist/animation/applyAnimationRenderPreset.d.ts.map +1 -1
- package/dist/animation/index.d.ts +2 -1
- package/dist/animation/index.d.ts.map +1 -1
- package/dist/animation/index.js +1 -1
- package/dist/animation/index.js.map +1 -1
- package/dist/atmosphere/CloudLayer.d.ts +24 -0
- package/dist/atmosphere/CloudLayer.d.ts.map +1 -0
- package/dist/atmosphere/CloudLayer.js +30 -0
- package/dist/atmosphere/CloudLayer.js.map +1 -0
- package/dist/atmosphere/FogVolumes.d.ts +30 -0
- package/dist/atmosphere/FogVolumes.d.ts.map +1 -0
- package/dist/atmosphere/FogVolumes.js +96 -0
- package/dist/atmosphere/FogVolumes.js.map +1 -0
- package/dist/atmosphere/GradientSky.d.ts +40 -0
- package/dist/atmosphere/GradientSky.d.ts.map +1 -0
- package/dist/atmosphere/GradientSky.js +75 -0
- package/dist/atmosphere/GradientSky.js.map +1 -0
- package/dist/atmosphere/HeightFog.d.ts +154 -0
- package/dist/atmosphere/HeightFog.d.ts.map +1 -0
- package/dist/atmosphere/HeightFog.js +379 -0
- package/dist/atmosphere/HeightFog.js.map +1 -0
- package/dist/atmosphere/PreethamSky.d.ts +38 -0
- package/dist/atmosphere/PreethamSky.d.ts.map +1 -0
- package/dist/atmosphere/PreethamSky.js +150 -0
- package/dist/atmosphere/PreethamSky.js.map +1 -0
- package/dist/atmosphere/SkyBackgroundPass.d.ts +63 -0
- package/dist/atmosphere/SkyBackgroundPass.d.ts.map +1 -0
- package/dist/atmosphere/SkyBackgroundPass.js +233 -0
- package/dist/atmosphere/SkyBackgroundPass.js.map +1 -0
- package/dist/atmosphere/SkyCaptureAdapter.d.ts +45 -0
- package/dist/atmosphere/SkyCaptureAdapter.d.ts.map +1 -0
- package/dist/atmosphere/SkyCaptureAdapter.js +65 -0
- package/dist/atmosphere/SkyCaptureAdapter.js.map +1 -0
- package/dist/atmosphere/SkyEval.d.ts +56 -0
- package/dist/atmosphere/SkyEval.d.ts.map +1 -0
- package/dist/atmosphere/SkyEval.js +99 -0
- package/dist/atmosphere/SkyEval.js.map +1 -0
- package/dist/atmosphere/StarField.d.ts +26 -0
- package/dist/atmosphere/StarField.d.ts.map +1 -0
- package/dist/atmosphere/StarField.js +31 -0
- package/dist/atmosphere/StarField.js.map +1 -0
- package/dist/atmosphere/VolumetricFogPass.d.ts +69 -0
- package/dist/atmosphere/VolumetricFogPass.d.ts.map +1 -0
- package/dist/atmosphere/VolumetricFogPass.js +265 -0
- package/dist/atmosphere/VolumetricFogPass.js.map +1 -0
- package/dist/atmosphere/fogChunks.d.ts +8 -0
- package/dist/atmosphere/fogChunks.d.ts.map +1 -0
- package/dist/atmosphere/fogChunks.js +39 -0
- package/dist/atmosphere/fogChunks.js.map +1 -0
- package/dist/atmosphere/fogUniformStore.d.ts +20 -0
- package/dist/atmosphere/fogUniformStore.d.ts.map +1 -0
- package/dist/atmosphere/fogUniformStore.js +45 -0
- package/dist/atmosphere/fogUniformStore.js.map +1 -0
- package/dist/atmosphere/shaders/fog.glsl.d.ts +10 -0
- package/dist/atmosphere/shaders/fog.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/fog.glsl.js +161 -0
- package/dist/atmosphere/shaders/fog.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts +3 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.js +61 -0
- package/dist/atmosphere/shaders/volumetric-apply.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts +4 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.js +129 -0
- package/dist/atmosphere/shaders/volumetric-inject.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts +3 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.js +55 -0
- package/dist/atmosphere/shaders/volumetric-integrate.glsl.js.map +1 -0
- package/dist/atmosphere/shaders/wetness.glsl.d.ts +34 -0
- package/dist/atmosphere/shaders/wetness.glsl.d.ts.map +1 -0
- package/dist/atmosphere/shaders/wetness.glsl.js +101 -0
- package/dist/atmosphere/shaders/wetness.glsl.js.map +1 -0
- package/dist/atmosphere/sky.glsl.d.ts +8 -0
- package/dist/atmosphere/sky.glsl.d.ts.map +1 -0
- package/dist/atmosphere/sky.glsl.js +249 -0
- package/dist/atmosphere/sky.glsl.js.map +1 -0
- package/dist/batching/BatchedGeometryPool.d.ts +72 -0
- package/dist/batching/BatchedGeometryPool.d.ts.map +1 -0
- package/dist/batching/BatchedGeometryPool.js +138 -0
- package/dist/batching/BatchedGeometryPool.js.map +1 -0
- package/dist/batching/ContentKeys.d.ts +29 -0
- package/dist/batching/ContentKeys.d.ts.map +1 -0
- package/dist/batching/ContentKeys.js +220 -0
- package/dist/batching/ContentKeys.js.map +1 -0
- package/dist/batching/DrawDataTexture.d.ts +51 -0
- package/dist/batching/DrawDataTexture.d.ts.map +1 -0
- package/dist/batching/DrawDataTexture.js +99 -0
- package/dist/batching/DrawDataTexture.js.map +1 -0
- package/dist/batching/MultiDrawBatch.d.ts +64 -0
- package/dist/batching/MultiDrawBatch.d.ts.map +1 -0
- package/dist/batching/MultiDrawBatch.js +103 -0
- package/dist/batching/MultiDrawBatch.js.map +1 -0
- package/dist/batching/StaticMergePlanner.d.ts +80 -0
- package/dist/batching/StaticMergePlanner.d.ts.map +1 -0
- package/dist/batching/StaticMergePlanner.js +323 -0
- package/dist/batching/StaticMergePlanner.js.map +1 -0
- package/dist/batching/index.d.ts +8 -0
- package/dist/batching/index.d.ts.map +1 -0
- package/dist/batching/index.js +8 -0
- package/dist/batching/index.js.map +1 -0
- package/dist/batching/shaders/drawId.glsl.d.ts +29 -0
- package/dist/batching/shaders/drawId.glsl.d.ts.map +1 -0
- package/dist/batching/shaders/drawId.glsl.js +93 -0
- package/dist/batching/shaders/drawId.glsl.js.map +1 -0
- package/dist/batching/shaders/instanceEmissive.glsl.d.ts +16 -0
- package/dist/batching/shaders/instanceEmissive.glsl.d.ts.map +1 -0
- package/dist/batching/shaders/instanceEmissive.glsl.js +63 -0
- package/dist/batching/shaders/instanceEmissive.glsl.js.map +1 -0
- package/dist/cinematic/BloomPass.d.ts +5 -9
- package/dist/cinematic/BloomPass.d.ts.map +1 -1
- package/dist/cinematic/BloomPass.js +5 -17
- package/dist/cinematic/BloomPass.js.map +1 -1
- package/dist/cinematic/DepthHazePass.d.ts +5 -11
- package/dist/cinematic/DepthHazePass.d.ts.map +1 -1
- package/dist/cinematic/DepthHazePass.js +5 -19
- package/dist/cinematic/DepthHazePass.js.map +1 -1
- package/dist/cinematic/FilmGrainPass.d.ts +5 -8
- package/dist/cinematic/FilmGrainPass.d.ts.map +1 -1
- package/dist/cinematic/FilmGrainPass.js +5 -16
- package/dist/cinematic/FilmGrainPass.js.map +1 -1
- package/dist/cinematic/VignettePass.d.ts +5 -9
- package/dist/cinematic/VignettePass.d.ts.map +1 -1
- package/dist/cinematic/VignettePass.js +5 -16
- package/dist/cinematic/VignettePass.js.map +1 -1
- package/dist/cinematic/index.d.ts +2 -1
- package/dist/cinematic/index.d.ts.map +1 -1
- package/dist/cinematic/index.js +1 -1
- package/dist/cinematic/index.js.map +1 -1
- package/dist/contracts/atmosphere.d.ts +30 -0
- package/dist/contracts/atmosphere.d.ts.map +1 -0
- package/dist/contracts/atmosphere.js +42 -0
- package/dist/contracts/atmosphere.js.map +1 -0
- package/dist/contracts/blend.d.ts +28 -0
- package/dist/contracts/blend.d.ts.map +1 -0
- package/dist/contracts/blend.js +73 -0
- package/dist/contracts/blend.js.map +1 -0
- package/dist/contracts/core.d.ts +47 -0
- package/dist/contracts/core.d.ts.map +1 -0
- package/dist/contracts/core.js +70 -0
- package/dist/contracts/core.js.map +1 -0
- package/dist/contracts/deform.d.ts +38 -0
- package/dist/contracts/deform.d.ts.map +1 -0
- package/dist/contracts/deform.js +14 -0
- package/dist/contracts/deform.js.map +1 -0
- package/dist/contracts/device.d.ts +71 -0
- package/dist/contracts/device.d.ts.map +1 -0
- package/dist/contracts/device.js +97 -0
- package/dist/contracts/device.js.map +1 -0
- package/dist/contracts/environment.d.ts +55 -0
- package/dist/contracts/environment.d.ts.map +1 -0
- package/dist/contracts/environment.js +115 -0
- package/dist/contracts/environment.js.map +1 -0
- package/dist/contracts/flags.state.d.ts +15 -0
- package/dist/contracts/flags.state.d.ts.map +1 -0
- package/dist/contracts/flags.state.js +45 -0
- package/dist/contracts/flags.state.js.map +1 -0
- package/dist/contracts/frameGraph.d.ts +78 -0
- package/dist/contracts/frameGraph.d.ts.map +1 -0
- package/dist/contracts/frameGraph.js +32 -0
- package/dist/contracts/frameGraph.js.map +1 -0
- package/dist/contracts/frameUniforms.d.ts +43 -0
- package/dist/contracts/frameUniforms.d.ts.map +1 -0
- package/dist/contracts/frameUniforms.js +35 -0
- package/dist/contracts/frameUniforms.js.map +1 -0
- package/dist/contracts/geometry.d.ts +33 -0
- package/dist/contracts/geometry.d.ts.map +1 -0
- package/dist/contracts/geometry.js +59 -0
- package/dist/contracts/geometry.js.map +1 -0
- package/dist/contracts/index.d.ts +27 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +27 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/contracts/materialLobes.d.ts +41 -0
- package/dist/contracts/materialLobes.d.ts.map +1 -0
- package/dist/contracts/materialLobes.js +14 -0
- package/dist/contracts/materialLobes.js.map +1 -0
- package/dist/contracts/output.d.ts +35 -0
- package/dist/contracts/output.d.ts.map +1 -0
- package/dist/contracts/output.js +18 -0
- package/dist/contracts/output.js.map +1 -0
- package/dist/contracts/particles.d.ts +41 -0
- package/dist/contracts/particles.d.ts.map +1 -0
- package/dist/contracts/particles.js +15 -0
- package/dist/contracts/particles.js.map +1 -0
- package/dist/contracts/post.d.ts +71 -0
- package/dist/contracts/post.d.ts.map +1 -0
- package/dist/contracts/post.js +28 -0
- package/dist/contracts/post.js.map +1 -0
- package/dist/contracts/program.d.ts +158 -0
- package/dist/contracts/program.d.ts.map +1 -0
- package/dist/contracts/program.js +128 -0
- package/dist/contracts/program.js.map +1 -0
- package/dist/contracts/quality.d.ts +93 -0
- package/dist/contracts/quality.d.ts.map +1 -0
- package/dist/contracts/quality.js +149 -0
- package/dist/contracts/quality.js.map +1 -0
- package/dist/contracts/renderItem.d.ts +58 -0
- package/dist/contracts/renderItem.d.ts.map +1 -0
- package/dist/contracts/renderItem.js +8 -0
- package/dist/contracts/renderItem.js.map +1 -0
- package/dist/contracts/renderSource.d.ts +63 -0
- package/dist/contracts/renderSource.d.ts.map +1 -0
- package/dist/contracts/renderSource.js +7 -0
- package/dist/contracts/renderSource.js.map +1 -0
- package/dist/contracts/rendererFactory.d.ts +42 -0
- package/dist/contracts/rendererFactory.d.ts.map +1 -0
- package/dist/contracts/rendererFactory.js +32 -0
- package/dist/contracts/rendererFactory.js.map +1 -0
- package/dist/contracts/sampling.d.ts +23 -0
- package/dist/contracts/sampling.d.ts.map +1 -0
- package/dist/contracts/sampling.js +17 -0
- package/dist/contracts/sampling.js.map +1 -0
- package/dist/contracts/shadows.d.ts +53 -0
- package/dist/contracts/shadows.d.ts.map +1 -0
- package/dist/contracts/shadows.js +66 -0
- package/dist/contracts/shadows.js.map +1 -0
- package/dist/contracts/testing/ChunkHarness.d.ts +18 -0
- package/dist/contracts/testing/ChunkHarness.d.ts.map +1 -0
- package/dist/contracts/testing/ChunkHarness.js +68 -0
- package/dist/contracts/testing/ChunkHarness.js.map +1 -0
- package/dist/contracts/textureFormats.d.ts +18 -0
- package/dist/contracts/textureFormats.d.ts.map +1 -0
- package/dist/contracts/textureFormats.js +13 -0
- package/dist/contracts/textureFormats.js.map +1 -0
- package/dist/contracts/velocity.d.ts +37 -0
- package/dist/contracts/velocity.d.ts.map +1 -0
- package/dist/contracts/velocity.js +22 -0
- package/dist/contracts/velocity.js.map +1 -0
- package/dist/environment/EnvUniforms.d.ts +42 -0
- package/dist/environment/EnvUniforms.d.ts.map +1 -0
- package/dist/environment/EnvUniforms.js +54 -0
- package/dist/environment/EnvUniforms.js.map +1 -0
- package/dist/environment/EnvironmentCache.d.ts +83 -0
- package/dist/environment/EnvironmentCache.d.ts.map +1 -0
- package/dist/environment/EnvironmentCache.js +205 -0
- package/dist/environment/EnvironmentCache.js.map +1 -0
- package/dist/environment/EnvironmentProbeFactory.d.ts +41 -0
- package/dist/environment/EnvironmentProbeFactory.d.ts.map +1 -0
- package/dist/environment/EnvironmentProbeFactory.js +52 -0
- package/dist/environment/EnvironmentProbeFactory.js.map +1 -0
- package/dist/environment/GPUPMREMGenerator.d.ts +44 -0
- package/dist/environment/GPUPMREMGenerator.d.ts.map +1 -0
- package/dist/environment/GPUPMREMGenerator.js +98 -0
- package/dist/environment/GPUPMREMGenerator.js.map +1 -0
- package/dist/environment/HdrEquirect.d.ts +28 -0
- package/dist/environment/HdrEquirect.d.ts.map +1 -0
- package/dist/environment/HdrEquirect.js +205 -0
- package/dist/environment/HdrEquirect.js.map +1 -0
- package/dist/environment/LightingSamplerBudget.d.ts +20 -0
- package/dist/environment/LightingSamplerBudget.d.ts.map +1 -0
- package/dist/environment/LightingSamplerBudget.js +94 -0
- package/dist/environment/LightingSamplerBudget.js.map +1 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.d.ts +10 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.d.ts.map +1 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.js +100 -0
- package/dist/environment/Prd02BackgroundShaderLibrary.js.map +1 -0
- package/dist/environment/Rgb9e5Cube.d.ts +25 -0
- package/dist/environment/Rgb9e5Cube.d.ts.map +1 -0
- package/dist/environment/Rgb9e5Cube.js +103 -0
- package/dist/environment/Rgb9e5Cube.js.map +1 -0
- package/dist/environment/RoomEnvironmentScene.d.ts +57 -0
- package/dist/environment/RoomEnvironmentScene.d.ts.map +1 -0
- package/dist/environment/RoomEnvironmentScene.js +165 -0
- package/dist/environment/RoomEnvironmentScene.js.map +1 -0
- package/dist/environment/SphericalHarmonics.d.ts +32 -0
- package/dist/environment/SphericalHarmonics.d.ts.map +1 -0
- package/dist/environment/SphericalHarmonics.js +155 -0
- package/dist/environment/SphericalHarmonics.js.map +1 -0
- package/dist/environment/probeBuild.d.ts +97 -0
- package/dist/environment/probeBuild.d.ts.map +1 -0
- package/dist/environment/probeBuild.js +406 -0
- package/dist/environment/probeBuild.js.map +1 -0
- package/dist/environment/workers/cpuPrefilter.d.ts +58 -0
- package/dist/environment/workers/cpuPrefilter.d.ts.map +1 -0
- package/dist/environment/workers/cpuPrefilter.js +288 -0
- package/dist/environment/workers/cpuPrefilter.js.map +1 -0
- package/dist/forward/Deform.d.ts +56 -0
- package/dist/forward/Deform.d.ts.map +1 -0
- package/dist/forward/Deform.js +517 -0
- package/dist/forward/Deform.js.map +1 -0
- package/dist/forward/DrawSubmit.d.ts +32 -0
- package/dist/forward/DrawSubmit.d.ts.map +1 -0
- package/dist/forward/DrawSubmit.js +75 -0
- package/dist/forward/DrawSubmit.js.map +1 -0
- package/dist/forward/Lighting.d.ts +35 -0
- package/dist/forward/Lighting.d.ts.map +1 -0
- package/dist/forward/Lighting.js +477 -0
- package/dist/forward/Lighting.js.map +1 -0
- package/dist/forward/Transmission.d.ts +62 -0
- package/dist/forward/Transmission.d.ts.map +1 -0
- package/dist/forward/Transmission.js +299 -0
- package/dist/forward/Transmission.js.map +1 -0
- package/dist/forward/Velocity.d.ts +47 -0
- package/dist/forward/Velocity.d.ts.map +1 -0
- package/dist/forward/Velocity.js +153 -0
- package/dist/forward/Velocity.js.map +1 -0
- package/dist/forward/transmissionTargetStore.d.ts +21 -0
- package/dist/forward/transmissionTargetStore.d.ts.map +1 -0
- package/dist/forward/transmissionTargetStore.js +8 -0
- package/dist/forward/transmissionTargetStore.js.map +1 -0
- package/dist/geometry/Primitives.d.ts +28 -0
- package/dist/geometry/Primitives.d.ts.map +1 -0
- package/dist/geometry/Primitives.js +110 -0
- package/dist/geometry/Primitives.js.map +1 -0
- package/dist/index.d.ts +140 -58
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +102 -52
- package/dist/index.js.map +1 -1
- package/dist/lanes/index.d.ts +17 -0
- package/dist/lanes/index.d.ts.map +1 -0
- package/dist/lanes/index.js +17 -0
- package/dist/lanes/index.js.map +1 -0
- package/dist/lanes/prd01.d.ts +6 -0
- package/dist/lanes/prd01.d.ts.map +1 -0
- package/dist/lanes/prd01.js +19 -0
- package/dist/lanes/prd01.js.map +1 -0
- package/dist/lanes/prd02.d.ts +62 -0
- package/dist/lanes/prd02.d.ts.map +1 -0
- package/dist/lanes/prd02.js +117 -0
- package/dist/lanes/prd02.js.map +1 -0
- package/dist/lanes/prd03.d.ts +19 -0
- package/dist/lanes/prd03.d.ts.map +1 -0
- package/dist/lanes/prd03.js +55 -0
- package/dist/lanes/prd03.js.map +1 -0
- package/dist/lanes/prd04.d.ts +22 -0
- package/dist/lanes/prd04.d.ts.map +1 -0
- package/dist/lanes/prd04.js +35 -0
- package/dist/lanes/prd04.js.map +1 -0
- package/dist/lanes/prd05.d.ts +4 -0
- package/dist/lanes/prd05.d.ts.map +1 -0
- package/dist/lanes/prd05.js +31 -0
- package/dist/lanes/prd05.js.map +1 -0
- package/dist/lanes/prd06.d.ts +33 -0
- package/dist/lanes/prd06.d.ts.map +1 -0
- package/dist/lanes/prd06.js +217 -0
- package/dist/lanes/prd06.js.map +1 -0
- package/dist/lanes/prd07.d.ts +49 -0
- package/dist/lanes/prd07.d.ts.map +1 -0
- package/dist/lanes/prd07.js +112 -0
- package/dist/lanes/prd07.js.map +1 -0
- package/dist/lanes/prd08.d.ts +2 -0
- package/dist/lanes/prd08.d.ts.map +1 -0
- package/dist/lanes/prd08.js +17 -0
- package/dist/lanes/prd08.js.map +1 -0
- package/dist/lanes/prd09.d.ts +6 -0
- package/dist/lanes/prd09.d.ts.map +1 -0
- package/dist/lanes/prd09.js +6 -0
- package/dist/lanes/prd09.js.map +1 -0
- package/dist/lanes/prd10.d.ts +2 -0
- package/dist/lanes/prd10.d.ts.map +1 -0
- package/dist/lanes/prd10.js +10 -0
- package/dist/lanes/prd10.js.map +1 -0
- package/dist/lanes/prd11.d.ts +61 -0
- package/dist/lanes/prd11.d.ts.map +1 -0
- package/dist/lanes/prd11.js +244 -0
- package/dist/lanes/prd11.js.map +1 -0
- package/dist/lanes/prd12.d.ts +6 -0
- package/dist/lanes/prd12.d.ts.map +1 -0
- package/dist/lanes/prd12.js +6 -0
- package/dist/lanes/prd12.js.map +1 -0
- package/dist/lanes/prd13.d.ts +6 -0
- package/dist/lanes/prd13.d.ts.map +1 -0
- package/dist/lanes/prd13.js +6 -0
- package/dist/lanes/prd13.js.map +1 -0
- package/dist/lanes/prd14.d.ts +6 -0
- package/dist/lanes/prd14.d.ts.map +1 -0
- package/dist/lanes/prd14.js +6 -0
- package/dist/lanes/prd14.js.map +1 -0
- package/dist/lanes/prd15.d.ts +6 -0
- package/dist/lanes/prd15.d.ts.map +1 -0
- package/dist/lanes/prd15.js +6 -0
- package/dist/lanes/prd15.js.map +1 -0
- package/dist/materials/PhysicalFeatures.d.ts +71 -0
- package/dist/materials/PhysicalFeatures.d.ts.map +1 -0
- package/dist/materials/PhysicalFeatures.js +255 -0
- package/dist/materials/PhysicalFeatures.js.map +1 -0
- package/dist/materials/PhysicalMaterial.d.ts +85 -0
- package/dist/materials/PhysicalMaterial.d.ts.map +1 -1
- package/dist/materials/PhysicalMaterial.js +21 -0
- package/dist/materials/PhysicalMaterial.js.map +1 -1
- package/dist/materials/features.d.ts +47 -0
- package/dist/materials/features.d.ts.map +1 -0
- package/dist/materials/features.js +282 -0
- package/dist/materials/features.js.map +1 -0
- package/dist/materials/lobes.d.ts +3 -0
- package/dist/materials/lobes.d.ts.map +1 -0
- package/dist/materials/lobes.js +225 -0
- package/dist/materials/lobes.js.map +1 -0
- package/dist/output/HdrTarget.d.ts +27 -0
- package/dist/output/HdrTarget.d.ts.map +1 -0
- package/dist/output/HdrTarget.js +48 -0
- package/dist/output/HdrTarget.js.map +1 -0
- package/dist/output/OutputPass.d.ts +28 -0
- package/dist/output/OutputPass.d.ts.map +1 -0
- package/dist/output/OutputPass.js +142 -0
- package/dist/output/OutputPass.js.map +1 -0
- package/dist/output/ToneMappingOperators.glsl.d.ts +22 -0
- package/dist/output/ToneMappingOperators.glsl.d.ts.map +1 -0
- package/dist/output/ToneMappingOperators.glsl.js +217 -0
- package/dist/output/ToneMappingOperators.glsl.js.map +1 -0
- package/dist/passes/ContactShadowPass.d.ts +57 -0
- package/dist/passes/ContactShadowPass.d.ts.map +1 -0
- package/dist/passes/ContactShadowPass.js +151 -0
- package/dist/passes/ContactShadowPass.js.map +1 -0
- package/dist/passes/Prd02ContactShadowsContributor.d.ts +16 -0
- package/dist/passes/Prd02ContactShadowsContributor.d.ts.map +1 -0
- package/dist/passes/Prd02ContactShadowsContributor.js +133 -0
- package/dist/passes/Prd02ContactShadowsContributor.js.map +1 -0
- package/dist/passes/Prd02SubFlags.d.ts +22 -0
- package/dist/passes/Prd02SubFlags.d.ts.map +1 -0
- package/dist/passes/Prd02SubFlags.js +32 -0
- package/dist/passes/Prd02SubFlags.js.map +1 -0
- package/dist/performance/BVH.d.ts +46 -0
- package/dist/performance/BVH.d.ts.map +1 -1
- package/dist/performance/BVH.js +212 -0
- package/dist/performance/BVH.js.map +1 -1
- package/dist/performance/Batcher.d.ts +11 -0
- package/dist/performance/Batcher.d.ts.map +1 -1
- package/dist/performance/Batcher.js +10 -0
- package/dist/performance/Batcher.js.map +1 -1
- package/dist/performance/FrustumCuller.d.ts +29 -0
- package/dist/performance/FrustumCuller.d.ts.map +1 -1
- package/dist/performance/FrustumCuller.js +78 -1
- package/dist/performance/FrustumCuller.js.map +1 -1
- package/dist/performance/LOD.d.ts +6 -0
- package/dist/performance/LOD.d.ts.map +1 -1
- package/dist/performance/LOD.js +12 -0
- package/dist/performance/LOD.js.map +1 -1
- package/dist/performance/RenderItemSorting.d.ts +2 -0
- package/dist/performance/RenderItemSorting.d.ts.map +1 -1
- package/dist/performance/RenderItemSorting.js +5 -1
- package/dist/performance/RenderItemSorting.js.map +1 -1
- package/dist/post/CubeLut.d.ts +15 -0
- package/dist/post/CubeLut.d.ts.map +1 -0
- package/dist/post/CubeLut.js +86 -0
- package/dist/post/CubeLut.js.map +1 -0
- package/dist/post/DisplayLutCache.d.ts +31 -0
- package/dist/post/DisplayLutCache.d.ts.map +1 -0
- package/dist/post/DisplayLutCache.js +44 -0
- package/dist/post/DisplayLutCache.js.map +1 -0
- package/dist/post/PostAntiAlias.d.ts +49 -0
- package/dist/post/PostAntiAlias.d.ts.map +1 -0
- package/dist/post/PostAntiAlias.js +75 -0
- package/dist/post/PostAntiAlias.js.map +1 -0
- package/dist/post/PostGraph.d.ts +206 -0
- package/dist/post/PostGraph.d.ts.map +1 -0
- package/dist/post/PostGraph.js +234 -0
- package/dist/post/PostGraph.js.map +1 -0
- package/dist/post/PostQualityTiers.d.ts +95 -0
- package/dist/post/PostQualityTiers.d.ts.map +1 -0
- package/dist/post/PostQualityTiers.js +62 -0
- package/dist/post/PostQualityTiers.js.map +1 -0
- package/dist/post/PostResources.d.ts +49 -0
- package/dist/post/PostResources.d.ts.map +1 -0
- package/dist/post/PostResources.js +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 +34 -0
- package/dist/postprocess/NativeBloomPyramid.d.ts.map +1 -1
- package/dist/postprocess/NativeBloomPyramid.js +57 -0
- package/dist/postprocess/NativeBloomPyramid.js.map +1 -1
- package/dist/postprocess/SSAOPass.d.ts +5 -5
- package/dist/postprocess/SSAOPass.d.ts.map +1 -1
- package/dist/postprocess/SSAOPass.js +5 -17
- package/dist/postprocess/SSAOPass.js.map +1 -1
- package/dist/probes/IrradianceVolume.d.ts +45 -0
- package/dist/probes/IrradianceVolume.d.ts.map +1 -0
- package/dist/probes/IrradianceVolume.js +230 -0
- package/dist/probes/IrradianceVolume.js.map +1 -0
- package/dist/probes/LtcLuts.d.ts +30 -0
- package/dist/probes/LtcLuts.d.ts.map +1 -0
- package/dist/probes/LtcLuts.js +120 -0
- package/dist/probes/LtcLuts.js.map +1 -0
- package/dist/probes/Prd02ProbesContributor.d.ts +53 -0
- package/dist/probes/Prd02ProbesContributor.d.ts.map +1 -0
- package/dist/probes/Prd02ProbesContributor.js +241 -0
- package/dist/probes/Prd02ProbesContributor.js.map +1 -0
- package/dist/probes/ProbeBoxProjection.d.ts +53 -0
- package/dist/probes/ProbeBoxProjection.d.ts.map +1 -0
- package/dist/probes/ProbeBoxProjection.js +99 -0
- package/dist/probes/ProbeBoxProjection.js.map +1 -0
- package/dist/probes/ReflectionProbeSystem.d.ts +64 -0
- package/dist/probes/ReflectionProbeSystem.d.ts.map +1 -0
- package/dist/probes/ReflectionProbeSystem.js +157 -0
- package/dist/probes/ReflectionProbeSystem.js.map +1 -0
- package/dist/production-runtime/PBRHDRPipeline.d.ts.map +1 -1
- package/dist/production-runtime/PBRHDRPipeline.js +23 -9
- package/dist/production-runtime/PBRHDRPipeline.js.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.d.ts +16 -6
- package/dist/production-runtime/ProductionRendererTypes.d.ts.map +1 -1
- package/dist/production-runtime/ProductionRendererTypes.js.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts +4 -4
- package/dist/production-runtime/ProductionWebGPURenderer.d.ts.map +1 -1
- package/dist/production-runtime/ProductionWebGPURenderer.js +10 -45
- package/dist/production-runtime/ProductionWebGPURenderer.js.map +1 -1
- package/dist/production-runtime/backendSelection.d.ts +26 -0
- package/dist/production-runtime/backendSelection.d.ts.map +1 -0
- package/dist/production-runtime/backendSelection.js +46 -0
- package/dist/production-runtime/backendSelection.js.map +1 -0
- package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts +1 -1
- package/dist/production-runtime/backends/WebGL2RendererBackend.d.ts.map +1 -1
- package/dist/production-runtime/backends/WebGL2RendererBackend.js +8 -4
- package/dist/production-runtime/backends/WebGL2RendererBackend.js.map +1 -1
- package/dist/production-runtime/backends/WebGPURendererBackend.d.ts +2 -19
- package/dist/production-runtime/backends/WebGPURendererBackend.d.ts.map +1 -1
- package/dist/production-runtime/backends/WebGPURendererBackend.js +2 -18
- package/dist/production-runtime/backends/WebGPURendererBackend.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Buffer.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Capabilities.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2RenderTarget.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Shader.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts +1 -0
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js +1 -0
- package/dist/production-runtime/backends/webgl2/WebGL2StateCache.js.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts +2 -10
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.js +2 -7
- package/dist/production-runtime/backends/webgl2/WebGL2Texture.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUBuffer.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUCapabilities.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPURenderTarget.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUShader.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUShader.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUShader.js.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts +2 -10
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.d.ts.map +1 -1
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.js +2 -7
- package/dist/production-runtime/backends/webgpu/WebGPUTexture.js.map +1 -1
- package/dist/production-runtime/index.d.ts +6 -6
- package/dist/production-runtime/index.d.ts.map +1 -1
- package/dist/production-runtime/index.js +9 -3
- package/dist/production-runtime/index.js.map +1 -1
- package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts +12 -13
- package/dist/production-runtime/materials/GLTFMaterialAdapter.d.ts.map +1 -1
- package/dist/production-runtime/materials/GLTFMaterialAdapter.js +10 -4
- package/dist/production-runtime/materials/GLTFMaterialAdapter.js.map +1 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts +9 -2
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.d.ts.map +1 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js +7 -1
- package/dist/production-runtime/materials/GLTFPBRMaterialAdapter.js.map +1 -1
- package/dist/production-runtime/materials/MaterialCompiler.d.ts +10 -8
- package/dist/production-runtime/materials/MaterialCompiler.d.ts.map +1 -1
- package/dist/production-runtime/materials/MaterialCompiler.js +9 -4
- package/dist/production-runtime/materials/MaterialCompiler.js.map +1 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.d.ts.map +1 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.js +30 -1
- package/dist/production-runtime/materials/PBRShaderFeatures.js.map +1 -1
- package/dist/production-runtime/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/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.map +1 -1
- package/dist/webgpu/WebGPUPostShaders.js +33 -2
- package/dist/webgpu/WebGPUPostShaders.js.map +1 -1
- package/dist/webgpu/WebGPUTexture.d.ts +1 -0
- package/dist/webgpu/WebGPUTexture.d.ts.map +1 -1
- package/dist/webgpu/WebGPUTexture.js.map +1 -1
- package/dist/world/chunks.d.ts +15 -0
- package/dist/world/chunks.d.ts.map +1 -0
- package/dist/world/chunks.js +56 -0
- package/dist/world/chunks.js.map +1 -0
- package/dist/world/index.d.ts +38 -0
- package/dist/world/index.d.ts.map +1 -0
- package/dist/world/index.js +39 -0
- package/dist/world/index.js.map +1 -0
- package/dist/world/shared/shaders/worldLightFallback.d.ts +12 -0
- package/dist/world/shared/shaders/worldLightFallback.d.ts.map +1 -0
- package/dist/world/shared/shaders/worldLightFallback.js +82 -0
- package/dist/world/shared/shaders/worldLightFallback.js.map +1 -0
- package/dist/world/space/PlanetMaterial.d.ts +24 -0
- package/dist/world/space/PlanetMaterial.d.ts.map +1 -0
- package/dist/world/space/PlanetMaterial.js +82 -0
- package/dist/world/space/PlanetMaterial.js.map +1 -0
- package/dist/world/space/SpaceSkyBake.d.ts +46 -0
- package/dist/world/space/SpaceSkyBake.d.ts.map +1 -0
- package/dist/world/space/SpaceSkyBake.js +145 -0
- package/dist/world/space/SpaceSkyBake.js.map +1 -0
- package/dist/world/space/shaders/planet.d.ts +8 -0
- package/dist/world/space/shaders/planet.d.ts.map +1 -0
- package/dist/world/space/shaders/planet.js +55 -0
- package/dist/world/space/shaders/planet.js.map +1 -0
- package/dist/world/space/shaders/spaceBake.d.ts +9 -0
- package/dist/world/space/shaders/spaceBake.d.ts.map +1 -0
- package/dist/world/space/shaders/spaceBake.js +102 -0
- package/dist/world/space/shaders/spaceBake.js.map +1 -0
- package/dist/world/terrain/SplatBake.d.ts +76 -0
- package/dist/world/terrain/SplatBake.d.ts.map +1 -0
- package/dist/world/terrain/SplatBake.js +308 -0
- package/dist/world/terrain/SplatBake.js.map +1 -0
- package/dist/world/terrain/TerrainCdlod.d.ts +67 -0
- package/dist/world/terrain/TerrainCdlod.d.ts.map +1 -0
- package/dist/world/terrain/TerrainCdlod.js +115 -0
- package/dist/world/terrain/TerrainCdlod.js.map +1 -0
- package/dist/world/terrain/TerrainHeightTexture.d.ts +44 -0
- package/dist/world/terrain/TerrainHeightTexture.d.ts.map +1 -0
- package/dist/world/terrain/TerrainHeightTexture.js +173 -0
- package/dist/world/terrain/TerrainHeightTexture.js.map +1 -0
- package/dist/world/terrain/TerrainPatchGeometry.d.ts +18 -0
- package/dist/world/terrain/TerrainPatchGeometry.d.ts.map +1 -0
- package/dist/world/terrain/TerrainPatchGeometry.js +40 -0
- package/dist/world/terrain/TerrainPatchGeometry.js.map +1 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts +19 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.js +162 -0
- package/dist/world/terrain/shaders/terrain.vert.glsl.js.map +1 -0
- package/dist/world/terrain/shaders/terrainCdlod.d.ts +23 -0
- package/dist/world/terrain/shaders/terrainCdlod.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrainCdlod.js +110 -0
- package/dist/world/terrain/shaders/terrainCdlod.js.map +1 -0
- package/dist/world/terrain/shaders/terrainSplat.d.ts +26 -0
- package/dist/world/terrain/shaders/terrainSplat.d.ts.map +1 -0
- package/dist/world/terrain/shaders/terrainSplat.js +181 -0
- package/dist/world/terrain/shaders/terrainSplat.js.map +1 -0
- package/dist/world/vegetation/FoliageMaterial.d.ts +14 -0
- package/dist/world/vegetation/FoliageMaterial.d.ts.map +1 -0
- package/dist/world/vegetation/FoliageMaterial.js +107 -0
- package/dist/world/vegetation/FoliageMaterial.js.map +1 -0
- package/dist/world/vegetation/GrassField.d.ts +43 -0
- package/dist/world/vegetation/GrassField.d.ts.map +1 -0
- package/dist/world/vegetation/GrassField.js +68 -0
- package/dist/world/vegetation/GrassField.js.map +1 -0
- package/dist/world/vegetation/ImpostorMaterial.d.ts +20 -0
- package/dist/world/vegetation/ImpostorMaterial.d.ts.map +1 -0
- package/dist/world/vegetation/ImpostorMaterial.js +80 -0
- package/dist/world/vegetation/ImpostorMaterial.js.map +1 -0
- package/dist/world/vegetation/InstanceChunkGrid.d.ts +67 -0
- package/dist/world/vegetation/InstanceChunkGrid.d.ts.map +1 -0
- package/dist/world/vegetation/InstanceChunkGrid.js +150 -0
- package/dist/world/vegetation/InstanceChunkGrid.js.map +1 -0
- package/dist/world/vegetation/WindCpu.d.ts +19 -0
- package/dist/world/vegetation/WindCpu.d.ts.map +1 -0
- package/dist/world/vegetation/WindCpu.js +43 -0
- package/dist/world/vegetation/WindCpu.js.map +1 -0
- package/dist/world/vegetation/WindField.d.ts +42 -0
- package/dist/world/vegetation/WindField.d.ts.map +1 -0
- package/dist/world/vegetation/WindField.js +154 -0
- package/dist/world/vegetation/WindField.js.map +1 -0
- package/dist/world/vegetation/shaders/foliage.d.ts +8 -0
- package/dist/world/vegetation/shaders/foliage.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/foliage.js +104 -0
- package/dist/world/vegetation/shaders/foliage.js.map +1 -0
- package/dist/world/vegetation/shaders/grass.d.ts +10 -0
- package/dist/world/vegetation/shaders/grass.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/grass.js +79 -0
- package/dist/world/vegetation/shaders/grass.js.map +1 -0
- package/dist/world/vegetation/shaders/impostor.d.ts +9 -0
- package/dist/world/vegetation/shaders/impostor.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/impostor.js +97 -0
- package/dist/world/vegetation/shaders/impostor.js.map +1 -0
- package/dist/world/vegetation/shaders/wind.d.ts +9 -0
- package/dist/world/vegetation/shaders/wind.d.ts.map +1 -0
- package/dist/world/vegetation/shaders/wind.js +103 -0
- package/dist/world/vegetation/shaders/wind.js.map +1 -0
- package/dist/world/water/GerstnerWaves.d.ts +65 -0
- package/dist/world/water/GerstnerWaves.d.ts.map +1 -0
- package/dist/world/water/GerstnerWaves.js +182 -0
- package/dist/world/water/GerstnerWaves.js.map +1 -0
- package/dist/world/water/ReflectionViewPass.d.ts +46 -0
- package/dist/world/water/ReflectionViewPass.d.ts.map +1 -0
- package/dist/world/water/ReflectionViewPass.js +85 -0
- package/dist/world/water/ReflectionViewPass.js.map +1 -0
- package/dist/world/water/SceneCopyFallback.d.ts +21 -0
- package/dist/world/water/SceneCopyFallback.d.ts.map +1 -0
- package/dist/world/water/SceneCopyFallback.js +150 -0
- package/dist/world/water/SceneCopyFallback.js.map +1 -0
- package/dist/world/water/UnderwaterState.d.ts +25 -0
- package/dist/world/water/UnderwaterState.d.ts.map +1 -0
- package/dist/world/water/UnderwaterState.js +134 -0
- package/dist/world/water/UnderwaterState.js.map +1 -0
- package/dist/world/water/WaterMaterial.d.ts +23 -0
- package/dist/world/water/WaterMaterial.d.ts.map +1 -0
- package/dist/world/water/WaterMaterial.js +129 -0
- package/dist/world/water/WaterMaterial.js.map +1 -0
- package/dist/world/water/shaders/caustics.d.ts +13 -0
- package/dist/world/water/shaders/caustics.d.ts.map +1 -0
- package/dist/world/water/shaders/caustics.js +103 -0
- package/dist/world/water/shaders/caustics.js.map +1 -0
- package/dist/world/water/shaders/gerstner.d.ts +9 -0
- package/dist/world/water/shaders/gerstner.d.ts.map +1 -0
- package/dist/world/water/shaders/gerstner.js +100 -0
- package/dist/world/water/shaders/gerstner.js.map +1 -0
- package/dist/world/water/shaders/water.d.ts +12 -0
- package/dist/world/water/shaders/water.d.ts.map +1 -0
- package/dist/world/water/shaders/water.js +112 -0
- package/dist/world/water/shaders/water.js.map +1 -0
- package/package.json +32 -11
package/dist/ForwardPass.js
CHANGED
|
@@ -2,23 +2,41 @@ import { Geometry } from "./Geometry.js";
|
|
|
2
2
|
import {} from "./LightCollector.js";
|
|
3
3
|
import { LightUniforms } from "./LightUniforms.js";
|
|
4
4
|
import { Material } from "./Material.js";
|
|
5
|
-
import { MaterialBinding } from "./MaterialBinding.js";
|
|
5
|
+
import { MaterialBinding, MaterialBindingError } from "./MaterialBinding.js";
|
|
6
6
|
import { MaterialInstance } from "./MaterialInstance.js";
|
|
7
|
-
import { applyMorphTargets } from "./MorphTarget.js";
|
|
8
7
|
import { RenderDeviceError } from "./RenderDevice.js";
|
|
9
8
|
import { RenderPipeline } from "./RenderPipeline.js";
|
|
10
9
|
import { BaseRenderPass } from "./RenderPass.js";
|
|
11
10
|
import { MAX_UNIFORM_SKINNING_JOINTS as SHADER_MAX_UNIFORM_SKINNING_JOINTS } from "./ShaderChunks.js";
|
|
12
|
-
import {
|
|
11
|
+
import {} from "./WebGPUSkinningLimits.js";
|
|
13
12
|
import { ShaderModule } from "./ShaderModule.js";
|
|
14
13
|
import { createLeanCoreShaderLibrary } from "./ShaderLibraryCore.js";
|
|
15
|
-
import {
|
|
16
|
-
import { Sampler } from "./Sampler.js";
|
|
17
|
-
import { Texture } from "./Texture.js";
|
|
14
|
+
import {} from "./ShadowMap.js";
|
|
18
15
|
import { TextureBinding } from "./TextureBinding.js";
|
|
19
16
|
import { UnlitMaterial } from "./UnlitMaterial.js";
|
|
20
17
|
import { sortRenderQueueItems } from "./performance/RenderItemSorting.js";
|
|
21
|
-
import {
|
|
18
|
+
import { blendQueueForState, blendStateIsTransparent } from "./BlendModes.js";
|
|
19
|
+
import { renderStateKey } from "./contracts/blend.js";
|
|
20
|
+
import {} from "./contracts/renderItem.js";
|
|
21
|
+
import { instanceBufferSlot } from "./contracts/geometry.js";
|
|
22
|
+
import {} from "./VertexFormat.js";
|
|
23
|
+
import {} from "./ClusteredForwardLighting.js";
|
|
24
|
+
import { programCacheSlot } from "./contracts/program.js";
|
|
25
|
+
import { normalizeProgramFeatures } from "./program/ProgramFeatures.js";
|
|
26
|
+
import { featuresForGeometry, geometryHasSkin, materialFeatureWarning, materialRoutesToGeneratedProgram } from "./program/MaterialFeatures.js";
|
|
27
|
+
import { bindShaderFeatureUniforms, selectShaderFeatureBits } from "./program/FeatureSelect.js";
|
|
28
|
+
import { bindMaterialLobeUniforms } from "./materials/PhysicalFeatures.js";
|
|
29
|
+
import { QUALITY_TIERS } from "./contracts/quality.js";
|
|
30
|
+
import { rendererQrFlags } from "./renderer/FrameGraph.js";
|
|
31
|
+
import { qrCoreGeneratorOn, qrE3CompilerLightingOn, qrGeneratedProgramsOn, qrMaterialsLobeProgramsOn, rendererProgramCache, rendererAuraFrame } from "./renderer/qrSubFlags.js";
|
|
32
|
+
import { PRD02_IBL_FEATURE } from "./contracts/environment.js";
|
|
33
|
+
import { packA3DEnvironmentUniforms } from "./environment/EnvUniforms.js";
|
|
34
|
+
import { dfgLutBinding, dfgLutTexture } from "./program/DFGLut.js";
|
|
35
|
+
// PR 0b-2 re-imports for moved carve-out modules (CONTRACTS.md §3.3).
|
|
36
|
+
import { SkinningPaletteUploadManager, applyGpuMorphUniforms, resolveRenderGeometry } from "./forward/Deform.js";
|
|
37
|
+
import { FORWARD_DIRECT_LIGHT_CAPACITY, applyClusteredLightingUniforms, applyForwardShadowMapUniforms, resolveForwardClusteredLighting, selectForwardShadowMap } from "./forward/Lighting.js";
|
|
38
|
+
import { flushMultiDrawQueue, submitDraw } from "./forward/DrawSubmit.js";
|
|
39
|
+
import { bindVelocityUniforms } from "./forward/Velocity.js";
|
|
22
40
|
/** Joints addressable through the uniform-array palette. Re-exported for shaders. */
|
|
23
41
|
export const MAX_UNIFORM_SKINNING_JOINTS = SHADER_MAX_UNIFORM_SKINNING_JOINTS;
|
|
24
42
|
/**
|
|
@@ -28,12 +46,10 @@ export const MAX_UNIFORM_SKINNING_JOINTS = SHADER_MAX_UNIFORM_SKINNING_JOINTS;
|
|
|
28
46
|
* a 1024x4 texture) while covering rigs far beyond anything the uniform path allows.
|
|
29
47
|
*/
|
|
30
48
|
export const MAX_SKINNING_JOINTS = 1024;
|
|
31
|
-
const SKINNING_PALETTE_TEXTURE_MAX_WIDTH = 1024;
|
|
32
49
|
export const MAX_GPU_MORPH_VERTICES = 64;
|
|
33
50
|
export const MAX_GPU_MORPH_TARGETS = 4;
|
|
34
51
|
export const MAX_GPU_INSTANCES = 64;
|
|
35
|
-
const MAX_FORWARD_SHADOW_PCF_SAMPLES = 32;
|
|
36
|
-
const DEFAULT_FORWARD_SHADOW_FILTER_KERNEL = createShadowFilterKernel({ filter: "pcf", pcfRadius: 1, pcfSamples: 9 });
|
|
52
|
+
export const MAX_FORWARD_SHADOW_PCF_SAMPLES = 32;
|
|
37
53
|
const INSTANCE_MATRIX_ATTRIBUTE_NAMES = [
|
|
38
54
|
"a_instanceMatrix0",
|
|
39
55
|
"a_instanceMatrix1",
|
|
@@ -47,20 +63,61 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
47
63
|
shaderLibrary;
|
|
48
64
|
skinningPaletteUploads = new SkinningPaletteUploadManager();
|
|
49
65
|
clusteredLighting = null;
|
|
66
|
+
generatorProgramCache;
|
|
67
|
+
// PRD-01 Phase 6 (submission performance): device-keyed pools — ForwardPass
|
|
68
|
+
// instances are rebuilt per frame/segment, so pass-level caches would never
|
|
69
|
+
// hit. Keyed by device they survive pass reconstruction (same precedent as
|
|
70
|
+
// `shaderCaches`) and die with the device.
|
|
71
|
+
static pipelineCaches = new WeakMap();
|
|
72
|
+
static uniformPacketPools = new WeakMap();
|
|
73
|
+
static instanceSlotPools = new WeakMap();
|
|
74
|
+
instanceSlotCursor = 0;
|
|
75
|
+
static vertexFormatIds = new WeakMap();
|
|
76
|
+
static nextVertexFormatId = 1;
|
|
77
|
+
static renderStateIds = new WeakMap();
|
|
78
|
+
static nextRenderStateId = 1;
|
|
79
|
+
static requiredAttributeIds = new WeakMap();
|
|
80
|
+
static nextRequiredAttributeId = 1;
|
|
50
81
|
constructor(options) {
|
|
51
|
-
super("forward", options.inputColorResource ? [options.inputColorResource] : [], ["color"]);
|
|
82
|
+
super(options.framePass?.name ?? "forward", [...(options.inputColorResource ? [options.inputColorResource] : []), ...(options.framePass?.reads ?? [])], options.framePass?.writes ?? ["color"]);
|
|
52
83
|
this.options = options;
|
|
53
84
|
this.shaderLibrary = options.shaderLibrary ?? createLeanCoreShaderLibrary();
|
|
54
85
|
}
|
|
55
86
|
execute(context) {
|
|
56
87
|
this.skinningPaletteUploads.beginFrame();
|
|
57
|
-
this.
|
|
58
|
-
|
|
59
|
-
|
|
88
|
+
this.beginFramePools(context.device);
|
|
89
|
+
this.clusteredLighting = resolveForwardClusteredLighting(this.options.lights, context.width, context.height, this.options.cameraViewProjectionMatrix);
|
|
90
|
+
const flags = rendererQrFlags(context.device);
|
|
91
|
+
if (qrGeneratedProgramsOn(flags)) {
|
|
92
|
+
const auraFrame = rendererAuraFrame(context.device, flags);
|
|
93
|
+
if ("viewport" in auraFrame) {
|
|
94
|
+
auraFrame.viewport = { width: context.width, height: context.height };
|
|
95
|
+
}
|
|
96
|
+
const vp = this.options.cameraViewProjectionMatrix ?? identityMatrix();
|
|
97
|
+
auraFrame.update({
|
|
98
|
+
viewMatrix: toMat4Uniform(this.options.cameraViewMatrix ?? identityMatrix(), "cameraViewMatrix"),
|
|
99
|
+
projectionMatrix: toMat4Uniform(this.options.auraFrameCamera?.projectionMatrix ?? identityMatrix(), "auraFrameCamera.projectionMatrix"),
|
|
100
|
+
viewProjectionMatrix: toMat4Uniform(vp, "cameraViewProjectionMatrix"),
|
|
101
|
+
previousViewProjectionMatrix: this.options.auraFrameCamera?.previousViewProjectionMatrix
|
|
102
|
+
? toMat4Uniform(this.options.auraFrameCamera.previousViewProjectionMatrix, "auraFrameCamera.previousViewProjectionMatrix")
|
|
103
|
+
: null,
|
|
104
|
+
near: this.options.auraFrameCamera?.near ?? 0.1,
|
|
105
|
+
far: this.options.auraFrameCamera?.far ?? 1000,
|
|
106
|
+
projection: this.options.auraFrameCamera?.projection ?? "perspective",
|
|
107
|
+
position: this.options.cameraPosition ?? [0, 0, 0]
|
|
108
|
+
}, this.options.timeSeconds ?? 0, this.options.exposure ?? 1, 0);
|
|
109
|
+
// The device binds the AuraFrame block to point 0 at link time
|
|
110
|
+
// (`uniformBlockBinding`), so one global buffer bind covers every
|
|
111
|
+
// generated draw this frame.
|
|
112
|
+
if (auraFrame.buffer)
|
|
113
|
+
context.device.bindUniformBuffer?.(auraFrame.buffer, 0);
|
|
114
|
+
}
|
|
60
115
|
try {
|
|
61
116
|
for (const item of sortForwardRenderItems(this.options.items, this.options.cameraPosition)) {
|
|
62
117
|
this.drawItem(context.device, item);
|
|
63
118
|
}
|
|
119
|
+
// #181: issue any trailing multi-draw run deferred by `submitDraw`.
|
|
120
|
+
flushMultiDrawQueue(context.device);
|
|
64
121
|
}
|
|
65
122
|
finally {
|
|
66
123
|
this.clusteredLighting?.dispose();
|
|
@@ -71,73 +128,128 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
71
128
|
const material = item.material ?? new UnlitMaterial();
|
|
72
129
|
const baseMaterial = getBaseMaterial(material);
|
|
73
130
|
this.applyLightUniforms(material);
|
|
74
|
-
|
|
131
|
+
let shader = this.getShader(baseMaterial, device, item);
|
|
132
|
+
if (shader === undefined)
|
|
133
|
+
return; // A3D_QR_CORE_GENERATOR async-skip (C-02 §A.2)
|
|
134
|
+
// Generated iff getShader resolved a generated program for this draw (a
|
|
135
|
+
// compile-failed fallback or an unskinnable skinned item is a legacy draw).
|
|
136
|
+
let generated = this.lastProgramFeatures !== undefined;
|
|
75
137
|
if (item.instanceTransforms && baseMaterial.renderState.cullMode !== "none" && instancedItemNeedsPerInstanceCullState(item)) {
|
|
76
138
|
for (const expanded of expandInstancedRenderItem(item)) {
|
|
77
139
|
this.drawItem(device, expanded);
|
|
78
140
|
}
|
|
79
141
|
return;
|
|
80
142
|
}
|
|
81
|
-
|
|
143
|
+
// Phase 6: generated programs only know attribute-matrix instancing — the
|
|
144
|
+
// uniform fallback (`u_instanceMatrices[64]`) exists only in the frozen
|
|
145
|
+
// legacy library, so the >64 split and no-support expansion never apply
|
|
146
|
+
// on this path.
|
|
147
|
+
if (item.instanceTransforms && !generated && !supportsInstanceAttributes(shader) && instanceTransformCount(item) > MAX_GPU_INSTANCES) {
|
|
82
148
|
for (const batch of splitInstanceTransforms(item.instanceTransforms)) {
|
|
83
149
|
this.drawItem(device, { ...item, instanceTransforms: batch });
|
|
84
150
|
}
|
|
85
151
|
return;
|
|
86
152
|
}
|
|
87
|
-
if (item.instanceTransforms && !supportsInstanceAttributes(shader) && !supportsInstanceUniforms(shader)) {
|
|
153
|
+
if (item.instanceTransforms && !generated && !supportsInstanceAttributes(shader) && !supportsInstanceUniforms(shader)) {
|
|
88
154
|
for (const expanded of expandInstancedRenderItem(item)) {
|
|
89
155
|
this.drawItem(device, expanded);
|
|
90
156
|
}
|
|
91
157
|
return;
|
|
92
158
|
}
|
|
93
|
-
|
|
94
|
-
|
|
159
|
+
let uniforms = generated ? this.acquireUniformPacket(device) : new Map();
|
|
160
|
+
// #867 (games): binding validation never kills the frame. A generated
|
|
161
|
+
// draw that fails validation falls back to the legacy shaderKey program;
|
|
162
|
+
// a legacy draw that fails is skipped with one warning. Strict throws.
|
|
163
|
+
let binding = null;
|
|
164
|
+
try {
|
|
165
|
+
binding = generated
|
|
166
|
+
? this.materialBinding.bindGenerated(material, shader, this.lastProgramFeatures, uniforms)
|
|
167
|
+
: this.materialBinding.bind(material, shader);
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
if (!(error instanceof MaterialBindingError) || rendererQrFlags(device).on("A3D_QR_STRICT"))
|
|
171
|
+
throw error;
|
|
172
|
+
warnBindingOnce(item, baseMaterial, error, generated);
|
|
173
|
+
if (!generated)
|
|
174
|
+
return;
|
|
175
|
+
this.lastProgramFeatures = undefined;
|
|
176
|
+
generated = false;
|
|
177
|
+
shader = this.legacyShader(baseMaterial, device);
|
|
178
|
+
uniforms = new Map();
|
|
179
|
+
try {
|
|
180
|
+
binding = this.materialBinding.bind(material, shader);
|
|
181
|
+
}
|
|
182
|
+
catch (legacyError) {
|
|
183
|
+
if (!(legacyError instanceof MaterialBindingError))
|
|
184
|
+
throw legacyError;
|
|
185
|
+
warnBindingOnce(item, baseMaterial, legacyError, false);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (!generated)
|
|
190
|
+
for (const [k, v] of binding.uniforms)
|
|
191
|
+
uniforms.set(k, v);
|
|
95
192
|
applyClusteredLightingUniforms(this.clusteredLighting, shader, uniforms);
|
|
96
|
-
|
|
193
|
+
// E3 stage-2b: under the conjunction a generated draw that selected
|
|
194
|
+
// `prd02.ibl` shades indirect from the C-09 probe pack below (single
|
|
195
|
+
// knob), so its other environment binds stop competing for the same
|
|
196
|
+
// intensity names. E3 step 4/5: frozen draws under the conjunction get
|
|
197
|
+
// bind-level suppression of their stacked terms (and of the stale 0.18
|
|
198
|
+
// material default on no-environment draws) inside
|
|
199
|
+
// applyEnvironmentLightingUniforms — see its header note.
|
|
200
|
+
const drawFlags = rendererQrFlags(device);
|
|
201
|
+
const e3Conjunction = qrE3CompilerLightingOn(drawFlags);
|
|
202
|
+
const prd02Ibl = generated && e3Conjunction && this.lastProgramFeatures?.features[PRD02_IBL_FEATURE] !== undefined;
|
|
203
|
+
applyEnvironmentLightingUniforms(this.options.environmentLighting, item, shader, uniforms, { conjunction: e3Conjunction, generated });
|
|
204
|
+
if (generated)
|
|
205
|
+
applyGeneratedEnvironmentMapUniforms(this.options.environmentLighting, item, shader, uniforms, drawFlags);
|
|
206
|
+
if (generated)
|
|
207
|
+
applyGeneratedProceduralEnvironmentUniforms(this.options.environmentLighting, item, shader, uniforms, prd02Ibl);
|
|
97
208
|
applyEnvironmentFogUniforms(this.options.environmentFog, item, shader, uniforms);
|
|
209
|
+
if (generated)
|
|
210
|
+
applyGeneratedFogUniforms(this.options.environmentFog, shader, uniforms);
|
|
98
211
|
applyForwardShadowMapUniforms(selectForwardShadowMap(this.options.shadowMap, item, this.options.cameraViewMatrix, this.options.cameraPosition), item, shader, uniforms);
|
|
99
212
|
applyOutputColorSpaceUniform(this.options.outputColorSpace ?? "srgb", item, shader, uniforms);
|
|
100
213
|
applyCameraUniforms(this.options.cameraPosition, item, shader, uniforms);
|
|
101
214
|
applyAlphaCutoffUniform(item, shader, uniforms);
|
|
102
215
|
applyWrinkleUniform(item, shader, uniforms);
|
|
103
216
|
applyTransformUniforms(item, shader, uniforms);
|
|
104
|
-
|
|
105
|
-
|
|
217
|
+
bindVelocityUniforms?.(item, uniforms);
|
|
218
|
+
if (generated && this.lastProgramFeatures) {
|
|
219
|
+
// C-02 `ShaderFeature.bindUniforms` for the features this draw selected.
|
|
220
|
+
bindShaderFeatureUniforms(this.lastProgramFeatures.features, rendererQrFlags(device), item, (name, value) => uniforms.set(name, value));
|
|
221
|
+
// E3 stage-2b bind site: `prd02.ibl` has no feature-local bind (the
|
|
222
|
+
// probe, knob and ambient are pass state, not item state), so the
|
|
223
|
+
// PRD-02 environment pack is bound here, in the feature-bind slot.
|
|
224
|
+
if (prd02Ibl)
|
|
225
|
+
applyPrd02EnvironmentUniforms(this.options.environmentLighting, item, material, uniforms);
|
|
226
|
+
// C-03 `lobe.bind` (04-LOBES): descriptor factors and lobe textures for the
|
|
227
|
+
// lobes this record carries. Material parameters stay authoritative.
|
|
228
|
+
bindMaterialLobeUniforms(this.lastProgramFeatures.extensions, baseMaterial, rendererQrFlags(device), (name, value) => {
|
|
229
|
+
if (!uniforms.has(name))
|
|
230
|
+
uniforms.set(name, value);
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
if (item.skinning && !generated) {
|
|
234
|
+
// Legacy skinned programs take the u_jointMatrices palette; on the
|
|
235
|
+
// generated path prd06.deform's bindUniforms binds the bone texture, and
|
|
236
|
+
// a generated draw without it has no skin attributes (featuresForGeometry).
|
|
237
|
+
this.skinningPaletteUploads.bind(item, item.skinning, baseMaterial, shader, uniforms, device);
|
|
106
238
|
}
|
|
107
|
-
const instanceBinding = item.instanceTransforms ? applyInstanceBinding(device, item, shader, uniforms) : { count: 1 };
|
|
239
|
+
const instanceBinding = item.instanceTransforms ? this.applyInstanceBinding(device, item, shader, uniforms, generated) : { count: 1 };
|
|
108
240
|
const gpuMorph = item.morphTargets || item.morphWeights ? applyGpuMorphUniforms(item, shader, uniforms) : false;
|
|
109
241
|
const geometry = gpuMorph ? item.geometry : resolveRenderGeometry(item);
|
|
110
|
-
|
|
242
|
+
// Generated programs validate their selected attributes in MaterialBinding.
|
|
243
|
+
// The legacy descriptor can require maps/tangents deliberately masked out
|
|
244
|
+
// for this geometry, so it is not the generated program contract.
|
|
245
|
+
if (!generated)
|
|
246
|
+
validateMaterialGeometryContract(item, baseMaterial, geometry);
|
|
111
247
|
try {
|
|
112
248
|
const vertexBuffer = geometry.vertexBuffer.upload(device);
|
|
113
249
|
const indexBuffer = geometry.indexBuffer?.upload(device);
|
|
114
250
|
const drawRange = resolveDrawRange(geometry, item.drawRange);
|
|
115
|
-
const pipeline =
|
|
116
|
-
|
|
117
|
-
shader,
|
|
118
|
-
vertexFormat: geometry.vertexBuffer.format,
|
|
119
|
-
topology: geometry.topology,
|
|
120
|
-
renderState: renderStateForItem(baseMaterial.renderState, item),
|
|
121
|
-
requiredAttributes: baseMaterial.requiredAttributes
|
|
122
|
-
});
|
|
123
|
-
const command = pipeline.createDrawCommand({
|
|
124
|
-
label: item.label,
|
|
125
|
-
vertexBuffer,
|
|
126
|
-
vertexCount: indexBuffer !== undefined ? geometry.vertexBuffer.vertexCount : drawRange.count,
|
|
127
|
-
...(indexBuffer === undefined && drawRange.start > 0 ? { firstVertex: drawRange.start } : {}),
|
|
128
|
-
uniforms,
|
|
129
|
-
...(item.instanceTransforms ? { instanceCount: instanceBinding.count } : {}),
|
|
130
|
-
...(instanceBinding.attributes ? { instanceAttributes: instanceBinding.attributes } : {})
|
|
131
|
-
});
|
|
132
|
-
if (indexBuffer !== undefined) {
|
|
133
|
-
Object.assign(command, {
|
|
134
|
-
indexBuffer,
|
|
135
|
-
indexType: geometry.indexBuffer?.type,
|
|
136
|
-
indexCount: drawRange.count,
|
|
137
|
-
...(drawRange.start > 0 ? { firstIndex: drawRange.start } : {})
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
device.draw(command);
|
|
251
|
+
const pipeline = this.pipelineFor(device, item, baseMaterial, shader, geometry);
|
|
252
|
+
submitDraw(device, pipeline, geometry, instanceBinding.count, drawRange, { item, vertexBuffer, indexBuffer, drawRange, uniforms, instanceBinding });
|
|
141
253
|
}
|
|
142
254
|
finally {
|
|
143
255
|
for (const buffer of instanceBinding.buffers ?? [])
|
|
@@ -147,6 +259,49 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
147
259
|
}
|
|
148
260
|
}
|
|
149
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* Generated-path instancing (Phase 6): attribute matrices only — the
|
|
264
|
+
* `u_instanceMatrices[64]` uniform path exists solely in the frozen legacy
|
|
265
|
+
* library. Matrices (and colors) ride a persistent per-slot `InstanceBuffer`;
|
|
266
|
+
* `buffers` carries only transient extra-attribute buffers, which the draw
|
|
267
|
+
* finally-block disposes.
|
|
268
|
+
*/
|
|
269
|
+
applyInstanceBinding(device, item, shader, uniforms, generated) {
|
|
270
|
+
if (!generated)
|
|
271
|
+
return applyInstanceBinding(device, item, shader, uniforms);
|
|
272
|
+
const source = validateInstanceTransformSource(item);
|
|
273
|
+
const count = source.length / 16;
|
|
274
|
+
const slot = this.instanceSlotFor(device, count, item.instanceColors !== undefined);
|
|
275
|
+
slot.buffer.setMatrices(source instanceof Float32Array ? source : new Float32Array(source), count);
|
|
276
|
+
if (item.instanceColors) {
|
|
277
|
+
slot.buffer.setColors(item.instanceColors instanceof Float32Array ? item.instanceColors : new Float32Array(item.instanceColors));
|
|
278
|
+
}
|
|
279
|
+
const bound = slot.buffer.bind();
|
|
280
|
+
const extra = createExtraInstanceAttributeBindings(device, item, count, false);
|
|
281
|
+
return {
|
|
282
|
+
count,
|
|
283
|
+
attributes: [
|
|
284
|
+
...INSTANCE_MATRIX_ATTRIBUTE_NAMES.map((shaderName, column) => ({
|
|
285
|
+
buffer: bound.matrixBuffer,
|
|
286
|
+
shaderName,
|
|
287
|
+
components: 4,
|
|
288
|
+
offset: column * 16,
|
|
289
|
+
stride: 64,
|
|
290
|
+
divisor: 1
|
|
291
|
+
})),
|
|
292
|
+
...(bound.colorBuffer ? [{
|
|
293
|
+
buffer: bound.colorBuffer,
|
|
294
|
+
shaderName: "a_instanceColor",
|
|
295
|
+
components: 4,
|
|
296
|
+
offset: 0,
|
|
297
|
+
stride: 16,
|
|
298
|
+
divisor: 1
|
|
299
|
+
}] : []),
|
|
300
|
+
...extra.attributes
|
|
301
|
+
],
|
|
302
|
+
...(extra.buffers.length > 0 ? { buffers: extra.buffers } : {})
|
|
303
|
+
};
|
|
304
|
+
}
|
|
150
305
|
applyLightUniforms(material) {
|
|
151
306
|
const baseMaterial = getBaseMaterial(material);
|
|
152
307
|
if (!baseMaterial.requiredUniforms.includes("u_lightCount") || !baseMaterial.requiredUniforms.includes("u_lightData")) {
|
|
@@ -162,7 +317,53 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
162
317
|
material.setParameter("u_lightData", packed.data);
|
|
163
318
|
}
|
|
164
319
|
}
|
|
165
|
-
getShader(material, device) {
|
|
320
|
+
getShader(material, device, item) {
|
|
321
|
+
const flags = rendererQrFlags(device);
|
|
322
|
+
this.lastProgramFeatures = undefined;
|
|
323
|
+
// PRD-04: under `materials` without the core generator, lobe-bearing
|
|
324
|
+
// materials still take the generated program (the legacy shader has no
|
|
325
|
+
// lobe code). That program writes linear HDR, so the lobe route only runs
|
|
326
|
+
// into a linear target (postprocess / OutputPass encodes).
|
|
327
|
+
const route = {
|
|
328
|
+
core: qrCoreGeneratorOn(flags),
|
|
329
|
+
lobes: qrMaterialsLobeProgramsOn(flags) && this.options.outputColorSpace === "linear"
|
|
330
|
+
};
|
|
331
|
+
if ((route.core || route.lobes) && materialRoutesToGeneratedProgram(material, route, { flags, tier: this.options.qualityTier ?? QUALITY_TIERS.high })) {
|
|
332
|
+
const warning = materialFeatureWarning(material);
|
|
333
|
+
if (warning)
|
|
334
|
+
console.warn(`[prd01] ${warning}`);
|
|
335
|
+
this.lastProgramFeatures = this.programFeaturesFor(material, device, item);
|
|
336
|
+
// #867: a skinned draw needs its program to skin. When no registered
|
|
337
|
+
// deform feature (prd06.deform, A3D_QR_ANIMATION) selected this item,
|
|
338
|
+
// the generated program has no skinning, so the draw keeps the legacy
|
|
339
|
+
// skinned shaderKey program instead of rendering the bind pose.
|
|
340
|
+
// A skinned item whose geometry has no joints/weights draws unskinned on
|
|
341
|
+
// the generated program (features follow the geometry, #867 games).
|
|
342
|
+
if (item?.skinning && geometryHasSkin((a) => geometryHasAttribute(item.geometry, a)) && this.lastProgramFeatures.features["prd06.deform"] === undefined) {
|
|
343
|
+
this.lastProgramFeatures = undefined;
|
|
344
|
+
return this.legacyShader(material, device);
|
|
345
|
+
}
|
|
346
|
+
const handle = this.programCache(device).acquire(this.lastProgramFeatures);
|
|
347
|
+
if (handle.status === "failed") {
|
|
348
|
+
// T0-03: the cache already emitted `program-compile-failed` (C-36) +
|
|
349
|
+
// console.error. Strict escalates to a throw; otherwise the draw falls
|
|
350
|
+
// back to the legacy shaderKey path below.
|
|
351
|
+
if (flags.on("A3D_QR_STRICT")) {
|
|
352
|
+
throw new RenderDeviceError(`generated program failed to compile: ${handle.error ?? handle.key}`, "PROGRAM_COMPILE_FAILED", { key: handle.key });
|
|
353
|
+
}
|
|
354
|
+
// The fallback draw is a legacy draw: bind it as one.
|
|
355
|
+
this.lastProgramFeatures = undefined;
|
|
356
|
+
}
|
|
357
|
+
else {
|
|
358
|
+
// async-skip: a not-yet-ready program skips the draw this frame
|
|
359
|
+
// (C-02 §A.2 semantics; warm-then-block warmup renders them ready up front).
|
|
360
|
+
return handle.status === "ready" ? handle.program : undefined;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
return this.legacyShader(material, device);
|
|
364
|
+
}
|
|
365
|
+
/** Frozen legacy shaderKey program (flag-off path, and generated-path fallbacks). */
|
|
366
|
+
legacyShader(material, device) {
|
|
166
367
|
const cacheKey = shaderCacheKey(material);
|
|
167
368
|
const shaderCache = getForwardPassShaderCache(device, this.shaderLibrary);
|
|
168
369
|
let module = shaderCache.get(cacheKey);
|
|
@@ -174,97 +375,199 @@ export class ForwardPass extends BaseRenderPass {
|
|
|
174
375
|
}
|
|
175
376
|
return module.compile(device);
|
|
176
377
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
this.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
378
|
+
/** Feature record for the program `getShader` most recently resolved (C-02). */
|
|
379
|
+
lastProgramFeatures;
|
|
380
|
+
programCache(device) {
|
|
381
|
+
this.generatorProgramCache ??= rendererProgramCache(device, rendererQrFlags(device));
|
|
382
|
+
return this.generatorProgramCache;
|
|
383
|
+
}
|
|
384
|
+
programFeaturesFor(material, device, item) {
|
|
385
|
+
const flags = rendererQrFlags(device);
|
|
386
|
+
const tier = this.options.qualityTier ?? QUALITY_TIERS.high;
|
|
387
|
+
const mf = material.programFeatures({ flags, tier });
|
|
388
|
+
const axes = forwardPassFeatureAxes(this.options, this.clusteredLighting !== null);
|
|
389
|
+
// T0-05: registered ShaderFeatures select their bits per draw (C-02 §A.2:
|
|
390
|
+
// at acquire time); the warmup applies the same selection per item.
|
|
391
|
+
const selected = item ? selectShaderFeatureBits({ item, pass: "forward", tier, flags }) : {};
|
|
392
|
+
// E3 stage-2b: `prd02.ibl` shades from a C-09 probe cube; without one
|
|
393
|
+
// (bare preset/procedural lighting) the default indirect body stays.
|
|
394
|
+
if (selected[PRD02_IBL_FEATURE] !== undefined && !prd02IblEnvironmentAvailable(this.options.environmentLighting, item)) {
|
|
395
|
+
delete selected[PRD02_IBL_FEATURE];
|
|
396
|
+
}
|
|
397
|
+
// #867 (games): the feature set follows what the geometry carries
|
|
398
|
+
// (three.js semantics): no uv → no uv maps, no joints/weights → no skin.
|
|
399
|
+
const record = item ? featuresForGeometry({ ...mf, features: { ...mf.features, ...selected } }, (a) => geometryHasAttribute(item.geometry, a)) : { ...mf, features: { ...mf.features, ...selected } };
|
|
400
|
+
return normalizeProgramFeatures({
|
|
401
|
+
...record,
|
|
402
|
+
...axes,
|
|
403
|
+
// Phase 6: instancing is item-driven — a material's own feature record
|
|
404
|
+
// only declares it when authored instanced; the draw's program must
|
|
405
|
+
// cover the union (attribute matrices are the only generated path).
|
|
406
|
+
...(item?.instanceTransforms ? { instancing: { color: item.instanceColors !== undefined } } : {}),
|
|
407
|
+
// #1140: a per-item probe cube (PRD-02 S12) is sampled as a cube.
|
|
408
|
+
...(item?.environmentCube?.texture?.dimension === "cube" ? { environment: "pmrem-cube" } : {}),
|
|
409
|
+
backgroundCoverage: this.options.backgroundCoverage === true,
|
|
410
|
+
pass: "forward",
|
|
411
|
+
target: "glsl300es"
|
|
412
|
+
});
|
|
413
|
+
}
|
|
414
|
+
// ── Phase 6 submission-perf pools ──────────────────────────────────────
|
|
415
|
+
static packetPoolFor(device) {
|
|
416
|
+
let pool = ForwardPass.uniformPacketPools.get(device);
|
|
417
|
+
if (!pool) {
|
|
418
|
+
pool = { free: [], used: [] };
|
|
419
|
+
ForwardPass.uniformPacketPools.set(device, pool);
|
|
420
|
+
}
|
|
421
|
+
return pool;
|
|
422
|
+
}
|
|
423
|
+
beginFramePools(device) {
|
|
424
|
+
const pool = ForwardPass.packetPoolFor(device);
|
|
425
|
+
if (pool.used.length > 0) {
|
|
426
|
+
pool.free.push(...pool.used);
|
|
427
|
+
pool.used = [];
|
|
428
|
+
}
|
|
429
|
+
this.instanceSlotCursor = 0;
|
|
430
|
+
}
|
|
431
|
+
/** A cleared per-item scratch map; recycled after the next execute begins. */
|
|
432
|
+
acquireUniformPacket(device) {
|
|
433
|
+
const pool = ForwardPass.packetPoolFor(device);
|
|
434
|
+
const packet = pool.free.pop() ?? new Map();
|
|
435
|
+
packet.clear();
|
|
436
|
+
pool.used.push(packet);
|
|
437
|
+
return packet;
|
|
438
|
+
}
|
|
439
|
+
/** Identity ids for the pipeline key — avoids serializing descriptors per draw. */
|
|
440
|
+
static weakId(map, next, key) {
|
|
441
|
+
const existing = map.get(key);
|
|
442
|
+
if (existing !== undefined)
|
|
443
|
+
return existing;
|
|
444
|
+
const id = next();
|
|
445
|
+
map.set(key, id);
|
|
446
|
+
return id;
|
|
200
447
|
}
|
|
201
448
|
/**
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
* upload path used) so the CPU-fallback reason code travels with the diagnostics.
|
|
449
|
+
* One `RenderPipeline` per (shader, vertex format, topology, render state,
|
|
450
|
+
* required attributes) — previously constructed per item per frame. The
|
|
451
|
+
* pipeline is a pure descriptor: no GL resources, safe to reuse.
|
|
206
452
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
bind(item, skinning, material, shader, uniforms) {
|
|
222
|
-
// Recorded before the upload so a contract throw still leaves its reason code behind.
|
|
223
|
-
this.recordDecision(item, skinning, shader);
|
|
224
|
-
const path = applySkinningUniforms(skinning, material, shader, uniforms);
|
|
225
|
-
if (path === "data-texture")
|
|
226
|
-
this.dataTextureSubmissions += 1;
|
|
227
|
-
else
|
|
228
|
-
this.uniformArraySubmissions += 1;
|
|
229
|
-
const eightInfluence = item.geometry.vertexBuffer.format.hasAttribute("joints1")
|
|
230
|
-
&& item.geometry.vertexBuffer.format.hasAttribute("weights1");
|
|
231
|
-
if (eightInfluence)
|
|
232
|
-
this.eightInfluenceSubmissions += 1;
|
|
233
|
-
const validatedJointCounts = SkinningPaletteUploadManager.validatedGeometryJointCounts.get(item.geometry) ?? new Set();
|
|
234
|
-
if (!validatedJointCounts.has(skinning.jointCount)) {
|
|
235
|
-
validateSkinningGeometryContract(item, skinning);
|
|
236
|
-
validatedJointCounts.add(skinning.jointCount);
|
|
237
|
-
SkinningPaletteUploadManager.validatedGeometryJointCounts.set(item.geometry, validatedJointCounts);
|
|
453
|
+
pipelineFor(device, item, baseMaterial, shader, geometry) {
|
|
454
|
+
const renderState = renderStateForItem(baseMaterial.renderState, item);
|
|
455
|
+
const vertexFormatId = ForwardPass.weakId(ForwardPass.vertexFormatIds, () => ForwardPass.nextVertexFormatId++, geometry.vertexBuffer.format);
|
|
456
|
+
const renderStateId = ForwardPass.weakId(ForwardPass.renderStateIds, () => ForwardPass.nextRenderStateId++, baseMaterial.renderState);
|
|
457
|
+
const attrsId = ForwardPass.weakId(ForwardPass.requiredAttributeIds, () => ForwardPass.nextRequiredAttributeId++, baseMaterial.requiredAttributes);
|
|
458
|
+
// `renderStateForItem` returns the SAME object for the unflipped case, so
|
|
459
|
+
// the flip bit is the only per-item term needed in the key.
|
|
460
|
+
const key = `${shader.id}|${vertexFormatId}|${geometry.topology ?? "triangles"}|${renderStateId}:${renderState === baseMaterial.renderState ? 0 : 1}|${attrsId}`;
|
|
461
|
+
let cache = ForwardPass.pipelineCaches.get(device);
|
|
462
|
+
if (!cache) {
|
|
463
|
+
cache = new Map();
|
|
464
|
+
ForwardPass.pipelineCaches.set(device, cache);
|
|
238
465
|
}
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
});
|
|
252
|
-
if (decision.cpuFallback)
|
|
253
|
-
this.cpuFallbackCount += 1;
|
|
254
|
-
if (this.decisions.length < SkinningPaletteUploadManager.maxRecordedDecisions) {
|
|
255
|
-
this.decisions.push({
|
|
256
|
-
label: item.label ?? "skinned-item",
|
|
257
|
-
jointCount: skinning.jointCount,
|
|
258
|
-
path: decision.path,
|
|
259
|
-
reason: decision.reason,
|
|
260
|
-
cpuFallback: decision.cpuFallback
|
|
466
|
+
let pipeline = cache.get(key);
|
|
467
|
+
if (!pipeline || pipeline.shader !== shader) {
|
|
468
|
+
pipeline = new RenderPipeline({
|
|
469
|
+
label: item.label ?? baseMaterial.name,
|
|
470
|
+
shader,
|
|
471
|
+
vertexFormat: geometry.vertexBuffer.format,
|
|
472
|
+
topology: geometry.topology,
|
|
473
|
+
renderState,
|
|
474
|
+
requiredAttributes: this.lastProgramFeatures
|
|
475
|
+
? baseMaterial.requiredAttributes.filter((attribute) => !["a_uv", "a_uv1", "a_color", "a_tangent", "a_joints", "a_weights", "a_joints1", "a_weights1"].includes(attribute)
|
|
476
|
+
|| geometry.vertexBuffer.format.attributes.some((a) => a.semantic === attribute || a.shaderName === attribute))
|
|
477
|
+
: baseMaterial.requiredAttributes
|
|
261
478
|
});
|
|
479
|
+
cache.set(key, pipeline);
|
|
262
480
|
}
|
|
263
|
-
|
|
264
|
-
|
|
481
|
+
return pipeline;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Persistent attribute-matrix slot for the generated path (Phase 6): slots
|
|
485
|
+
* are reused in draw order; capacity/colors mismatches retire the old
|
|
486
|
+
* buffer (its VAOs are evicted by the §6.1 dispose fix).
|
|
487
|
+
*/
|
|
488
|
+
instanceSlotFor(device, count, colors) {
|
|
489
|
+
const index = this.instanceSlotCursor;
|
|
490
|
+
this.instanceSlotCursor += 1;
|
|
491
|
+
const capacity = Math.max(64, 2 ** Math.ceil(Math.log2(Math.max(1, count))));
|
|
492
|
+
let slots = ForwardPass.instanceSlotPools.get(device);
|
|
493
|
+
if (!slots) {
|
|
494
|
+
slots = [];
|
|
495
|
+
ForwardPass.instanceSlotPools.set(device, slots);
|
|
496
|
+
}
|
|
497
|
+
const existing = slots[index];
|
|
498
|
+
if (existing && existing.colors === colors && existing.capacity >= count) {
|
|
499
|
+
return existing;
|
|
265
500
|
}
|
|
501
|
+
existing?.buffer.dispose();
|
|
502
|
+
const buffer = instanceBufferSlot.get(rendererQrFlags(device))(device, capacity, { colors });
|
|
503
|
+
const slot = { buffer, colors, capacity };
|
|
504
|
+
slots[index] = slot;
|
|
505
|
+
if (slots.length > index + 64)
|
|
506
|
+
slots.length = index + 64;
|
|
507
|
+
return slot;
|
|
266
508
|
}
|
|
267
509
|
}
|
|
510
|
+
function lightBucket(count, max = 8) {
|
|
511
|
+
return count <= 0 ? 0 : count === 1 ? 1 : count === 2 ? 2 : count <= 4 ? 4 : max;
|
|
512
|
+
}
|
|
513
|
+
/**
|
|
514
|
+
* Pass-owned feature axes (C-02): lights/shadows/environment/fog shared by every
|
|
515
|
+
* material in the pass. `clustered` is the pass's resolved state; above
|
|
516
|
+
* FORWARD_DIRECT_LIGHT_CAPACITY lights the axes report clustered regardless.
|
|
517
|
+
*/
|
|
518
|
+
export function forwardPassFeatureAxes(options, clustered) {
|
|
519
|
+
let directional = 0;
|
|
520
|
+
let point = 0;
|
|
521
|
+
let spot = 0;
|
|
522
|
+
let rect = 0;
|
|
523
|
+
for (const light of options.lights ?? []) {
|
|
524
|
+
if (light.kind === "directional")
|
|
525
|
+
directional += 1;
|
|
526
|
+
else if (light.kind === "point")
|
|
527
|
+
point += 1;
|
|
528
|
+
else if (light.kind === "spot")
|
|
529
|
+
spot += 1;
|
|
530
|
+
else
|
|
531
|
+
rect += 1;
|
|
532
|
+
}
|
|
533
|
+
const fog = options.environmentFog;
|
|
534
|
+
const fogMode = fog === undefined || fog === false
|
|
535
|
+
? "none"
|
|
536
|
+
: fog.mode === "linear"
|
|
537
|
+
? "linear"
|
|
538
|
+
: fog.heightFalloff !== undefined
|
|
539
|
+
? "height"
|
|
540
|
+
: "exp2";
|
|
541
|
+
const env = options.environmentLighting;
|
|
542
|
+
return {
|
|
543
|
+
lights: {
|
|
544
|
+
dir: lightBucket(directional),
|
|
545
|
+
point: lightBucket(point),
|
|
546
|
+
spot: lightBucket(spot),
|
|
547
|
+
rect: lightBucket(rect, 4),
|
|
548
|
+
// #1140: mirrors resolveForwardClusteredLighting (clusters above the
|
|
549
|
+
// u_lightData capacity), not the per-kind key bucket.
|
|
550
|
+
clustered: clustered || directional + point + spot + rect > FORWARD_DIRECT_LIGHT_CAPACITY,
|
|
551
|
+
hemisphere: env?.proceduralMap !== undefined
|
|
552
|
+
},
|
|
553
|
+
shadows: options.shadowMap
|
|
554
|
+
? { cascades: Math.max(1, Math.min(4, options.shadowMap.cascades?.length ?? 1)), pcfTaps: 4, localShadows: 0, contact: false }
|
|
555
|
+
: { cascades: 0, pcfTaps: 4, localShadows: 0, contact: false },
|
|
556
|
+
environment:
|
|
557
|
+
// #1140: the generated env chunk samples exactly the texture it was
|
|
558
|
+
// selected for. The prefiltered cube wins when present (the flag-off
|
|
559
|
+
// shader mixes to the cube whenever it is enabled); otherwise the 2D
|
|
560
|
+
// `environmentMapTexture`. Procedural-only → no sampler at all.
|
|
561
|
+
env?.environmentCubeMapTexture?.texture?.dimension === "cube"
|
|
562
|
+
? "pmrem-cube"
|
|
563
|
+
: env?.environmentMapTexture?.texture !== undefined
|
|
564
|
+
? "equirect"
|
|
565
|
+
: "none",
|
|
566
|
+
fog: fogMode
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
export { SkinningPaletteUploadManager, releaseMorphScratchGeometry } from "./forward/Deform.js";
|
|
570
|
+
export { ensureMorphTargetTexture, releaseMorphTargetTexture, morphTextureDiagnostics } from "./shaders/deform/forwardFeature.js";
|
|
268
571
|
function getForwardPassShaderCache(device, library) {
|
|
269
572
|
let libraryCaches = ForwardPass["shaderCaches"].get(device);
|
|
270
573
|
if (!libraryCaches) {
|
|
@@ -296,6 +599,47 @@ function applyOutputColorSpaceUniform(outputColorSpace, item, shader, uniforms)
|
|
|
296
599
|
}
|
|
297
600
|
uniforms.set("u_outputColorSpace", outputColorSpace === "srgb" ? 1 : 0);
|
|
298
601
|
}
|
|
602
|
+
/**
|
|
603
|
+
* C-02 generated-program fog. `fog_default` declares `u_fogColor`,
|
|
604
|
+
* `u_fogRange`, `u_fogDensity` and `u_fogHeightFalloff` under FOG_LINEAR /
|
|
605
|
+
* FOG_EXP2 / FOG_HEIGHT, and `forwardProgramFeatures` selects those defines
|
|
606
|
+
* whenever the frame has fog. Nothing bound them, so every uniform read 0:
|
|
607
|
+
* the exp2 factor was 1 - exp(0) = 0 and generated programs drew no fog at all
|
|
608
|
+
* (scenes 09/17/18 under A3D_QR_CORE: distant surfaces kept their own colour
|
|
609
|
+
* instead of blending to the fog colour).
|
|
610
|
+
*
|
|
611
|
+
* The values are the legacy `u_environmentFog*` inputs. The generated chunk
|
|
612
|
+
* follows three.js FogExp2/Fog: view depth, and no opacity cap (legacy
|
|
613
|
+
* `maxOpacity` is a legacy-only clamp). Lane 07's PRD-07 fog chunk shares
|
|
614
|
+
* `u_fogColor` (#880); a value it already set is kept.
|
|
615
|
+
*/
|
|
616
|
+
export function generatedFogUniformValues(fog) {
|
|
617
|
+
if (!fog)
|
|
618
|
+
return undefined;
|
|
619
|
+
return new Map([
|
|
620
|
+
["u_fogColor", Array.from(fog.color)],
|
|
621
|
+
["u_fogRange", [fog.near, fog.far]],
|
|
622
|
+
["u_fogDensity", fog.density],
|
|
623
|
+
["u_fogHeightFalloff", fog.heightFalloff ?? 0]
|
|
624
|
+
]);
|
|
625
|
+
}
|
|
626
|
+
export function applyGeneratedFogUniforms(fog, shader, uniforms) {
|
|
627
|
+
// Reflection lists ACTIVE uniforms only: exp2 programs drop the unused
|
|
628
|
+
// `u_fogRange`, linear ones drop `u_fogDensity`. Either marks fog_default
|
|
629
|
+
// (forward programs declare neither otherwise; lane 07 uses u_fogA/u_fogB).
|
|
630
|
+
if (!shader.reflection.uniforms.has("u_fogRange") && !shader.reflection.uniforms.has("u_fogDensity"))
|
|
631
|
+
return;
|
|
632
|
+
const values = generatedFogUniformValues(fog);
|
|
633
|
+
if (!values)
|
|
634
|
+
return;
|
|
635
|
+
for (const [name, value] of values) {
|
|
636
|
+
if (!shader.reflection.uniforms.has(name))
|
|
637
|
+
continue;
|
|
638
|
+
if (name === "u_fogColor" && uniforms.has(name))
|
|
639
|
+
continue;
|
|
640
|
+
uniforms.set(name, value);
|
|
641
|
+
}
|
|
642
|
+
}
|
|
299
643
|
function applyEnvironmentFogUniforms(fog, item, shader, uniforms) {
|
|
300
644
|
const requiredUniforms = [
|
|
301
645
|
"u_environmentFogEnabled",
|
|
@@ -446,6 +790,17 @@ function resolveDrawRange(geometry, range) {
|
|
|
446
790
|
}
|
|
447
791
|
return range;
|
|
448
792
|
}
|
|
793
|
+
const warnedBindings = new WeakMap();
|
|
794
|
+
/** One console warning per (material, item label, path) for a non-fatal binding failure. */
|
|
795
|
+
function warnBindingOnce(item, material, error, generated) {
|
|
796
|
+
const key = `${item.label ?? ""}|${generated ? "generated" : "legacy"}`;
|
|
797
|
+
const seen = warnedBindings.get(material) ?? new Set();
|
|
798
|
+
if (seen.has(key))
|
|
799
|
+
return;
|
|
800
|
+
seen.add(key);
|
|
801
|
+
warnedBindings.set(material, seen);
|
|
802
|
+
console.warn(`[prd01] ${generated ? "generated draw falls back to the legacy program" : "draw skipped"} for "${item.label ?? material.name}": ${error.message}`);
|
|
803
|
+
}
|
|
449
804
|
function geometryHasAttribute(geometry, attribute) {
|
|
450
805
|
return geometry.vertexBuffer.format.attributes.some((candidate) => candidate.semantic === attribute || candidate.shaderName === attribute);
|
|
451
806
|
}
|
|
@@ -588,444 +943,304 @@ function invertMat4(matrix) {
|
|
|
588
943
|
(a20 * b03 - a21 * b01 + a22 * b00) * invDet
|
|
589
944
|
];
|
|
590
945
|
}
|
|
591
|
-
export
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
946
|
+
export { selectForwardShadowMap } from "./forward/Lighting.js";
|
|
947
|
+
export { applyForwardSpotShadowMapUniforms } from "./forward/Lighting.js";
|
|
948
|
+
/**
|
|
949
|
+
* Frozen-namespace environment binds (`u_environmentColor` /
|
|
950
|
+
* `u_environmentIntensity` / procedural / sampled), shared by both program
|
|
951
|
+
* families.
|
|
952
|
+
*
|
|
953
|
+
* E3 step 4 (frozen family, bind-level by design): the frozen shaders
|
|
954
|
+
* (ShaderLibraryCore lean PBR + ShaderLibrary duplicates) are fallback-only
|
|
955
|
+
* and their sources must stay byte-identical flag-off, so under the
|
|
956
|
+
* conjunction a frozen draw's stacked terms are suppressed here instead of
|
|
957
|
+
* by shader-body surgery: the procedural diffuse+specular are zeroed, the
|
|
958
|
+
* duplicated ambient is zeroed when a sampled term shades from a
|
|
959
|
+
* non-probe bundle, and absent sampled intensities read 0 (step-3 parity
|
|
960
|
+
* with the generated binder). The sampled term — the single knob under the
|
|
961
|
+
* conjunction — is kept. NOT bind-removable, so deliberately left and
|
|
962
|
+
* UNVERIFIED until the L4 capture: the shader-constant sampled-specular
|
|
963
|
+
* fudges (ShaderLibraryCore `mix(1.1, 0.65, roughness)`, ShaderLibrary
|
|
964
|
+
* `mix(0.84, 0.58, …)` variants) and the extension environment re-add
|
|
965
|
+
* (`a3dPbrExtensionEnvironmentLight` reuses the sampled radiance for its
|
|
966
|
+
* lobes; zeroing it at the bind layer would mean zeroing the material
|
|
967
|
+
* extension factors that also drive direct extension light). Its input is
|
|
968
|
+
* de-stacked (procedural removed) by the zeroing above.
|
|
969
|
+
*
|
|
970
|
+
* E3 step 5 (0.18 at the bind layer): `DEFAULT_PBR_ENVIRONMENT_INTENSITY`
|
|
971
|
+
* (PBRLightingDefaults, public API at index.ts) is a material-constructor
|
|
972
|
+
* default for `u_environmentIntensity`. With an environment present this
|
|
973
|
+
* function overwrites it per draw — always the case on production engine
|
|
974
|
+
* paths, where compileScene's RenderSource resolves through
|
|
975
|
+
* `collectEnvironmentLighting`, which never returns undefined for a
|
|
976
|
+
* RenderSource. It otherwise survives only when the pass has no
|
|
977
|
+
* environment at all: Renderer `Scene`/iterable sources and direct
|
|
978
|
+
* ForwardPass use (both public `@aura3d/rendering` surfaces, not
|
|
979
|
+
* production engine paths). Under the conjunction that branch now binds
|
|
980
|
+
* `u_environmentIntensity = 0` (absent knob means zero, step-3 rule), so
|
|
981
|
+
* the stale constructor default never reaches a conjunction draw; the
|
|
982
|
+
* public constant and every conjunction-off packet are unchanged.
|
|
983
|
+
*/
|
|
984
|
+
export function applyEnvironmentLightingUniforms(environment, item, shader, uniforms, e3 = {}) {
|
|
985
|
+
const generatedE3Conjunction = e3.conjunction === true && e3.generated === true;
|
|
986
|
+
const frozenE3Conjunction = e3.conjunction === true && e3.generated !== true;
|
|
987
|
+
if (!environment) {
|
|
988
|
+
clearProceduralEnvironmentMapUniforms(shader, uniforms);
|
|
989
|
+
clearSampledEnvironmentMapUniforms(shader, uniforms);
|
|
990
|
+
clearEnvironmentBrdfLutUniforms(shader, uniforms);
|
|
991
|
+
// E3 step 5: see header note — never let the 0.18 constructor default
|
|
992
|
+
// (or any material-side ambient scalar) survive a no-environment
|
|
993
|
+
// conjunction draw. Conjunction-off the packet is untouched.
|
|
994
|
+
if (e3.conjunction === true && shader.reflection.uniforms.has("u_environmentIntensity")) {
|
|
995
|
+
uniforms.set("u_environmentIntensity", 0);
|
|
996
|
+
}
|
|
635
997
|
return;
|
|
636
998
|
}
|
|
637
|
-
|
|
638
|
-
applyForwardSpotShadowMapUniforms(shadowMap?.spotLight, item, shader, uniforms);
|
|
639
|
-
if (!shadowMap) {
|
|
640
|
-
uniforms.set("u_shadowMapTexture", new TextureBinding({ name: "u_shadowMapTexture", required: false }));
|
|
641
|
-
uniforms.set("u_shadowMapEnabled", 0);
|
|
642
|
-
uniforms.set("u_shadowMapMatrix", new Float32Array(identityMatrix()));
|
|
643
|
-
uniforms.set("u_shadowMapStrength", 0);
|
|
644
|
-
uniforms.set("u_shadowMapBias", 0);
|
|
645
|
-
uniforms.set("u_shadowMapSlopeBias", 0);
|
|
646
|
-
uniforms.set("u_shadowMapTexelSize", [1, 1]);
|
|
647
|
-
uniforms.set("u_shadowPcfSampleCount", 1);
|
|
648
|
-
uniforms.set("u_shadowPcfSamples", new Float32Array(MAX_FORWARD_SHADOW_PCF_SAMPLES * 4));
|
|
999
|
+
if (!shader.reflection.uniforms.has("u_environmentColor") || !shader.reflection.uniforms.has("u_environmentIntensity")) {
|
|
649
1000
|
return;
|
|
650
1001
|
}
|
|
651
|
-
const
|
|
652
|
-
if (!
|
|
653
|
-
throw new RenderDeviceError("
|
|
654
|
-
label: item.label,
|
|
655
|
-
diagnostics: validation.diagnostics
|
|
656
|
-
});
|
|
657
|
-
}
|
|
658
|
-
const strength = shadowMap.strength ?? 0.65;
|
|
659
|
-
const bias = shadowMap.bias ?? 0.001;
|
|
660
|
-
const slopeBias = shadowMap.slopeBias ?? 1;
|
|
661
|
-
const texelSize = shadowMap.texelSize ?? [
|
|
662
|
-
1 / Math.max(1, shadowMap.texture.texture?.width ?? 1),
|
|
663
|
-
1 / Math.max(1, shadowMap.texture.texture?.height ?? 1)
|
|
664
|
-
];
|
|
665
|
-
if (!Number.isFinite(strength) || strength < 0 || strength > 1) {
|
|
666
|
-
throw new RenderDeviceError("Forward shadow-map strength must be finite in [0, 1]", "FORWARD_SHADOW_MAP_CONTRACT", {
|
|
667
|
-
label: item.label,
|
|
668
|
-
strength
|
|
669
|
-
});
|
|
670
|
-
}
|
|
671
|
-
if (!Number.isFinite(bias) || bias < 0) {
|
|
672
|
-
throw new RenderDeviceError("Forward shadow-map bias must be finite and non-negative", "FORWARD_SHADOW_MAP_CONTRACT", {
|
|
673
|
-
label: item.label,
|
|
674
|
-
bias
|
|
675
|
-
});
|
|
676
|
-
}
|
|
677
|
-
if (!Number.isFinite(slopeBias) || slopeBias < 0) {
|
|
678
|
-
throw new RenderDeviceError("Forward shadow-map slopeBias must be finite and non-negative", "FORWARD_SHADOW_MAP_CONTRACT", {
|
|
1002
|
+
const color = environment.color;
|
|
1003
|
+
if (color.length !== 3 || !isFiniteColor(color)) {
|
|
1004
|
+
throw new RenderDeviceError("Environment lighting color must contain three finite values in [0, 1]", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
679
1005
|
label: item.label,
|
|
680
|
-
|
|
1006
|
+
color
|
|
681
1007
|
});
|
|
682
1008
|
}
|
|
683
|
-
if (
|
|
684
|
-
throw new RenderDeviceError("
|
|
1009
|
+
if (!Number.isFinite(environment.intensity) || environment.intensity < 0) {
|
|
1010
|
+
throw new RenderDeviceError("Environment lighting intensity must be finite and non-negative", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
685
1011
|
label: item.label,
|
|
686
|
-
|
|
1012
|
+
intensity: environment.intensity
|
|
687
1013
|
});
|
|
688
1014
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
uniforms.set("u_clusteredLightEnabled", 0);
|
|
713
|
-
uniforms.set("u_clusterGridSize", [1, 1]);
|
|
714
|
-
uniforms.set("u_clusterViewportSize", [1, 1]);
|
|
715
|
-
uniforms.set("u_clusterLightData", new TextureBinding({ name: "u_clusterLightData", required: false }));
|
|
716
|
-
uniforms.set("u_clusterLightIndices", new TextureBinding({ name: "u_clusterLightIndices", required: false }));
|
|
717
|
-
return;
|
|
1015
|
+
uniforms.set("u_environmentColor", color);
|
|
1016
|
+
uniforms.set("u_environmentIntensity", environment.intensity);
|
|
1017
|
+
applyProceduralEnvironmentMapUniforms(environment.proceduralMap, item, shader, uniforms, generatedE3Conjunction);
|
|
1018
|
+
const sampledEnvironment = withItemEnvironmentCube(environment, item);
|
|
1019
|
+
applySampledEnvironmentMapUniforms(sampledEnvironment, item, shader, uniforms, frozenE3Conjunction);
|
|
1020
|
+
if (frozenE3Conjunction) {
|
|
1021
|
+
// E3 step 4 frozen suppression (see header note): when a sampled
|
|
1022
|
+
// environment is present, procedural terms are zeroed after their
|
|
1023
|
+
// validating bind (matching `#ifndef A3D_ENV_SAMPLE` in the generated
|
|
1024
|
+
// shader), so conjunction-off packets, procedural-only fallbacks, and
|
|
1025
|
+
// error behavior are unchanged. The ambient scalar is a stacked
|
|
1026
|
+
// duplicate of the sampled knob only for non-probe bundles with a
|
|
1027
|
+
// sampled term: probe-path lighting carries the authored ambient in
|
|
1028
|
+
// `intensity` (additive outside IBL, F-02-01), and with no sampled
|
|
1029
|
+
// term the ambient and procedural terms remain active.
|
|
1030
|
+
const sampledPresent = sampledEnvironment.environmentMapTexture !== undefined
|
|
1031
|
+
|| sampledEnvironment.environmentCubeMapTexture !== undefined;
|
|
1032
|
+
if (sampledPresent) {
|
|
1033
|
+
clearProceduralEnvironmentMapUniforms(shader, uniforms);
|
|
1034
|
+
}
|
|
1035
|
+
if (sampledPresent && !environment.environmentProbe) {
|
|
1036
|
+
uniforms.set("u_environmentIntensity", 0);
|
|
1037
|
+
}
|
|
718
1038
|
}
|
|
719
|
-
uniforms.set("u_clusteredLightEnabled", 1);
|
|
720
|
-
uniforms.set("u_clusterGridSize", [clustered.diagnostics.gridWidth, clustered.diagnostics.gridHeight]);
|
|
721
|
-
uniforms.set("u_clusterViewportSize", [
|
|
722
|
-
clustered.diagnostics.viewportWidth,
|
|
723
|
-
clustered.diagnostics.viewportHeight
|
|
724
|
-
]);
|
|
725
|
-
uniforms.set("u_clusterLightData", clustered.lightData);
|
|
726
|
-
uniforms.set("u_clusterLightIndices", clustered.lightIndices);
|
|
727
1039
|
}
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
"u_pointShadowPcfSamples"
|
|
742
|
-
];
|
|
743
|
-
if (!requiredUniforms.every((uniform) => shader.reflection.uniforms.has(uniform))) {
|
|
1040
|
+
/**
|
|
1041
|
+
* #1140: generated-program environment map (`indirect_default` chunk). The
|
|
1042
|
+
* legacy binder above only fills the frozen library's `u_environmentMapTexture*`
|
|
1043
|
+
* names, so a generated program's sampler used to stay unbound (sampling
|
|
1044
|
+
* whatever its texture unit held). Binds whichever sampler the program
|
|
1045
|
+
* declares: `u_environmentCubeMap` (ENVMAP_TYPE_CUBE_UV — the prefiltered
|
|
1046
|
+
* cube, honouring the per-item probe cube) or `u_environmentMap`
|
|
1047
|
+
* (ENVMAP_TYPE_EQUIRECT — the 2D map), plus the shared intensity / rotation /
|
|
1048
|
+
* mip range / encoding uniforms.
|
|
1049
|
+
*/
|
|
1050
|
+
export function applyGeneratedEnvironmentMapUniforms(environment, item, shader, uniforms, flags) {
|
|
1051
|
+
const cube = shader.reflection.uniforms.has("u_environmentCubeMap");
|
|
1052
|
+
if (!cube && !shader.reflection.uniforms.has("u_environmentMap"))
|
|
744
1053
|
return;
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
uniforms.set("
|
|
751
|
-
uniforms.set("u_pointShadowFaceMatrices", new Float32Array(6 * 16));
|
|
752
|
-
uniforms.set("u_pointShadowFaceRects", new Float32Array(6 * 4));
|
|
753
|
-
uniforms.set("u_pointShadowStrength", 0);
|
|
754
|
-
uniforms.set("u_pointShadowBias", 0);
|
|
755
|
-
uniforms.set("u_pointShadowSlopeBias", 0);
|
|
756
|
-
uniforms.set("u_pointShadowTexelSize", [1, 1]);
|
|
757
|
-
uniforms.set("u_pointShadowPcfSampleCount", 1);
|
|
758
|
-
uniforms.set("u_pointShadowPcfSamples", new Float32Array(MAX_FORWARD_SHADOW_PCF_SAMPLES * 4));
|
|
1054
|
+
const env = environment ? withItemEnvironmentCube(environment, item) : undefined;
|
|
1055
|
+
const binding = cube ? env?.environmentCubeMapTexture : env?.environmentMapTexture;
|
|
1056
|
+
if (!env || !binding?.texture) {
|
|
1057
|
+
// forwardPassFeatureAxes never selects a sampler whose texture is absent;
|
|
1058
|
+
// a stale program draws with no environment contribution, never garbage.
|
|
1059
|
+
uniforms.set("u_environmentMapIntensity", 0);
|
|
759
1060
|
return;
|
|
760
1061
|
}
|
|
761
|
-
const
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
if (!Number.isFinite(pointShadowMap.range) || pointShadowMap.range <= 0) {
|
|
775
|
-
throw new RenderDeviceError("Forward point-shadow range must be finite and positive", "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
776
|
-
label: item.label,
|
|
777
|
-
range: pointShadowMap.range
|
|
778
|
-
});
|
|
779
|
-
}
|
|
780
|
-
const faceMatrices = toFloat32Array(pointShadowMap.faceMatrices, 6 * 16, "pointShadowMap.faceMatrices", item.label);
|
|
781
|
-
const faceRects = toFloat32Array(pointShadowMap.faceRects, 6 * 4, "pointShadowMap.faceRects", item.label);
|
|
782
|
-
validatePointShadowFaceRects(faceRects, item.label);
|
|
783
|
-
const strength = pointShadowMap.strength ?? 0.65;
|
|
784
|
-
const bias = pointShadowMap.bias ?? 0.001;
|
|
785
|
-
const slopeBias = pointShadowMap.slopeBias ?? 1;
|
|
786
|
-
const texelSize = pointShadowMap.texelSize ?? [
|
|
787
|
-
1 / Math.max(1, pointShadowMap.texture.texture?.width ?? 1),
|
|
788
|
-
1 / Math.max(1, pointShadowMap.texture.texture?.height ?? 1)
|
|
789
|
-
];
|
|
790
|
-
if (!Number.isFinite(strength) || strength < 0 || strength > 1) {
|
|
791
|
-
throw new RenderDeviceError("Forward point-shadow strength must be finite in [0, 1]", "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
792
|
-
label: item.label,
|
|
793
|
-
strength
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
if (!Number.isFinite(bias) || bias < 0) {
|
|
797
|
-
throw new RenderDeviceError("Forward point-shadow bias must be finite and non-negative", "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
798
|
-
label: item.label,
|
|
799
|
-
bias
|
|
800
|
-
});
|
|
801
|
-
}
|
|
802
|
-
if (!Number.isFinite(slopeBias) || slopeBias < 0) {
|
|
803
|
-
throw new RenderDeviceError("Forward point-shadow slopeBias must be finite and non-negative", "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
1062
|
+
const dimension = cube ? "cube" : "2d";
|
|
1063
|
+
validateEnvironmentTextureBinding(cube ? "Environment cube map texture" : "Environment map texture", binding, dimension, item);
|
|
1064
|
+
// E3 stage-2b (step 3): under the conjunction the stage-2a knob is the
|
|
1065
|
+
// only IBL intensity source — an absent field means zero, never the
|
|
1066
|
+
// legacy absent-field default of 1. Conjunction-off keeps `?? 1`.
|
|
1067
|
+
const intensity = flags !== undefined && qrE3CompilerLightingOn(flags)
|
|
1068
|
+
? env.environmentMapIntensity ?? 0
|
|
1069
|
+
: env.environmentMapIntensity ?? 1;
|
|
1070
|
+
const rotation = env.environmentMapRotation ?? 0;
|
|
1071
|
+
const mipCount = env.environmentMapMipCount ?? 1;
|
|
1072
|
+
const encoding = env.environmentMapEncoding ?? "srgb";
|
|
1073
|
+
if (!Number.isFinite(intensity) || intensity < 0 || !Number.isFinite(rotation) || !Number.isInteger(mipCount) || mipCount < 1) {
|
|
1074
|
+
throw new RenderDeviceError("Sampled environment map options are invalid", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
804
1075
|
label: item.label,
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
if (texelSize.length !== 2 || !texelSize.every((value) => Number.isFinite(value) && value > 0)) {
|
|
809
|
-
throw new RenderDeviceError("Forward point-shadow texelSize must contain two finite positive values", "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
810
|
-
label: item.label,
|
|
811
|
-
texelSize: Array.from(texelSize)
|
|
1076
|
+
intensity,
|
|
1077
|
+
rotation,
|
|
1078
|
+
mipCount
|
|
812
1079
|
});
|
|
813
1080
|
}
|
|
814
|
-
const
|
|
815
|
-
uniforms.set(
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
uniforms.set("
|
|
825
|
-
uniforms.set("
|
|
826
|
-
uniforms.set("
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
"u_spotShadowStrength",
|
|
838
|
-
"u_spotShadowBias",
|
|
839
|
-
"u_spotShadowSlopeBias",
|
|
840
|
-
"u_spotShadowTexelSize",
|
|
841
|
-
"u_spotShadowPcfSampleCount",
|
|
842
|
-
"u_spotShadowPcfSamples"
|
|
843
|
-
];
|
|
844
|
-
if (!requiredUniforms.every((uniform) => shader.reflection.uniforms.has(uniform))) {
|
|
1081
|
+
const name = cube ? "u_environmentCubeMap" : "u_environmentMap";
|
|
1082
|
+
uniforms.set(name, new TextureBinding({
|
|
1083
|
+
name,
|
|
1084
|
+
texture: binding.texture,
|
|
1085
|
+
sampler: binding.sampler,
|
|
1086
|
+
required: true,
|
|
1087
|
+
ready: binding.ready,
|
|
1088
|
+
expectedColorSpace: binding.expectedColorSpace,
|
|
1089
|
+
expectedDimension: dimension
|
|
1090
|
+
}));
|
|
1091
|
+
uniforms.set("u_environmentMapIntensity", intensity);
|
|
1092
|
+
uniforms.set("u_environmentMapRotation", rotation);
|
|
1093
|
+
uniforms.set("u_environmentMapMaxLod", Math.max(mipCount - 1, 0));
|
|
1094
|
+
uniforms.set("u_environmentMapEncoding", encoding === "rgbe" ? 1 : encoding === "linear" ? 2 : 0);
|
|
1095
|
+
}
|
|
1096
|
+
/**
|
|
1097
|
+
* Generated-program procedural environment (`indirect_default` LIGHT_HEMISPHERE
|
|
1098
|
+
* block). Same validation as the frozen binder below, under the generator's
|
|
1099
|
+
* own `u_a3dProcedural*` names; a program compiled for a procedural map whose
|
|
1100
|
+
* environment no longer has one draws with zero procedural contribution.
|
|
1101
|
+
*/
|
|
1102
|
+
export function applyGeneratedProceduralEnvironmentUniforms(environment, item, shader, uniforms, suppressProcedural = false) {
|
|
1103
|
+
if (!shader.reflection.uniforms.has("u_a3dProceduralIntensity"))
|
|
845
1104
|
return;
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
uniforms.set("
|
|
851
|
-
uniforms.set("
|
|
852
|
-
uniforms.set("u_spotShadowMatrix", new Float32Array(identityMatrix()));
|
|
853
|
-
uniforms.set("u_spotShadowCone", [Math.PI / 4, 0]);
|
|
854
|
-
uniforms.set("u_spotShadowRange", 1);
|
|
855
|
-
uniforms.set("u_spotShadowStrength", 0);
|
|
856
|
-
uniforms.set("u_spotShadowBias", 0);
|
|
857
|
-
uniforms.set("u_spotShadowSlopeBias", 0);
|
|
858
|
-
uniforms.set("u_spotShadowTexelSize", [1, 1]);
|
|
859
|
-
uniforms.set("u_spotShadowPcfSampleCount", 1);
|
|
860
|
-
uniforms.set("u_spotShadowPcfSamples", new Float32Array(MAX_FORWARD_SHADOW_PCF_SAMPLES * 4));
|
|
1105
|
+
// E3 stage-2b: a PRD-02-IBL draw takes no procedural term at all (the
|
|
1106
|
+
// stage-2a knob already zeroed it in the bundle; bare-path bundles are
|
|
1107
|
+
// zeroed here so the sampled/probe term can never double-count).
|
|
1108
|
+
if (suppressProcedural) {
|
|
1109
|
+
uniforms.set("u_a3dProceduralIntensity", 0);
|
|
1110
|
+
uniforms.set("u_a3dProceduralSpecularIntensity", 0);
|
|
861
1111
|
return;
|
|
862
1112
|
}
|
|
863
|
-
const
|
|
864
|
-
if (!
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
});
|
|
869
|
-
}
|
|
870
|
-
if (spotShadowMap.lightPosition.length !== 3 || !isFiniteArrayLike(spotShadowMap.lightPosition)) {
|
|
871
|
-
throw new RenderDeviceError("Forward spot-shadow lightPosition must contain three finite values", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
872
|
-
label: item.label,
|
|
873
|
-
lightPosition: spotShadowMap.lightPosition
|
|
874
|
-
});
|
|
875
|
-
}
|
|
876
|
-
if (spotShadowMap.lightDirection.length !== 3 || !isFiniteArrayLike(spotShadowMap.lightDirection)) {
|
|
877
|
-
throw new RenderDeviceError("Forward spot-shadow lightDirection must contain three finite values", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
878
|
-
label: item.label,
|
|
879
|
-
lightDirection: spotShadowMap.lightDirection
|
|
880
|
-
});
|
|
881
|
-
}
|
|
882
|
-
if (!Number.isFinite(spotShadowMap.angle) || spotShadowMap.angle <= 0 || spotShadowMap.angle >= Math.PI / 2) {
|
|
883
|
-
throw new RenderDeviceError("Forward spot-shadow angle must be within (0, PI / 2)", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
884
|
-
label: item.label,
|
|
885
|
-
angle: spotShadowMap.angle
|
|
886
|
-
});
|
|
887
|
-
}
|
|
888
|
-
if (spotShadowMap.penumbra !== undefined && (!Number.isFinite(spotShadowMap.penumbra) || spotShadowMap.penumbra < 0 || spotShadowMap.penumbra > 1)) {
|
|
889
|
-
throw new RenderDeviceError("Forward spot-shadow penumbra must be in [0, 1]", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
890
|
-
label: item.label,
|
|
891
|
-
penumbra: spotShadowMap.penumbra
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
if (!Number.isFinite(spotShadowMap.range) || spotShadowMap.range <= 0) {
|
|
895
|
-
throw new RenderDeviceError("Forward spot-shadow range must be finite and positive", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
896
|
-
label: item.label,
|
|
897
|
-
range: spotShadowMap.range
|
|
898
|
-
});
|
|
899
|
-
}
|
|
900
|
-
const shadowMatrix = toFloat32Array(spotShadowMap.shadowMatrix, 16, "spotShadowMap.shadowMatrix", item.label);
|
|
901
|
-
const strength = spotShadowMap.strength ?? 0.65;
|
|
902
|
-
const bias = spotShadowMap.bias ?? 0.001;
|
|
903
|
-
const slopeBias = spotShadowMap.slopeBias ?? 1;
|
|
904
|
-
const texelSize = spotShadowMap.texelSize ?? [
|
|
905
|
-
1 / Math.max(1, spotShadowMap.texture.texture?.width ?? 1),
|
|
906
|
-
1 / Math.max(1, spotShadowMap.texture.texture?.height ?? 1)
|
|
907
|
-
];
|
|
908
|
-
if (!Number.isFinite(strength) || strength < 0 || strength > 1) {
|
|
909
|
-
throw new RenderDeviceError("Forward spot-shadow strength must be finite in [0, 1]", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
910
|
-
label: item.label,
|
|
911
|
-
strength
|
|
912
|
-
});
|
|
913
|
-
}
|
|
914
|
-
if (!Number.isFinite(bias) || bias < 0) {
|
|
915
|
-
throw new RenderDeviceError("Forward spot-shadow bias must be finite and non-negative", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
916
|
-
label: item.label,
|
|
917
|
-
bias
|
|
918
|
-
});
|
|
919
|
-
}
|
|
920
|
-
if (!Number.isFinite(slopeBias) || slopeBias < 0) {
|
|
921
|
-
throw new RenderDeviceError("Forward spot-shadow slopeBias must be finite and non-negative", "FORWARD_SPOT_SHADOW_MAP_CONTRACT", {
|
|
922
|
-
label: item.label,
|
|
923
|
-
slopeBias
|
|
924
|
-
});
|
|
1113
|
+
const proceduralMap = environment?.proceduralMap;
|
|
1114
|
+
if (!proceduralMap) {
|
|
1115
|
+
uniforms.set("u_a3dProceduralIntensity", 0);
|
|
1116
|
+
uniforms.set("u_a3dProceduralSpecularIntensity", 0);
|
|
1117
|
+
return;
|
|
925
1118
|
}
|
|
926
|
-
if (
|
|
927
|
-
|
|
1119
|
+
if (!Number.isFinite(proceduralMap.intensity) || proceduralMap.intensity < 0
|
|
1120
|
+
|| !Number.isFinite(proceduralMap.specularIntensity) || proceduralMap.specularIntensity < 0) {
|
|
1121
|
+
throw new RenderDeviceError("Procedural environment map intensities must be finite and non-negative", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
928
1122
|
label: item.label,
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
}
|
|
932
|
-
const filterKernel = spotShadowMap.filterKernel ?? DEFAULT_FORWARD_SHADOW_FILTER_KERNEL;
|
|
933
|
-
uniforms.set("u_spotShadowMapTexture", spotShadowMap.texture);
|
|
934
|
-
uniforms.set("u_spotShadowMapEnabled", 1);
|
|
935
|
-
uniforms.set("u_spotShadowLightPosition", spotShadowMap.lightPosition);
|
|
936
|
-
uniforms.set("u_spotShadowLightDirection", spotShadowMap.lightDirection);
|
|
937
|
-
uniforms.set("u_spotShadowMatrix", shadowMatrix);
|
|
938
|
-
uniforms.set("u_spotShadowCone", [spotShadowMap.angle, spotShadowMap.penumbra ?? 0]);
|
|
939
|
-
uniforms.set("u_spotShadowRange", spotShadowMap.range);
|
|
940
|
-
uniforms.set("u_spotShadowStrength", strength);
|
|
941
|
-
uniforms.set("u_spotShadowBias", bias);
|
|
942
|
-
uniforms.set("u_spotShadowSlopeBias", slopeBias);
|
|
943
|
-
uniforms.set("u_spotShadowTexelSize", texelSize);
|
|
944
|
-
uniforms.set("u_spotShadowPcfSampleCount", filterKernel.samples.length);
|
|
945
|
-
uniforms.set("u_spotShadowPcfSamples", packForwardShadowPcfSamples(filterKernel, item.label));
|
|
946
|
-
}
|
|
947
|
-
function toFloat32Array(values, expectedLength, name, label) {
|
|
948
|
-
const source = values instanceof Float32Array ? values : new Float32Array(values);
|
|
949
|
-
if (source.length !== expectedLength || !isFiniteArrayLike(source)) {
|
|
950
|
-
throw new RenderDeviceError(`${name} must contain ${expectedLength} finite values`, "FORWARD_POINT_SHADOW_MAP_CONTRACT", {
|
|
951
|
-
label,
|
|
952
|
-
length: source.length,
|
|
953
|
-
expectedLength
|
|
1123
|
+
intensity: proceduralMap.intensity,
|
|
1124
|
+
specularIntensity: proceduralMap.specularIntensity
|
|
954
1125
|
});
|
|
955
1126
|
}
|
|
956
|
-
|
|
1127
|
+
uniforms.set("u_a3dProceduralSkyColor", toEnvironmentColor(proceduralMap.skyColor, "proceduralMap.skyColor", item.label));
|
|
1128
|
+
uniforms.set("u_a3dProceduralHorizonColor", toEnvironmentColor(proceduralMap.horizonColor, "proceduralMap.horizonColor", item.label));
|
|
1129
|
+
uniforms.set("u_a3dProceduralGroundColor", toEnvironmentColor(proceduralMap.groundColor, "proceduralMap.groundColor", item.label));
|
|
1130
|
+
uniforms.set("u_a3dProceduralSpecularColor", toEnvironmentColor(proceduralMap.specularColor, "proceduralMap.specularColor", item.label));
|
|
1131
|
+
uniforms.set("u_a3dProceduralIntensity", proceduralMap.intensity);
|
|
1132
|
+
uniforms.set("u_a3dProceduralSpecularIntensity", proceduralMap.specularIntensity);
|
|
957
1133
|
}
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* E3 stage-2b: `prd02.ibl` can only shade when a real SH-bearing C-09
|
|
1136
|
+
* probe exists (27-float `sh9`, the probe contract length). A cube-only
|
|
1137
|
+
* source — a scene `environmentCubeMapTexture` or a per-item
|
|
1138
|
+
* `environmentCube` with no SH — must NOT select the replacement body:
|
|
1139
|
+
* the pack would bind zeroed SH and diffuse IBL would vanish, where the
|
|
1140
|
+
* default indirect body samples that cube for diffuse. Such draws keep
|
|
1141
|
+
* the default body (which already honours the selected cube via
|
|
1142
|
+
* `withItemEnvironmentCube`). A per-item cube still wins for specular
|
|
1143
|
+
* when a scene SH probe exists (see the pack below); `_item` is kept in
|
|
1144
|
+
* the signature so the draw path and the Renderer warmup share one gate
|
|
1145
|
+
* and their program keys agree on the feature bit.
|
|
1146
|
+
*/
|
|
1147
|
+
export function prd02IblEnvironmentAvailable(environment, _item) {
|
|
1148
|
+
return environment?.environmentProbe?.sh9?.length === 27;
|
|
969
1149
|
}
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
1150
|
+
/**
|
|
1151
|
+
* E3 stage-2b bind site for the PRD-02 IBL chunk: packs
|
|
1152
|
+
* `packA3DEnvironmentUniforms` (previously zero production callers) from the
|
|
1153
|
+
* pass environment and writes it into the draw's uniform packet.
|
|
1154
|
+
*
|
|
1155
|
+
* Single intensity source (step 3): diffuse/specular intensities are the
|
|
1156
|
+
* stage-2a knob (`environmentMapIntensity` /
|
|
1157
|
+
* `environmentMapSpecularIntensity`, authored-equal under the conjunction;
|
|
1158
|
+
* an absent field is 0, never a legacy default), multiplied ONCE by the
|
|
1159
|
+
* per-material `envMapIntensity` (`u_materialEnvironmentIntensity`, kept as
|
|
1160
|
+
* a multiplier pending the owner decision). No preset scalar stack is read
|
|
1161
|
+
* here. Ambient rides `color`/`intensity` (under the probe path these are
|
|
1162
|
+
* the authored-ambient term, additive outside IBL per F-02-01); hemisphere
|
|
1163
|
+
* is not passed — the probe SH already carries sky/ground, and the
|
|
1164
|
+
* procedural map is suppressed on this path.
|
|
1165
|
+
*
|
|
1166
|
+
* Frozen-family scoping (step 1): this bind runs only for generated draws
|
|
1167
|
+
* that selected `prd02.ibl`. The frozen shader family (ShaderLibraryCore
|
|
1168
|
+
* lean PBR + ShaderLibrary duplicates) serves fallback-only draws
|
|
1169
|
+
* (unskinnable skinned items, compile failure, binding failure); since
|
|
1170
|
+
* step 4 those draws get bind-level suppression of their stacked terms in
|
|
1171
|
+
* `applyEnvironmentLightingUniforms` under the conjunction, while
|
|
1172
|
+
* conjunction-off every draw stays byte-identical.
|
|
1173
|
+
*/
|
|
1174
|
+
export function applyPrd02EnvironmentUniforms(environment, item, material, uniforms) {
|
|
1175
|
+
const env = environment ? withItemEnvironmentCube(environment, item) : undefined;
|
|
1176
|
+
const cubeTexture = env?.environmentCubeMapTexture?.texture ?? undefined;
|
|
1177
|
+
const sceneProbe = env?.environmentProbe ?? null;
|
|
1178
|
+
// A selected per-item cube (`withItemEnvironmentCube` already folded it
|
|
1179
|
+
// into `env.environmentCubeMapTexture`, e.g. from
|
|
1180
|
+
// `applyProbeEnvironmentCubes`) wins for specular; diffuse SH still
|
|
1181
|
+
// comes from the scene probe — the item cube carries no SH of its own.
|
|
1182
|
+
const selectedCubeMips = cubeTexture?.cubeFaces[0]?.mipLevels.length;
|
|
1183
|
+
const probe = sceneProbe && cubeTexture && cubeTexture.dimension === "cube" && cubeTexture !== sceneProbe.specularCube
|
|
1184
|
+
? {
|
|
1185
|
+
specularCube: cubeTexture,
|
|
1186
|
+
mipCount: item.environmentCubeMip
|
|
1187
|
+
?? (selectedCubeMips !== undefined && selectedCubeMips > 0
|
|
1188
|
+
? selectedCubeMips
|
|
1189
|
+
: env?.environmentMapMipCount ?? sceneProbe.mipCount),
|
|
1190
|
+
sh9: sceneProbe.sh9
|
|
985
1191
|
}
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
if (color.length !== 3 || !isFiniteColor(color)) {
|
|
1012
|
-
throw new RenderDeviceError("Environment lighting color must contain three finite values in [0, 1]", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
1013
|
-
label: item.label,
|
|
1014
|
-
color
|
|
1015
|
-
});
|
|
1016
|
-
}
|
|
1017
|
-
if (!Number.isFinite(environment.intensity) || environment.intensity < 0) {
|
|
1018
|
-
throw new RenderDeviceError("Environment lighting intensity must be finite and non-negative", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
1192
|
+
: sceneProbe
|
|
1193
|
+
?? (cubeTexture
|
|
1194
|
+
? {
|
|
1195
|
+
specularCube: cubeTexture,
|
|
1196
|
+
mipCount: env?.environmentMapMipCount ?? Math.max(1, cubeTexture.cubeFaces[0]?.mipLevels.length ?? 1),
|
|
1197
|
+
sh9: new Float32Array(0)
|
|
1198
|
+
}
|
|
1199
|
+
: null);
|
|
1200
|
+
const knobDiffuse = env?.environmentMapIntensity ?? 0;
|
|
1201
|
+
const knobSpecular = env?.environmentMapSpecularIntensity ?? knobDiffuse;
|
|
1202
|
+
// Effective (instance-overridden) multiplier, resolved the way the
|
|
1203
|
+
// generated binding resolved it: `MaterialBinding.bindGenerated` fills
|
|
1204
|
+
// this packet from `materialLike.getParameters()`, and
|
|
1205
|
+
// `MaterialInstance.getParameter` is override-first. Prefer the value
|
|
1206
|
+
// already bound into the packet; fall back to asking the material
|
|
1207
|
+
// itself (never the stripped base material) for direct callers.
|
|
1208
|
+
const boundMultiplier = uniforms.get("u_materialEnvironmentIntensity");
|
|
1209
|
+
const materialMultiplierRaw = typeof boundMultiplier === "number"
|
|
1210
|
+
? boundMultiplier
|
|
1211
|
+
: material.getParameter?.("u_materialEnvironmentIntensity");
|
|
1212
|
+
const materialMultiplier = typeof materialMultiplierRaw === "number" && Number.isFinite(materialMultiplierRaw) && materialMultiplierRaw >= 0
|
|
1213
|
+
? materialMultiplierRaw
|
|
1214
|
+
: 1;
|
|
1215
|
+
if (!Number.isFinite(knobDiffuse) || knobDiffuse < 0 || !Number.isFinite(knobSpecular) || knobSpecular < 0) {
|
|
1216
|
+
throw new RenderDeviceError("PRD-02 IBL knob intensities must be finite and non-negative", "ENVIRONMENT_LIGHTING_CONTRACT", {
|
|
1019
1217
|
label: item.label,
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1218
|
+
knobDiffuse,
|
|
1219
|
+
knobSpecular
|
|
1220
|
+
});
|
|
1221
|
+
}
|
|
1222
|
+
const packed = packA3DEnvironmentUniforms({
|
|
1223
|
+
probe,
|
|
1224
|
+
...(env ? { ambient: { color: env.color, intensity: env.intensity } } : {}),
|
|
1225
|
+
// EnvironmentLightingOptions rotation is in turns (indirect_default);
|
|
1226
|
+
// the PRD-02 chunk's u_envRotation is radians.
|
|
1227
|
+
rotation: (env?.environmentMapRotation ?? 0) * Math.PI * 2,
|
|
1228
|
+
diffuseIntensity: knobDiffuse * materialMultiplier,
|
|
1229
|
+
specularIntensity: knobSpecular * materialMultiplier
|
|
1230
|
+
});
|
|
1231
|
+
for (const [name, value] of packed.uniforms)
|
|
1232
|
+
uniforms.set(name, value);
|
|
1233
|
+
// The chunk declares `u_envDfgLut` (its own split-sum entry, unused by the
|
|
1234
|
+
// stage-2b call body, which routes through the r185 multiscatter helpers);
|
|
1235
|
+
// bind the renderer DFG LUT so the sampler never reads a stale unit.
|
|
1236
|
+
uniforms.set("u_envDfgLut", new TextureBinding({
|
|
1237
|
+
name: "u_envDfgLut",
|
|
1238
|
+
texture: dfgLutTexture(),
|
|
1239
|
+
sampler: dfgLutBinding().sampler,
|
|
1240
|
+
expectedColorSpace: "linear"
|
|
1241
|
+
}));
|
|
1242
|
+
}
|
|
1243
|
+
function applyProceduralEnvironmentMapUniforms(proceduralMap, item, shader, uniforms, generatedE3Conjunction = false) {
|
|
1029
1244
|
if (!proceduralMap) {
|
|
1030
1245
|
clearProceduralEnvironmentMapUniforms(shader, uniforms);
|
|
1031
1246
|
return;
|
|
@@ -1061,7 +1276,15 @@ function applyProceduralEnvironmentMapUniforms(proceduralMap, item, shader, unif
|
|
|
1061
1276
|
uniforms.set("u_environmentHorizonColor", horizonColor);
|
|
1062
1277
|
uniforms.set("u_environmentGroundColor", groundColor);
|
|
1063
1278
|
uniforms.set("u_environmentSpecularColor", specularColor);
|
|
1064
|
-
|
|
1279
|
+
// E3 stage-2b (step 3): `u_environmentMapIntensity` is the generated
|
|
1280
|
+
// program's SAMPLED-map (knob) uniform; the frozen namespace reuses the
|
|
1281
|
+
// same name for its procedural diffuse. On a generated conjunction draw
|
|
1282
|
+
// the procedural write is dropped so the knob owns the name outright.
|
|
1283
|
+
// Frozen draws keep this legacy write here; step 4 zeroes it afterwards
|
|
1284
|
+
// in applyEnvironmentLightingUniforms on frozen conjunction draws.
|
|
1285
|
+
if (!generatedE3Conjunction) {
|
|
1286
|
+
uniforms.set("u_environmentMapIntensity", proceduralMap.intensity);
|
|
1287
|
+
}
|
|
1065
1288
|
uniforms.set("u_environmentSpecularIntensity", proceduralMap.specularIntensity);
|
|
1066
1289
|
}
|
|
1067
1290
|
function clearProceduralEnvironmentMapUniforms(shader, uniforms) {
|
|
@@ -1072,7 +1295,21 @@ function clearProceduralEnvironmentMapUniforms(shader, uniforms) {
|
|
|
1072
1295
|
uniforms.set("u_environmentSpecularIntensity", 0);
|
|
1073
1296
|
}
|
|
1074
1297
|
}
|
|
1075
|
-
|
|
1298
|
+
/**
|
|
1299
|
+
* PRD-02 S12 (lane-01 half): a RenderItem's `environmentCube` (a captured
|
|
1300
|
+
* reflection probe) replaces the scene environment's cube for that draw only.
|
|
1301
|
+
* Items without one get `environment` back unchanged (same object).
|
|
1302
|
+
*/
|
|
1303
|
+
function withItemEnvironmentCube(environment, item) {
|
|
1304
|
+
if (!item.environmentCube)
|
|
1305
|
+
return environment;
|
|
1306
|
+
return {
|
|
1307
|
+
...environment,
|
|
1308
|
+
environmentCubeMapTexture: item.environmentCube,
|
|
1309
|
+
...(item.environmentCubeMip !== undefined ? { environmentMapMipCount: item.environmentCubeMip } : {})
|
|
1310
|
+
};
|
|
1311
|
+
}
|
|
1312
|
+
function applySampledEnvironmentMapUniforms(environment, item, shader, uniforms, frozenE3Conjunction = false) {
|
|
1076
1313
|
const environmentMapTexture = environment.environmentMapTexture;
|
|
1077
1314
|
const environmentCubeMapTexture = environment.environmentCubeMapTexture;
|
|
1078
1315
|
if (!environmentMapTexture && !environmentCubeMapTexture) {
|
|
@@ -1097,8 +1334,11 @@ function applySampledEnvironmentMapUniforms(environment, item, shader, uniforms)
|
|
|
1097
1334
|
if (environmentCubeMapTexture) {
|
|
1098
1335
|
validateEnvironmentTextureBinding("Environment cube map texture", environmentCubeMapTexture, "cube", item);
|
|
1099
1336
|
}
|
|
1100
|
-
|
|
1101
|
-
|
|
1337
|
+
// E3 step 4: on a frozen conjunction draw an absent sampled intensity
|
|
1338
|
+
// is zero (single-knob rule, step-3 parity with the generated binder),
|
|
1339
|
+
// never the legacy absent-field defaults of 1 / 0.5.
|
|
1340
|
+
const intensity = frozenE3Conjunction ? environment.environmentMapIntensity ?? 0 : environment.environmentMapIntensity ?? 1;
|
|
1341
|
+
const specularIntensity = frozenE3Conjunction ? environment.environmentMapSpecularIntensity ?? 0 : environment.environmentMapSpecularIntensity ?? 0.5;
|
|
1102
1342
|
const rotation = environment.environmentMapRotation ?? 0;
|
|
1103
1343
|
const mipCount = environment.environmentMapMipCount ?? 1;
|
|
1104
1344
|
const encoding = environment.environmentMapEncoding ?? "srgb";
|
|
@@ -1263,13 +1503,16 @@ function applyTransformUniforms(item, shader, uniforms) {
|
|
|
1263
1503
|
if (modelMatrix && shader.reflection.uniforms.has("u_modelMatrix")) {
|
|
1264
1504
|
uniforms.set("u_modelMatrix", modelMatrix);
|
|
1265
1505
|
}
|
|
1506
|
+
if (shader.reflection.uniforms.has("u_geometryMatrix")) {
|
|
1507
|
+
uniforms.set("u_geometryMatrix", toMat4Uniform(item.geometryMatrix ?? identityMatrix(), "geometryMatrix", item.label));
|
|
1508
|
+
}
|
|
1266
1509
|
if (shader.reflection.uniforms.has("u_normalMatrix")) {
|
|
1267
1510
|
uniforms.set("u_normalMatrix", item.normalMatrix
|
|
1268
1511
|
? toMat4Uniform(item.normalMatrix, "normalMatrix", item.label)
|
|
1269
1512
|
: new Float32Array(normalMatrixFromModel(toMat4Values(modelMatrix ?? identityMatrix(), "modelMatrix", item.label))));
|
|
1270
1513
|
}
|
|
1271
1514
|
}
|
|
1272
|
-
function toMat4Uniform(value, field, label) {
|
|
1515
|
+
export function toMat4Uniform(value, field, label) {
|
|
1273
1516
|
if (value.length !== 16 || !isFiniteArrayLike(value)) {
|
|
1274
1517
|
throw new RenderDeviceError("Render item transform uniforms must be finite mat4 values", "RENDER_ITEM_TRANSFORM_CONTRACT", {
|
|
1275
1518
|
label,
|
|
@@ -1289,7 +1532,7 @@ function toMat4Values(value, field, label) {
|
|
|
1289
1532
|
}
|
|
1290
1533
|
return mat4FromArrayLike(value, 0);
|
|
1291
1534
|
}
|
|
1292
|
-
function identityMatrix() {
|
|
1535
|
+
export function identityMatrix() {
|
|
1293
1536
|
return [
|
|
1294
1537
|
1, 0, 0, 0,
|
|
1295
1538
|
0, 1, 0, 0,
|
|
@@ -1301,18 +1544,56 @@ function getBaseMaterial(material) {
|
|
|
1301
1544
|
return material instanceof MaterialInstance ? material.baseMaterial : material;
|
|
1302
1545
|
}
|
|
1303
1546
|
function sortForwardRenderItems(items, cameraPosition) {
|
|
1304
|
-
return sortRenderQueueItems(items.map((item) =>
|
|
1305
|
-
item
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1547
|
+
return sortRenderQueueItems(items.map((item) => {
|
|
1548
|
+
const queue = blendQueueForState(getBaseMaterial(item.material ?? new UnlitMaterial()).renderState);
|
|
1549
|
+
return {
|
|
1550
|
+
item,
|
|
1551
|
+
bucket: queue !== "opaque" ? "transparent" : isTransmissionRenderItem(item) ? "transmission" : "opaque",
|
|
1552
|
+
depth: cameraPosition ? distanceSquaredFromCamera(item, cameraPosition) : 0,
|
|
1553
|
+
pipelineKey: renderItemPipelineKey(item),
|
|
1554
|
+
batchKey: renderItemPipelineKey(item),
|
|
1555
|
+
blendRank: queue === "transparent-unordered" ? 1 : 0,
|
|
1556
|
+
instanceCount: item.instanceTransforms ? instanceTransformCount(item) : 1
|
|
1557
|
+
};
|
|
1558
|
+
})).items;
|
|
1312
1559
|
}
|
|
1313
1560
|
function isTransparentRenderItem(item) {
|
|
1314
1561
|
const material = item.material ?? new UnlitMaterial();
|
|
1315
|
-
return getBaseMaterial(material).renderState
|
|
1562
|
+
return blendStateIsTransparent(getBaseMaterial(material).renderState);
|
|
1563
|
+
}
|
|
1564
|
+
/** Bucket one item the same way `sortForwardRenderItems` does. */
|
|
1565
|
+
export function forwardItemBucket(item) {
|
|
1566
|
+
const material = item.material ?? new UnlitMaterial();
|
|
1567
|
+
const queue = blendQueueForState(getBaseMaterial(material).renderState);
|
|
1568
|
+
if (queue !== "opaque")
|
|
1569
|
+
return "transparent";
|
|
1570
|
+
return isTransmissionRenderItem(item) ? "transmission" : "opaque";
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* §9.1 split: `opaque` feeds the opaque phase, `transmission` the transmissive
|
|
1574
|
+
* draw after contributor `transmission` passes, and `transparent` the
|
|
1575
|
+
* interleaved transparent phase (each item carries its view-space distance as
|
|
1576
|
+
* `sortDepth`, larger = farther, matching `TransparentQueueItem` semantics).
|
|
1577
|
+
*/
|
|
1578
|
+
export function splitForwardItems(items, cameraPosition) {
|
|
1579
|
+
const opaque = [];
|
|
1580
|
+
const transmission = [];
|
|
1581
|
+
const transparent = [];
|
|
1582
|
+
for (const item of items) {
|
|
1583
|
+
const bucket = forwardItemBucket(item);
|
|
1584
|
+
if (bucket === "opaque") {
|
|
1585
|
+
opaque.push(item);
|
|
1586
|
+
}
|
|
1587
|
+
else if (bucket === "transmission") {
|
|
1588
|
+
transmission.push(item);
|
|
1589
|
+
}
|
|
1590
|
+
else {
|
|
1591
|
+
transparent.push({ item, sortDepth: cameraPosition ? Math.sqrt(distanceSquaredFromCamera(item, cameraPosition)) : 0 });
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
// Transparents are drawn back-to-front (farther first), matching the queue sort.
|
|
1595
|
+
transparent.sort((a, b) => b.sortDepth - a.sortDepth);
|
|
1596
|
+
return { opaque, transmission, transparent };
|
|
1316
1597
|
}
|
|
1317
1598
|
function materialNumericParameter(material, name, fallback) {
|
|
1318
1599
|
const value = material.getParameter(name);
|
|
@@ -1342,7 +1623,10 @@ function renderItemPipelineKey(item) {
|
|
|
1342
1623
|
const material = item.material ?? new UnlitMaterial();
|
|
1343
1624
|
const baseMaterial = getBaseMaterial(material);
|
|
1344
1625
|
const state = baseMaterial.renderState;
|
|
1345
|
-
|
|
1626
|
+
const blendToken = state.blendMode === undefined
|
|
1627
|
+
? (state.blend ? "blend" : "opaque")
|
|
1628
|
+
: typeof state.blendMode === "string" ? state.blendMode : `custom:${renderStateKey(state)}`;
|
|
1629
|
+
return `${baseMaterial.name}|${state.depthTest ? "dt" : "ndt"}|${state.depthWrite ? "dw" : "ndw"}|${state.cullMode}|${blendToken}`;
|
|
1346
1630
|
}
|
|
1347
1631
|
function instanceTransformCount(item) {
|
|
1348
1632
|
return validateInstanceTransformSource(item).length / 16;
|
|
@@ -1408,9 +1692,9 @@ function applyInstanceBinding(device, item, shader, uniforms) {
|
|
|
1408
1692
|
...(extraBindings.buffers.length > 0 ? { buffers: extraBindings.buffers } : {})
|
|
1409
1693
|
};
|
|
1410
1694
|
}
|
|
1411
|
-
function createExtraInstanceAttributeBindings(device, item, instanceCount) {
|
|
1695
|
+
function createExtraInstanceAttributeBindings(device, item, instanceCount, includeColors = true) {
|
|
1412
1696
|
const descriptors = [];
|
|
1413
|
-
if (item.instanceColors) {
|
|
1697
|
+
if (item.instanceColors && includeColors) {
|
|
1414
1698
|
descriptors.push({
|
|
1415
1699
|
shaderName: "a_instanceColor",
|
|
1416
1700
|
components: 4,
|
|
@@ -1463,317 +1747,12 @@ function validateInstanceAttributeDescriptor(descriptor, instanceCount, label) {
|
|
|
1463
1747
|
});
|
|
1464
1748
|
}
|
|
1465
1749
|
}
|
|
1466
|
-
function resolveRenderGeometry(item) {
|
|
1467
|
-
if (item.morphTargets === undefined && item.morphWeights === undefined) {
|
|
1468
|
-
return item.geometry;
|
|
1469
|
-
}
|
|
1470
|
-
if (!item.morphTargets || !item.morphWeights) {
|
|
1471
|
-
throw new RenderDeviceError("Morph render items require both morphTargets and morphWeights", "MORPH_TARGET_CONTRACT", {
|
|
1472
|
-
label: item.label,
|
|
1473
|
-
targetCount: item.morphTargets?.length ?? 0,
|
|
1474
|
-
weightCount: item.morphWeights?.length ?? 0
|
|
1475
|
-
});
|
|
1476
|
-
}
|
|
1477
|
-
return applyMorphTargets(item.geometry, item.morphTargets, item.morphWeights);
|
|
1478
|
-
}
|
|
1479
|
-
function applyGpuMorphUniforms(item, shader, uniforms) {
|
|
1480
|
-
if (!shader.reflection.uniforms.has("u_morphPositionDeltas") ||
|
|
1481
|
-
!shader.reflection.uniforms.has("u_morphWeights") ||
|
|
1482
|
-
!shader.reflection.uniforms.has("u_morphTargetCount")) {
|
|
1483
|
-
return false;
|
|
1484
|
-
}
|
|
1485
|
-
if (!item.morphTargets || !item.morphWeights) {
|
|
1486
|
-
throw new RenderDeviceError("Morph render items require both morphTargets and morphWeights", "MORPH_TARGET_CONTRACT", {
|
|
1487
|
-
label: item.label,
|
|
1488
|
-
targetCount: item.morphTargets?.length ?? 0,
|
|
1489
|
-
weightCount: item.morphWeights?.length ?? 0
|
|
1490
|
-
});
|
|
1491
|
-
}
|
|
1492
|
-
if (item.morphTargets.length !== item.morphWeights.length) {
|
|
1493
|
-
throw new RenderDeviceError("Morph target count must match morph weight count", "MORPH_TARGET_CONTRACT", {
|
|
1494
|
-
label: item.label,
|
|
1495
|
-
targetCount: item.morphTargets.length,
|
|
1496
|
-
weightCount: item.morphWeights.length
|
|
1497
|
-
});
|
|
1498
|
-
}
|
|
1499
|
-
// Counts beyond the uniform fast-path capacity are not an error: fall back to the CPU morph
|
|
1500
|
-
// (resolveRenderGeometry -> applyMorphTargets), which is unlimited and morphs normals + tangents
|
|
1501
|
-
// so lighting follows the deformation. The texture-backed GPU plan (createMorphTargetPlan) packs
|
|
1502
|
-
// the same data for the texture path; see MorphTargetPlan.ts.
|
|
1503
|
-
if (item.morphTargets.length > MAX_GPU_MORPH_TARGETS || item.geometry.vertexBuffer.vertexCount > MAX_GPU_MORPH_VERTICES) {
|
|
1504
|
-
return false;
|
|
1505
|
-
}
|
|
1506
|
-
const packed = new Float32Array(MAX_GPU_MORPH_TARGETS * MAX_GPU_MORPH_VERTICES * 4);
|
|
1507
|
-
const packedNormals = new Float32Array(MAX_GPU_MORPH_TARGETS * MAX_GPU_MORPH_VERTICES * 4);
|
|
1508
|
-
const weights = new Float32Array(MAX_GPU_MORPH_TARGETS);
|
|
1509
|
-
for (let targetIndex = 0; targetIndex < item.morphTargets.length; targetIndex += 1) {
|
|
1510
|
-
const target = item.morphTargets[targetIndex];
|
|
1511
|
-
if (!target.positions || target.positions.length < item.geometry.vertexBuffer.vertexCount) {
|
|
1512
|
-
throw new RenderDeviceError("GPU morph shader path requires position deltas for every source vertex", "GPU_MORPH_TARGET_CONTRACT", {
|
|
1513
|
-
label: item.label,
|
|
1514
|
-
targetIndex,
|
|
1515
|
-
vertexCount: item.geometry.vertexBuffer.vertexCount,
|
|
1516
|
-
deltaCount: target.positions?.length ?? 0
|
|
1517
|
-
});
|
|
1518
|
-
}
|
|
1519
|
-
const weight = item.morphWeights[targetIndex] ?? 0;
|
|
1520
|
-
if (!Number.isFinite(weight)) {
|
|
1521
|
-
throw new RenderDeviceError("GPU morph weights must be finite", "GPU_MORPH_TARGET_CONTRACT", {
|
|
1522
|
-
label: item.label,
|
|
1523
|
-
targetIndex,
|
|
1524
|
-
weight
|
|
1525
|
-
});
|
|
1526
|
-
}
|
|
1527
|
-
weights[targetIndex] = weight;
|
|
1528
|
-
for (let vertex = 0; vertex < item.geometry.vertexBuffer.vertexCount; vertex += 1) {
|
|
1529
|
-
const delta = target.positions[vertex];
|
|
1530
|
-
if (delta.length !== 3 || !Number.isFinite(delta[0]) || !Number.isFinite(delta[1]) || !Number.isFinite(delta[2])) {
|
|
1531
|
-
throw new RenderDeviceError("GPU morph position deltas must be finite vec3 values", "GPU_MORPH_TARGET_CONTRACT", {
|
|
1532
|
-
label: item.label,
|
|
1533
|
-
targetIndex,
|
|
1534
|
-
vertex
|
|
1535
|
-
});
|
|
1536
|
-
}
|
|
1537
|
-
const offset = (targetIndex * MAX_GPU_MORPH_VERTICES + vertex) * 4;
|
|
1538
|
-
packed[offset] = delta[0];
|
|
1539
|
-
packed[offset + 1] = delta[1];
|
|
1540
|
-
packed[offset + 2] = delta[2];
|
|
1541
|
-
const normal = target.normals?.[vertex];
|
|
1542
|
-
if (normal && normal.length === 3) {
|
|
1543
|
-
packedNormals[offset] = normal[0];
|
|
1544
|
-
packedNormals[offset + 1] = normal[1];
|
|
1545
|
-
packedNormals[offset + 2] = normal[2];
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
uniforms.set("u_morphPositionDeltas", packed);
|
|
1550
|
-
uniforms.set("u_morphWeights", weights);
|
|
1551
|
-
uniforms.set("u_morphTargetCount", item.morphTargets.length);
|
|
1552
|
-
// Normal deltas are uploaded only when the bound shader declares the uniform (lit morph variants);
|
|
1553
|
-
// the default unlit morph shader ignores them.
|
|
1554
|
-
if (shader.reflection.uniforms.has("u_morphNormalDeltas")) {
|
|
1555
|
-
uniforms.set("u_morphNormalDeltas", packedNormals);
|
|
1556
|
-
}
|
|
1557
|
-
return true;
|
|
1558
|
-
}
|
|
1559
|
-
function applySkinningUniforms(skinning, material, shader, uniforms) {
|
|
1560
|
-
if (!shader.reflection.uniforms.has("u_jointMatrices") || !shader.reflection.uniforms.has("u_jointCount")) {
|
|
1561
|
-
throw new RenderDeviceError("Skinned render item requires a shader with joint palette uniforms", "SKINNING_SHADER_CONTRACT", {
|
|
1562
|
-
material: material.name
|
|
1563
|
-
});
|
|
1564
|
-
}
|
|
1565
|
-
if (!Number.isInteger(skinning.jointCount) || skinning.jointCount <= 0 || skinning.jointCount > MAX_SKINNING_JOINTS) {
|
|
1566
|
-
throw new RenderDeviceError(`Skinning jointCount must be an integer in [1, ${MAX_SKINNING_JOINTS}]`, "INVALID_SKINNING_PALETTE", {
|
|
1567
|
-
jointCount: skinning.jointCount,
|
|
1568
|
-
maxUniformJoints: MAX_UNIFORM_SKINNING_JOINTS,
|
|
1569
|
-
maxJoints: MAX_SKINNING_JOINTS
|
|
1570
|
-
});
|
|
1571
|
-
}
|
|
1572
|
-
if (skinning.matrices.length !== skinning.jointCount * 16) {
|
|
1573
|
-
throw new RenderDeviceError("Skinning matrix palette length must equal jointCount * 16", "INVALID_SKINNING_PALETTE", {
|
|
1574
|
-
jointCount: skinning.jointCount,
|
|
1575
|
-
matrixScalars: skinning.matrices.length
|
|
1576
|
-
});
|
|
1577
|
-
}
|
|
1578
|
-
if (!isFiniteArrayLike(skinning.matrices)) {
|
|
1579
|
-
throw new RenderDeviceError("Skinning matrix palette must contain finite values", "INVALID_SKINNING_PALETTE", {
|
|
1580
|
-
jointCount: skinning.jointCount
|
|
1581
|
-
});
|
|
1582
|
-
}
|
|
1583
|
-
uniforms.set("u_jointCount", skinning.jointCount);
|
|
1584
|
-
// Over the uniform-array limit the palette travels as an RGBA32F data texture, four
|
|
1585
|
-
// texels per matrix. A mat4 uniform costs four vec4 slots, so a uniform array cannot
|
|
1586
|
-
// be grown far enough for large rigs without exhausting MAX_VERTEX_UNIFORM_VECTORS.
|
|
1587
|
-
const path = skinning.jointCount > MAX_UNIFORM_SKINNING_JOINTS ? "data-texture" : "uniform-array";
|
|
1588
|
-
if (path === "data-texture") {
|
|
1589
|
-
if (!shader.reflection.uniforms.has("u_jointPaletteTexture") || !shader.reflection.uniforms.has("u_jointPaletteMode")) {
|
|
1590
|
-
throw new RenderDeviceError(`Skinning palettes above ${MAX_UNIFORM_SKINNING_JOINTS} joints require a shader with data-texture palette uniforms`, "SKINNING_SHADER_CONTRACT", { material: material.name, jointCount: skinning.jointCount });
|
|
1591
|
-
}
|
|
1592
|
-
const texture = createSkinningPaletteTexture(skinning, material.name);
|
|
1593
|
-
uniforms.set("u_jointPaletteMode", 1);
|
|
1594
|
-
uniforms.set("u_jointPaletteTexture", new TextureBinding({
|
|
1595
|
-
name: "u_jointPaletteTexture",
|
|
1596
|
-
texture,
|
|
1597
|
-
sampler: new Sampler({ minFilter: "nearest", magFilter: "nearest", addressU: "clamp-to-edge", addressV: "clamp-to-edge" }),
|
|
1598
|
-
required: true
|
|
1599
|
-
}));
|
|
1600
|
-
uniforms.set("u_jointPaletteTextureSize", [texture.width, texture.height]);
|
|
1601
|
-
// The uniform array is still declared by the shader, so give it a valid value.
|
|
1602
|
-
uniforms.set("u_jointMatrices", new Float32Array(MAX_UNIFORM_SKINNING_JOINTS * 16));
|
|
1603
|
-
return path;
|
|
1604
|
-
}
|
|
1605
|
-
if (shader.reflection.uniforms.has("u_jointPaletteMode")) {
|
|
1606
|
-
uniforms.set("u_jointPaletteMode", 0);
|
|
1607
|
-
if (shader.reflection.uniforms.has("u_jointPaletteTextureSize"))
|
|
1608
|
-
uniforms.set("u_jointPaletteTextureSize", [1, 1]);
|
|
1609
|
-
if (shader.reflection.uniforms.has("u_jointPaletteTexture")) {
|
|
1610
|
-
uniforms.set("u_jointPaletteTexture", new TextureBinding({ name: "u_jointPaletteTexture", required: false }));
|
|
1611
|
-
}
|
|
1612
|
-
}
|
|
1613
|
-
uniforms.set("u_jointMatrices", skinning.matrices);
|
|
1614
|
-
return path;
|
|
1615
|
-
}
|
|
1616
1750
|
/**
|
|
1617
1751
|
* Packs a joint palette into an RGBA32F texture, one texel per matrix column.
|
|
1618
1752
|
*
|
|
1619
1753
|
* Width is a multiple of four so no matrix straddles a row boundary, which keeps the
|
|
1620
1754
|
* shader's texel addressing a simple divide and avoids per-column row recomputation.
|
|
1621
1755
|
*/
|
|
1622
|
-
function createSkinningPaletteTexture(skinning, materialName) {
|
|
1623
|
-
const texelsPerMatrix = 4;
|
|
1624
|
-
const totalTexels = skinning.jointCount * texelsPerMatrix;
|
|
1625
|
-
const width = Math.min(SKINNING_PALETTE_TEXTURE_MAX_WIDTH, Math.max(texelsPerMatrix, ceilToMultiple(Math.ceil(Math.sqrt(totalTexels)), texelsPerMatrix)));
|
|
1626
|
-
const height = Math.ceil(totalTexels / width);
|
|
1627
|
-
const data = new Float32Array(width * height * 4);
|
|
1628
|
-
data.set(skinning.matrices.subarray(0, Math.min(skinning.matrices.length, data.length)));
|
|
1629
|
-
if (skinning.matrices.length > data.length) {
|
|
1630
|
-
throw new RenderDeviceError("Skinning palette does not fit the data texture", "INVALID_SKINNING_PALETTE", {
|
|
1631
|
-
material: materialName,
|
|
1632
|
-
jointCount: skinning.jointCount
|
|
1633
|
-
});
|
|
1634
|
-
}
|
|
1635
|
-
return new Texture({
|
|
1636
|
-
width,
|
|
1637
|
-
height,
|
|
1638
|
-
format: "rgba32f",
|
|
1639
|
-
colorSpace: "linear",
|
|
1640
|
-
label: `aura3d-skinning-palette-${skinning.jointCount}-joints`,
|
|
1641
|
-
data
|
|
1642
|
-
});
|
|
1643
|
-
}
|
|
1644
|
-
function ceilToMultiple(value, multiple) {
|
|
1645
|
-
return Math.ceil(value / multiple) * multiple;
|
|
1646
|
-
}
|
|
1647
|
-
function validateSkinningGeometryContract(item, skinning) {
|
|
1648
|
-
const format = item.geometry.vertexBuffer.format;
|
|
1649
|
-
if (!format.hasAttribute("joints") || !format.hasAttribute("weights")) {
|
|
1650
|
-
throw new RenderDeviceError("Skinned render item geometry must include joints and weights attributes", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1651
|
-
label: item.label,
|
|
1652
|
-
jointCount: skinning.jointCount,
|
|
1653
|
-
vertexFormat: format.attributes.map((attribute) => attribute.shaderName),
|
|
1654
|
-
missingAttributes: [
|
|
1655
|
-
...(format.hasAttribute("joints") ? [] : ["a_joints"]),
|
|
1656
|
-
...(format.hasAttribute("weights") ? [] : ["a_weights"])
|
|
1657
|
-
]
|
|
1658
|
-
});
|
|
1659
|
-
}
|
|
1660
|
-
const jointsAttribute = format.getAttribute("joints");
|
|
1661
|
-
const weightsAttribute = format.getAttribute("weights");
|
|
1662
|
-
if (jointsAttribute.components !== 4 || weightsAttribute.components !== 4) {
|
|
1663
|
-
throw new RenderDeviceError("Skinned render item geometry must use four joint and four weight influences per vertex", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1664
|
-
label: item.label,
|
|
1665
|
-
jointCount: skinning.jointCount,
|
|
1666
|
-
jointComponents: jointsAttribute.components,
|
|
1667
|
-
weightComponents: weightsAttribute.components
|
|
1668
|
-
});
|
|
1669
|
-
}
|
|
1670
|
-
// Eight-influence geometry must supply both halves of the second set, and both must
|
|
1671
|
-
// be vec4. A half-declared second set would silently drop influences at draw time.
|
|
1672
|
-
const hasJoints1 = format.hasAttribute("joints1");
|
|
1673
|
-
const hasWeights1 = format.hasAttribute("weights1");
|
|
1674
|
-
if (hasJoints1 !== hasWeights1) {
|
|
1675
|
-
throw new RenderDeviceError("Eight-influence skinned geometry must declare both joints1 and weights1", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1676
|
-
label: item.label,
|
|
1677
|
-
hasJoints1,
|
|
1678
|
-
hasWeights1
|
|
1679
|
-
});
|
|
1680
|
-
}
|
|
1681
|
-
const eightInfluence = hasJoints1 && hasWeights1;
|
|
1682
|
-
if (eightInfluence) {
|
|
1683
|
-
const joints1Attribute = format.getAttribute("joints1");
|
|
1684
|
-
const weights1Attribute = format.getAttribute("weights1");
|
|
1685
|
-
if (joints1Attribute.components !== 4 || weights1Attribute.components !== 4) {
|
|
1686
|
-
throw new RenderDeviceError("Eight-influence skinned geometry must use four components per second-set attribute", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1687
|
-
label: item.label,
|
|
1688
|
-
joints1Components: joints1Attribute.components,
|
|
1689
|
-
weights1Components: weights1Attribute.components
|
|
1690
|
-
});
|
|
1691
|
-
}
|
|
1692
|
-
}
|
|
1693
|
-
for (let vertex = 0; vertex < item.geometry.vertexBuffer.vertexCount; vertex += 1) {
|
|
1694
|
-
const joints = item.geometry.vertexBuffer.getAttribute(vertex, "joints");
|
|
1695
|
-
const weights = item.geometry.vertexBuffer.getAttribute(vertex, "weights");
|
|
1696
|
-
let weightSum = 0;
|
|
1697
|
-
if (eightInfluence) {
|
|
1698
|
-
// Validate the second set with the same rules, and fold it into the weight sum so
|
|
1699
|
-
// a vertex whose influence is split across both sets is not reported as unweighted.
|
|
1700
|
-
const joints1 = item.geometry.vertexBuffer.getAttribute(vertex, "joints1");
|
|
1701
|
-
const weights1 = item.geometry.vertexBuffer.getAttribute(vertex, "weights1");
|
|
1702
|
-
for (let influence = 0; influence < 4; influence += 1) {
|
|
1703
|
-
const joint = joints1[influence] ?? 0;
|
|
1704
|
-
const weight = weights1[influence] ?? 0;
|
|
1705
|
-
if (!Number.isFinite(weight) || weight < 0) {
|
|
1706
|
-
throw new RenderDeviceError("Skinned render item weights must be finite non-negative values", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1707
|
-
label: item.label,
|
|
1708
|
-
jointCount: skinning.jointCount,
|
|
1709
|
-
vertex,
|
|
1710
|
-
influence: influence + 4,
|
|
1711
|
-
weight
|
|
1712
|
-
});
|
|
1713
|
-
}
|
|
1714
|
-
if (!Number.isInteger(joint) || joint < 0 || joint >= skinning.jointCount) {
|
|
1715
|
-
throw new RenderDeviceError("Skinned render item joint indices must reference palette joints", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1716
|
-
label: item.label,
|
|
1717
|
-
jointCount: skinning.jointCount,
|
|
1718
|
-
vertex,
|
|
1719
|
-
influence: influence + 4,
|
|
1720
|
-
joint
|
|
1721
|
-
});
|
|
1722
|
-
}
|
|
1723
|
-
weightSum += weight;
|
|
1724
|
-
}
|
|
1725
|
-
}
|
|
1726
|
-
for (let influence = 0; influence < 4; influence += 1) {
|
|
1727
|
-
const joint = joints[influence] ?? 0;
|
|
1728
|
-
const weight = weights[influence] ?? 0;
|
|
1729
|
-
if (!Number.isFinite(weight) || weight < 0) {
|
|
1730
|
-
throw new RenderDeviceError("Skinned render item weights must be finite non-negative values", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1731
|
-
label: item.label,
|
|
1732
|
-
jointCount: skinning.jointCount,
|
|
1733
|
-
vertex,
|
|
1734
|
-
influence,
|
|
1735
|
-
weight
|
|
1736
|
-
});
|
|
1737
|
-
}
|
|
1738
|
-
if (!Number.isFinite(joint) || !Number.isInteger(joint) || joint < 0) {
|
|
1739
|
-
throw new RenderDeviceError("Skinned render item joints must be finite non-negative integer indices", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1740
|
-
label: item.label,
|
|
1741
|
-
jointCount: skinning.jointCount,
|
|
1742
|
-
vertex,
|
|
1743
|
-
influence,
|
|
1744
|
-
joint
|
|
1745
|
-
});
|
|
1746
|
-
}
|
|
1747
|
-
if (weight > 0 && joint >= skinning.jointCount) {
|
|
1748
|
-
throw new RenderDeviceError("Skinned render item joint indices must be within the uploaded skinning palette", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1749
|
-
label: item.label,
|
|
1750
|
-
jointCount: skinning.jointCount,
|
|
1751
|
-
vertex,
|
|
1752
|
-
influence,
|
|
1753
|
-
joint,
|
|
1754
|
-
weight
|
|
1755
|
-
});
|
|
1756
|
-
}
|
|
1757
|
-
weightSum += weight;
|
|
1758
|
-
}
|
|
1759
|
-
if (weightSum <= 0) {
|
|
1760
|
-
throw new RenderDeviceError("Skinned render item weights must sum to a positive value", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1761
|
-
label: item.label,
|
|
1762
|
-
jointCount: skinning.jointCount,
|
|
1763
|
-
vertex,
|
|
1764
|
-
weightSum
|
|
1765
|
-
});
|
|
1766
|
-
}
|
|
1767
|
-
if (Math.abs(weightSum - 1) > 0.02) {
|
|
1768
|
-
throw new RenderDeviceError("Skinned render item weights must be normalized before GPU skinning", "SKINNING_GEOMETRY_CONTRACT", {
|
|
1769
|
-
label: item.label,
|
|
1770
|
-
jointCount: skinning.jointCount,
|
|
1771
|
-
vertex,
|
|
1772
|
-
weightSum
|
|
1773
|
-
});
|
|
1774
|
-
}
|
|
1775
|
-
}
|
|
1776
|
-
}
|
|
1777
1756
|
function validateInstanceTransformSource(item) {
|
|
1778
1757
|
const source = item.instanceTransforms ?? [];
|
|
1779
1758
|
if (source.length === 0 || source.length % 16 !== 0) {
|
|
@@ -1789,7 +1768,7 @@ function validateInstanceTransformSource(item) {
|
|
|
1789
1768
|
}
|
|
1790
1769
|
return source;
|
|
1791
1770
|
}
|
|
1792
|
-
function isFiniteArrayLike(values) {
|
|
1771
|
+
export function isFiniteArrayLike(values) {
|
|
1793
1772
|
for (let index = 0; index < values.length; index += 1) {
|
|
1794
1773
|
if (!Number.isFinite(values[index]))
|
|
1795
1774
|
return false;
|