@zephyr3d/scene 0.9.21 → 0.9.23

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 (238) hide show
  1. package/dist/animation/joint_dynamics/collision.js +1 -7
  2. package/dist/animation/joint_dynamics/collision.js.map +1 -1
  3. package/dist/animation/joint_dynamics/constraints.js +2 -17
  4. package/dist/animation/joint_dynamics/constraints.js.map +1 -1
  5. package/dist/animation/joint_dynamics/controller.js +2 -20
  6. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  7. package/dist/animation/joint_dynamics/joint_dynamics_system.js +1 -3
  8. package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
  9. package/dist/animation/joint_dynamics/solver.js +14 -60
  10. package/dist/animation/joint_dynamics/solver.js.map +1 -1
  11. package/dist/animation/joint_dynamics/types.js +3 -3
  12. package/dist/animation/joint_dynamics/types.js.map +1 -1
  13. package/dist/app/app.js +23 -0
  14. package/dist/app/app.js.map +1 -1
  15. package/dist/app/scriptregistry.js +16 -53
  16. package/dist/app/scriptregistry.js.map +1 -1
  17. package/dist/asset/assetmanager.js +2 -0
  18. package/dist/asset/assetmanager.js.map +1 -1
  19. package/dist/asset/model.js +22 -0
  20. package/dist/asset/model.js.map +1 -1
  21. package/dist/blitter/bilateralblur.js +3 -1
  22. package/dist/blitter/bilateralblur.js.map +1 -1
  23. package/dist/blitter/blitter.js +3 -3
  24. package/dist/blitter/blitter.js.map +1 -1
  25. package/dist/camera/camera.js +398 -45
  26. package/dist/camera/camera.js.map +1 -1
  27. package/dist/camera/perspectivecamera.js +69 -2
  28. package/dist/camera/perspectivecamera.js.map +1 -1
  29. package/dist/index.d.ts +9100 -8712
  30. package/dist/index.js +9 -1
  31. package/dist/index.js.map +1 -1
  32. package/dist/material/blinn.js +1 -1
  33. package/dist/material/blinn.js.map +1 -1
  34. package/dist/material/lambert.js +3 -3
  35. package/dist/material/lambert.js.map +1 -1
  36. package/dist/material/material.js +8 -5
  37. package/dist/material/material.js.map +1 -1
  38. package/dist/material/meshmaterial.js +17 -10
  39. package/dist/material/meshmaterial.js.map +1 -1
  40. package/dist/material/mixins/lightmodel/blinnphong.js +1 -1
  41. package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
  42. package/dist/material/mixins/lightmodel/lambert.js +1 -1
  43. package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
  44. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +21 -6
  45. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
  46. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +1 -1
  47. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  48. package/dist/material/mixins/lightmodel/pbrspecularglossness.js +1 -1
  49. package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
  50. package/dist/material/mixins/lit.js +33 -11
  51. package/dist/material/mixins/lit.js.map +1 -1
  52. package/dist/material/mixins/pbr/brdf.js +44 -12
  53. package/dist/material/mixins/pbr/brdf.js.map +1 -1
  54. package/dist/material/mixins/pbr/common.js +149 -14
  55. package/dist/material/mixins/pbr/common.js.map +1 -1
  56. package/dist/material/mtoon.js +7 -4
  57. package/dist/material/mtoon.js.map +1 -1
  58. package/dist/material/pbrblueprint.js +5 -1
  59. package/dist/material/pbrblueprint.js.map +1 -1
  60. package/dist/material/pbrmr.js +1 -1
  61. package/dist/material/pbrmr.js.map +1 -1
  62. package/dist/material/pbrsg.js +1 -1
  63. package/dist/material/pbrsg.js.map +1 -1
  64. package/dist/material/shader/helper.js +186 -11
  65. package/dist/material/shader/helper.js.map +1 -1
  66. package/dist/material/skin.js +2 -2
  67. package/dist/material/skin.js.map +1 -1
  68. package/dist/material/terrain-cm.js +5 -5
  69. package/dist/material/terrain-cm.js.map +1 -1
  70. package/dist/material/water.js +6 -4
  71. package/dist/material/water.js.map +1 -1
  72. package/dist/posteffect/bloom.js +54 -4
  73. package/dist/posteffect/bloom.js.map +1 -1
  74. package/dist/posteffect/compositor.js +41 -0
  75. package/dist/posteffect/compositor.js.map +1 -1
  76. package/dist/posteffect/posteffect.js +51 -0
  77. package/dist/posteffect/posteffect.js.map +1 -1
  78. package/dist/posteffect/sao.js +7 -6
  79. package/dist/posteffect/sao.js.map +1 -1
  80. package/dist/posteffect/skinsss.js +3 -3
  81. package/dist/posteffect/skinsss.js.map +1 -1
  82. package/dist/posteffect/ssgi.js +1196 -0
  83. package/dist/posteffect/ssgi.js.map +1 -0
  84. package/dist/posteffect/ssr.js +83 -45
  85. package/dist/posteffect/ssr.js.map +1 -1
  86. package/dist/posteffect/sss.js +137 -49
  87. package/dist/posteffect/sss.js.map +1 -1
  88. package/dist/posteffect/taa.js +5 -4
  89. package/dist/posteffect/taa.js.map +1 -1
  90. package/dist/posteffect/tonemap.js +15 -3
  91. package/dist/posteffect/tonemap.js.map +1 -1
  92. package/dist/render/abuffer_oit.js +2 -2
  93. package/dist/render/abuffer_oit.js.map +1 -1
  94. package/dist/render/cluster_light.js +12 -6
  95. package/dist/render/cluster_light.js.map +1 -1
  96. package/dist/render/drawable_mixin.js +8 -5
  97. package/dist/render/drawable_mixin.js.map +1 -1
  98. package/dist/render/dualdepthpeeling_oit.js +10 -5
  99. package/dist/render/dualdepthpeeling_oit.js.map +1 -1
  100. package/dist/render/envlight.js +298 -5
  101. package/dist/render/envlight.js.map +1 -1
  102. package/dist/render/gpu_picking.js +7 -5
  103. package/dist/render/gpu_picking.js.map +1 -1
  104. package/dist/render/hzb.js +28 -19
  105. package/dist/render/hzb.js.map +1 -1
  106. package/dist/render/lightpass.js +18 -4
  107. package/dist/render/lightpass.js.map +1 -1
  108. package/dist/render/render_queue.js +37 -4
  109. package/dist/render/render_queue.js.map +1 -1
  110. package/dist/render/renderer.js +8 -3
  111. package/dist/render/renderer.js.map +1 -1
  112. package/dist/render/rendergraph/blackboard.js +20 -48
  113. package/dist/render/rendergraph/blackboard.js.map +1 -1
  114. package/dist/render/rendergraph/device_pool_allocator.js +18 -58
  115. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
  116. package/dist/render/rendergraph/executor.js +89 -115
  117. package/dist/render/rendergraph/executor.js.map +1 -1
  118. package/dist/render/rendergraph/forward_plus_builder.js +1003 -715
  119. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  120. package/dist/render/rendergraph/frame_graph_context.js +41 -0
  121. package/dist/render/rendergraph/frame_graph_context.js.map +1 -0
  122. package/dist/render/rendergraph/frame_resource_requirements.js +14 -0
  123. package/dist/render/rendergraph/frame_resource_requirements.js.map +1 -0
  124. package/dist/render/rendergraph/history_resource_manager.js +74 -140
  125. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  126. package/dist/render/rendergraph/history_resources.js +7 -5
  127. package/dist/render/rendergraph/history_resources.js.map +1 -1
  128. package/dist/render/rendergraph/render_context.js +19 -0
  129. package/dist/render/rendergraph/render_context.js.map +1 -0
  130. package/dist/render/rendergraph/render_pipeline.js +315 -0
  131. package/dist/render/rendergraph/render_pipeline.js.map +1 -0
  132. package/dist/render/rendergraph/rendergraph.js +158 -141
  133. package/dist/render/rendergraph/rendergraph.js.map +1 -1
  134. package/dist/render/rendergraph/scene_render_context.js +267 -0
  135. package/dist/render/rendergraph/scene_render_context.js.map +1 -0
  136. package/dist/render/rendergraph/texture_affinity_cache.js +19 -0
  137. package/dist/render/rendergraph/texture_affinity_cache.js.map +1 -0
  138. package/dist/render/rendergraph/types.js +19 -31
  139. package/dist/render/rendergraph/types.js.map +1 -1
  140. package/dist/render/renderpass.js +3 -3
  141. package/dist/render/renderpass.js.map +1 -1
  142. package/dist/render/shadow_mask_pass.js +10 -6
  143. package/dist/render/shadow_mask_pass.js.map +1 -1
  144. package/dist/render/sky.js +197 -35
  145. package/dist/render/sky.js.map +1 -1
  146. package/dist/render/weightedblended_oit.js +4 -3
  147. package/dist/render/weightedblended_oit.js.map +1 -1
  148. package/dist/scene/basesprite.js +2 -0
  149. package/dist/scene/basesprite.js.map +1 -1
  150. package/dist/scene/batchgroup.js +10 -0
  151. package/dist/scene/batchgroup.js.map +1 -1
  152. package/dist/scene/environment.js +61 -2
  153. package/dist/scene/environment.js.map +1 -1
  154. package/dist/scene/light.js +178 -10
  155. package/dist/scene/light.js.map +1 -1
  156. package/dist/scene/meshdrawable.js +89 -2
  157. package/dist/scene/meshdrawable.js.map +1 -1
  158. package/dist/scene/msdftext.js +2 -0
  159. package/dist/scene/msdftext.js.map +1 -1
  160. package/dist/scene/msdftextsprite.js +2 -0
  161. package/dist/scene/msdftextsprite.js.map +1 -1
  162. package/dist/scene/particlesys.js +2 -0
  163. package/dist/scene/particlesys.js.map +1 -1
  164. package/dist/scene/scene.js +34 -1
  165. package/dist/scene/scene.js.map +1 -1
  166. package/dist/scene/terrain-cm/grass.js +2 -1
  167. package/dist/scene/terrain-cm/grass.js.map +1 -1
  168. package/dist/scene/terrain-cm/terrain-cm.js +2 -0
  169. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  170. package/dist/scene/water.js +2 -0
  171. package/dist/scene/water.js.map +1 -1
  172. package/dist/shaders/atmosphere.js +5 -4
  173. package/dist/shaders/atmosphere.js.map +1 -1
  174. package/dist/shaders/fog.js +10 -3
  175. package/dist/shaders/fog.js.map +1 -1
  176. package/dist/shaders/shadow.js +96 -29
  177. package/dist/shaders/shadow.js.map +1 -1
  178. package/dist/shaders/ssgi.js +63 -0
  179. package/dist/shaders/ssgi.js.map +1 -0
  180. package/dist/shaders/ssgi_reprojection.js +118 -0
  181. package/dist/shaders/ssgi_reprojection.js.map +1 -0
  182. package/dist/shaders/ssr.js +322 -154
  183. package/dist/shaders/ssr.js.map +1 -1
  184. package/dist/shadow/esm.js +13 -8
  185. package/dist/shadow/esm.js.map +1 -1
  186. package/dist/shadow/pcf_opt.js +15 -12
  187. package/dist/shadow/pcf_opt.js.map +1 -1
  188. package/dist/shadow/pcf_pd.js +15 -12
  189. package/dist/shadow/pcf_pd.js.map +1 -1
  190. package/dist/shadow/pcss.js +17 -11
  191. package/dist/shadow/pcss.js.map +1 -1
  192. package/dist/shadow/shadow_impl.js +20 -2
  193. package/dist/shadow/shadow_impl.js.map +1 -1
  194. package/dist/shadow/shadowmapper.js +10 -3
  195. package/dist/shadow/shadowmapper.js.map +1 -1
  196. package/dist/shadow/ssm.js +16 -13
  197. package/dist/shadow/ssm.js.map +1 -1
  198. package/dist/shadow/vsm.js +10 -8
  199. package/dist/shadow/vsm.js.map +1 -1
  200. package/dist/utility/physical.js +74 -0
  201. package/dist/utility/physical.js.map +1 -0
  202. package/dist/utility/rendermipmap.js +2 -2
  203. package/dist/utility/rendermipmap.js.map +1 -1
  204. package/dist/utility/serialization/manager.js +3 -1
  205. package/dist/utility/serialization/manager.js.map +1 -1
  206. package/dist/utility/serialization/scene/animation.js +3 -1
  207. package/dist/utility/serialization/scene/animation.js.map +1 -1
  208. package/dist/utility/serialization/scene/batch.js +3 -1
  209. package/dist/utility/serialization/scene/batch.js.map +1 -1
  210. package/dist/utility/serialization/scene/camera.js +598 -2
  211. package/dist/utility/serialization/scene/camera.js.map +1 -1
  212. package/dist/utility/serialization/scene/light.js +180 -9
  213. package/dist/utility/serialization/scene/light.js.map +1 -1
  214. package/dist/utility/serialization/scene/material.js +43 -3
  215. package/dist/utility/serialization/scene/material.js.map +1 -1
  216. package/dist/utility/serialization/scene/mesh.js +3 -1
  217. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  218. package/dist/utility/serialization/scene/node.js +3 -1
  219. package/dist/utility/serialization/scene/node.js.map +1 -1
  220. package/dist/utility/serialization/scene/particle.js +3 -1
  221. package/dist/utility/serialization/scene/particle.js.map +1 -1
  222. package/dist/utility/serialization/scene/primitive.js +2 -0
  223. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  224. package/dist/utility/serialization/scene/scene.js +70 -0
  225. package/dist/utility/serialization/scene/scene.js.map +1 -1
  226. package/dist/utility/serialization/scene/sprite.js +3 -1
  227. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  228. package/dist/utility/serialization/scene/terrain.js +3 -1
  229. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  230. package/dist/utility/serialization/scene/text.js +3 -0
  231. package/dist/utility/serialization/scene/text.js.map +1 -1
  232. package/dist/utility/serialization/scene/water.js +3 -1
  233. package/dist/utility/serialization/scene/water.js.map +1 -1
  234. package/dist/values.js +2 -3
  235. package/dist/values.js.map +1 -1
  236. package/package.json +3 -3
  237. package/dist/animation/joint_dynamics/convex_collider.js +0 -320
  238. package/dist/animation/joint_dynamics/convex_collider.js.map +0 -1
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Animated interleaved-gradient-noise pair used to decorrelate SSGI rays.
3
+ *
4
+ * Produces two low-discrepancy random numbers in [0, 1) for a given fragment,
5
+ * advanced per sample/frame through golden-ratio sequences so the temporal
6
+ * resolve pass converges the Monte-Carlo estimate.
7
+ *
8
+ * @param scope - The shader scope
9
+ * @param fragCoord - Fragment coordinate in pixels
10
+ * @param seed - Sequence index (frameIndex * sampleCount + sampleIndex)
11
+ * @returns A vec2 of pseudo random numbers in [0, 1)
12
+ *
13
+ * @internal
14
+ */ function SSGI_rand2(scope, fragCoord, seed) {
15
+ const pb = scope.$builder;
16
+ pb.func('SSGI_ign', [
17
+ pb.vec2('p')
18
+ ], function() {
19
+ this.$return(pb.fract(pb.mul(52.9829189, pb.fract(pb.add(pb.mul(0.06711056, this.p.x), pb.mul(0.00583715, this.p.y))))));
20
+ });
21
+ pb.func('SSGI_rand2', [
22
+ pb.vec2('fragCoord'),
23
+ pb.float('seed')
24
+ ], function() {
25
+ this.$l.n1 = this.SSGI_ign(this.fragCoord);
26
+ this.$l.n2 = this.SSGI_ign(pb.add(this.fragCoord, pb.vec2(5.588238, 5.588238)));
27
+ // Golden-ratio (and its square) sequences advance the pair every sample
28
+ this.$return(pb.fract(pb.add(pb.vec2(this.n1, this.n2), pb.mul(pb.vec2(0.61803398875, 0.38196601125), this.seed))));
29
+ });
30
+ return scope.SSGI_rand2(fragCoord, seed);
31
+ }
32
+ /**
33
+ * Cosine-weighted hemisphere sampling around a normal.
34
+ *
35
+ * With cosine-weighted sampling the Monte-Carlo estimator of the rendering
36
+ * equation's diffuse term reduces to the plain average of the sampled
37
+ * radiances, so the SSGI trace pass can simply accumulate hit colors.
38
+ *
39
+ * @param scope - The shader scope
40
+ * @param normal - Unit normal the hemisphere is oriented around
41
+ * @param rand - Two random numbers in [0, 1)
42
+ * @returns A unit direction inside the hemisphere
43
+ *
44
+ * @internal
45
+ */ function SSGI_cosineSampleHemisphere(scope, normal, rand) {
46
+ const pb = scope.$builder;
47
+ pb.func('SSGI_cosineSampleHemisphere', [
48
+ pb.vec3('n'),
49
+ pb.vec2('u')
50
+ ], function() {
51
+ this.$l.up = this.$choice(pb.lessThan(pb.abs(this.n.z), 0.999), pb.vec3(0, 0, 1), pb.vec3(1, 0, 0));
52
+ this.$l.tangent = pb.normalize(pb.cross(this.up, this.n));
53
+ this.$l.bitangent = pb.cross(this.n, this.tangent);
54
+ this.$l.r = pb.sqrt(this.u.x);
55
+ this.$l.phi = pb.mul(this.u.y, Math.PI * 2);
56
+ this.$l.dir = pb.add(pb.mul(this.tangent, pb.mul(this.r, pb.cos(this.phi))), pb.mul(this.bitangent, pb.mul(this.r, pb.sin(this.phi))), pb.mul(this.n, pb.sqrt(pb.max(0, pb.sub(1, this.u.x)))));
57
+ this.$return(pb.normalize(this.dir));
58
+ });
59
+ return scope.SSGI_cosineSampleHemisphere(normal, rand);
60
+ }
61
+
62
+ export { SSGI_cosineSampleHemisphere, SSGI_rand2 };
63
+ //# sourceMappingURL=ssgi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssgi.js","sources":["../../src/shaders/ssgi.ts"],"sourcesContent":["import type { PBInsideFunctionScope, PBShaderExp } from '@zephyr3d/device';\n\n/**\n * Animated interleaved-gradient-noise pair used to decorrelate SSGI rays.\n *\n * Produces two low-discrepancy random numbers in [0, 1) for a given fragment,\n * advanced per sample/frame through golden-ratio sequences so the temporal\n * resolve pass converges the Monte-Carlo estimate.\n *\n * @param scope - The shader scope\n * @param fragCoord - Fragment coordinate in pixels\n * @param seed - Sequence index (frameIndex * sampleCount + sampleIndex)\n * @returns A vec2 of pseudo random numbers in [0, 1)\n *\n * @internal\n */\nexport function SSGI_rand2(scope: PBInsideFunctionScope, fragCoord: PBShaderExp, seed: PBShaderExp) {\n const pb = scope.$builder;\n pb.func('SSGI_ign', [pb.vec2('p')], function () {\n this.$return(\n pb.fract(\n pb.mul(52.9829189, pb.fract(pb.add(pb.mul(0.06711056, this.p.x), pb.mul(0.00583715, this.p.y))))\n )\n );\n });\n pb.func('SSGI_rand2', [pb.vec2('fragCoord'), pb.float('seed')], function () {\n this.$l.n1 = this.SSGI_ign(this.fragCoord);\n this.$l.n2 = this.SSGI_ign(pb.add(this.fragCoord, pb.vec2(5.588238, 5.588238)));\n // Golden-ratio (and its square) sequences advance the pair every sample\n this.$return(\n pb.fract(pb.add(pb.vec2(this.n1, this.n2), pb.mul(pb.vec2(0.61803398875, 0.38196601125), this.seed)))\n );\n });\n return scope.SSGI_rand2(fragCoord, seed);\n}\n\n/**\n * Cosine-weighted hemisphere sampling around a normal.\n *\n * With cosine-weighted sampling the Monte-Carlo estimator of the rendering\n * equation's diffuse term reduces to the plain average of the sampled\n * radiances, so the SSGI trace pass can simply accumulate hit colors.\n *\n * @param scope - The shader scope\n * @param normal - Unit normal the hemisphere is oriented around\n * @param rand - Two random numbers in [0, 1)\n * @returns A unit direction inside the hemisphere\n *\n * @internal\n */\nexport function SSGI_cosineSampleHemisphere(\n scope: PBInsideFunctionScope,\n normal: PBShaderExp,\n rand: PBShaderExp\n) {\n const pb = scope.$builder;\n pb.func('SSGI_cosineSampleHemisphere', [pb.vec3('n'), pb.vec2('u')], function () {\n this.$l.up = this.$choice(pb.lessThan(pb.abs(this.n.z), 0.999), pb.vec3(0, 0, 1), pb.vec3(1, 0, 0));\n this.$l.tangent = pb.normalize(pb.cross(this.up, this.n));\n this.$l.bitangent = pb.cross(this.n, this.tangent);\n this.$l.r = pb.sqrt(this.u.x);\n this.$l.phi = pb.mul(this.u.y, Math.PI * 2);\n this.$l.dir = pb.add(\n pb.mul(this.tangent, pb.mul(this.r, pb.cos(this.phi))),\n pb.mul(this.bitangent, pb.mul(this.r, pb.sin(this.phi))),\n pb.mul(this.n, pb.sqrt(pb.max(0, pb.sub(1, this.u.x))))\n );\n this.$return(pb.normalize(this.dir));\n });\n return scope.SSGI_cosineSampleHemisphere(normal, rand);\n}\n"],"names":["SSGI_rand2","scope","fragCoord","seed","pb","$builder","func","vec2","$return","fract","mul","add","p","x","y","float","$l","n1","SSGI_ign","n2","SSGI_cosineSampleHemisphere","normal","rand","vec3","up","$choice","lessThan","abs","n","z","tangent","normalize","cross","bitangent","r","sqrt","u","phi","Math","PI","dir","cos","sin","max","sub"],"mappings":"AAEA;;;;;;;;;;;;;AAaC,IACM,SAASA,UAAAA,CAAWC,KAA4B,EAAEC,SAAsB,EAAEC,IAAiB,EAAA;IAChG,MAAMC,EAAAA,GAAKH,MAAMI,QAAQ;IACzBD,EAAGE,CAAAA,IAAI,CAAC,UAAY,EAAA;AAACF,QAAAA,EAAAA,CAAGG,IAAI,CAAC,GAAA;KAAK,EAAE,WAAA;AAClC,QAAA,IAAI,CAACC,OAAO,CACVJ,EAAAA,CAAGK,KAAK,CACNL,EAAAA,CAAGM,GAAG,CAAC,YAAYN,EAAGK,CAAAA,KAAK,CAACL,EAAAA,CAAGO,GAAG,CAACP,EAAAA,CAAGM,GAAG,CAAC,UAAY,EAAA,IAAI,CAACE,CAAC,CAACC,CAAC,CAAA,EAAGT,EAAGM,CAAAA,GAAG,CAAC,UAAY,EAAA,IAAI,CAACE,CAAC,CAACE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAGlG,KAAA,CAAA;IACAV,EAAGE,CAAAA,IAAI,CAAC,YAAc,EAAA;AAACF,QAAAA,EAAAA,CAAGG,IAAI,CAAC,WAAA,CAAA;AAAcH,QA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C,EAAGwC,CAAAA,GAAG,CAAC,CAAG,EAAA,IAAI,CAACR,CAAC,CAACvB,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA;QAErD,IAAI,CAACL,OAAO,CAACJ,EAAAA,CAAG2B,SAAS,CAAC,IAAI,CAACS,GAAG,CAAA,CAAA;AACpC,KAAA,CAAA;IACA,OAAOvC,KAAAA,CAAMmB,2BAA2B,CAACC,MAAQC,EAAAA,IAAAA,CAAAA;AACnD;;;;"}
@@ -0,0 +1,118 @@
1
+ import { Matrix4x4 } from '@zephyr3d/base';
2
+
3
+ /**
4
+ * Shared helpers for validating SSGI temporal history across frames.
5
+ *
6
+ * SSGI stores the surface depth of a frame as that frame's view-space Z (the
7
+ * distance along the camera forward axis, in world units). Comparing such a
8
+ * value against the *current* frame's view-space Z is only meaningful while the
9
+ * camera is still: rotating the camera turns the forward axis, so a static world
10
+ * point changes its view-space Z by roughly
11
+ *
12
+ * dz ~ dTheta * viewZ * tan(halfFovX) * |ndc.x|
13
+ *
14
+ * which is zero at the screen center and grows with both depth and screen
15
+ * eccentricity. At a plain mouse-look rate that already exceeds any reasonable
16
+ * absolute tolerance for distant off-center pixels, so history gets rejected in
17
+ * screen-edge bands even though it is perfectly valid. Every consumer therefore
18
+ * has to convert the current depth into the *previous* frame's view space before
19
+ * comparing.
20
+ *
21
+ * @internal
22
+ */ /**
23
+ * Relative share of the compared depth added to the absolute tolerance. 2% keeps
24
+ * a 10m surface within 0.2m, comfortably above rgba16f depth quantization while
25
+ * still separating surfaces that a bounce should not share.
26
+ * @internal
27
+ */ const SSGI_DEPTH_TOLERANCE_SLOPE = 0.02;
28
+ /**
29
+ * `prevVP * inverse(currentVP)`: maps a current-frame clip position onto the
30
+ * previous frame's clip space, where `w` is the previous view-space Z.
31
+ *
32
+ * The current half uses the jittered inverse VP because every consumer
33
+ * reconstructs from a depth buffer that was rasterized with jitter applied.
34
+ * Jitter only shifts clip x/y, so pairing it with the unjittered `prevVPMatrix`
35
+ * still produces the correct `w`.
36
+ *
37
+ * Falls back to the current VP before any previous transform exists, which
38
+ * degenerates into comparing the current depth against itself - harmless,
39
+ * because the history textures are empty on that frame anyway.
40
+ *
41
+ * @param ctx - Current draw context
42
+ * @returns The reprojection matrix
43
+ * @internal
44
+ */ function ssgiCurrentToPrevClipMatrix(ctx) {
45
+ const camera = ctx.camera;
46
+ const prevVP = camera.prevVPMatrix ?? camera.viewProjectionMatrix;
47
+ return Matrix4x4.multiply(prevVP, camera.jitteredInvVPMatrix);
48
+ }
49
+ /**
50
+ * Converts the current frame's linear depth at `uv` into the view-space Z it
51
+ * would have had in the previous frame, so it can be compared against the depth
52
+ * stored in the SSGI surface history.
53
+ *
54
+ * `currentToPrevClipMatrix` must be `prevViewProjection * inverse(currentViewProjection)`,
55
+ * mapping a current-frame clip position onto the previous frame's clip space. In
56
+ * a perspective projection the resulting `w` is exactly the previous view-space
57
+ * Z in world units, which is the quantity the surface pass wrote.
58
+ *
59
+ * @param scope - Current shader scope
60
+ * @param currentToPrevClipMatrix - `prevVP * invCurrentVP`, as a mat4
61
+ * @param uv - Screen uv of the pixel being validated
62
+ * @param linearDepth - Normalized linear depth (viewZ / far) at `uv`
63
+ * @param nearFar - Camera near and far planes
64
+ * @returns Previous-frame view-space Z, in world units
65
+ * @internal
66
+ */ function ssgiPreviousViewDepth(scope, currentToPrevClipMatrix, uv, linearDepth, nearFar) {
67
+ const pb = scope.$builder;
68
+ const funcName = 'Z_ssgiPreviousViewDepth';
69
+ pb.func(funcName, [
70
+ pb.mat4('toPrevClip'),
71
+ pb.vec2('uv'),
72
+ pb.float('linearDepth'),
73
+ pb.vec2('nearFar')
74
+ ], function() {
75
+ // Invert the perspective depth mapping. `linearDepth` is the normalized
76
+ // viewZ / far that the depth prepass stored, so the non-linear depth is
77
+ // (near / linearDepth - far) / (near - far) - identical to the
78
+ // reconstruction in SSGI_getPosition. Operating on the normalized value
79
+ // directly matters: converting to world-unit viewZ first and reusing the
80
+ // same expression silently drops a factor of `far`, which pins every
81
+ // pixel at the far plane and rejects all history.
82
+ this.$l.safeLinearDepth = pb.max(this.linearDepth, 1e-6);
83
+ this.$l.ndcZ = pb.div(pb.sub(pb.div(this.nearFar.x, this.safeLinearDepth), this.nearFar.y), pb.sub(this.nearFar.x, this.nearFar.y));
84
+ this.$l.clipPos = pb.vec4(pb.sub(pb.mul(this.uv, 2), pb.vec2(1)), pb.sub(pb.mul(pb.clamp(this.ndcZ, 0, 1), 2), 1), 1);
85
+ // clipPos is already normalized (w = 1 after the NDC divide), so the
86
+ // reprojected w is directly the previous view-space Z.
87
+ this.$return(pb.mul(this.toPrevClip, this.clipPos).w);
88
+ });
89
+ return scope[funcName](currentToPrevClipMatrix, uv, linearDepth, nearFar);
90
+ }
91
+ /**
92
+ * Depth tolerance for a history comparison at a given depth.
93
+ *
94
+ * A single absolute tolerance cannot serve the whole depth range: it is far too
95
+ * loose next to the camera, where a few centimetres separate distinct surfaces,
96
+ * and too tight in the distance, where depth precision and residual reprojection
97
+ * error both scale with viewZ. Scaling the floor by depth keeps the test at a
98
+ * roughly constant relative strictness.
99
+ *
100
+ * @param scope - Current shader scope
101
+ * @param baseTolerance - Configured absolute tolerance, in world units
102
+ * @param viewDepth - View-space Z the comparison happens at, in world units
103
+ * @returns Effective tolerance, in world units
104
+ * @internal
105
+ */ function ssgiDepthTolerance(scope, baseTolerance, viewDepth) {
106
+ const pb = scope.$builder;
107
+ const funcName = 'Z_ssgiDepthTolerance';
108
+ pb.func(funcName, [
109
+ pb.float('baseTolerance'),
110
+ pb.float('viewDepth')
111
+ ], function() {
112
+ this.$return(pb.max(pb.max(this.baseTolerance, 1e-4), pb.mul(pb.abs(this.viewDepth), SSGI_DEPTH_TOLERANCE_SLOPE)));
113
+ });
114
+ return scope[funcName](baseTolerance, viewDepth);
115
+ }
116
+
117
+ export { SSGI_DEPTH_TOLERANCE_SLOPE, ssgiCurrentToPrevClipMatrix, ssgiDepthTolerance, ssgiPreviousViewDepth };
118
+ //# sourceMappingURL=ssgi_reprojection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssgi_reprojection.js","sources":["../../src/shaders/ssgi_reprojection.ts"],"sourcesContent":["import { Matrix4x4 } from '@zephyr3d/base';\nimport type { PBInsideFunctionScope, PBShaderExp } from '@zephyr3d/device';\nimport type { DrawContext } from '../render/drawable';\n\n/**\n * Shared helpers for validating SSGI temporal history across frames.\n *\n * SSGI stores the surface depth of a frame as that frame's view-space Z (the\n * distance along the camera forward axis, in world units). Comparing such a\n * value against the *current* frame's view-space Z is only meaningful while the\n * camera is still: rotating the camera turns the forward axis, so a static world\n * point changes its view-space Z by roughly\n *\n * dz ~ dTheta * viewZ * tan(halfFovX) * |ndc.x|\n *\n * which is zero at the screen center and grows with both depth and screen\n * eccentricity. At a plain mouse-look rate that already exceeds any reasonable\n * absolute tolerance for distant off-center pixels, so history gets rejected in\n * screen-edge bands even though it is perfectly valid. Every consumer therefore\n * has to convert the current depth into the *previous* frame's view space before\n * comparing.\n *\n * @internal\n */\n\n/**\n * Relative share of the compared depth added to the absolute tolerance. 2% keeps\n * a 10m surface within 0.2m, comfortably above rgba16f depth quantization while\n * still separating surfaces that a bounce should not share.\n * @internal\n */\nexport const SSGI_DEPTH_TOLERANCE_SLOPE = 0.02;\n\n/**\n * `prevVP * inverse(currentVP)`: maps a current-frame clip position onto the\n * previous frame's clip space, where `w` is the previous view-space Z.\n *\n * The current half uses the jittered inverse VP because every consumer\n * reconstructs from a depth buffer that was rasterized with jitter applied.\n * Jitter only shifts clip x/y, so pairing it with the unjittered `prevVPMatrix`\n * still produces the correct `w`.\n *\n * Falls back to the current VP before any previous transform exists, which\n * degenerates into comparing the current depth against itself - harmless,\n * because the history textures are empty on that frame anyway.\n *\n * @param ctx - Current draw context\n * @returns The reprojection matrix\n * @internal\n */\nexport function ssgiCurrentToPrevClipMatrix(ctx: DrawContext): Matrix4x4 {\n const camera = ctx.camera;\n const prevVP = camera.prevVPMatrix ?? camera.viewProjectionMatrix;\n return Matrix4x4.multiply(prevVP, camera.jitteredInvVPMatrix);\n}\n\n/**\n * Converts the current frame's linear depth at `uv` into the view-space Z it\n * would have had in the previous frame, so it can be compared against the depth\n * stored in the SSGI surface history.\n *\n * `currentToPrevClipMatrix` must be `prevViewProjection * inverse(currentViewProjection)`,\n * mapping a current-frame clip position onto the previous frame's clip space. In\n * a perspective projection the resulting `w` is exactly the previous view-space\n * Z in world units, which is the quantity the surface pass wrote.\n *\n * @param scope - Current shader scope\n * @param currentToPrevClipMatrix - `prevVP * invCurrentVP`, as a mat4\n * @param uv - Screen uv of the pixel being validated\n * @param linearDepth - Normalized linear depth (viewZ / far) at `uv`\n * @param nearFar - Camera near and far planes\n * @returns Previous-frame view-space Z, in world units\n * @internal\n */\nexport function ssgiPreviousViewDepth(\n scope: PBInsideFunctionScope,\n currentToPrevClipMatrix: PBShaderExp,\n uv: PBShaderExp,\n linearDepth: PBShaderExp,\n nearFar: PBShaderExp\n): PBShaderExp {\n const pb = scope.$builder;\n const funcName = 'Z_ssgiPreviousViewDepth';\n pb.func(\n funcName,\n [pb.mat4('toPrevClip'), pb.vec2('uv'), pb.float('linearDepth'), pb.vec2('nearFar')],\n function () {\n // Invert the perspective depth mapping. `linearDepth` is the normalized\n // viewZ / far that the depth prepass stored, so the non-linear depth is\n // (near / linearDepth - far) / (near - far) - identical to the\n // reconstruction in SSGI_getPosition. Operating on the normalized value\n // directly matters: converting to world-unit viewZ first and reusing the\n // same expression silently drops a factor of `far`, which pins every\n // pixel at the far plane and rejects all history.\n this.$l.safeLinearDepth = pb.max(this.linearDepth, 1e-6);\n this.$l.ndcZ = pb.div(\n pb.sub(pb.div(this.nearFar.x, this.safeLinearDepth), this.nearFar.y),\n pb.sub(this.nearFar.x, this.nearFar.y)\n );\n this.$l.clipPos = pb.vec4(\n pb.sub(pb.mul(this.uv, 2), pb.vec2(1)),\n pb.sub(pb.mul(pb.clamp(this.ndcZ, 0, 1), 2), 1),\n 1\n );\n // clipPos is already normalized (w = 1 after the NDC divide), so the\n // reprojected w is directly the previous view-space Z.\n this.$return(pb.mul(this.toPrevClip, this.clipPos).w);\n }\n );\n return scope[funcName](currentToPrevClipMatrix, uv, linearDepth, nearFar) as PBShaderExp;\n}\n\n/**\n * Depth tolerance for a history comparison at a given depth.\n *\n * A single absolute tolerance cannot serve the whole depth range: it is far too\n * loose next to the camera, where a few centimetres separate distinct surfaces,\n * and too tight in the distance, where depth precision and residual reprojection\n * error both scale with viewZ. Scaling the floor by depth keeps the test at a\n * roughly constant relative strictness.\n *\n * @param scope - Current shader scope\n * @param baseTolerance - Configured absolute tolerance, in world units\n * @param viewDepth - View-space Z the comparison happens at, in world units\n * @returns Effective tolerance, in world units\n * @internal\n */\nexport function ssgiDepthTolerance(\n scope: PBInsideFunctionScope,\n baseTolerance: PBShaderExp,\n viewDepth: PBShaderExp\n): PBShaderExp {\n const pb = scope.$builder;\n const funcName = 'Z_ssgiDepthTolerance';\n pb.func(funcName, [pb.float('baseTolerance'), pb.float('viewDepth')], function () {\n this.$return(\n pb.max(pb.max(this.baseTolerance, 1e-4), pb.mul(pb.abs(this.viewDepth), SSGI_DEPTH_TOLERANCE_SLOPE))\n );\n });\n return scope[funcName](baseTolerance, viewDepth) as PBShaderExp;\n}\n"],"names":["SSGI_DEPTH_TOLERANCE_SLOPE","ssgiCurrentToPrevClipMatrix","ctx","camera","prevVP","prevVPMatrix","viewProjectionMatrix","Matrix4x4","multiply","jitteredInvVPMatrix","ssgiPreviousViewDepth","scope","currentToPrevClipMatrix","uv","linearDepth","nearFar","pb","$builder","funcName","func","mat4","vec2","float","$l","safeLinearDepth","max","ndcZ","div","sub","x","y","clipPos","vec4","mul","clamp","$return","toPrevClip","w","ssgiDepthTolerance","baseTolerance","viewDepth","abs"],"mappings":";;AAIA;;;;;;;;;;;;;;;;;;;;;;;;IA2BaA,MAAAA,0BAAAA,GAA6B;AAE1C;;;;;;;;;;;;;;;;IAiBO,SAASC,2BAAAA,CAA4BC,GAAgB,EAAA;IAC1D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