@woosh/meep-engine 3.75.0 → 3.77.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/editor/particles/effect/ParticleReferenceSimulation.d.ts +11 -0
- package/editor/particles/effect/ParticleReferenceSimulation.d.ts.map +1 -1
- package/editor/particles/effect/ParticleReferenceSimulation.js +14 -0
- package/editor/view/particles/effect/ParticleGraphEditorView.js +1 -1
- package/package.json +1 -1
- package/src/engine/asset/GameAssetType.d.ts +1 -0
- package/src/engine/asset/GameAssetType.js +5 -1
- package/src/engine/asset/loaders/GroomAssetLoader.d.ts +33 -0
- package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -0
- package/src/engine/asset/loaders/GroomAssetLoader.js +113 -0
- package/src/engine/graphics/ecs/hair/Hair.d.ts +54 -0
- package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
- package/src/engine/graphics/ecs/hair/Hair.js +70 -0
- package/src/engine/graphics/ecs/hair/HairDynamics.d.ts +63 -0
- package/src/engine/graphics/ecs/hair/HairDynamics.d.ts.map +1 -0
- package/src/engine/graphics/ecs/hair/HairDynamics.js +82 -0
- package/src/engine/graphics/hair/Groom.d.ts +175 -0
- package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
- package/src/engine/graphics/hair/Groom.js +249 -0
- package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +50 -0
- package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
- package/src/engine/graphics/hair/GroomSerializationAdapter.js +150 -0
- package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.d.ts +8 -0
- package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.js +31 -0
- package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +85 -0
- package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_bind_to_mesh.js +216 -0
- package/src/engine/graphics/hair/groom_build_group.d.ts +90 -0
- package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_build_group.js +496 -0
- package/src/engine/graphics/hair/groom_build_guides.d.ts +43 -0
- package/src/engine/graphics/hair/groom_build_guides.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_build_guides.js +267 -0
- package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
- package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
- package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
- package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_rank_order.js +53 -0
- package/src/engine/graphics/hair/groom_root_spacing.d.ts +14 -0
- package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
- package/src/engine/graphics/hair/groom_root_spacing.js +253 -0
- package/src/engine/graphics3/HairColliderSystem.d.ts +59 -0
- package/src/engine/graphics3/HairColliderSystem.d.ts.map +1 -0
- package/src/engine/graphics3/HairColliderSystem.js +270 -0
- package/src/engine/graphics3/HairSystem.d.ts +119 -0
- package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
- package/src/engine/graphics3/HairSystem.js +722 -0
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/assets/textures/hair_scattering.bin +0 -0
- package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
- package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
- package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
- package/src/shade/playground/hair/index.html +50 -0
- package/src/shade/playground/hair/main.d.ts +2 -0
- package/src/shade/playground/hair/main.d.ts.map +1 -0
- package/src/shade/playground/hair/main.js +297 -0
- package/src/shade/playground/hair_skinned/index.html +192 -0
- package/src/shade/playground/hair_skinned/main.d.ts +7 -0
- package/src/shade/playground/hair_skinned/main.d.ts.map +1 -0
- package/src/shade/playground/hair_skinned/main.js +481 -0
- package/src/shade/playground/hair_skinned/skinned_hair.d.ts +49 -0
- package/src/shade/playground/hair_skinned/skinned_hair.d.ts.map +1 -0
- package/src/shade/playground/hair_skinned/skinned_hair.js +362 -0
- package/src/shade/playground/screen_probes/README.md +54 -0
- package/src/shade/playground/screen_probes/index.html +271 -0
- package/src/shade/playground/screen_probes/main.d.ts +8 -0
- package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
- package/src/shade/playground/screen_probes/main.js +527 -0
- package/src/shade/playground/sparks/README.md +36 -0
- package/src/shade/playground/sparks/index.html +145 -0
- package/src/shade/playground/sparks/main.d.ts +7 -0
- package/src/shade/playground/sparks/main.d.ts.map +1 -0
- package/src/shade/playground/sparks/main.js +312 -0
- package/src/shade/playground/sparks/sparks_effect.d.ts +72 -0
- package/src/shade/playground/sparks/sparks_effect.d.ts.map +1 -0
- package/src/shade/playground/sparks/sparks_effect.js +180 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +72 -11
- package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
- package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
- package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
- package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
- package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts +3 -2
- package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
- package/src/shade/renderer/animation/GPUAnimationManager.js +74 -3
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +13 -3
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +16 -5
- package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.js +8 -8
- package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
- package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
- package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
- package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
- package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +19 -6
- package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +30 -21
- package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
- package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
- package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
- package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
- package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
- package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
- package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
- package/src/shade/renderer/extension/ShadowAtlas.d.ts +75 -0
- package/src/shade/renderer/extension/ShadowAtlas.d.ts.map +1 -0
- package/src/shade/renderer/extension/ShadowAtlas.js +133 -0
- package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
- package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
- package/src/shade/renderer/extension/ViewLighting.js +168 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +37 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +132 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +3 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
- package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
- package/src/shade/renderer/global_illumination/sharc/sharc_constants.d.ts +0 -18
- package/src/shade/renderer/global_illumination/sharc/sharc_constants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/sharc/sharc_constants.js +1 -21
- package/src/shade/renderer/hair/GPUHairSystem.d.ts +278 -0
- package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
- package/src/shade/renderer/hair/GPUHairSystem.js +2263 -0
- package/src/shade/renderer/hair/HAIR.d.ts +121 -0
- package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
- package/src/shade/renderer/hair/HAIR.js +136 -0
- package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
- package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
- package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +104 -0
- package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +15 -0
- package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
- package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +70 -0
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +139 -0
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -0
- package/src/shade/renderer/hair/HAIR_SIMULATION.js +160 -0
- package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
- package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
- package/src/shade/renderer/hair/HairFrame.js +76 -0
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +37 -0
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +158 -0
- package/src/shade/renderer/hair/chunk_hair_guide.d.ts +59 -0
- package/src/shade/renderer/hair/chunk_hair_guide.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_guide.js +179 -0
- package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
- package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
- package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
- package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
- package/src/shade/renderer/hair/chunk_hair_volume.d.ts +32 -0
- package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
- package/src/shade/renderer/hair/chunk_hair_volume.js +115 -0
- package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
- package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
- package/src/shade/renderer/hair/hair_id_draw.js +135 -0
- package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
- package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
- package/src/shade/renderer/hair/hair_lighting.js +279 -0
- package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
- package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
- package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
- package/src/shade/renderer/hair/hair_shadow_draw.d.ts +32 -0
- package/src/shade/renderer/hair/hair_shadow_draw.d.ts.map +1 -0
- package/src/shade/renderer/hair/hair_shadow_draw.js +123 -0
- package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
- package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
- package/src/shade/renderer/hair/hair_stamp.js +175 -0
- package/src/shade/renderer/hair/shader_hair_classes.d.ts +22 -0
- package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_classes.js +90 -0
- package/src/shade/renderer/hair/shader_hair_cull.d.ts +37 -0
- package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_cull.js +251 -0
- package/src/shade/renderer/hair/shader_hair_lod.d.ts +39 -0
- package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_lod.js +362 -0
- package/src/shade/renderer/hair/shader_hair_roots.d.ts +36 -0
- package/src/shade/renderer/hair/shader_hair_roots.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_roots.js +261 -0
- package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts +44 -0
- package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_shadow_list.js +240 -0
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts +55 -0
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_simulate.js +563 -0
- package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
- package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
- package/src/shade/renderer/hair/shader_hair_volume.js +154 -0
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
- package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
- package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
- package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +65 -0
- package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
- package/src/shade/renderer/loader/usd/usd_groom_extension.js +470 -0
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +28 -0
- package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph/ParticleNodeRegistry.js +22 -0
- package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.js +4 -0
- package/src/shade/renderer/particles/graph/groups/particle_groups_scene.d.ts +32 -0
- package/src/shade/renderer/particles/graph/groups/particle_groups_scene.d.ts.map +1 -0
- package/src/shade/renderer/particles/graph/groups/particle_groups_scene.js +80 -0
- package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph/particle_node_parameters.js +1 -0
- package/src/shade/renderer/particles/graph/particle_node_presentation.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph/particle_node_presentation.js +12 -0
- package/src/shade/renderer/particles/graph_particles.d.ts +5 -1
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +18 -3
- package/src/shade/renderer/particles/isa/InstructionStream.d.ts +25 -0
- package/src/shade/renderer/particles/isa/InstructionStream.d.ts.map +1 -1
- package/src/shade/renderer/particles/isa/InstructionStream.js +25 -0
- package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts +9 -0
- package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts.map +1 -1
- package/src/shade/renderer/particles/isa/ParticleVMISA.js +20 -0
- package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.d.ts +9 -0
- package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.d.ts.map +1 -0
- package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.js +29 -0
- package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts +2 -1
- package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts.map +1 -1
- package/src/shade/renderer/particles/optimizer/particle_program_equivalence.js +27 -5
- package/src/shade/renderer/particles/optimizer/particle_program_fuzz.js +1 -1
- package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts.map +1 -1
- package/src/shade/renderer/particles/optimizer/particle_vm_semantics.js +5 -0
- package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts +7 -0
- package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts.map +1 -1
- package/src/shade/renderer/particles/runtime/EmitterRegistry.js +10 -0
- package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +5 -0
- package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
- package/src/shade/renderer/particles/runtime/ParticleEmitter.js +5 -0
- package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts +8 -0
- package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts.map +1 -1
- package/src/shade/renderer/particles/runtime/ProgramHeap.js +25 -0
- package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit.js +9 -3
- package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.js +4 -2
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts +2 -2
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_simulate.js +10 -4
- package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.js +4 -2
- package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts +14 -1
- package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts.map +1 -1
- package/src/shade/renderer/particles/vm/ParticleVMReference.js +34 -1
- package/src/shade/renderer/particles/vm/chunk_particle_vm.d.ts.map +1 -1
- package/src/shade/renderer/particles/vm/chunk_particle_vm.js +10 -0
- package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.d.ts +39 -0
- package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.d.ts.map +1 -0
- package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.js +90 -0
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +4 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +14 -2
- package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts +1 -1
- package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.js +9 -3
- package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.js +4 -2
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
- package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
- package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts +7 -4
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +26 -16
- package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
- package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
- package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +18 -0
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
- package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
- package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
- package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
- package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
- package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.d.ts +20 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.js +134 -0
- package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
- package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
- package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +15 -0
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +69 -0
- package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.d.ts +10 -0
- package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.d.ts.map +1 -0
- package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.js +22 -0
- package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
- package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
|
@@ -210,8 +210,9 @@ export class GPUMeshSkinningContext {
|
|
|
210
210
|
#dispatch_lookup_capacity = 0;
|
|
211
211
|
|
|
212
212
|
/**
|
|
213
|
-
* Side-buffer holding
|
|
214
|
-
*
|
|
213
|
+
* Side-buffer holding where every clone meshlet's vertices stood
|
|
214
|
+
* a frame ago, in the space {@link prev_positions_buffer}
|
|
215
|
+
* states. Laid out as
|
|
215
216
|
* tightly-packed `vec3<f32>` (3 × u32 words, f32 bit pattern)
|
|
216
217
|
* per vertex; each clone meshlet owns a contiguous slice of
|
|
217
218
|
* `vertex_count` vec3s starting at the offset recorded in
|
|
@@ -339,9 +340,19 @@ export class GPUMeshSkinningContext {
|
|
|
339
340
|
}
|
|
340
341
|
|
|
341
342
|
/**
|
|
342
|
-
* Side-buffer of
|
|
343
|
-
*
|
|
344
|
-
* has been
|
|
343
|
+
* Side-buffer of every clone vertex posed by the animation
|
|
344
|
+
* manager's `prev_skin_matrices_buffer`, for the velocity
|
|
345
|
+
* post-pass. `null` until the first skinning binding has been
|
|
346
|
+
* registered.
|
|
347
|
+
*
|
|
348
|
+
* The positions are in the mesh node's space of the **current**
|
|
349
|
+
* frame: the previous skin matrices are blended under this
|
|
350
|
+
* frame's `inverse(node.global)`, as the current ones are for the
|
|
351
|
+
* clone itself. A reader takes one to the world by the node's
|
|
352
|
+
* current `global`, and has where the vertex stood a frame ago —
|
|
353
|
+
* or where it stands now, on a frame the manager seeded
|
|
354
|
+
* "previous" from "current" for the skin, which reads as no
|
|
355
|
+
* motion.
|
|
345
356
|
*
|
|
346
357
|
* @returns {GPUBuffer|null}
|
|
347
358
|
*/
|
|
@@ -58,7 +58,7 @@ resources.createGroup()
|
|
|
58
58
|
.addStorageBuffer('skinning_bindings', WebGPUArray.from(SKINNING_BINDING_STRUCT), false)
|
|
59
59
|
.addStorageBuffer('dispatch_lookup', WebGPUArray.from(u32), false)
|
|
60
60
|
// Per-meshlet base u32-word offset into the side-buffer that
|
|
61
|
-
// holds
|
|
61
|
+
// holds where each vertex stood a frame ago. Sentinel
|
|
62
62
|
// `0xFFFFFFFF` for non-clone meshlets — those skip the
|
|
63
63
|
// prev-position write entirely, since the velocity post-pass
|
|
64
64
|
// will fall back to per-object math for them.
|
|
@@ -259,23 +259,23 @@ fn main(
|
|
|
259
259
|
meshlet_data[clone_pos_addr + 1u] = bitcast<u32>(p_skinned.y);
|
|
260
260
|
meshlet_data[clone_pos_addr + 2u] = bitcast<u32>(p_skinned.z);
|
|
261
261
|
|
|
262
|
-
//
|
|
262
|
+
// Where the vertex stood a frame ago: same dual-quat math,
|
|
263
263
|
// but driven by prev_skin_matrices instead of skin_matrices.
|
|
264
264
|
// Written to the side-buffer at the per-meshlet base
|
|
265
265
|
// offset + v * 3 u32 words. The velocity post-pass reads
|
|
266
266
|
// these to interpolate per-vertex skin deformation across
|
|
267
|
-
// the rasterized triangle
|
|
268
|
-
// → mesh.prev_global delta that Stage 1's path captures).
|
|
267
|
+
// the rasterized triangle.
|
|
269
268
|
//
|
|
270
269
|
// Skipping the write when there's no slot for this meshlet
|
|
271
270
|
// (non-clone — shouldn't be hit by this shader's dispatch
|
|
272
271
|
// set, but the guard is cheap). The dual-quat build is
|
|
273
272
|
// also skipped to save the per-joint work.
|
|
274
273
|
if has_prev_positions {
|
|
275
|
-
//
|
|
276
|
-
// position is
|
|
277
|
-
//
|
|
278
|
-
//
|
|
274
|
+
// In the mesh node's space of THIS frame, the same one
|
|
275
|
+
// the current-frame position is in: the previous skin
|
|
276
|
+
// matrices under this frame's inverse(mesh.global). A
|
|
277
|
+
// reader takes it to the world by this frame's
|
|
278
|
+
// mesh.global.
|
|
279
279
|
let prev_dq_blend = skin_blend_mesh_local(
|
|
280
280
|
inv_mesh_world,
|
|
281
281
|
prev_skin_matrices[skin_base + j0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_read_gBuffer_material.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_read_gBuffer_material.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_read_gBuffer_material.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_read_gBuffer_material.js"],"names":[],"mappings":"AAWA,oDAyDE;0BA5DwB,iCAAiC"}
|
|
@@ -4,6 +4,7 @@ import { chunk_rgbe9995_decode } from "../shader/chunk/color/rgbe9995/chunk_rgbe
|
|
|
4
4
|
import { chunk_decode_g_buffer_metalness } from "../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
|
|
5
5
|
import { chunk_decode_g_buffer_roughness } from "../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
|
|
6
6
|
import { chunk_metalness_to_specular_color } from "../shader/chunk/material/chunk_metalness_to_specular_color.js";
|
|
7
|
+
import { chunk_metalness_to_specular_F90 } from "../shader/chunk/material/chunk_metalness_to_specular_F90.js";
|
|
7
8
|
import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
|
|
8
9
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
9
10
|
import { GBUFFER_ALBEDO_RESOURCE, GBUFFER_EMISSIVE_RESOURCE, GBUFFER_PBR_RESOURCE } from "./GBUFFER_RESOURCES.js";
|
|
@@ -48,7 +49,7 @@ fn read_gBuffer_material(
|
|
|
48
49
|
material.roughness = max(f_roughness, ${BSDF_ROUGHNESS_MINIMUM});
|
|
49
50
|
|
|
50
51
|
material.specularF0 = metalness_to_specular_color(f_metalness, albedo);
|
|
51
|
-
material.specularF90 =
|
|
52
|
+
material.specularF90 = metalness_to_specular_F90(f_metalness, albedo);
|
|
52
53
|
material.specularF0_dielectric = vec3(MIN_DIELECTRICS_F0);
|
|
53
54
|
material.specularF0_metal = albedo;
|
|
54
55
|
|
|
@@ -59,6 +60,7 @@ fn read_gBuffer_material(
|
|
|
59
60
|
`, [
|
|
60
61
|
MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
|
|
61
62
|
chunk_metalness_to_specular_color,
|
|
63
|
+
chunk_metalness_to_specular_F90,
|
|
62
64
|
chunk_MIN_DIELECTRICS_F0,
|
|
63
65
|
chunk_decode_g_buffer_roughness,
|
|
64
66
|
chunk_decode_g_buffer_metalness,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every light that reaches a point: each occupied directional light, then every point and spot light of the froxel
|
|
3
|
+
* cluster the point falls in, each shadow-mapped at the point and handed to the including shader's lobe:
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn shade_direct_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f,
|
|
7
|
+
* coord: vec2f, view_depth: f32)
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* `coord` is the pixel and `view_depth` the planar view depth the cluster is looked up by. The lobe, its context and
|
|
11
|
+
* the normal the shadows are taken along are the including shader's, by name, as {@link chunk_shade_directional_lights}
|
|
12
|
+
* describes. A point or spot light that its shadow hides entirely is not handed on.
|
|
13
|
+
*
|
|
14
|
+
* **Every light the cell lists is handed on; there is no budget.** A surface's direct light changes at the pixel, and
|
|
15
|
+
* stopping part-way through the list would keep a different set in each of two neighbouring cells, which list
|
|
16
|
+
* different lights, and step at their shared edge. So the cost follows the scene: a point shades as many point and
|
|
17
|
+
* spot lights as its cell lists, each with its shadow map.
|
|
18
|
+
*
|
|
19
|
+
* @type {CodeChunk}
|
|
20
|
+
*/
|
|
21
|
+
export const chunk_shade_direct_lights: CodeChunk;
|
|
22
|
+
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
23
|
+
//# sourceMappingURL=chunk_shade_direct_lights.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_shade_direct_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_direct_lights.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wCAFU,SAAS,CA4EjB;0BAnGwB,iCAAiC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { chunk_light_cluster_counts } from "../light/cluster/chunk_light_cluster_counts.js";
|
|
2
|
+
import { chunk_light_cluster_metadata_by_position } from "../light/cluster/chunk_light_cluster_metadata_by_position.js";
|
|
3
|
+
import { LIGHT_CLUSTER_DATA_RESOURCE } from "../light/cluster/LIGHT_CLUSTER_RESOURCES.js";
|
|
4
|
+
import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
|
|
5
|
+
import { chunk_get_point_light_info_by_index } from "../shader/chunk/light/io/chunk_get_point_light_info_by_index.js";
|
|
6
|
+
import { chunk_get_spot_light_info_by_index } from "../shader/chunk/light/io/chunk_get_spot_light_info_by_index.js";
|
|
7
|
+
import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
|
|
8
|
+
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
9
|
+
import { chunk_shadowmap_get_light_visibility } from "../shadow/map/shader/chunk_shadowmap_get_light_visibility.js";
|
|
10
|
+
import { VIEW_RESOURCE } from "../view/VIEW_RESOURCE.js";
|
|
11
|
+
import { chunk_shade_directional_lights } from "./chunk_shade_directional_lights.js";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Every light that reaches a point: each occupied directional light, then every point and spot light of the froxel
|
|
15
|
+
* cluster the point falls in, each shadow-mapped at the point and handed to the including shader's lobe:
|
|
16
|
+
*
|
|
17
|
+
* ```wgsl
|
|
18
|
+
* fn shade_direct_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f,
|
|
19
|
+
* coord: vec2f, view_depth: f32)
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* `coord` is the pixel and `view_depth` the planar view depth the cluster is looked up by. The lobe, its context and
|
|
23
|
+
* the normal the shadows are taken along are the including shader's, by name, as {@link chunk_shade_directional_lights}
|
|
24
|
+
* describes. A point or spot light that its shadow hides entirely is not handed on.
|
|
25
|
+
*
|
|
26
|
+
* **Every light the cell lists is handed on; there is no budget.** A surface's direct light changes at the pixel, and
|
|
27
|
+
* stopping part-way through the list would keep a different set in each of two neighbouring cells, which list
|
|
28
|
+
* different lights, and step at their shared edge. So the cost follows the scene: a point shades as many point and
|
|
29
|
+
* spot lights as its cell lists, each with its shadow map.
|
|
30
|
+
*
|
|
31
|
+
* @type {CodeChunk}
|
|
32
|
+
*/
|
|
33
|
+
export const chunk_shade_direct_lights = CodeChunk.from(
|
|
34
|
+
//language=WGSL
|
|
35
|
+
`
|
|
36
|
+
fn shade_direct_lights(
|
|
37
|
+
context: ptr<function, DirectLightContext>,
|
|
38
|
+
position: vec3<f32>,
|
|
39
|
+
view_direction: vec3<f32>,
|
|
40
|
+
coord: vec2<f32>,
|
|
41
|
+
view_depth: f32,
|
|
42
|
+
) {
|
|
43
|
+
shade_directional_lights(context, position, view_direction);
|
|
44
|
+
|
|
45
|
+
// Process local lights (point, then spot)
|
|
46
|
+
let cluster_metadata = light_cluster_metadata_by_position(
|
|
47
|
+
coord.xy,
|
|
48
|
+
view_depth,
|
|
49
|
+
vec2(view.width, view.height)
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
let cluster_offset = cluster_metadata.offset;
|
|
53
|
+
let point_count = light_cluster_count_point(cluster_metadata.counts);
|
|
54
|
+
let spot_count = light_cluster_count_spot(cluster_metadata.counts);
|
|
55
|
+
|
|
56
|
+
for (var i = 0u; i < point_count; i++) {
|
|
57
|
+
let light_index = cluster_data[cluster_offset + i];
|
|
58
|
+
|
|
59
|
+
var direct_light = get_point_light_info_by_index(&light_data, light_index, position);
|
|
60
|
+
|
|
61
|
+
let visibility = shadowmap_get_point_light_visibility(
|
|
62
|
+
&light_data,
|
|
63
|
+
light_index,
|
|
64
|
+
position,
|
|
65
|
+
direct_light_visibility_normal(context, direct_light)
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
direct_light.color *= visibility;
|
|
69
|
+
|
|
70
|
+
if (all(direct_light.color == vec3(0.0))) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
direct_light_lobe(context, direct_light, false);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
for (var j = 0u; j < spot_count; j++) {
|
|
78
|
+
let light_index = cluster_data[cluster_offset + point_count + j];
|
|
79
|
+
|
|
80
|
+
var direct_light = get_spot_light_info_by_index(&light_data, light_index, position);
|
|
81
|
+
|
|
82
|
+
let visibility = shadowmap_get_spot_light_visibility(
|
|
83
|
+
&light_data,
|
|
84
|
+
light_index,
|
|
85
|
+
position,
|
|
86
|
+
direct_light_visibility_normal(context, direct_light)
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
direct_light.color *= visibility;
|
|
90
|
+
|
|
91
|
+
if (all(direct_light.color == vec3(0.0))) {
|
|
92
|
+
continue;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
direct_light_lobe(context, direct_light, true);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
`, [
|
|
99
|
+
INCIDENT_LIGHT_STRUCT.declaration_chunk,
|
|
100
|
+
chunk_shade_directional_lights,
|
|
101
|
+
chunk_light_cluster_metadata_by_position,
|
|
102
|
+
chunk_light_cluster_counts,
|
|
103
|
+
chunk_get_point_light_info_by_index,
|
|
104
|
+
chunk_get_spot_light_info_by_index,
|
|
105
|
+
chunk_shadowmap_get_light_visibility,
|
|
106
|
+
]
|
|
107
|
+
);
|
|
108
|
+
|
|
109
|
+
chunk_shade_direct_lights.requireResource(LIGHT_CLUSTER_DATA_RESOURCE);
|
|
110
|
+
chunk_shade_direct_lights.requireResource(LIGHT_DATA_RESOURCE);
|
|
111
|
+
chunk_shade_direct_lights.requireResource(VIEW_RESOURCE);
|
|
@@ -1,11 +1,24 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
* atlas for visibility.
|
|
2
|
+
* Every occupied directional light (at most 32, enforced by GPULightCollection), shadow-mapped at a point and
|
|
3
|
+
* handed to the including shader's lobe:
|
|
5
4
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn shade_directional_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f)
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* The lobe is the including shader's, by name. It defines:
|
|
10
|
+
*
|
|
11
|
+
* - `struct DirectLightContext`, whatever the lobe reads and accumulates into;
|
|
12
|
+
* - `fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: IncidentLight, atlas_casters: bool)`,
|
|
13
|
+
* given each light with its colour already multiplied by the light's shadow visibility at `position`, and
|
|
14
|
+
* whether that shadow holds the casters drawn through `ShadowAtlas`: a directional light's cascades and a spot
|
|
15
|
+
* light's map do, a virtual shadow map and a point light's do not;
|
|
16
|
+
* - `fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: IncidentLight) -> vec3f`,
|
|
17
|
+
* the normal the shadow lookup offsets along and culls back faces by: a light behind it is not visible. A lobe
|
|
18
|
+
* lit from every side (a strand) answers the light's own direction, which culls nothing and offsets nothing.
|
|
19
|
+
*
|
|
20
|
+
* Linked by the clustered and the ReSTIR direct shading alike, through {@link chunk_shade_direct_lights} for the
|
|
21
|
+
* former; the standard material's lobe is `chunk_standard_material_direct_light_lobe`.
|
|
9
22
|
*
|
|
10
23
|
* @type {CodeChunk}
|
|
11
24
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_shade_directional_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_directional_lights.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_shade_directional_lights.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_directional_lights.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,6CAFU,SAAS,CAqCjB;0BAhEwB,iCAAiC"}
|
|
@@ -4,22 +4,33 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
chunk_get_directional_light_info_by_index
|
|
6
6
|
} from "../shader/chunk/light/io/chunk_get_directional_light_info_by_index.js";
|
|
7
|
-
import {
|
|
8
|
-
import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
|
|
9
|
-
import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
|
|
10
|
-
import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
|
|
7
|
+
import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
|
|
11
8
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
9
|
+
import { chunk_shadowmap_directional_atlas_casters } from "../shadow/map/shader/chunk_shadowmap_directional_atlas_casters.js";
|
|
12
10
|
import { chunk_shadowmap_get_light_visibility } from "../shadow/map/shader/chunk_shadowmap_get_light_visibility.js";
|
|
13
11
|
import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
|
|
14
12
|
|
|
15
13
|
/**
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* atlas for visibility.
|
|
14
|
+
* Every occupied directional light (at most 32, enforced by GPULightCollection), shadow-mapped at a point and
|
|
15
|
+
* handed to the including shader's lobe:
|
|
19
16
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
17
|
+
* ```wgsl
|
|
18
|
+
* fn shade_directional_lights(context: ptr<function, DirectLightContext>, position: vec3f, view_direction: vec3f)
|
|
19
|
+
* ```
|
|
20
|
+
*
|
|
21
|
+
* The lobe is the including shader's, by name. It defines:
|
|
22
|
+
*
|
|
23
|
+
* - `struct DirectLightContext`, whatever the lobe reads and accumulates into;
|
|
24
|
+
* - `fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: IncidentLight, atlas_casters: bool)`,
|
|
25
|
+
* given each light with its colour already multiplied by the light's shadow visibility at `position`, and
|
|
26
|
+
* whether that shadow holds the casters drawn through `ShadowAtlas`: a directional light's cascades and a spot
|
|
27
|
+
* light's map do, a virtual shadow map and a point light's do not;
|
|
28
|
+
* - `fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: IncidentLight) -> vec3f`,
|
|
29
|
+
* the normal the shadow lookup offsets along and culls back faces by: a light behind it is not visible. A lobe
|
|
30
|
+
* lit from every side (a strand) answers the light's own direction, which culls nothing and offsets nothing.
|
|
31
|
+
*
|
|
32
|
+
* Linked by the clustered and the ReSTIR direct shading alike, through {@link chunk_shade_direct_lights} for the
|
|
33
|
+
* former; the standard material's lobe is `chunk_standard_material_direct_light_lobe`.
|
|
23
34
|
*
|
|
24
35
|
* @type {CodeChunk}
|
|
25
36
|
*/
|
|
@@ -27,9 +38,9 @@ export const chunk_shade_directional_lights = CodeChunk.from(
|
|
|
27
38
|
//language=WGSL
|
|
28
39
|
`
|
|
29
40
|
fn shade_directional_lights(
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
41
|
+
context: ptr<function, DirectLightContext>,
|
|
42
|
+
position: vec3<f32>,
|
|
43
|
+
view_direction: vec3<f32>,
|
|
33
44
|
) {
|
|
34
45
|
var directional_bits = directional_lights_iteration_mask(&light_data);
|
|
35
46
|
while (directional_bits != 0u) {
|
|
@@ -41,24 +52,22 @@ fn shade_directional_lights(
|
|
|
41
52
|
let visibility = shadowmap_get_directional_light_visibility(
|
|
42
53
|
&light_data,
|
|
43
54
|
directional_index,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
55
|
+
position,
|
|
56
|
+
view_direction,
|
|
57
|
+
direct_light_visibility_normal(context, direct_light)
|
|
47
58
|
);
|
|
48
59
|
|
|
49
60
|
direct_light.color *= visibility;
|
|
50
61
|
|
|
51
|
-
|
|
62
|
+
direct_light_lobe(context, direct_light, SHADOWMAP_DIRECTIONAL_ATLAS_CASTERS);
|
|
52
63
|
}
|
|
53
64
|
}
|
|
54
65
|
`, [
|
|
55
|
-
|
|
56
|
-
GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
|
|
57
|
-
MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
|
|
58
|
-
chunk_re_direct_physical,
|
|
66
|
+
INCIDENT_LIGHT_STRUCT.declaration_chunk,
|
|
59
67
|
chunk_get_directional_light_info_by_index,
|
|
60
68
|
chunk_directional_lights_iteration_mask,
|
|
61
69
|
chunk_shadowmap_get_light_visibility,
|
|
70
|
+
chunk_shadowmap_directional_atlas_casters,
|
|
62
71
|
]
|
|
63
72
|
);
|
|
64
73
|
|
|
@@ -1,29 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Brute-force direct shading of a standard material: every
|
|
3
|
-
*
|
|
4
|
-
* shadow-mapped
|
|
2
|
+
* Brute-force direct shading of a standard material: every light that reaches the point
|
|
3
|
+
* ({@link chunk_shade_direct_lights}: each occupied directional light, then every point and spot light in the froxel
|
|
4
|
+
* cluster, each shadow-mapped) through the standard material's lobe, then the multiple-scattering compensation and
|
|
5
|
+
* the emission.
|
|
5
6
|
*
|
|
6
|
-
* **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* WGSL function name, with the cluster metadata lookup, the point loop, the spot loop and the
|
|
10
|
-
* emissive sum character-identical between the two and only the directional half differing: this copy
|
|
11
|
-
* re-inlined `chunk_shade_directional_lights`' body where the other called it. Two files one edit away
|
|
12
|
-
* from shading the same scene differently depending on which of them the pass reached.
|
|
7
|
+
* **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it (through the
|
|
8
|
+
* `_deferred` choice next door) and so does `chunk_forward_shade_standard_fragment`, so two passes one edit apart
|
|
9
|
+
* cannot shade the same scene differently.
|
|
13
10
|
*
|
|
14
|
-
* The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
|
|
11
|
+
* The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different function — it
|
|
12
|
+
* replaces the cluster loop with one resampled, ray-traced sample — and stays separate. The deferred pass links one
|
|
13
|
+
* of the two by a shader switch (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
|
|
18
14
|
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
* cells, which list different lights, and step at their shared edge. So the cost follows the scene: a
|
|
22
|
-
* pixel shades as many point and spot lights as its cell lists, each with its shadow map.
|
|
23
|
-
*
|
|
24
|
-
* A note carried by the inlined copy, kept because it is still true and now has nowhere else to sit:
|
|
25
|
-
* a screen-space ray-trace for directional visibility would be wanted on the deferred path only, and
|
|
26
|
-
* adding it means splitting these paths again deliberately rather than by accident.
|
|
15
|
+
* A screen-space ray-trace for directional visibility would be wanted on the deferred path only, and adding it means
|
|
16
|
+
* splitting these paths again deliberately rather than by accident.
|
|
27
17
|
*
|
|
28
18
|
* @type {CodeChunk}
|
|
29
19
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_shade_standard_material_direct.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_shade_standard_material_direct.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;GAkBG;AACH,mDAFU,SAAS,CAgCjB;0BArDwB,iCAAiC"}
|
|
@@ -1,45 +1,27 @@
|
|
|
1
|
-
import { chunk_light_cluster_counts } from "../light/cluster/chunk_light_cluster_counts.js";
|
|
2
|
-
import { chunk_light_cluster_metadata_by_position } from "../light/cluster/chunk_light_cluster_metadata_by_position.js";
|
|
3
|
-
import { chunk_get_point_light_info_by_index } from "../shader/chunk/light/io/chunk_get_point_light_info_by_index.js";
|
|
4
|
-
import { chunk_get_spot_light_info_by_index } from "../shader/chunk/light/io/chunk_get_spot_light_info_by_index.js";
|
|
5
1
|
import { REFLECTED_LIGHT_STRUCT } from "../shader/chunk/light/REFLECTED_LIGHT_STRUCT.js";
|
|
6
2
|
import { chunk_re_direct_multiscatter } from "../shader/chunk/material/chunk_re_direct_multiscatter.js";
|
|
7
|
-
import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
|
|
8
3
|
import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
|
|
9
4
|
import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
|
|
10
5
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { LIGHT_CLUSTER_DATA_RESOURCE } from "../light/cluster/LIGHT_CLUSTER_RESOURCES.js";
|
|
14
|
-
import { LIGHT_DATA_RESOURCE } from "../light/LIGHT_DATA_RESOURCE.js";
|
|
15
|
-
import { VIEW_RESOURCE } from "../view/VIEW_RESOURCE.js";
|
|
6
|
+
import { chunk_shade_direct_lights } from "./chunk_shade_direct_lights.js";
|
|
7
|
+
import { chunk_standard_material_direct_light_lobe } from "./chunk_standard_material_direct_light_lobe.js";
|
|
16
8
|
|
|
17
9
|
/**
|
|
18
|
-
* Brute-force direct shading of a standard material: every
|
|
19
|
-
*
|
|
20
|
-
* shadow-mapped
|
|
10
|
+
* Brute-force direct shading of a standard material: every light that reaches the point
|
|
11
|
+
* ({@link chunk_shade_direct_lights}: each occupied directional light, then every point and spot light in the froxel
|
|
12
|
+
* cluster, each shadow-mapped) through the standard material's lobe, then the multiple-scattering compensation and
|
|
13
|
+
* the emission.
|
|
21
14
|
*
|
|
22
|
-
* **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* WGSL function name, with the cluster metadata lookup, the point loop, the spot loop and the
|
|
26
|
-
* emissive sum character-identical between the two and only the directional half differing: this copy
|
|
27
|
-
* re-inlined `chunk_shade_directional_lights`' body where the other called it. Two files one edit away
|
|
28
|
-
* from shading the same scene differently depending on which of them the pass reached.
|
|
15
|
+
* **One chunk, linked by both the deferred and the forward paths.** `shader_deferred_main` links it (through the
|
|
16
|
+
* `_deferred` choice next door) and so does `chunk_forward_shade_standard_fragment`, so two passes one edit apart
|
|
17
|
+
* cannot shade the same scene differently.
|
|
29
18
|
*
|
|
30
|
-
* The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
|
|
19
|
+
* The ReSTIR DI variant ({@link chunk_shade_standard_material_direct_restir}) is a genuinely different function — it
|
|
20
|
+
* replaces the cluster loop with one resampled, ray-traced sample — and stays separate. The deferred pass links one
|
|
21
|
+
* of the two by a shader switch (`chunk_shade_standard_material_direct_deferred`), not via a runtime branch.
|
|
34
22
|
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* cells, which list different lights, and step at their shared edge. So the cost follows the scene: a
|
|
38
|
-
* pixel shades as many point and spot lights as its cell lists, each with its shadow map.
|
|
39
|
-
*
|
|
40
|
-
* A note carried by the inlined copy, kept because it is still true and now has nowhere else to sit:
|
|
41
|
-
* a screen-space ray-trace for directional visibility would be wanted on the deferred path only, and
|
|
42
|
-
* adding it means splitting these paths again deliberately rather than by accident.
|
|
23
|
+
* A screen-space ray-trace for directional visibility would be wanted on the deferred path only, and adding it means
|
|
24
|
+
* splitting these paths again deliberately rather than by accident.
|
|
43
25
|
*
|
|
44
26
|
* @type {CodeChunk}
|
|
45
27
|
*/
|
|
@@ -53,68 +35,15 @@ fn shade_standard_material_direct(
|
|
|
53
35
|
view_depth: f32,
|
|
54
36
|
) -> vec3<f32>{
|
|
55
37
|
|
|
56
|
-
var
|
|
57
|
-
|
|
58
|
-
shade_directional_lights(material, geometry, &reflected_light);
|
|
59
|
-
|
|
60
|
-
// Process local lights (point, then spot)
|
|
61
|
-
let cluster_metadata = light_cluster_metadata_by_position(
|
|
62
|
-
coord.xy,
|
|
63
|
-
view_depth,
|
|
64
|
-
vec2(view.width, view.height)
|
|
65
|
-
);
|
|
66
|
-
|
|
67
|
-
let cluster_offset = cluster_metadata.offset;
|
|
68
|
-
let point_count = light_cluster_count_point(cluster_metadata.counts);
|
|
69
|
-
let spot_count = light_cluster_count_spot(cluster_metadata.counts);
|
|
70
|
-
|
|
71
|
-
for (var i = 0u; i < point_count; i++) {
|
|
72
|
-
let light_index = cluster_data[cluster_offset + i];
|
|
73
|
-
|
|
74
|
-
var direct_light = get_point_light_info_by_index(&light_data, light_index, geometry.position);
|
|
75
|
-
|
|
76
|
-
let visibility = shadowmap_get_point_light_visibility(
|
|
77
|
-
&light_data,
|
|
78
|
-
light_index,
|
|
79
|
-
geometry.position,
|
|
80
|
-
geometry.shading_normal
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
direct_light.color *= visibility;
|
|
38
|
+
var context = DirectLightContext(material, geometry, ${REFLECTED_LIGHT_STRUCT.wgsl_ref}());
|
|
84
39
|
|
|
85
|
-
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
40
|
+
shade_direct_lights(&context, geometry.position, geometry.view_direction, coord, view_depth);
|
|
88
41
|
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
for (var j = 0u; j < spot_count; j++) {
|
|
93
|
-
let light_index = cluster_data[cluster_offset + point_count + j];
|
|
94
|
-
|
|
95
|
-
var direct_light = get_spot_light_info_by_index(&light_data, light_index, geometry.position);
|
|
96
|
-
|
|
97
|
-
let visibility = shadowmap_get_spot_light_visibility(
|
|
98
|
-
&light_data,
|
|
99
|
-
light_index,
|
|
100
|
-
geometry.position,
|
|
101
|
-
geometry.shading_normal
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
direct_light.color *= visibility;
|
|
105
|
-
|
|
106
|
-
if (all(direct_light.color == vec3(0.0))) {
|
|
107
|
-
continue;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
re_direct_physical(direct_light, geometry, material, &reflected_light);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
re_direct_multiscatter(geometry, material, &reflected_light);
|
|
42
|
+
re_direct_multiscatter(geometry, material, &context.reflected);
|
|
114
43
|
|
|
115
44
|
var total_emissive_radiance = vec3(material.emissive);
|
|
116
45
|
|
|
117
|
-
let outgoing_light =
|
|
46
|
+
let outgoing_light = context.reflected.diffuse + context.reflected.specular + total_emissive_radiance;
|
|
118
47
|
|
|
119
48
|
return outgoing_light;
|
|
120
49
|
}
|
|
@@ -122,17 +51,8 @@ fn shade_standard_material_direct(
|
|
|
122
51
|
REFLECTED_LIGHT_STRUCT.declaration_chunk,
|
|
123
52
|
GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
|
|
124
53
|
MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
|
|
125
|
-
|
|
54
|
+
chunk_standard_material_direct_light_lobe,
|
|
55
|
+
chunk_shade_direct_lights,
|
|
126
56
|
chunk_re_direct_multiscatter,
|
|
127
|
-
chunk_light_cluster_metadata_by_position,
|
|
128
|
-
chunk_light_cluster_counts,
|
|
129
|
-
chunk_get_point_light_info_by_index,
|
|
130
|
-
chunk_get_spot_light_info_by_index,
|
|
131
|
-
chunk_shade_directional_lights,
|
|
132
|
-
chunk_shadowmap_get_light_visibility,
|
|
133
57
|
]
|
|
134
58
|
);
|
|
135
|
-
|
|
136
|
-
chunk_shade_standard_material_direct.requireResource(LIGHT_CLUSTER_DATA_RESOURCE);
|
|
137
|
-
chunk_shade_standard_material_direct.requireResource(LIGHT_DATA_RESOURCE);
|
|
138
|
-
chunk_shade_standard_material_direct.requireResource(VIEW_RESOURCE);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_shade_standard_material_direct_restir.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_shade_standard_material_direct_restir.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;GAYG;AACH,0DAFU,SAAS,CAiCjB;0BAjDwB,iCAAiC"}
|
|
@@ -4,6 +4,7 @@ import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRI
|
|
|
4
4
|
import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
|
|
5
5
|
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
6
6
|
import { chunk_shade_directional_lights } from "./chunk_shade_directional_lights.js";
|
|
7
|
+
import { chunk_standard_material_direct_light_lobe } from "./chunk_standard_material_direct_light_lobe.js";
|
|
7
8
|
import { RESTIR_RADIANCE_RESOURCE } from "../restir/di/RESTIR_RADIANCE_RESOURCE.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -29,23 +30,24 @@ fn shade_standard_material_direct(
|
|
|
29
30
|
view_depth: f32,
|
|
30
31
|
) -> vec3<f32>{
|
|
31
32
|
|
|
32
|
-
var
|
|
33
|
+
var context = DirectLightContext(material, geometry, ${REFLECTED_LIGHT_STRUCT.wgsl_ref}());
|
|
33
34
|
|
|
34
|
-
shade_directional_lights(
|
|
35
|
+
shade_directional_lights(&context, geometry.position, geometry.view_direction);
|
|
35
36
|
|
|
36
|
-
re_direct_multiscatter(geometry, material, &
|
|
37
|
+
re_direct_multiscatter(geometry, material, &context.reflected);
|
|
37
38
|
|
|
38
39
|
// ReSTIR-resolved point + spot direct lighting (already visibility-tested).
|
|
39
40
|
let restir_radiance = textureLoad(tRestirRadiance, vec2<u32>(coord), 0).rgb;
|
|
40
41
|
|
|
41
42
|
let total_emissive_radiance = vec3(material.emissive);
|
|
42
43
|
|
|
43
|
-
return
|
|
44
|
+
return context.reflected.diffuse + context.reflected.specular + total_emissive_radiance + restir_radiance;
|
|
44
45
|
}
|
|
45
46
|
`, [
|
|
46
47
|
REFLECTED_LIGHT_STRUCT.declaration_chunk,
|
|
47
48
|
GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
|
|
48
49
|
MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
|
|
50
|
+
chunk_standard_material_direct_light_lobe,
|
|
49
51
|
chunk_shade_directional_lights,
|
|
50
52
|
chunk_re_direct_multiscatter,
|
|
51
53
|
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The standard material's lobe for the direct-light loops ({@link chunk_shade_direct_lights},
|
|
3
|
+
* `chunk_shade_directional_lights`): its context carries the material and the geometry at the shaded point and
|
|
4
|
+
* accumulates the reflected light, and each light goes through `re_direct_physical`. Shadows are taken along the
|
|
5
|
+
* shading normal.
|
|
6
|
+
*
|
|
7
|
+
* ```wgsl
|
|
8
|
+
* struct DirectLightContext { material: MaterialShadingInfo, geometry: GeometricShadingInfo, reflected: ReflectedLight }
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* @type {CodeChunk}
|
|
12
|
+
*/
|
|
13
|
+
export const chunk_standard_material_direct_light_lobe: CodeChunk;
|
|
14
|
+
import { CodeChunk } from "../shader/compiler/CodeChunk.js";
|
|
15
|
+
//# sourceMappingURL=chunk_standard_material_direct_light_lobe.d.ts.map
|