@woosh/meep-engine 3.50.0 → 3.51.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.
Files changed (112) hide show
  1. package/package.json +1 -1
  2. package/src/engine/graphics3/make_default_environment.d.ts.map +1 -1
  3. package/src/engine/graphics3/make_default_environment.js +11 -5
  4. package/src/shade/playground/particle_ecs/moonlit_environment.d.ts.map +1 -1
  5. package/src/shade/playground/particle_ecs/moonlit_environment.js +11 -5
  6. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.d.ts.map +1 -1
  7. package/src/shade/playground/sh_exponential/sh_exp_playground_shaders.js +3 -1
  8. package/src/shade/renderer/atmosphere/chunk_sample_environment_color.d.ts +3 -0
  9. package/src/shade/renderer/atmosphere/chunk_sample_environment_color.d.ts.map +1 -1
  10. package/src/shade/renderer/atmosphere/chunk_sample_environment_color.js +11 -8
  11. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts +6 -0
  12. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
  13. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +227 -215
  14. package/src/shade/renderer/deferred/SHADING_LIGHT_RESOURCE_GROUP.d.ts.map +1 -1
  15. package/src/shade/renderer/deferred/SHADING_LIGHT_RESOURCE_GROUP.js +2 -0
  16. package/src/shade/renderer/deferred/indirect/chunk_get_ibl_irradiance.d.ts.map +1 -1
  17. package/src/shade/renderer/deferred/indirect/chunk_get_ibl_irradiance.js +4 -2
  18. package/src/shade/renderer/deferred/indirect/chunk_get_ibl_radiance.d.ts.map +1 -1
  19. package/src/shade/renderer/deferred/indirect/chunk_get_ibl_radiance.js +4 -2
  20. package/src/shade/renderer/deferred/shader_background.d.ts.map +1 -1
  21. package/src/shade/renderer/deferred/shader_background.js +4 -2
  22. package/src/shade/renderer/global_illumination/brick4/gpu/bake/shader_brick4_bake_probes.d.ts.map +1 -1
  23. package/src/shade/renderer/global_illumination/brick4/gpu/bake/shader_brick4_bake_probes.js +3 -1
  24. package/src/shade/renderer/global_illumination/ibl/shader_diffuse_IBL.d.ts.map +1 -1
  25. package/src/shade/renderer/global_illumination/ibl/shader_diffuse_IBL.js +3 -1
  26. package/src/shade/renderer/global_illumination/ibl/shader_specular_IBL.d.ts.map +1 -1
  27. package/src/shade/renderer/global_illumination/ibl/shader_specular_IBL.js +3 -1
  28. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts.map +1 -1
  29. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.js +3 -1
  30. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +1 -1
  31. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +4 -2
  32. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  33. package/src/shade/renderer/light/GPULightCollection.js +44 -0
  34. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_RESOURCE.d.ts +2 -1
  35. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_RESOURCE.d.ts.map +1 -1
  36. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_RESOURCE.js +3 -2
  37. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.d.ts +14 -0
  38. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.d.ts.map +1 -0
  39. package/src/shade/renderer/light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js +25 -0
  40. package/src/shade/renderer/light/environment/execute_filter_environment_map.d.ts.map +1 -1
  41. package/src/shade/renderer/light/environment/execute_filter_environment_map.js +3 -4
  42. package/src/shade/renderer/light/environment/octahedral_skirt_matches.d.ts +19 -0
  43. package/src/shade/renderer/light/environment/octahedral_skirt_matches.d.ts.map +1 -0
  44. package/src/shade/renderer/light/environment/octahedral_skirt_matches.js +67 -0
  45. package/src/shade/renderer/light/environment/octahedral_skirt_source_texel.d.ts +16 -0
  46. package/src/shade/renderer/light/environment/octahedral_skirt_source_texel.d.ts.map +1 -0
  47. package/src/shade/renderer/light/environment/octahedral_skirt_source_texel.js +35 -0
  48. package/src/shade/renderer/light/environment/resample_cube_to_octahedral.d.ts +7 -2
  49. package/src/shade/renderer/light/environment/resample_cube_to_octahedral.d.ts.map +1 -1
  50. package/src/shade/renderer/light/environment/resample_cube_to_octahedral.js +23 -7
  51. package/src/shade/renderer/light/environment/resample_equirectangular_to_octahedral.d.ts +8 -2
  52. package/src/shade/renderer/light/environment/resample_equirectangular_to_octahedral.d.ts.map +1 -1
  53. package/src/shade/renderer/light/environment/resample_equirectangular_to_octahedral.js +24 -7
  54. package/src/shade/renderer/light/environment/sampler2d_octahedral_skirt_fill.d.ts +12 -0
  55. package/src/shade/renderer/light/environment/sampler2d_octahedral_skirt_fill.d.ts.map +1 -0
  56. package/src/shade/renderer/light/environment/sampler2d_octahedral_skirt_fill.js +54 -0
  57. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts +2 -2
  58. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.d.ts.map +1 -1
  59. package/src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js +5 -4
  60. package/src/shade/renderer/light/environment/shader_convolve_reflection_map.d.ts.map +1 -1
  61. package/src/shade/renderer/light/environment/shader_convolve_reflection_map.js +13 -9
  62. package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts.map +1 -1
  63. package/src/shade/renderer/light/environment/shader_project_environment_sh.js +3 -1
  64. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.d.ts.map +1 -1
  65. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js +3 -1
  66. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.d.ts.map +1 -1
  67. package/src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js +3 -1
  68. package/src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.d.ts.map +1 -1
  69. package/src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.js +3 -1
  70. package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
  71. package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +3 -1
  72. package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -1
  73. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  74. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +3 -1
  75. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +0 -5
  76. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts.map +1 -1
  77. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +0 -6
  78. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.d.ts.map +1 -1
  79. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.js +4 -1
  80. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  81. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +3 -0
  82. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  83. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +3 -0
  84. package/src/shade/renderer/shader/chunk/color/tonemap/chunk_PAPER_WHITE_NITS.js +1 -1
  85. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.d.ts +15 -0
  86. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.d.ts.map +1 -0
  87. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.js +27 -0
  88. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.d.ts +18 -0
  89. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.d.ts.map +1 -0
  90. package/src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js +24 -0
  91. package/src/shade/renderer/shader/chunk/texture/sample/chunk_sample_environment_map.d.ts +18 -1
  92. package/src/shade/renderer/shader/chunk/texture/sample/chunk_sample_environment_map.d.ts.map +1 -1
  93. package/src/shade/renderer/shader/chunk/texture/sample/chunk_sample_environment_map.js +45 -27
  94. package/src/shade/renderer/view/GPUViewSkyContext.js +169 -169
  95. package/src/shade/renderer/volumetrics/NOTES.md +209 -0
  96. package/src/shade/renderer/volumetrics/VOLUMETRICS_METADATA_STRUCT.d.ts.map +1 -1
  97. package/src/shade/renderer/volumetrics/VOLUMETRICS_METADATA_STRUCT.js +1 -1
  98. package/src/shade/renderer/volumetrics/chunk_volumetrics_media_group_list.d.ts +36 -0
  99. package/src/shade/renderer/volumetrics/chunk_volumetrics_media_group_list.d.ts.map +1 -0
  100. package/src/shade/renderer/volumetrics/chunk_volumetrics_media_group_list.js +129 -0
  101. package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
  102. package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +75 -0
  103. package/src/shade/renderer/volumetrics/shader_volumetrics_bin_participating_media.d.ts +26 -0
  104. package/src/shade/renderer/volumetrics/shader_volumetrics_bin_participating_media.d.ts.map +1 -0
  105. package/src/shade/renderer/volumetrics/shader_volumetrics_bin_participating_media.js +110 -0
  106. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.d.ts.map +1 -1
  107. package/src/shade/renderer/volumetrics/shader_volumetrics_build_participating_media.js +38 -14
  108. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.d.ts.map +1 -1
  109. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +9 -4
  110. package/src/shade/renderer/volumetrics/shader_volumetrics_split_participating_media.d.ts +31 -0
  111. package/src/shade/renderer/volumetrics/shader_volumetrics_split_participating_media.d.ts.map +1 -0
  112. package/src/shade/renderer/volumetrics/shader_volumetrics_split_participating_media.js +139 -0
@@ -10,8 +10,8 @@
10
10
  */
11
11
  export const SH_EXP_MAX_TEXELS_PER_CELL_SIDE: number;
12
12
  /**
13
- * First pass of the SH-exponential encoder: integrates the octahedral environment's level 0 down to a
14
- * coarse octahedral grid of `cell_resolution²` cells, each a direction and its radiance times solid
13
+ * First pass of the SH-exponential encoder: integrates the octahedral environment's level 0 — the
14
+ * square inside its one-texel skirt, so no texel is counted twice — down to a coarse octahedral grid of `cell_resolution²` cells, each a direction and its radiance times solid
15
15
  * angle — the quadrature the reference reflectance is integrated over.
16
16
  *
17
17
  * Writes two `vec4` per cell into `cells`: `(direction, 0)`, then `(radiance * solid_angle, solid_angle)`.
@@ -1 +1 @@
1
- {"version":3,"file":"shader_sh_exp_environment_cells.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,8CAFU,MAAM,CAEkC;AA0GlD;;;;;;;;;;;;;;;GAeG;AACH,8CAFU,aAAa,CAMpB;8BA/I2B,kCAAkC"}
1
+ {"version":3,"file":"shader_sh_exp_environment_cells.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/light/environment/sh_exponential/shader_sh_exp_environment_cells.js"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,8CAFU,MAAM,CAEkC;AA2GlD;;;;;;;;;;;;;;;GAeG;AACH,8CAFU,aAAa,CAMpB;8BAhJ2B,kCAAkC"}
@@ -59,7 +59,8 @@ fn main(
59
59
  let cell_x = cell % resolution;
60
60
  let cell_y = cell / resolution;
61
61
 
62
- let source_resolution = textureDimensions(tEnvironment, 0).x;
62
+ // the octahedral square only: the one-texel skirt around it repeats texels already counted
63
+ let source_resolution = textureDimensions(tEnvironment, 0).x - 2u;
63
64
  let inverse_source_resolution = 1.0 / f32(source_resolution);
64
65
 
65
66
  // The source texels whose centres fall in this cell. A source coarser than the grid has none in
@@ -97,7 +98,7 @@ fn main(
97
98
  let uv = (vec2<f32>(texel) + 0.5) * inverse_source_resolution;
98
99
 
99
100
  let solid_angle = octahedral_solid_angle(uv, inverse_source_resolution) * f32(block_size.x * block_size.y);
100
- let radiance = textureLoad(tEnvironment, texel, 0).rgb;
101
+ let radiance = textureLoad(tEnvironment, texel + 1u, 0).rgb;
101
102
 
102
103
  accumulated += vec4<f32>(radiance * solid_angle, solid_angle);
103
104
  }
@@ -125,8 +126,8 @@ fn main(
125
126
  ]);
126
127
 
127
128
  /**
128
- * First pass of the SH-exponential encoder: integrates the octahedral environment's level 0 down to a
129
- * coarse octahedral grid of `cell_resolution²` cells, each a direction and its radiance times solid
129
+ * First pass of the SH-exponential encoder: integrates the octahedral environment's level 0 — the
130
+ * square inside its one-texel skirt, so no texel is counted twice — down to a coarse octahedral grid of `cell_resolution²` cells, each a direction and its radiance times solid
130
131
  * angle — the quadrature the reference reflectance is integrated over.
131
132
  *
132
133
  * Writes two `vec4` per cell into `cells`: `(direction, 0)`, then `(radiance * solid_angle, solid_angle)`.
@@ -1 +1 @@
1
- {"version":3,"file":"shader_convolve_reflection_map.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_convolve_reflection_map.js"],"names":[],"mappings":"AA6HA,2DAII;8BA/G0B,+BAA+B"}
1
+ {"version":3,"file":"shader_convolve_reflection_map.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_convolve_reflection_map.js"],"names":[],"mappings":"AAiIA,2DAII;8BAnH0B,+BAA+B"}
@@ -11,10 +11,10 @@ import {
11
11
  import { chunk_uniform_sample_cone } from "../../shader/chunk/geometry/ray/chunk_uniform_sample_cone.js";
12
12
  import { chunk_safe_rcp } from "../../shader/chunk/math/chunk_safe_rcp.js";
13
13
  import { chunk_hammersley_2d } from "../../shader/chunk/noise/chunk_hammersley_2d.js";
14
- import { chunk_texel_coordinate_to_uv } from "../../shader/chunk/texture/chunk_texel_coordinate_to_uv.js";
15
14
  import {
16
- chunk_texture_octahedral_sample_bilinear
17
- } from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_sample_bilinear.js";
15
+ chunk_texture_octahedral_skirt_texel_uv
16
+ } from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.js";
17
+ import { chunk_texture_octahedral_skirt_uv } from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
18
18
  import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
19
19
  import { ComputeShader } from "../../shader/ComputeShader.js";
20
20
  import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
@@ -23,6 +23,7 @@ import { chunk_reflection_sample_weight } from "./chunk_reflection_sample_weight
23
23
  import { chunk_roughness_from_relative_mip } from "./chunk_roughness_from_relative_mip.js";
24
24
  import { chunk_sphere_probe_lod_to_roughness } from "./chunk_sphere_probe_lod_to_roughness.js";
25
25
  import { BSDF_ROUGHNESS_MINIMUM } from "./DEFINES.js";
26
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "./ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
26
27
 
27
28
  const resources = new ShaderResourceSetDescriptor();
28
29
 
@@ -32,8 +33,9 @@ const resources = new ShaderResourceSetDescriptor();
32
33
  resources.setImmediate("read_lod", "u32");
33
34
 
34
35
  resources.createGroup()
35
- .addTexture("input")
36
+ .addTexture("input", "float")
36
37
  .addStorageTexture("output", "rgba16float")
38
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
37
39
  ;
38
40
 
39
41
  /**
@@ -78,7 +80,8 @@ fn main(
78
80
  let mip_roughness_clamped = max(mip_roughness, ${BSDF_ROUGHNESS_MINIMUM});
79
81
  let cone_cos = cone_cosine_from_roughness(mip_roughness_clamped);
80
82
 
81
- let out_uv = texel_coordinate_to_uv(vec2<f32>(output_texel_i), output_size);
83
+ // the skirt too: a skirt texel takes its interior twin's uv, so it is that texel, computed again
84
+ let out_uv = texture_octahedral_skirt_texel_uv(output_texel_i, output_size.x);
82
85
  let out_direction = uv_octahedral_unit_decode( out_uv );
83
86
 
84
87
  let basis = build_orthonormal_matrix_n(out_direction);
@@ -88,14 +91,15 @@ fn main(
88
91
 
89
92
  const sample_count = ${SAMPLE_COUNT};
90
93
 
91
- let input_size = textureDimensions(input).xy;
94
+ let input_size = f32(textureDimensions(input).x);
92
95
 
93
96
  for (var i = 0u; i < sample_count; i++) {
94
97
  let rand = hammersley_2d(i, sample_count);
95
98
 
96
99
  let in_direction = normalize(basis * uniform_sample_cone(rand, cone_cos));
97
100
 
98
- let radiance = texture_octahedral_sample_bilinear(input, vec2(0u), input_size.x, in_direction, 0);
101
+ let in_uv = texture_octahedral_skirt_uv(uv_octahedral_unit_encode(in_direction), input_size);
102
+ let radiance = textureSampleLevel(input, sEnvironment, in_uv, 0.0);
99
103
 
100
104
  let weight = reflection_sample_weight(out_direction, in_direction, mip_roughness_clamped);
101
105
 
@@ -113,10 +117,10 @@ fn main(
113
117
  chunk_build_orthonormal_matrix_n,
114
118
  chunk_safe_rcp,
115
119
  chunk_uniform_sample_cone,
116
- chunk_texel_coordinate_to_uv,
120
+ chunk_texture_octahedral_skirt_texel_uv,
121
+ chunk_texture_octahedral_skirt_uv,
117
122
  chunk_uv_octahedral_unit_decode,
118
123
  chunk_uv_octahedral_unit_encode,
119
- chunk_texture_octahedral_sample_bilinear,
120
124
  chunk_reflection_sample_weight,
121
125
  chunk_cone_cosine_from_roughness,
122
126
  chunk_roughness_from_relative_mip
@@ -1 +1 @@
1
- {"version":3,"file":"shader_project_environment_sh.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_project_environment_sh.js"],"names":[],"mappings":"AAWA;;;;;;;;GAQG;AACH,kCAFU,WAAW,CAEyC;AAE9D;;;;;;GAMG;AACH,0CAFU,MAAM,CAE+B;AAuF/C;;;;;;;;;;;;;;GAcG;AACH,4CAFU,aAAa,CAMpB;4BA/HyB,kCAAkC;8BAFhC,+BAA+B"}
1
+ {"version":3,"file":"shader_project_environment_sh.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_project_environment_sh.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,kCAFU,WAAW,CAEyC;AAE9D;;;;;;GAMG;AACH,0CAFU,MAAM,CAE+B;AAwF/C;;;;;;;;;;;;;;GAcG;AACH,4CAFU,aAAa,CAMpB;4BAjIyB,kCAAkC;8BAFhC,+BAA+B"}
@@ -8,6 +8,7 @@ import { ComputeShader } from "../../shader/ComputeShader.js";
8
8
  import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
9
9
  import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
10
10
  import { vec4f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
11
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "./ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
11
12
 
12
13
  /**
13
14
  * The layout {@link shader_project_environment_sh} writes: the environment's radiance as RGB SH2,
@@ -33,7 +34,8 @@ const resources = new ShaderResourceSetDescriptor();
33
34
 
34
35
  resources.createGroup()
35
36
  // read texel by texel (texture_octahedral_sample_bilinear), as the forward path reads it
36
- .addTexture("tEnvironment")
37
+ .addTexture("tEnvironment", "float")
38
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
37
39
  .addStorageBuffer("output", ENVIRONMENT_SH_TYPE, true);
38
40
 
39
41
  const body = CodeChunk.from(
@@ -1 +1 @@
1
- {"version":3,"file":"shader_lightmap_viz_to_irradiance_flat.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js"],"names":[],"mappings":"AA4OA,iEASE;4BA3M0B,6BAA6B"}
1
+ {"version":3,"file":"shader_lightmap_viz_to_irradiance_flat.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_irradiance_flat.js"],"names":[],"mappings":"AA8OA,iEASE;4BA7M0B,6BAA6B"}
@@ -47,6 +47,7 @@ import { sr_create_group_RTX } from "../../geometry/sr_create_group_RTX.js";
47
47
  import { PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR } from "../../volumetrics/noise/PARTICIPATING_MEDIA_NOISE.js";
48
48
  import { wind_field_add_resources } from "../../wind/wind_field_add_resources.js";
49
49
  import { chunk_lightmap_geometry_uv_to_atlas } from "../chunk_lightmap_geometry_uv_to_atlas.js";
50
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
50
51
 
51
52
  const resources = new ShaderResourceSetDescriptor();
52
53
  sr_create_group_RTX(resources);
@@ -60,7 +61,8 @@ resources.createGroup()
60
61
  // the scene's wind, which carries the fog volumes' noise: one uniform, one texture, one sampler
61
62
  wind_field_add_resources(resources.createGroup()
62
63
  .addStorageBuffer("light_data", WebGPUArray.u32)
63
- .addTexture("tEnvironment", "unfilterable-float", "2d")
64
+ .addTexture("tEnvironment", "float", "2d")
65
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
64
66
  // the fog volumes' noise, read through participating_media_volume_density_at
65
67
  .addTexture("tParticipatingMediaNoise", "float", "3d")
66
68
  .addSampler("sParticipatingMediaNoise", "filtering", PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR));
@@ -1 +1 @@
1
- {"version":3,"file":"shader_lightmap_viz_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js"],"names":[],"mappings":"AAyOA,oDAOE;4BAxM0B,6BAA6B"}
1
+ {"version":3,"file":"shader_lightmap_viz_to_sh.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/lightmap/bake/shader_lightmap_viz_to_sh.js"],"names":[],"mappings":"AA2OA,oDAOE;4BA1M0B,6BAA6B"}
@@ -47,6 +47,7 @@ import { LIGHTMAP_SH_COLOR_TARGETS_DESCRIPTOR } from "./LIGHTMAP_SH_COLOR_TARGET
47
47
  import { LIGHTMAP_SH_FRAGMENT_OUTPUT } from "./LIGHTMAP_SH_FRAGMENT_OUTPUT.js";
48
48
  import { PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR } from "../../volumetrics/noise/PARTICIPATING_MEDIA_NOISE.js";
49
49
  import { wind_field_add_resources } from "../../wind/wind_field_add_resources.js";
50
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
50
51
 
51
52
  const resources = new ShaderResourceSetDescriptor();
52
53
  sr_create_group_RTX(resources);
@@ -60,7 +61,8 @@ resources.createGroup()
60
61
  // the scene's wind, which carries the fog volumes' noise: one uniform, one texture, one sampler
61
62
  wind_field_add_resources(resources.createGroup()
62
63
  .addStorageBuffer("light_data", WebGPUArray.u32)
63
- .addTexture("tEnvironment", "unfilterable-float", "2d")
64
+ .addTexture("tEnvironment", "float", "2d")
65
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
64
66
  // the fog volumes' noise, read through participating_media_volume_density_at
65
67
  .addTexture("tParticipatingMediaNoise", "float", "3d")
66
68
  .addSampler("sParticipatingMediaNoise", "filtering", PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR));
@@ -1 +1 @@
1
- {"version":3,"file":"shader_accumulating_path_tracer.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.js"],"names":[],"mappings":"AAoBA,2DAKG;AAmFH,4DAIG;6BA9G0B,mCAAmC;8BAOlC,+BAA+B"}
1
+ {"version":3,"file":"shader_accumulating_path_tracer.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/path_tracer/accumulating/shader_accumulating_path_tracer.js"],"names":[],"mappings":"AAqBA,2DAKG;AAoFH,4DAIG;6BAhH0B,mCAAmC;8BAOlC,+BAA+B"}
@@ -15,6 +15,7 @@ import { MEDIA_TABLE_STRUCT } from "../../medium/MEDIA_TABLE_STRUCT.js";
15
15
  import { chunk_render_trace_path } from "../shader/chunk_render_trace_path.js";
16
16
  import { PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR } from "../../volumetrics/noise/PARTICIPATING_MEDIA_NOISE.js";
17
17
  import { wind_field_add_resources } from "../../wind/wind_field_add_resources.js";
18
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
18
19
 
19
20
  const resources = new ShaderResourceSetDescriptor();
20
21
 
@@ -39,7 +40,8 @@ resources.createGroup()
39
40
  // the scene's wind, which carries the fog volumes' noise: one uniform, one texture, one sampler
40
41
  wind_field_add_resources(resources.createGroup()
41
42
  .addStorageBuffer("light_data", WebGPUArray.u32)
42
- .addTexture("tEnvironment", "unfilterable-float", "2d")
43
+ .addTexture("tEnvironment", "float", "2d")
44
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
43
45
  // the fog volumes' noise, read through participating_media_volume_density_at
44
46
  .addTexture("tParticipatingMediaNoise", "float", "3d")
45
47
  .addSampler("sParticipatingMediaNoise", "filtering", PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR));
@@ -1 +1 @@
1
- {"version":3,"file":"graph_path_trace_scene.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/path_tracer/graph_path_trace_scene.js"],"names":[],"mappings":"AAwGA;;;;;;GAMG;AACH;IAJ+B,KAAK;IACD,IAAI;IAC1B,MAAM,CAyFlB"}
1
+ {"version":3,"file":"graph_path_trace_scene.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/path_tracer/graph_path_trace_scene.js"],"names":[],"mappings":"AA0GA;;;;;;GAMG;AACH;IAJ+B,KAAK;IACD,IAAI;IAC1B,MAAM,CAyFlB"}
@@ -18,6 +18,7 @@ import { MEDIA_TABLE_STRUCT } from "../medium/MEDIA_TABLE_STRUCT.js";
18
18
  import { chunk_render_trace_path } from "./shader/chunk_render_trace_path.js";
19
19
  import { PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR } from "../volumetrics/noise/PARTICIPATING_MEDIA_NOISE.js";
20
20
  import { wind_field_add_resources } from "../wind/wind_field_add_resources.js";
21
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
21
22
 
22
23
  const RAY_TRACING_UNIFORMS_STRUCT = WebGPUStruct.from({
23
24
  random_seed: u32
@@ -35,7 +36,8 @@ resources.createGroup()
35
36
  // the scene's wind, which carries the fog volumes' noise: one uniform, one texture, one sampler
36
37
  wind_field_add_resources(resources.createGroup()
37
38
  .addStorageBuffer("light_data", WebGPUArray.u32)
38
- .addTexture("tEnvironment", "unfilterable-float", "2d")
39
+ .addTexture("tEnvironment", "float", "2d")
40
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
39
41
  // the fog volumes' noise, read through participating_media_volume_density_at
40
42
  .addTexture("tParticipatingMediaNoise", "float", "3d")
41
43
  .addSampler("sParticipatingMediaNoise", "filtering", PARTICIPATING_MEDIA_NOISE_SAMPLER_DESCRIPTOR));
@@ -236,7 +236,7 @@ fn render_trace_path(
236
236
  if(hit.t <= 0.0){
237
237
  // didn't hit anything
238
238
 
239
- var environment_sample = sample_environment_color(tEnvironment, ray.direction);
239
+ var environment_sample = sample_environment_color(tEnvironment, sEnvironment, ray.direction);
240
240
 
241
241
  let env_luma = rgb_to_luminance(environment_sample);
242
242
 
@@ -1 +1 @@
1
- {"version":3,"file":"ssr_resolve_shader.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js"],"names":[],"mappings":"AA+VA;;;;;;;GAOG;AACH,iCAFU,WAAW,CAgBlB;4BAlWyB,gCAAgC"}
1
+ {"version":3,"file":"ssr_resolve_shader.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js"],"names":[],"mappings":"AAiWA;;;;;;;GAOG;AACH,iCAFU,WAAW,CAgBlB;4BApWyB,gCAAgC"}
@@ -31,6 +31,7 @@ import { BLACK_PIXEL_TEXTURE } from "../../../texture/util/BLACK_PIXEL_TEXTURE.j
31
31
  import { ZERO_UINT_PIXEL_TEXTURE } from "../../../texture/util/ZERO_UINT_PIXEL_TEXTURE.js";
32
32
  import { chunk_ssr_add_hit_irradiance } from "./chunk_ssr_add_hit_irradiance.js";
33
33
  import { chunk_ssr_sample_radiance } from "./chunk_ssr_sample_radiance.js";
34
+ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
34
35
 
35
36
  const RESOLVE_UNIFORMS = WebGPUStruct.from({
36
37
  frame_index: u32,
@@ -43,7 +44,8 @@ const resources = new ShaderResourceSetDescriptor();
43
44
  // the noise that jitters them, and the light probe volume. The pass binds only the running mode's, and each
44
45
  // mode's source has a default for the others: black textures, transient buffers, a volume of no probes.
45
46
  resources.createGroup()
46
- .addTexture("tEnvironment")
47
+ .addTexture("tEnvironment", "float")
48
+ .add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
47
49
  .addStorageBuffer("brick4", BRICK4_DATA_STRUCT, false, true)
48
50
  .addTexture("tSTBN_vec2", "unfilterable-float", "3d")
49
51
  .addTexture("lpv_atlas_radiance", "uint", "2d", false, ZERO_UINT_PIXEL_TEXTURE)
@@ -77,11 +77,6 @@ export const AVBOIT_EXTINCTION_SCALE: number;
77
77
  * @type {number}
78
78
  */
79
79
  export const AVBOIT_FIELD_BITS: number;
80
- /**
81
- * Field mask.
82
- * @type {number}
83
- */
84
- export const AVBOIT_FIELD_MASK: number;
85
80
  /**
86
81
  * How far toward the camera, in virtual slices, the draw pass samples the integral so that a surface
87
82
  * does not occlude itself through its own linear splat. With the exclusive-prefix storage convention
@@ -1 +1 @@
1
- {"version":3,"file":"AVBOIT_CONSTANTS.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,qCAFU,MAAM,CAE0B;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,wCAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,qCAFU,MAAM,CAEqD;AAErE;;;;GAIG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;;;;GAMG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;;;;GAMG;AACH,oCAFU,MAAM,CAEmC;AAEnD;;;;;;;;;;;GAWG;AACH,2CAFU,MAAM,CAEoC;AAEpD;;;;GAIG;AACH,sCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;GAGG;AACH,gCAFU,MAAM,CAE8C;AAE9D;;;;;;;;GAQG;AACH,wCAFU,MAAM,CAE6B;AAE7C;;;;;GAKG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,sDAAmD;AAEnD;;;GAGG;AACH,8CAFU,MAAM,CAEiC"}
1
+ {"version":3,"file":"AVBOIT_CONSTANTS.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,qCAFU,MAAM,CAE0B;AAE1C;;;;;;;;;;;;;;;;GAgBG;AACH,wCAFU,MAAM,CAE8B;AAE9C;;;GAGG;AACH,qCAFU,MAAM,CAEqD;AAErE;;;;GAIG;AACH,qCAFU,MAAM,CAEwB;AAExC;;;;;;GAMG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;;;;GAMG;AACH,oCAFU,MAAM,CAEmC;AAEnD;;;;;;;;;;;GAWG;AACH,2CAFU,MAAM,CAEoC;AAEpD;;;;GAIG;AACH,sCAFU,MAAM,CAE2B;AAE3C;;;GAGG;AACH,gCAFU,MAAM,CAEoB;AAEpC;;;;;;;;GAQG;AACH,wCAFU,MAAM,CAE6B;AAE7C;;;;;GAKG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,sDAAmD;AAEnD;;;GAGG;AACH,8CAFU,MAAM,CAEiC"}
@@ -87,12 +87,6 @@ export const AVBOIT_EXTINCTION_SCALE = 255;
87
87
  */
88
88
  export const AVBOIT_FIELD_BITS = 10;
89
89
 
90
- /**
91
- * Field mask.
92
- * @type {number}
93
- */
94
- export const AVBOIT_FIELD_MASK = (1 << AVBOIT_FIELD_BITS) - 1;
95
-
96
90
  /**
97
91
  * How far toward the camera, in virtual slices, the draw pass samples the integral so that a surface
98
92
  * does not occlude itself through its own linear splat. With the exclusive-prefix storage convention
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_avboit_counts_to_extinction.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,gDAFU,SAAS,CASjB;0BAhBwB,uCAAuC"}
1
+ {"version":3,"file":"chunk_avboit_counts_to_extinction.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/chunk_avboit_counts_to_extinction.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,gDAFU,SAAS,CASjB;0BAnBwB,uCAAuC"}
@@ -1,6 +1,9 @@
1
1
  import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
2
2
  import { AVBOIT_EXTINCTION_SCALE } from "./AVBOIT_CONSTANTS.js";
3
3
 
4
+
5
+ const AVBOIT_EXTINCTION_SCALE_INV = 1.0 / AVBOIT_EXTINCTION_SCALE;
6
+
4
7
  /**
5
8
  * Accumulated counts back to normalized extinction. Not clamped: a field that summed past 255 reads
6
9
  * above 1.0 here and saturates in the integration, which is where the running value is kept.
@@ -11,7 +14,7 @@ export const chunk_avboit_counts_to_extinction = CodeChunk.from(
11
14
  //language=WGSL
12
15
  `
13
16
  fn avboit_counts_to_extinction(counts: vec3<u32>) -> vec3<f32> {
14
- return vec3<f32>(counts) / ${AVBOIT_EXTINCTION_SCALE}.0;
17
+ return vec3<f32>(counts) * ${AVBOIT_EXTINCTION_SCALE_INV};
15
18
  }
16
19
  `
17
20
  );
@@ -1 +1 @@
1
- {"version":3,"file":"graph_rasterize_meshes_transparent_avboit.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js"],"names":[],"mappings":"AA2DA;;;;;GAKG;AACH,oDAHW,UAAU,MAAM,CAAC,GACf,MAAM,EAAE,CAOpB;AAED;;;;;;;;;;;;GAYG;AACH;IAT+B,KAAK;IACA,KAAK;IACd,MAAM,EAAtB,MAAM;IACqB,kBAAkB,EAA7C,UAAU,MAAM,CAAC;IACD,kBAAkB,EAAlC,MAAM;IACU,wBAAwB,EAAxC,MAAM;IACW,SAAS,GAA1B,MAAM;IACJ,MAAM,CA4DlB;AAED;;;;;;;;;;GAUG;AACH;IAP+B,KAAK;IACT,SAAS,EAAzB,MAAM;IACY,gBAAgB,EAAlC,MAAM,EAAE;IACmB,kBAAkB,EAA7C,UAAU,MAAM,CAAC;IACQ,MAAM,GAA/B,cAAc;IACZ,MAAM,CAuDlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,6KAFa;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAiJjE;AAED;;;;;;;;;;GAUG;AACH;IAP+B,KAAK;IACT,IAAI,EAApB,MAAM;IACU,UAAU,EAA1B,MAAM;IACU,QAAQ,EAAxB,MAAM;IACY,gBAAgB,EAAlC,MAAM,EAAE;IACN,MAAM,CAoClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8TAFa;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAqM7D;AAED;;;;;;;;GAQG;AACH,+EAHW,UAAU,MAAM,CAAC,GACf;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAe/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH;IAxB+B,KAAK;IACT,OAAO,EAAvB,MAAM;IACkB,QAAQ;IACd,QAAQ,EAA1B,MAAM,EAAE;IACQ,aAAa,EAA7B,MAAM;IACU,aAAa,EAA7B,MAAM;IACuB,MAAM;IACnB,wBAAwB,EAAxC,MAAM;IACU,oBAAoB,EAApC,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACU,eAAe,EAA/B,MAAM;IACU,eAAe,EAA/B,MAAM;IACU,oBAAoB,EAApC,MAAM;IAC6B,sBAAsB,EAAzD;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC;IAGC,eAAe,GAAzC,eAAe;IAGU,MAAM,GAA/B,cAAc;IACiD,aAAa,GAA5E,OAAO,wBAAwB,EAAE,iBAAiB,EAAE;IAElD,MAAM,CAkTlB;+BAz8B8B,qBAAqB;gCAIpB,6CAA6C"}
1
+ {"version":3,"file":"graph_rasterize_meshes_transparent_avboit.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js"],"names":[],"mappings":"AA4DA;;;;;GAKG;AACH,oDAHW,UAAU,MAAM,CAAC,GACf,MAAM,EAAE,CAOpB;AAED;;;;;;;;;;;;GAYG;AACH;IAT+B,KAAK;IACA,KAAK;IACd,MAAM,EAAtB,MAAM;IACqB,kBAAkB,EAA7C,UAAU,MAAM,CAAC;IACD,kBAAkB,EAAlC,MAAM;IACU,wBAAwB,EAAxC,MAAM;IACW,SAAS,GAA1B,MAAM;IACJ,MAAM,CA4DlB;AAED;;;;;;;;;;GAUG;AACH;IAP+B,KAAK;IACT,SAAS,EAAzB,MAAM;IACY,gBAAgB,EAAlC,MAAM,EAAE;IACmB,kBAAkB,EAA7C,UAAU,MAAM,CAAC;IACQ,MAAM,GAA/B,cAAc;IACZ,MAAM,CAuDlB;AAED;;;;;;;;;;;;;;;GAeG;AACH,6KAFa;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAC,CAiJjE;AAED;;;;;;;;;;GAUG;AACH;IAP+B,KAAK;IACT,IAAI,EAApB,MAAM;IACU,UAAU,EAA1B,MAAM;IACU,QAAQ,EAAxB,MAAM;IACY,gBAAgB,EAAlC,MAAM,EAAE;IACN,MAAM,CAoClB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8TAFa;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAC,CAuM7D;AAED;;;;;;;;GAQG;AACH,+EAHW,UAAU,MAAM,CAAC,GACf;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAC,CAe/E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH;IAxB+B,KAAK;IACT,OAAO,EAAvB,MAAM;IACkB,QAAQ;IACd,QAAQ,EAA1B,MAAM,EAAE;IACQ,aAAa,EAA7B,MAAM;IACU,aAAa,EAA7B,MAAM;IACuB,MAAM;IACnB,wBAAwB,EAAxC,MAAM;IACU,oBAAoB,EAApC,MAAM;IACU,kBAAkB,EAAlC,MAAM;IACU,eAAe,EAA/B,MAAM;IACU,eAAe,EAA/B,MAAM;IACU,oBAAoB,EAApC,MAAM;IAC6B,sBAAsB,EAAzD;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC;IAGC,eAAe,GAAzC,eAAe;IAGU,MAAM,GAA/B,cAAc;IACiD,aAAa,GAA5E,OAAO,wBAAwB,EAAE,iBAAiB,EAAE;IAElD,MAAM,CAkTlB;+BA38B8B,qBAAqB;gCAIpB,6CAA6C"}
@@ -13,6 +13,7 @@ import { graph_import_texture } from "../../../shader/graph/graph_import_texture
13
13
  import {
14
14
  SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR
15
15
  } from "../../../shadow/map/SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR.js";
16
+ import { ENVIRONMENT_MAP_SAMPLER_DESCRIPTOR } from "../../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
16
17
  import { STATIC_GRAPHICS_ENGINE_ASSETS } from "../../../STATIC_GRAPHICS_ENGINE_ASSETS.js";
17
18
  import { rasterization_material_bucket } from "../../expand/bucket/chunk_rasterization_material_bucket.js";
18
19
  import { construct_primitive_state } from "../../bucket/construct_primitive_state.js";
@@ -518,12 +519,14 @@ export function graph_avboit_draw({
518
519
  ));
519
520
 
520
521
  const sampler_shadowmap = graphics.samplers.obtain(SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR);
522
+ const sampler_environment = graphics.samplers.obtain(ENVIRONMENT_MAP_SAMPLER_DESCRIPTOR);
521
523
 
522
524
  const light_bindings = bind_manager.obtain(BindGroupDescriptor.from(
523
525
  FORWARD_LIGHT_LAYOUT,
524
526
  [
525
527
  { buffer: view_ctx.scene.lights.buffer_data },
526
528
  view_ctx.scene.lights.environment.obtainView(),
529
+ sampler_environment,
527
530
  //
528
531
  { buffer: light_cluster_parameters },
529
532
  { buffer: light_cluster_lookup },
@@ -1 +1 @@
1
- {"version":3,"file":"graph_rasterize_meshes_transparent_oit.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js"],"names":[],"mappings":"AAuYA;;;;;;;;;;;;;;;;;GAiBG;AACH,gSAFa,MAAM,CAyOlB"}
1
+ {"version":3,"file":"graph_rasterize_meshes_transparent_oit.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js"],"names":[],"mappings":"AA0YA;;;;;;;;;;;;;;;;;GAiBG;AACH,gSAFa,MAAM,CAyOlB"}
@@ -11,6 +11,7 @@ import { graph_import_texture } from "../../../shader/graph/graph_import_texture
11
11
  import {
12
12
  SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR
13
13
  } from "../../../shadow/map/SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR.js";
14
+ import { ENVIRONMENT_MAP_SAMPLER_DESCRIPTOR } from "../../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
14
15
  import { STATIC_GRAPHICS_ENGINE_ASSETS } from "../../../STATIC_GRAPHICS_ENGINE_ASSETS.js";
15
16
  import { rasterization_material_bucket } from "../../expand/bucket/chunk_rasterization_material_bucket.js";
16
17
  import { construct_primitive_state } from "../../bucket/construct_primitive_state.js";
@@ -129,12 +130,14 @@ function graph_oit_resolve_moments({
129
130
  ));
130
131
 
131
132
  const sampler_shadowmap = context.graphics.samplers.obtain(SHADOWMAP_COMPARE_SAMPLER_DESCRIPTOR);
133
+ const sampler_environment = context.graphics.samplers.obtain(ENVIRONMENT_MAP_SAMPLER_DESCRIPTOR);
132
134
 
133
135
  const light_bindings = bind_manager.obtain(BindGroupDescriptor.from(
134
136
  FORWARD_LIGHT_LAYOUT,
135
137
  [
136
138
  { buffer: view_ctx.scene.lights.buffer_data },
137
139
  view_ctx.scene.lights.environment.obtainView(),
140
+ sampler_environment,
138
141
  //
139
142
  { buffer: light_cluster_parameters },
140
143
  { buffer: light_cluster_lookup },
@@ -17,6 +17,6 @@ import { CodeChunk } from "../../../compiler/CodeChunk.js";
17
17
  export const chunk_PAPER_WHITE_NITS = CodeChunk.from(
18
18
  //language=WGSL
19
19
  `
20
- const PAPER_WHITE_NITS: f32 = 250.0;
20
+ const PAPER_WHITE_NITS: f32 = 203.0;
21
21
  `
22
22
  );
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The octahedral uv a texel of a skirted level carries: its own centre for an interior texel, and
3
+ * for a skirt texel the centre of the interior texel the octahedral fold mirrors it onto.
4
+ *
5
+ * A pass that writes a skirted level computes every texel, skirt included, from this uv. A skirt
6
+ * texel then runs the exact computation its interior twin runs, so the two are bit-identical rather
7
+ * than equal to rounding — which is what lets a hardware bilinear sample across the edge match a
8
+ * manual wrap.
9
+ *
10
+ * @see chunk_texture_octahedral_skirt_uv for the layout
11
+ * @type {CodeChunk}
12
+ */
13
+ export const chunk_texture_octahedral_skirt_texel_uv: CodeChunk;
14
+ import { CodeChunk } from "../../../compiler/CodeChunk.js";
15
+ //# sourceMappingURL=chunk_texture_octahedral_skirt_texel_uv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_texture_octahedral_skirt_texel_uv.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_texel_uv.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;GAWG;AACH,sDAFU,SAAS,CAahB;0BA1BuB,gCAAgC"}
@@ -0,0 +1,27 @@
1
+ import { CodeChunk } from "../../../compiler/CodeChunk.js";
2
+ import { chunk_texture_octahedral_wrap_texel_coordinates } from "./chunk_texture_octahedral_wrap_texel_coordinates.js";
3
+
4
+ /**
5
+ * The octahedral uv a texel of a skirted level carries: its own centre for an interior texel, and
6
+ * for a skirt texel the centre of the interior texel the octahedral fold mirrors it onto.
7
+ *
8
+ * A pass that writes a skirted level computes every texel, skirt included, from this uv. A skirt
9
+ * texel then runs the exact computation its interior twin runs, so the two are bit-identical rather
10
+ * than equal to rounding — which is what lets a hardware bilinear sample across the edge match a
11
+ * manual wrap.
12
+ *
13
+ * @see chunk_texture_octahedral_skirt_uv for the layout
14
+ * @type {CodeChunk}
15
+ */
16
+ export const chunk_texture_octahedral_skirt_texel_uv = CodeChunk.from(
17
+ //language=WGSL
18
+ `
19
+ fn texture_octahedral_skirt_texel_uv(texel: vec2<u32>, texture_size: u32) -> vec2<f32> {
20
+ let interior = i32(texture_size) - 2;
21
+ let source = texture_octahedral_wrap_texel_coordinates(vec2<i32>(texel) - 1, interior);
22
+
23
+ return (vec2<f32>(source) + 0.5) / f32(interior);
24
+ }
25
+ `, [
26
+ chunk_texture_octahedral_wrap_texel_coordinates,
27
+ ]);
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Where an octahedral uv lands in one level of a skirted octahedral texture.
3
+ *
4
+ * A skirted level of side `texture_size` holds the octahedral square in its interior texels
5
+ * `[1, texture_size - 1)` and a one-texel skirt around it, each skirt texel a copy of the interior
6
+ * texel the octahedral fold puts next to it. With the skirt there, the hardware's bilinear footprint
7
+ * at the edge of the square reads exactly the texels a manual wrap would, so one filtered sample
8
+ * replaces four loads and their wraps.
9
+ *
10
+ * The interior is `texture_size - 2` texels, not half of the level above's, so a level's uv is its
11
+ * own: sample each level through its own size.
12
+ *
13
+ * @see chunk_texture_octahedral_skirt_texel_uv for the inverse, from a skirted texel to the uv it carries
14
+ * @type {CodeChunk}
15
+ */
16
+ export const chunk_texture_octahedral_skirt_uv: CodeChunk;
17
+ import { CodeChunk } from "../../../compiler/CodeChunk.js";
18
+ //# sourceMappingURL=chunk_texture_octahedral_skirt_uv.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_texture_octahedral_skirt_uv.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;GAcG;AACH,gDAFU,SAAS,CAQhB;0BAvBuB,gCAAgC"}
@@ -0,0 +1,24 @@
1
+ import { CodeChunk } from "../../../compiler/CodeChunk.js";
2
+
3
+ /**
4
+ * Where an octahedral uv lands in one level of a skirted octahedral texture.
5
+ *
6
+ * A skirted level of side `texture_size` holds the octahedral square in its interior texels
7
+ * `[1, texture_size - 1)` and a one-texel skirt around it, each skirt texel a copy of the interior
8
+ * texel the octahedral fold puts next to it. With the skirt there, the hardware's bilinear footprint
9
+ * at the edge of the square reads exactly the texels a manual wrap would, so one filtered sample
10
+ * replaces four loads and their wraps.
11
+ *
12
+ * The interior is `texture_size - 2` texels, not half of the level above's, so a level's uv is its
13
+ * own: sample each level through its own size.
14
+ *
15
+ * @see chunk_texture_octahedral_skirt_texel_uv for the inverse, from a skirted texel to the uv it carries
16
+ * @type {CodeChunk}
17
+ */
18
+ export const chunk_texture_octahedral_skirt_uv = CodeChunk.from(
19
+ //language=WGSL
20
+ `
21
+ fn texture_octahedral_skirt_uv(octahedral_uv: vec2<f32>, texture_size: f32) -> vec2<f32> {
22
+ return (octahedral_uv * (texture_size - 2.0) + 1.0) / texture_size;
23
+ }
24
+ `);
@@ -1,5 +1,22 @@
1
1
  /**
2
- * Works on ann octahedral-encoded pre-filtered environment map
2
+ * Works on an octahedral-encoded pre-filtered environment map with a one-texel octahedral skirt on
3
+ * every level it reads (see `texture_octahedral_skirt_uv`).
4
+ *
5
+ * Trilinear as two hardware bilinear taps, one per level, blended here: each level's interior is its
6
+ * own size less the skirt, so one uv cannot address two levels and the sampler's own mip blend would
7
+ * read the coarser one up to a texel off. Most texture units filter trilinear at half the bilinear
8
+ * rate anyway, so the second tap costs about what the hardware blend would.
9
+ *
10
+ * Measured against the manual form this replaces (8 loads, 4 octahedral wraps a level, each wrap
11
+ * two integer divisions and remainders), radiance + irradiance over 1920x1080: 88 → 17 µs on an RTX
12
+ * 4090, 15.4 → 1.3 ms on an RDNA2 iGPU, whose integer division is emulated.
13
+ *
14
+ * Every level the roughness mapping reaches (0 to `SPHERE_PROBE_MIPMAP_LEVELS - 1`) must be at least
15
+ * 3 texels wide to have an interior. A level's size is the texture's halved and kept at 1 or more, as
16
+ * a level's extent is, so a smaller map (the renderer's 1x1 black stand-in, a test's constant) still
17
+ * samples at a finite uv. At the roughest level the second tap reads the level past it at weight 0; a
18
+ * texture without one clamps to the last level, which the weight discards just the same.
19
+ *
3
20
  * @see https://github.com/GPUOpen-LibrariesAndSDKs/FidelityFX-SDK/blob/1bbe66e7ea0d358e84af4471a90aa9c35b583de0/samples/hybridreflections/shaders/Common.hlsl#L118
4
21
  * @type {CodeChunk}
5
22
  */
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_sample_environment_map.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/texture/sample/chunk_sample_environment_map.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,2CAFU,SAAS,CAyCjB;0BA/CwB,gCAAgC"}
1
+ {"version":3,"file":"chunk_sample_environment_map.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/texture/sample/chunk_sample_environment_map.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,2CAFU,SAAS,CAyCjB;0BAjEwB,gCAAgC"}