@woosh/meep-engine 3.78.0 → 3.78.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/engine/graphics3/GraphicsEngine.d.ts +19 -1
- package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics3/GraphicsEngine.js +24 -2
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +4 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +36 -2
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +60 -3
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +119 -0
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +563 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts +11 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts.map +1 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.js +10 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +123 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.js +355 -0
- package/src/generation/wfc/GridWFCEdge.d.ts +13 -0
- package/src/generation/wfc/GridWFCEdge.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCEdge.js +14 -0
- package/src/generation/wfc/GridWFCTileSet.d.ts +120 -0
- package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCTileSet.js +275 -0
- package/src/shade/device/pipeline/ComputePipelineManager.d.ts +8 -0
- package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
- package/src/shade/device/pipeline/ComputePipelineManager.js +18 -0
- package/src/shade/device/pipeline/RenderPipelineManager.d.ts +8 -0
- package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
- package/src/shade/device/pipeline/RenderPipelineManager.js +17 -0
- package/src/shade/playground/avboit_footprint/index.html +20 -0
- package/src/shade/playground/avboit_footprint/main.d.ts +2 -0
- package/src/shade/playground/avboit_footprint/main.d.ts.map +1 -0
- package/src/shade/playground/avboit_footprint/main.js +428 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +7 -3
- package/src/shade/playground/screen_probes/main.d.ts.map +1 -1
- package/src/shade/playground/screen_probes/main.js +7 -3
- package/src/shade/renderer/Renderer.d.ts +18 -8
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +201 -16
- package/src/shade/renderer/RendererConfiguration.d.ts +95 -0
- package/src/shade/renderer/RendererConfiguration.d.ts.map +1 -0
- package/src/shade/renderer/RendererConfiguration.js +119 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +8 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +34 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +7 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +15 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +10 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +37 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +31 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +7 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +20 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +8 -0
- 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 +14 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +7 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +13 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +11 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +71 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +13 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +9 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +47 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +6 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +17 -0
- package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
- package/src/shade/renderer/hair/GPUHairSystem.js +28 -9
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +50 -9
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -1
- package/src/shade/renderer/hair/HAIR_SIMULATION.js +71 -11
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts +22 -16
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -1
- package/src/shade/renderer/hair/shader_hair_simulate.js +151 -78
- 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 +20 -1
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +6 -0
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -1
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +11 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +6 -0
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +15 -0
- package/src/shade/renderer/particles/graph_particles.d.ts +8 -0
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +28 -3
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -0
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles_avboit.js +14 -0
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +5 -7
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +7 -0
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +15 -0
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +6 -0
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +16 -2
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts +6 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.js +9 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts +11 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.js +10 -0
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +6 -0
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +10 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +7 -0
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +21 -0
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts +7 -0
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.js +11 -1
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts +9 -0
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +29 -0
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +6 -0
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +13 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +6 -0
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +11 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +9 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.js +33 -18
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts +8 -0
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.js +42 -2
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts +6 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js +10 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +6 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +11 -0
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +8 -0
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +27 -3
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +6 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +10 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +5 -4
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -4
- package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +3 -3
- package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +3 -3
- 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 -7
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +5 -7
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts +34 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js +42 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +5 -4
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +8 -7
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +2 -2
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +4 -5
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +9 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +18 -0
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +9 -0
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +15 -0
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +6 -0
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/ReSTIRDI.js +10 -1
- package/src/shade/renderer/restir/di/graph_restir_di.d.ts +9 -0
- package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/graph_restir_di.js +19 -1
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts +6 -0
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.js +9 -0
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +7 -0
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
- package/src/shade/renderer/scene/movers/graph_scene_movers.js +11 -0
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +10 -0
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +25 -1
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts +7 -0
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts.map +1 -1
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.js +14 -0
- package/src/shade/renderer/text/shaders/shader_text_avboit.d.ts.map +1 -1
- package/src/shade/renderer/text/shaders/shader_text_avboit.js +5 -7
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +9 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +16 -1
- package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water_avboit.js +16 -13
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts +0 -33
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts.map +0 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js +0 -45
|
@@ -33,6 +33,7 @@ import { shader_nss_preprocess } from "./shader_nss_preprocess.js";
|
|
|
33
33
|
/**
|
|
34
34
|
* @typedef {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
|
|
35
35
|
* @typedef {import("../../GraphicsContext.js").GraphicsContext} GraphicsContext
|
|
36
|
+
* @typedef {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} PipelineEnquiry
|
|
36
37
|
*/
|
|
37
38
|
|
|
38
39
|
/**
|
|
@@ -78,6 +79,19 @@ import { shader_nss_preprocess } from "./shader_nss_preprocess.js";
|
|
|
78
79
|
export class NSS {
|
|
79
80
|
|
|
80
81
|
/**
|
|
82
|
+
* Offer the pipelines {@link graph_pass} dispatches — see {@link PipelineEnquiry}. They are the same for
|
|
83
|
+
* every weight bundle and every resolution, so no instance is needed to answer.
|
|
84
|
+
*
|
|
85
|
+
* @param {PipelineEnquiry} enquiry
|
|
86
|
+
*/
|
|
87
|
+
static enquirePipelines(enquiry) {
|
|
88
|
+
enquiry.compute.push(shader_nss_preprocess.pipeline);
|
|
89
|
+
enquiry.compute.push(shader_nss_conv_layer.pipeline);
|
|
90
|
+
enquiry.compute.push(shader_nss_concat.pipeline);
|
|
91
|
+
enquiry.compute.push(shader_nss_extract_feedback.pipeline);
|
|
92
|
+
enquiry.compute.push(shader_nss_postprocess.pipeline);
|
|
93
|
+
}
|
|
94
|
+
|
|
81
95
|
/**
|
|
82
96
|
* Sub-pixel jitter offset applied to the current frame's projection, in render-resolution pixels,
|
|
83
97
|
* range [-0.5, 0.5], and how far it moved since the last frame.
|
|
@@ -609,10 +623,11 @@ export class NSS {
|
|
|
609
623
|
const gr_feedback_in = graph_import_texture(graph, this.#feedback_textures[fb_idx_in], "nss_feedback_in");
|
|
610
624
|
const gr_feedback_out = graph_import_texture(graph, this.#feedback_textures[fb_idx_out], "nss_feedback_out");
|
|
611
625
|
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
];
|
|
626
|
+
// Each of these is rebound to the handle its latest writer returned. A handle names one
|
|
627
|
+
// version of a texture, and writing a texture again means attaching the version the
|
|
628
|
+
// previous writer produced, so the graph orders the two writes.
|
|
629
|
+
let pp_a = graph_import_texture(graph, this.#activation_textures[0], "nss_pp_a");
|
|
630
|
+
let pp_b = graph_import_texture(graph, this.#activation_textures[1], "nss_pp_b");
|
|
616
631
|
let skip = {
|
|
617
632
|
A: graph_import_texture(graph, this.#skip_textures[0], "nss_skip_a"),
|
|
618
633
|
B: graph_import_texture(graph, this.#skip_textures[1], "nss_skip_b"),
|
|
@@ -733,24 +748,24 @@ export class NSS {
|
|
|
733
748
|
};
|
|
734
749
|
|
|
735
750
|
// ── Encoder ──
|
|
736
|
-
|
|
737
|
-
skip.B = dispatch_conv(1,
|
|
738
|
-
|
|
739
|
-
skip.A = dispatch_conv(3,
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
751
|
+
pp_a = dispatch_conv(0, gr_preprocess_tensor, pp_a); // conv1 -> pp_a
|
|
752
|
+
skip.B = dispatch_conv(1, pp_a, skip.B); // conv2 -> skip_B
|
|
753
|
+
pp_a = dispatch_conv(2, skip.B, pp_a); // conv3 -> pp_a
|
|
754
|
+
skip.A = dispatch_conv(3, pp_a, skip.A); // conv4 -> skip_A
|
|
755
|
+
pp_b = dispatch_conv(4, skip.A, pp_b); // conv5 -> pp_b
|
|
756
|
+
pp_a = dispatch_conv(5, pp_b, pp_a); // conv6 -> pp_a
|
|
757
|
+
pp_b = dispatch_conv(6, pp_a, pp_b); // conv7 -> pp_b
|
|
743
758
|
|
|
744
759
|
// ── Decoder ──
|
|
745
|
-
|
|
746
|
-
gr_concat = dispatch_concat(
|
|
760
|
+
pp_a = dispatch_conv(7, pp_b, pp_a); // conv8 -> pp_a
|
|
761
|
+
gr_concat = dispatch_concat(pp_a, skip.A, gr_concat,
|
|
747
762
|
NSS_HEAD_INPUT_CHANNELS, NSS_CONCAT_CHANNELS); // concat[0] (conv8 + skip_A)
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
gr_concat = dispatch_concat(
|
|
763
|
+
pp_b = dispatch_conv(8, gr_concat, pp_b); // conv9 -> pp_b
|
|
764
|
+
pp_a = dispatch_conv(9, pp_b, pp_a); // conv10 -> pp_a
|
|
765
|
+
gr_concat = dispatch_concat(pp_a, skip.B, gr_concat,
|
|
751
766
|
NSS_HEAD_INPUT_CHANNELS, NSS_CONCAT_CHANNELS); // concat[1] (conv10 + skip_B)
|
|
752
|
-
|
|
753
|
-
gr_pre_output = dispatch_conv(11,
|
|
767
|
+
pp_b = dispatch_conv(10, gr_concat, pp_b); // conv11 -> pp_b
|
|
768
|
+
gr_pre_output = dispatch_conv(11, pp_b, gr_pre_output); // conv12 -> pre_output
|
|
754
769
|
|
|
755
770
|
// ── 6 parallel output heads (K0..K3, K4, FB) ──
|
|
756
771
|
// All read from the same pre_output tensor; each writes a
|
|
@@ -25,6 +25,14 @@ export class SSR {
|
|
|
25
25
|
set reprojection_mode(value: number);
|
|
26
26
|
/** @returns {SSRReprojectionMode} */
|
|
27
27
|
get reprojection_mode(): number;
|
|
28
|
+
/**
|
|
29
|
+
* Offer the pipelines {@link graph_pass} draws with as the denoising and reprojection are set now — see
|
|
30
|
+
* {@link PipelineEnquiry}. The combine pass is not among them: a frame that reads only the reflections culls it.
|
|
31
|
+
*
|
|
32
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
33
|
+
* @param {ShaderSwitchSet} shader_switches the renderer's, which the resolve is built for
|
|
34
|
+
*/
|
|
35
|
+
enquirePipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry, shader_switches: ShaderSwitchSet): void;
|
|
28
36
|
/**
|
|
29
37
|
*
|
|
30
38
|
* @param {number} x
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SSR.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/SSR.js"],"names":[],"mappings":"AAiBA;IA6EI;;;OAGG;IACH,sBAFW,OAAO,0BAA0B,EAAE,eAAe,EAkB5D;IA1ED,oBAAgB;IAWhB,2CAMC;IAZD;;;;OAIG;IACH,sCAAqE;IAoCrE,kCAMC;IAZD;;;;OAIG;IACH,6BAAmD;IAxBnD,8CAOC;IATD,iGAAiG;IACjG,yCAA2E;IAY3E,qCAMC;IARD,qCAAqC;IACrC,gCAA2D;IA6C3D;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAUhB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH;QA7BsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;QACjE,WAAW,EAA3B,MAAM;QACW,oBAAoB,GAArC,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,eAAe,EAA/B,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACqB,UAAU,EAArC,UAAU,MAAM,CAAC;QACD,cAAc,EAA9B,MAAM;QACU,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QAEuE,MAAM,GAA5F,OAAO,oDAAoD,EAAE,cAAc;QAE1D,sBAAsB,GAAvC,MAAM;QAEW,2BAA2B,GAA5C,MAAM;QAE4F,MAAM,EAAxG,OAAO,8DAA8D,EAAE,iBAAiB;QAExB,QAAQ,GAAxE,OAAO,8BAA8B,EAAE,cAAc;QACzB,MAAM,GAAlC,UAAU,MAAM,CAAC;QACA,GAAG,GAApB,MAAM;QACJ;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,WAAW,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,aAAa,EAAC,MAAM,CAAA;KAAC,CA+QtH;;CACJ;
|
|
1
|
+
{"version":3,"file":"SSR.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/SSR.js"],"names":[],"mappings":"AAiBA;IA6EI;;;OAGG;IACH,sBAFW,OAAO,0BAA0B,EAAE,eAAe,EAkB5D;IA1ED,oBAAgB;IAWhB,2CAMC;IAZD;;;;OAIG;IACH,sCAAqE;IAoCrE,kCAMC;IAZD;;;;OAIG;IACH,6BAAmD;IAxBnD,8CAOC;IATD,iGAAiG;IACjG,yCAA2E;IAY3E,qCAMC;IARD,qCAAqC;IACrC,gCAA2D;IA6C3D;;;;;;OAMG;IACH,0BAHW,OAAO,6CAA6C,EAAE,eAAe,mBACrE,eAAe,QAiCzB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAUhB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACH;QA7BsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;QACjE,WAAW,EAA3B,MAAM;QACW,oBAAoB,GAArC,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,eAAe,EAA/B,MAAM;QACU,iBAAiB,EAAjC,MAAM;QACqB,UAAU,EAArC,UAAU,MAAM,CAAC;QACD,cAAc,EAA9B,MAAM;QACU,eAAe,EAA/B,MAAM;QACoB,eAAe,GAAzC,eAAe;QAEuE,MAAM,GAA5F,OAAO,oDAAoD,EAAE,cAAc;QAE1D,sBAAsB,GAAvC,MAAM;QAEW,2BAA2B,GAA5C,MAAM;QAE4F,MAAM,EAAxG,OAAO,8DAA8D,EAAE,iBAAiB;QAExB,QAAQ,GAAxE,OAAO,8BAA8B,EAAE,cAAc;QACzB,MAAM,GAAlC,UAAU,MAAM,CAAC;QACA,GAAG,GAApB,MAAM;QACJ;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,WAAW,EAAC,MAAM,CAAC;QAAC,QAAQ,EAAC,MAAM,CAAC;QAAC,UAAU,EAAC,MAAM,CAAC;QAAC,aAAa,EAAC,MAAM,CAAA;KAAC,CA+QtH;;CACJ;gCAzd+B,0CAA0C"}
|
|
@@ -7,13 +7,13 @@ import { graph_image_pass } from "../../shader/graph/graph_image_pass.js";
|
|
|
7
7
|
import { STATIC_GRAPHICS_ENGINE_ASSETS } from "../../STATIC_GRAPHICS_ENGINE_ASSETS.js";
|
|
8
8
|
import { GPUTextureContext } from "../../texture/GPUTextureContext.js";
|
|
9
9
|
import { ssr_combine_shader } from "./ssr_combine_shader.js";
|
|
10
|
-
import { ssr_graph_prefilter_color } from "./ssr_graph_prefilter_color.js";
|
|
10
|
+
import { enquire_ssr_prefilter_color_pipelines, ssr_graph_prefilter_color } from "./ssr_graph_prefilter_color.js";
|
|
11
11
|
import { SSR_PREFILTER_MIP_COUNT } from "./SSR_PREFILTER_MIP_COUNT.js";
|
|
12
12
|
import { ssr_reproject_shader, ssr_reproject_tile_shader } from "./ssr_reproject_shader.js";
|
|
13
13
|
import { ssr_spatial_denoise_shader, ssr_spatial_denoise_metadata_shader,
|
|
14
14
|
ssr_spatial_denoise_tile_shader, ssr_spatial_denoise_metadata_tile_shader } from "./ssr_spatial_denoise_shader.js";
|
|
15
15
|
import { ssr_trace_shader } from "./ssr_trace_shader.js";
|
|
16
|
-
import { ssr_graph_denoise_tiles } from "./ssr_graph_denoise_tiles.js";
|
|
16
|
+
import { enquire_ssr_denoise_tiles_pipelines, ssr_graph_denoise_tiles } from "./ssr_graph_denoise_tiles.js";
|
|
17
17
|
|
|
18
18
|
export class SSR {
|
|
19
19
|
|
|
@@ -114,6 +114,46 @@ export class SSR {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Offer the pipelines {@link graph_pass} draws with as the denoising and reprojection are set now — see
|
|
119
|
+
* {@link PipelineEnquiry}. The combine pass is not among them: a frame that reads only the reflections culls it.
|
|
120
|
+
*
|
|
121
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
122
|
+
* @param {ShaderSwitchSet} shader_switches the renderer's, which the resolve is built for
|
|
123
|
+
*/
|
|
124
|
+
enquirePipelines(enquiry, shader_switches) {
|
|
125
|
+
const render = enquiry.render;
|
|
126
|
+
|
|
127
|
+
const spatial = this.#spatial_denoising_enabled;
|
|
128
|
+
const tiles = this.#tile_denoising_enabled
|
|
129
|
+
&& (spatial || this.#reprojection_mode !== SSRReprojectionMode.CurrentFrame);
|
|
130
|
+
|
|
131
|
+
render.push(ssr_trace_shader.pipeline);
|
|
132
|
+
|
|
133
|
+
enquire_ssr_prefilter_color_pipelines(enquiry);
|
|
134
|
+
|
|
135
|
+
render.push(ssr_resolve_shader.variant(shader_switches).pipeline);
|
|
136
|
+
|
|
137
|
+
if (tiles) {
|
|
138
|
+
enquire_ssr_denoise_tiles_pipelines(enquiry);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
if (spatial) {
|
|
142
|
+
render.push((tiles ? ssr_spatial_denoise_metadata_tile_shader : ssr_spatial_denoise_metadata_shader).pipeline);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// drawn into the history it writes
|
|
146
|
+
render.push((tiles ? ssr_reproject_tile_shader : ssr_reproject_shader).pipeline_for([
|
|
147
|
+
this.#history[0].descriptor.format,
|
|
148
|
+
this.#metadata[0].descriptor.format,
|
|
149
|
+
this.#geometry[0].descriptor.format,
|
|
150
|
+
]));
|
|
151
|
+
|
|
152
|
+
if (spatial) {
|
|
153
|
+
render.push((tiles ? ssr_spatial_denoise_tile_shader : ssr_spatial_denoise_shader).pipeline);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
117
157
|
/**
|
|
118
158
|
*
|
|
119
159
|
* @param {number} x
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offer the pipelines {@link ssr_graph_denoise_tiles} records with — see {@link PipelineEnquiry}.
|
|
3
|
+
*
|
|
4
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
5
|
+
*/
|
|
6
|
+
export function enquire_ssr_denoise_tiles_pipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
|
|
1
7
|
/**
|
|
2
8
|
* Frame-local coverage; allocation, lifetime, dependencies and timing belong to the graph.
|
|
3
9
|
* @param {object} options
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr_graph_denoise_tiles.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH;IAXsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;IACtD,UAAU,EAArC,UAAU,MAAM,CAAC;IACD,KAAK,EAArB,MAAM;IACU,QAAQ,EAAxB,MAAM;IACU,OAAO,EAAvB,MAAM;IACU,gBAAgB,EAAhC,MAAM;IACU,QAAQ,EAAxB,MAAM;IACW,aAAa,EAA9B,OAAO;IACoB,YAAY,EAAvC,UAAU,MAAM,CAAC;IACf,MAAM,CAsBlB"}
|
|
1
|
+
{"version":3,"file":"ssr_graph_denoise_tiles.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,6DAFW,OAAO,6CAA6C,EAAE,eAAe,QAK/E;AAED;;;;;;;;;;;;;GAaG;AACH;IAXsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;IACtD,UAAU,EAArC,UAAU,MAAM,CAAC;IACD,KAAK,EAArB,MAAM;IACU,QAAQ,EAAxB,MAAM;IACU,OAAO,EAAvB,MAAM;IACU,gBAAgB,EAAhC,MAAM;IACU,QAAQ,EAAxB,MAAM;IACW,aAAa,EAA9B,OAAO;IACoB,YAAY,EAAvC,UAAU,MAAM,CAAC;IACf,MAAM,CAsBlB"}
|
|
@@ -5,6 +5,16 @@ import { SSR_DENOISE_TILE_SIZE } from "./SSR_DENOISE_TILE_SIZE.js";
|
|
|
5
5
|
import { shader_ssr_denoise_tile_classify } from "./shader_ssr_denoise_tile_classify.js";
|
|
6
6
|
import { shader_ssr_denoise_tile_dilate } from "./shader_ssr_denoise_tile_dilate.js";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Offer the pipelines {@link ssr_graph_denoise_tiles} records with — see {@link PipelineEnquiry}.
|
|
10
|
+
*
|
|
11
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
12
|
+
*/
|
|
13
|
+
export function enquire_ssr_denoise_tiles_pipelines(enquiry) {
|
|
14
|
+
enquiry.compute.push(shader_ssr_denoise_tile_classify.pipeline);
|
|
15
|
+
enquiry.render.push(shader_ssr_denoise_tile_dilate.pipeline);
|
|
16
|
+
}
|
|
17
|
+
|
|
8
18
|
/**
|
|
9
19
|
* Frame-local coverage; allocation, lifetime, dependencies and timing belong to the graph.
|
|
10
20
|
* @param {object} options
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offer the pipelines {@link ssr_graph_prefilter_color} draws with — see {@link PipelineEnquiry}.
|
|
3
|
+
*
|
|
4
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
5
|
+
*/
|
|
6
|
+
export function enquire_ssr_prefilter_color_pipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
|
|
1
7
|
/**
|
|
2
8
|
* We can use blurred version of the color buffer during SSR resolve to reduce noise on rough surfaces.
|
|
3
9
|
* The downside is that it messes with temporal stability in my testing.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr_graph_prefilter_color.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;GAYG;AACH;IAP+B,KAAK;IACT,WAAW,EAA3B,MAAM;IACU,WAAW,EAA3B,MAAM;IACU,SAAS,EAAzB,MAAM;IAEY,UAAU,EAA5B,MAAM,EAAE;QA6GlB"}
|
|
1
|
+
{"version":3,"file":"ssr_graph_prefilter_color.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,+DAFW,OAAO,6CAA6C,EAAE,eAAe,QAM/E;AAED;;;;;;;;;;;;GAYG;AACH;IAP+B,KAAK;IACT,WAAW,EAA3B,MAAM;IACU,WAAW,EAA3B,MAAM;IACU,SAAS,EAAzB,MAAM;IAEY,UAAU,EAA5B,MAAM,EAAE;QA6GlB"}
|
|
@@ -6,6 +6,17 @@ import { shader_texture_copy } from "../../texture/util/shader_texture_copy.js";
|
|
|
6
6
|
import { shader_texture_sample } from "../../texture/util/shader_texture_sample.js";
|
|
7
7
|
import { downsample_karis } from "./downsample_karis.js";
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Offer the pipelines {@link ssr_graph_prefilter_color} draws with — see {@link PipelineEnquiry}.
|
|
11
|
+
*
|
|
12
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
13
|
+
*/
|
|
14
|
+
export function enquire_ssr_prefilter_color_pipelines(enquiry) {
|
|
15
|
+
enquiry.render.push(shader_texture_copy.pipeline);
|
|
16
|
+
enquiry.render.push(downsample_karis.pipeline);
|
|
17
|
+
enquiry.render.push(shader_texture_sample.pipeline);
|
|
18
|
+
}
|
|
19
|
+
|
|
9
20
|
/**
|
|
10
21
|
* We can use blurred version of the color buffer during SSR resolve to reduce noise on rough surfaces.
|
|
11
22
|
* The downside is that it messes with temporal stability in my testing.
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Offer the pipelines {@link graph_prepare_meshlet_draw_commands_by_material} dispatches — see
|
|
3
|
+
* {@link PipelineEnquiry}: a bucket's meshes read out, culled and expanded to meshlets, and those culled, counted
|
|
4
|
+
* and sorted into a draw command a material. Virtual geometry's expansion is its scenes' to offer.
|
|
5
|
+
*
|
|
6
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
7
|
+
*/
|
|
8
|
+
export function enquire_prepare_meshlet_draw_commands_by_material_pipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
|
|
1
9
|
/**
|
|
2
10
|
*
|
|
3
11
|
* @param {FrameGraph} graph
|
package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare_meshlet_draw_commands_by_material.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare_meshlet_draw_commands_by_material.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js"],"names":[],"mappings":"AAwCA;;;;;;GAMG;AACH,qFAFW,OAAO,6CAA6C,EAAE,eAAe,QAY/E;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,0LAJa;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAC;IAAC,wBAAwB,EAAE,MAAM,CAAA;CAAC,CAmWnH"}
|
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
cpu_hash_table_word_count
|
|
9
9
|
} from "../../gpu_primitive/hash_table/cpu_build_hash_table.js";
|
|
10
10
|
import {
|
|
11
|
+
enquire_prefix_scan_csdldf_pipelines,
|
|
11
12
|
graph_prefix_scan_csdldf,
|
|
12
13
|
prefix_scan_csdldf_output_descriptor
|
|
13
14
|
} from "../../gpu_primitive/prefix_sum/v1/graph_prefix_scan_csdldf.js";
|
|
@@ -19,10 +20,14 @@ import { graph_record_stat } from "../../util/graph_record_stat.js";
|
|
|
19
20
|
import {
|
|
20
21
|
build_indirect_compute_dispatch_command,
|
|
21
22
|
graph_build_indirect_dispatch_command,
|
|
22
|
-
INDIRECT_COMPUTE_COMMAND_DESCRIPTOR
|
|
23
|
+
INDIRECT_COMPUTE_COMMAND_DESCRIPTOR,
|
|
24
|
+
indirect_compute_dispatch_command_pipeline
|
|
23
25
|
} from "../../gpu_primitive/indirect/IndirectComputeCommandBuildPass.js";
|
|
24
|
-
import { graph_mesh_filter_one_way } from "../expand/graph_mesh_filter_one_way.js";
|
|
25
|
-
import {
|
|
26
|
+
import { enquire_mesh_filter_one_way_pipelines, graph_mesh_filter_one_way } from "../expand/graph_mesh_filter_one_way.js";
|
|
27
|
+
import {
|
|
28
|
+
enquire_expand_meshes_to_meshlets_pipelines,
|
|
29
|
+
graph_expand_meshes_to_meshlets
|
|
30
|
+
} from "../expand/mesh/graph_expand_meshes_to_meshlets.js";
|
|
26
31
|
import { graph_vgeo_expand_if_enabled } from "../../geometry/virtual/runtime/graph_vgeo_expand_if_enabled.js";
|
|
27
32
|
import { RasterizationCollectionType } from "../expand/RasterizationCollectionType.js";
|
|
28
33
|
import { CullPolicy } from "./construct_primitive_state.js";
|
|
@@ -33,6 +38,25 @@ import {
|
|
|
33
38
|
import { shader_read_out_bucket } from "./shader_read_out_bucket.js";
|
|
34
39
|
import { shader_sort_meshlets_by_material } from "./shader_sort_meshlets_by_material.js";
|
|
35
40
|
|
|
41
|
+
/**
|
|
42
|
+
* Offer the pipelines {@link graph_prepare_meshlet_draw_commands_by_material} dispatches — see
|
|
43
|
+
* {@link PipelineEnquiry}: a bucket's meshes read out, culled and expanded to meshlets, and those culled, counted
|
|
44
|
+
* and sorted into a draw command a material. Virtual geometry's expansion is its scenes' to offer.
|
|
45
|
+
*
|
|
46
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
47
|
+
*/
|
|
48
|
+
export function enquire_prepare_meshlet_draw_commands_by_material_pipelines(enquiry) {
|
|
49
|
+
enquiry.compute.push(shader_read_out_bucket.pipeline);
|
|
50
|
+
enquire_mesh_filter_one_way_pipelines(enquiry);
|
|
51
|
+
enquire_expand_meshes_to_meshlets_pipelines(enquiry);
|
|
52
|
+
enquiry.compute.push(indirect_compute_dispatch_command_pipeline(enquiry.device, COMPUTE_SHADER_DEFAULT_GROUP_SIZE, true));
|
|
53
|
+
enquiry.compute.push(shader_hzb_meshlet_filter_1way_full.pipeline);
|
|
54
|
+
enquiry.compute.push(shader_count_meshlets_by_material.pipeline);
|
|
55
|
+
enquire_prefix_scan_csdldf_pipelines(enquiry);
|
|
56
|
+
enquiry.compute.push(shader_sort_meshlets_by_material.pipeline);
|
|
57
|
+
enquiry.compute.push(shader_make_meshlet_indirect_draw_commands_by_material.pipeline);
|
|
58
|
+
}
|
|
59
|
+
|
|
36
60
|
/**
|
|
37
61
|
*
|
|
38
62
|
* @param {FrameGraph} graph
|
|
@@ -31,5 +31,11 @@ export class AVBOITSettings {
|
|
|
31
31
|
* @type {number}
|
|
32
32
|
*/
|
|
33
33
|
warp_steps_per_octave: number;
|
|
34
|
+
/**
|
|
35
|
+
* Take every field's value from `other`, which is left as it was. The two share nothing afterwards.
|
|
36
|
+
*
|
|
37
|
+
* @param {AVBOITSettings} other
|
|
38
|
+
*/
|
|
39
|
+
copy(other: AVBOITSettings): void;
|
|
34
40
|
}
|
|
35
41
|
//# sourceMappingURL=AVBOITSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AVBOITSettings.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;IAEI;;;;;;;;;;;;;OAaG;IACH,mCAFU,OAAO,CAEyB;IAE1C;;;;;;OAMG;IACH,uBAFU,MAAM,CAEU;
|
|
1
|
+
{"version":3,"file":"AVBOITSettings.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH;IAEI;;;;;;;;;;;;;OAaG;IACH,mCAFU,OAAO,CAEyB;IAE1C;;;;;;OAMG;IACH,uBAFU,MAAM,CAEU;IAE1B;;;;OAIG;IACH,YAFW,cAAc,QAKxB;CACJ"}
|
|
@@ -33,4 +33,14 @@ export class AVBOITSettings {
|
|
|
33
33
|
* @type {number}
|
|
34
34
|
*/
|
|
35
35
|
warp_steps_per_octave = 4;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Take every field's value from `other`, which is left as it was. The two share nothing afterwards.
|
|
39
|
+
*
|
|
40
|
+
* @param {AVBOITSettings} other
|
|
41
|
+
*/
|
|
42
|
+
copy(other) {
|
|
43
|
+
this.transmission_tint_from_base_color = other.transmission_tint_from_base_color;
|
|
44
|
+
this.warp_steps_per_octave = other.warp_steps_per_octave;
|
|
45
|
+
}
|
|
36
46
|
}
|
|
@@ -96,10 +96,11 @@ export type AVBOITSideChannel = {
|
|
|
96
96
|
/**
|
|
97
97
|
* draw the
|
|
98
98
|
* channel's fragments into the accumulators; returns their handles after the draw. A channel
|
|
99
|
-
* whose fragments splat into the volume
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* nothing into the volume
|
|
99
|
+
* whose fragments splat into the volume looks the integral up in front of `avboit_footprint_depth` (of
|
|
100
|
+
* the fragment's view depth and `fwidth` of its reciprocal, taken in uniform control flow), as the mesh
|
|
101
|
+
* draw does, and splats at the depth under each voxel column's centre, or a surface it draws at an angle
|
|
102
|
+
* occludes itself in an 8-pixel pattern; one whose fragments write nothing into the volume looks in
|
|
103
|
+
* front of the fragment's own depth.
|
|
103
104
|
* `volumetrics_irradiance` is what a fragment standing in a froxel is lit by
|
|
104
105
|
* (`chunk_volumetrics_irradiance_sh`), for a channel whose fragments are lit: the renderer's
|
|
105
106
|
* indirect lighting, whichever mode it runs, and the scene's lights, shadowed — lit as the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AVBOITSideChannel.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCc,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QACjH,QAAc,EAAE,OAAO,iCAAiC,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QACzF,aAAmB,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAChG,WAAiB,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAC;QACvD,wBAA8B,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QACjG,eAAqB,EAAE,MAAM,CAAC;QAC9B,eAAqB,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;QAC7F,MAAY,EAAE,OAAO,iEAAiE,EAAE,iBAAiB,CAAC;KACvG,KAAK;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAC;;;;;sBAMtB,CAAC,IAAI,EAAE;QACpB,KAAW,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QAClG,MAAY,EAAE,MAAM,CAAC;QACrB,kBAAwB,EAAE,UAAU,MAAM,CAAC,CAAC;QAC5C,SAAe,EAAE,MAAM,CAAC;KACrB,KAAK,MAAM;;;;;;;;kBAED,CAAC,IAAI,EAAE;QACpB,KAAW,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QAClG,MAAY,EAAE,MAAM,CAAC;QACrB,IAAU,EAAE,MAAM,CAAC;QACnB,aAAmB,EAAE,MAAM,CAAC;QAC5B,gBAAsB,EAAE,MAAM,EAAE,CAAC;QACjC,MAAY,EAAE;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC,CAAC;KACjE,KAAK;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC
|
|
1
|
+
{"version":3,"file":"AVBOITSideChannel.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAoCc,CAAC,IAAI,EAAE;QAAC,KAAK,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QACjH,QAAc,EAAE,OAAO,iCAAiC,EAAE,cAAc,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QACzF,aAAmB,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAC;QAChG,WAAiB,EAAE,MAAM,CAAC;QAAC,mBAAmB,EAAE,MAAM,CAAC;QACvD,wBAA8B,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAC;QAAC,kBAAkB,EAAE,MAAM,CAAC;QACjG,eAAqB,EAAE,MAAM,CAAC;QAC9B,eAAqB,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;QAC7F,MAAY,EAAE,OAAO,iEAAiE,EAAE,iBAAiB,CAAC;KACvG,KAAK;QAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;KAAC;;;;;sBAMtB,CAAC,IAAI,EAAE;QACpB,KAAW,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QAClG,MAAY,EAAE,MAAM,CAAC;QACrB,kBAAwB,EAAE,UAAU,MAAM,CAAC,CAAC;QAC5C,SAAe,EAAE,MAAM,CAAC;KACrB,KAAK,MAAM;;;;;;;;kBAED,CAAC,IAAI,EAAE;QACpB,KAAW,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QAClG,MAAY,EAAE,MAAM,CAAC;QACrB,IAAU,EAAE,MAAM,CAAC;QACnB,aAAmB,EAAE,MAAM,CAAC;QAC5B,gBAAsB,EAAE,MAAM,EAAE,CAAC;QACjC,MAAY,EAAE;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAC,CAAC;KACjE,KAAK;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC;;;;;;;;;;;;;;;iBAKhD,CAAC,IAAI,EAAE;QACpB,KAAW,EAAE,OAAO,iEAAiE,EAAE,UAAU,CAAC;QAClG,QAAc,EAAE,OAAO,iCAAiC,EAAE,cAAc,CAAC;QACzE,MAAY,EAAE,MAAM,CAAC;QACrB,aAAmB,EAAE,MAAM,CAAC;QAC5B,IAAU,EAAE,MAAM,CAAC;QACnB,QAAc,EAAE,MAAM,CAAC;QACvB,eAAqB,EAAE,MAAM,CAAC;QAC9B,oBAA0B,EAAE,MAAM,CAAC;QACnC,sBAA4B,EAAE;YAAC,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAC,CAAC;QACxD,YAAkB,EAAE;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC;YAAC,QAAQ,EAAE,MAAM,CAAA;SAAC,CAAC;KACrF,KAAK;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,UAAU,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAC;;;;;;sBAY9D,CAAC,IAAI,EAAE,OAAO,iCAAiC,EAAE,cAAc,KAAK,OAAO"}
|
|
@@ -80,10 +80,11 @@
|
|
|
80
80
|
* accumulators: {color: number, norm: number, extinction: number, emission: number},
|
|
81
81
|
* }) => {color: number, norm: number, extinction: number, emission: number}} avboit_draw draw the
|
|
82
82
|
* channel's fragments into the accumulators; returns their handles after the draw. A channel
|
|
83
|
-
* whose fragments splat into the volume
|
|
84
|
-
*
|
|
85
|
-
*
|
|
86
|
-
* nothing into the volume
|
|
83
|
+
* whose fragments splat into the volume looks the integral up in front of `avboit_footprint_depth` (of
|
|
84
|
+
* the fragment's view depth and `fwidth` of its reciprocal, taken in uniform control flow), as the mesh
|
|
85
|
+
* draw does, and splats at the depth under each voxel column's centre, or a surface it draws at an angle
|
|
86
|
+
* occludes itself in an 8-pixel pattern; one whose fragments write nothing into the volume looks in
|
|
87
|
+
* front of the fragment's own depth.
|
|
87
88
|
* `volumetrics_irradiance` is what a fragment standing in a froxel is lit by
|
|
88
89
|
* (`chunk_volumetrics_irradiance_sh`), for a channel whose fragments are lit: the renderer's
|
|
89
90
|
* indirect lighting, whichever mode it runs, and the scene's lights, shadowed — lit as the
|
|
@@ -81,9 +81,9 @@ export const AVBOIT_FIELD_BITS: number;
|
|
|
81
81
|
* How far toward the camera, in virtual slices, the draw pass samples the integral so that a surface
|
|
82
82
|
* does not occlude itself through its own linear splat. With the exclusive-prefix storage convention
|
|
83
83
|
* the analytic minimum is 1.5; the deck uses 2. Events closer together than this do not occlude each
|
|
84
|
-
* other and degrade to weighted blending. A surface tilted away from the camera
|
|
85
|
-
*
|
|
86
|
-
* draw also reads the neighbouring voxel columns, where a tilted one was splatted nearer.
|
|
84
|
+
* other and degrade to weighted blending. A surface tilted away from the camera takes it in front of
|
|
85
|
+
* its footprint depth (`avboit_footprint_depth`): the base bias is for a surface splatted at its own
|
|
86
|
+
* depth, and the draw also reads the neighbouring voxel columns, where a tilted one was splatted nearer.
|
|
87
87
|
* @type {number}
|
|
88
88
|
*/
|
|
89
89
|
export const AVBOIT_SAMPLE_BIAS_SLICES: number;
|
|
@@ -91,9 +91,9 @@ export const AVBOIT_FIELD_BITS = 10;
|
|
|
91
91
|
* How far toward the camera, in virtual slices, the draw pass samples the integral so that a surface
|
|
92
92
|
* does not occlude itself through its own linear splat. With the exclusive-prefix storage convention
|
|
93
93
|
* the analytic minimum is 1.5; the deck uses 2. Events closer together than this do not occlude each
|
|
94
|
-
* other and degrade to weighted blending. A surface tilted away from the camera
|
|
95
|
-
*
|
|
96
|
-
* draw also reads the neighbouring voxel columns, where a tilted one was splatted nearer.
|
|
94
|
+
* other and degrade to weighted blending. A surface tilted away from the camera takes it in front of
|
|
95
|
+
* its footprint depth (`avboit_footprint_depth`): the base bias is for a surface splatted at its own
|
|
96
|
+
* depth, and the draw also reads the neighbouring voxel columns, where a tilted one was splatted nearer.
|
|
97
97
|
* @type {number}
|
|
98
98
|
*/
|
|
99
99
|
export const AVBOIT_SAMPLE_BIAS_SLICES = 2.0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avboit_draw_fragment_body.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avboit_draw_fragment_body.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wCAFU,MAAM,CAyEV;AAEN;;;GAGG;AACH,gDAFU,WAAW,CAWnB;AAEF;;;GAGG;AACH,kCAFU,qBAAqB,CAiB3B"}
|
|
@@ -5,8 +5,7 @@ import { chunk_view_mip_bias } from "../../../view/chunk_view_mip_bias.js";
|
|
|
5
5
|
import { FORWARD_VERTEX_SHADER_STRUCT } from "../../forward/FORWARD_VERTEX_SHADER_STRUCT.js";
|
|
6
6
|
import { OIT_COVERAGE_MAX } from "../oit/OIT_CONSTANTS.js";
|
|
7
7
|
import { AVBOIT_EXTINCT_TRANSMITTANCE } from "./AVBOIT_CONSTANTS.js";
|
|
8
|
-
import {
|
|
9
|
-
import { chunk_avboit_footprint_bias } from "./chunk_avboit_footprint_bias.js";
|
|
8
|
+
import { chunk_avboit_footprint_depth } from "./chunk_avboit_footprint_depth.js";
|
|
10
9
|
import { chunk_avboit_sample_transmittance } from "./chunk_avboit_sample_transmittance.js";
|
|
11
10
|
import { chunk_avboit_transmission_tint } from "./chunk_avboit_transmission_tint.js";
|
|
12
11
|
|
|
@@ -72,11 +71,11 @@ fn main(
|
|
|
72
71
|
let frag_view_depth = get_view_space_depth(vert_adjusted.position.z, camera);
|
|
73
72
|
let frag_screen_uv = vert_adjusted.position.xy / vec2<f32>(f32(view.width), f32(view.height));
|
|
74
73
|
|
|
75
|
-
//
|
|
74
|
+
// the nearest the surface's own depth runs across a voxel, so it does not occlude itself through the
|
|
76
75
|
// neighbouring columns; taken here, in uniform control flow, before anything can discard
|
|
77
|
-
let footprint =
|
|
76
|
+
let footprint = avboit_footprint_depth(frag_view_depth, fwidth(1.0 / frag_view_depth));
|
|
78
77
|
|
|
79
|
-
let transmittance = avboit_sample_transmittance(&warp, tIntegral, sLinear, frag_screen_uv,
|
|
78
|
+
let transmittance = avboit_sample_transmittance(&warp, tIntegral, sLinear, frag_screen_uv, footprint);
|
|
80
79
|
|
|
81
80
|
if (all(transmittance <= vec3<f32>(${AVBOIT_EXTINCT_TRANSMITTANCE}))) {
|
|
82
81
|
// nothing this fragment contributes survives what is in front of it; skip the shading
|
|
@@ -125,8 +124,7 @@ export const AVBOIT_DRAW_FRAGMENT_DEPENDENCIES = [
|
|
|
125
124
|
chunk_get_view_space_depth,
|
|
126
125
|
chunk_random_initialize,
|
|
127
126
|
chunk_sample_volumetrics,
|
|
128
|
-
|
|
129
|
-
chunk_avboit_footprint_bias,
|
|
127
|
+
chunk_avboit_footprint_depth,
|
|
130
128
|
chunk_avboit_sample_transmittance,
|
|
131
129
|
chunk_avboit_transmission_tint,
|
|
132
130
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avboit_unlit_draw.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avboit_unlit_draw.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js"],"names":[],"mappings":"AA+GA;;;;;;;;;;;GAWG;AACH;IAP0B,KAAK,EAApB,MAAM;IACgG,SAAS,EAA/G,OAAO,yDAAyD,EAAE,2BAA2B;IAE9E,MAAM,EAArB,MAAM;IAEJ,wBAAwB,CAoBpC;AA3HD;;;;GAIG;AACH,2CAFU,6BAA6B,CAEyC;AAahF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,+CAFU,SAAS,CAsDjB;yCA3GuC,oEAAoE;8CAI/D,2DAA2D;0BAD/E,uCAAuC"}
|
|
@@ -11,11 +11,10 @@ import { VOLUMETRICS_METADATA_STRUCT } from "../../../volumetrics/VOLUMETRICS_ME
|
|
|
11
11
|
import { AVBOIT_EXTINCT_TRANSMITTANCE } from "./AVBOIT_CONSTANTS.js";
|
|
12
12
|
import { AVBOIT_WARP_STRUCT } from "./AVBOIT_WARP_STRUCT.js";
|
|
13
13
|
import { AVBOIT_DRAW_TARGETS } from "./avboit_draw_fragment_body.js";
|
|
14
|
-
import {
|
|
14
|
+
import { chunk_avboit_footprint_depth } from "./chunk_avboit_footprint_depth.js";
|
|
15
15
|
import { chunk_avboit_premultiplied_contribution } from "./chunk_avboit_premultiplied_contribution.js";
|
|
16
16
|
import { chunk_avboit_sample_transmittance } from "./chunk_avboit_sample_transmittance.js";
|
|
17
17
|
import { chunk_avboit_unlit_varyings } from "./chunk_avboit_unlit_varyings.js";
|
|
18
|
-
import { chunk_avboit_view_depth_to_virtual } from "./chunk_avboit_view_depth_to_virtual.js";
|
|
19
18
|
|
|
20
19
|
/**
|
|
21
20
|
* What the unlit draw reads once per pass: the view, the warp, the integral and the fog.
|
|
@@ -68,9 +67,9 @@ struct AVBOITUnlitDrawOutput {
|
|
|
68
67
|
|
|
69
68
|
@fragment
|
|
70
69
|
fn fs_main(fragment : AVBOITUnlitVaryings) -> AVBOITUnlitDrawOutput {
|
|
71
|
-
// a ribbon seen at an angle runs through depth across a voxel; see
|
|
70
|
+
// a ribbon seen at an angle runs through depth across a voxel; see avboit_footprint_depth. Taken
|
|
72
71
|
// first, in uniform control flow
|
|
73
|
-
let footprint =
|
|
72
|
+
let footprint = avboit_footprint_depth(fragment.view_depth, fwidth(1.0 / fragment.view_depth));
|
|
74
73
|
|
|
75
74
|
if (fragment.color.a <= 0.0) {
|
|
76
75
|
// faded out: covers nothing, and straight alpha carries no light without coverage
|
|
@@ -79,7 +78,7 @@ fn fs_main(fragment : AVBOITUnlitVaryings) -> AVBOITUnlitDrawOutput {
|
|
|
79
78
|
|
|
80
79
|
let screen_uv = fragment.clip.xy / vec2<f32>(f32(view.width), f32(view.height));
|
|
81
80
|
|
|
82
|
-
let transmittance = avboit_sample_transmittance(&warp, tIntegral, sLinear, screen_uv,
|
|
81
|
+
let transmittance = avboit_sample_transmittance(&warp, tIntegral, sLinear, screen_uv, footprint);
|
|
83
82
|
|
|
84
83
|
if (all(transmittance <= vec3<f32>(${AVBOIT_EXTINCT_TRANSMITTANCE}))) {
|
|
85
84
|
// nothing this fragment contributes survives what is in front of it; skip the shading
|
|
@@ -103,8 +102,7 @@ fn fs_main(fragment : AVBOITUnlitVaryings) -> AVBOITUnlitDrawOutput {
|
|
|
103
102
|
}
|
|
104
103
|
`, [
|
|
105
104
|
chunk_avboit_unlit_varyings,
|
|
106
|
-
|
|
107
|
-
chunk_avboit_footprint_bias,
|
|
105
|
+
chunk_avboit_footprint_depth,
|
|
108
106
|
chunk_avboit_sample_transmittance,
|
|
109
107
|
chunk_sample_volumetrics,
|
|
110
108
|
chunk_avboit_premultiplied_contribution,
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The nearest view depth a fragment's own surface reaches within one voxel of it — the depth the
|
|
3
|
+
* fragment has to look the integral up in front of (`avboit_sample_transmittance`), so that its own
|
|
4
|
+
* surface does not occlude it through the neighbouring voxel columns. Given the fragment's view depth
|
|
5
|
+
* and `inverse_depth_fwidth`, its `fwidth` of `1 / z_view`, which the caller takes in the fragment
|
|
6
|
+
* stage, in uniform control flow.
|
|
7
|
+
*
|
|
8
|
+
* The volume is 1/8 resolution and every column holds a surface at the depth under the column's
|
|
9
|
+
* centre. The draw reads the four nearest columns bilinearly, up to one voxel away along each screen
|
|
10
|
+
* axis. On a surface tilted away from the camera, the neighbour on its near side holds the same
|
|
11
|
+
* surface nearer by the surface's depth change over that distance, and a fragment that looked the
|
|
12
|
+
* integral up at its own depth would be occluded by it — by an amount that depends on where the pixel
|
|
13
|
+
* sits in its voxel, so the surface stripes in an 8-pixel pattern wherever something else shares its
|
|
14
|
+
* pixels (ledger entry 26).
|
|
15
|
+
*
|
|
16
|
+
* `1 / z_view` is linear across the screen for a plane, as device depth is, so its `fwidth` is the
|
|
17
|
+
* same everywhere on the plane and `AVBOIT_VOXEL_DOWNSCALE` times it is exactly how far the plane's
|
|
18
|
+
* `1 / z_view` runs over one voxel along both axes. The result is the plane's own depth there, the
|
|
19
|
+
* nearest any column the lookup reads can hold it: nearer than the fragment, and never nearer than
|
|
20
|
+
* the camera.
|
|
21
|
+
*
|
|
22
|
+
* What it costs: a tilted fragment is not occluded by what lies between that depth and itself, the
|
|
23
|
+
* depth the volume cannot tell apart from the surface at this resolution. On screen that is a band of
|
|
24
|
+
* at most the lookup's own reach beside where another surface crosses this one. A surface that curves
|
|
25
|
+
* away faster than its plane — the last pixel of a rim — is given more than it needs.
|
|
26
|
+
*
|
|
27
|
+
* A fragment that writes nothing into the volume — an additive particle's — has nothing of its own
|
|
28
|
+
* there to occlude it: its footprint depth is its own depth.
|
|
29
|
+
*
|
|
30
|
+
* @type {CodeChunk}
|
|
31
|
+
*/
|
|
32
|
+
export const chunk_avboit_footprint_depth: CodeChunk;
|
|
33
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
34
|
+
//# sourceMappingURL=chunk_avboit_footprint_depth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_avboit_footprint_depth.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,2CAFU,SAAS,CASjB;0BAzCwB,uCAAuC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
2
|
+
import { AVBOIT_VOXEL_DOWNSCALE } from "./AVBOIT_CONSTANTS.js";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The nearest view depth a fragment's own surface reaches within one voxel of it — the depth the
|
|
6
|
+
* fragment has to look the integral up in front of (`avboit_sample_transmittance`), so that its own
|
|
7
|
+
* surface does not occlude it through the neighbouring voxel columns. Given the fragment's view depth
|
|
8
|
+
* and `inverse_depth_fwidth`, its `fwidth` of `1 / z_view`, which the caller takes in the fragment
|
|
9
|
+
* stage, in uniform control flow.
|
|
10
|
+
*
|
|
11
|
+
* The volume is 1/8 resolution and every column holds a surface at the depth under the column's
|
|
12
|
+
* centre. The draw reads the four nearest columns bilinearly, up to one voxel away along each screen
|
|
13
|
+
* axis. On a surface tilted away from the camera, the neighbour on its near side holds the same
|
|
14
|
+
* surface nearer by the surface's depth change over that distance, and a fragment that looked the
|
|
15
|
+
* integral up at its own depth would be occluded by it — by an amount that depends on where the pixel
|
|
16
|
+
* sits in its voxel, so the surface stripes in an 8-pixel pattern wherever something else shares its
|
|
17
|
+
* pixels (ledger entry 26).
|
|
18
|
+
*
|
|
19
|
+
* `1 / z_view` is linear across the screen for a plane, as device depth is, so its `fwidth` is the
|
|
20
|
+
* same everywhere on the plane and `AVBOIT_VOXEL_DOWNSCALE` times it is exactly how far the plane's
|
|
21
|
+
* `1 / z_view` runs over one voxel along both axes. The result is the plane's own depth there, the
|
|
22
|
+
* nearest any column the lookup reads can hold it: nearer than the fragment, and never nearer than
|
|
23
|
+
* the camera.
|
|
24
|
+
*
|
|
25
|
+
* What it costs: a tilted fragment is not occluded by what lies between that depth and itself, the
|
|
26
|
+
* depth the volume cannot tell apart from the surface at this resolution. On screen that is a band of
|
|
27
|
+
* at most the lookup's own reach beside where another surface crosses this one. A surface that curves
|
|
28
|
+
* away faster than its plane — the last pixel of a rim — is given more than it needs.
|
|
29
|
+
*
|
|
30
|
+
* A fragment that writes nothing into the volume — an additive particle's — has nothing of its own
|
|
31
|
+
* there to occlude it: its footprint depth is its own depth.
|
|
32
|
+
*
|
|
33
|
+
* @type {CodeChunk}
|
|
34
|
+
*/
|
|
35
|
+
export const chunk_avboit_footprint_depth = CodeChunk.from(
|
|
36
|
+
//language=WGSL
|
|
37
|
+
`
|
|
38
|
+
fn avboit_footprint_depth(z_view: f32, inverse_depth_fwidth: f32) -> f32 {
|
|
39
|
+
return 1.0 / (1.0 / z_view + ${AVBOIT_VOXEL_DOWNSCALE.toFixed(1)} * inverse_depth_fwidth);
|
|
40
|
+
}
|
|
41
|
+
`
|
|
42
|
+
);
|