angular-three-soba 1.14.0 → 2.0.0-beta.3

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 (343) hide show
  1. package/README.md +2 -2
  2. package/abstractions/{lib/billboard → billboard}/billboard.d.ts +14 -4
  3. package/abstractions/catmull-rom-line/catmull-rom-line.d.ts +25 -0
  4. package/abstractions/cubic-bezier-line/cubic-bezier-line.d.ts +25 -0
  5. package/abstractions/{lib/edges → edges}/edges.d.ts +11 -7
  6. package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-helper.d.ts +16 -23
  7. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +22 -0
  8. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +30 -0
  9. package/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +32 -0
  10. package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/gizmo-viewcube.d.ts +2 -3
  11. package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewport/gizmo-viewport-axis.d.ts +28 -9
  12. package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewport/gizmo-viewport.d.ts +23 -4
  13. package/abstractions/index.d.ts +11 -11
  14. package/abstractions/line/line-input.d.ts +42 -0
  15. package/abstractions/line/line.d.ts +35 -0
  16. package/abstractions/{lib/quadratic-bezier-line → quadratic-bezier-line}/quadratic-bezier-line.d.ts +12 -8
  17. package/abstractions/text/text.d.ts +77 -0
  18. package/abstractions/text-3d/text-3d.d.ts +74 -0
  19. package/cameras/{lib/camera → camera}/camera-content.d.ts +1 -1
  20. package/cameras/{lib/camera → camera}/camera.d.ts +12 -8
  21. package/cameras/cube-camera/cube-camera.d.ts +42 -0
  22. package/cameras/index.d.ts +5 -4
  23. package/cameras/{lib/orthographic-camera → orthographic-camera}/orthographic-camera.d.ts +14 -5
  24. package/controls/index.d.ts +1 -1
  25. package/controls/{lib/orbit-controls → orbit-controls}/orbit-controls.d.ts +19 -11
  26. package/esm2022/abstractions/angular-three-soba-abstractions.mjs +1 -1
  27. package/esm2022/abstractions/billboard/billboard.mjs +71 -0
  28. package/esm2022/abstractions/catmull-rom-line/catmull-rom-line.mjs +131 -0
  29. package/esm2022/abstractions/cubic-bezier-line/cubic-bezier-line.mjs +113 -0
  30. package/esm2022/abstractions/edges/edges.mjs +93 -0
  31. package/esm2022/abstractions/gizmo-helper/gizmo-helper.mjs +210 -0
  32. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/constants.mjs +31 -0
  33. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +95 -0
  34. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +155 -0
  35. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +62 -0
  36. package/esm2022/abstractions/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +80 -0
  37. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +206 -0
  38. package/esm2022/abstractions/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +273 -0
  39. package/esm2022/abstractions/index.mjs +12 -12
  40. package/esm2022/abstractions/line/line-input.mjs +113 -0
  41. package/esm2022/abstractions/line/line.mjs +165 -0
  42. package/esm2022/abstractions/quadratic-bezier-line/quadratic-bezier-line.mjs +128 -0
  43. package/esm2022/abstractions/text/text.mjs +275 -0
  44. package/esm2022/abstractions/text-3d/text-3d.mjs +167 -0
  45. package/esm2022/angular-three-soba.mjs +1 -1
  46. package/esm2022/cameras/angular-three-soba-cameras.mjs +1 -1
  47. package/esm2022/cameras/camera/camera-content.mjs +21 -0
  48. package/esm2022/cameras/camera/camera.mjs +71 -0
  49. package/esm2022/cameras/cube-camera/cube-camera.mjs +131 -0
  50. package/esm2022/cameras/index.mjs +6 -5
  51. package/esm2022/cameras/orthographic-camera/orthographic-camera.mjs +99 -0
  52. package/esm2022/cameras/perspective-camera/perspective-camera.mjs +47 -0
  53. package/esm2022/controls/angular-three-soba-controls.mjs +1 -1
  54. package/esm2022/controls/index.mjs +2 -2
  55. package/esm2022/controls/orbit-controls/orbit-controls.mjs +165 -0
  56. package/esm2022/index.mjs +1 -1
  57. package/esm2022/loaders/angular-three-soba-loaders.mjs +1 -1
  58. package/esm2022/loaders/gltf-loader/gltf-loader.mjs +33 -0
  59. package/esm2022/loaders/index.mjs +5 -6
  60. package/esm2022/loaders/loader/loader.mjs +133 -0
  61. package/esm2022/loaders/progress/progress.mjs +52 -0
  62. package/esm2022/loaders/texture-loader/texture-loader.mjs +28 -0
  63. package/esm2022/materials/angular-three-soba-materials.mjs +1 -1
  64. package/esm2022/materials/index.mjs +6 -6
  65. package/esm2022/materials/mesh-distort-material/mesh-distort-material.mjs +73 -0
  66. package/esm2022/materials/mesh-reflector-material/mesh-reflector-material.mjs +383 -0
  67. package/esm2022/materials/mesh-refraction-material/mesh-refraction-material.mjs +168 -0
  68. package/esm2022/materials/mesh-transmission-material/mesh-transmission-material.mjs +257 -0
  69. package/esm2022/materials/mesh-wobble-material/mesh-wobble-material.mjs +66 -0
  70. package/esm2022/misc/angular-three-soba-misc.mjs +1 -1
  71. package/esm2022/misc/animations/animations.mjs +55 -0
  72. package/esm2022/misc/bake-shadows/bake-shadows.mjs +24 -0
  73. package/esm2022/misc/depth-buffer/depth-buffer.mjs +46 -0
  74. package/esm2022/misc/fbo/fbo.mjs +47 -0
  75. package/esm2022/misc/index.mjs +5 -5
  76. package/esm2022/performance/adaptive/adaptive-dpr.mjs +46 -0
  77. package/esm2022/performance/adaptive/adaptive-events.mjs +31 -0
  78. package/esm2022/performance/angular-three-soba-performance.mjs +1 -1
  79. package/esm2022/performance/detailed/detailed.mjs +61 -0
  80. package/esm2022/performance/index.mjs +7 -5
  81. package/esm2022/performance/instances/instance.mjs +48 -0
  82. package/esm2022/performance/instances/instances.mjs +189 -0
  83. package/esm2022/performance/instances/position-mesh.mjs +52 -0
  84. package/esm2022/performance/stats/stats.mjs +79 -0
  85. package/esm2022/shaders/angular-three-soba-shaders.mjs +1 -1
  86. package/esm2022/shaders/blur-pass/blur-pass.mjs +61 -0
  87. package/esm2022/shaders/caustics-material/caustics-material.mjs +128 -0
  88. package/esm2022/shaders/caustics-material/caustics-projection-material.mjs +33 -0
  89. package/esm2022/shaders/convolution-material/convolution-material.mjs +94 -0
  90. package/esm2022/shaders/discard-material/discard-material.mjs +3 -0
  91. package/esm2022/shaders/index.mjs +15 -15
  92. package/esm2022/shaders/mesh-distort-material/mesh-distort-material.mjs +55 -0
  93. package/esm2022/shaders/mesh-reflector-material/mesh-reflector-material.mjs +223 -0
  94. package/esm2022/shaders/mesh-refraction-material/mesh-refraction-material.mjs +170 -0
  95. package/esm2022/shaders/mesh-transmission-material/mesh-transmission-material.mjs +268 -0
  96. package/esm2022/shaders/mesh-wobble-material/mesh-wobble-material.mjs +37 -0
  97. package/esm2022/shaders/shader-material/shader-material.mjs +34 -0
  98. package/esm2022/shaders/soft-shadow-material/soft-shadow-material.mjs +33 -0
  99. package/esm2022/shaders/sparkles-material/sparkles-material.mjs +47 -0
  100. package/esm2022/shaders/spot-light-material/spot-light-material.mjs +86 -0
  101. package/esm2022/shaders/star-field-material/star-field-material.mjs +32 -0
  102. package/esm2022/staging/accumulative-shadows/accumulative-shadows.mjs +283 -0
  103. package/esm2022/staging/accumulative-shadows/progressive-light-map.mjs +108 -0
  104. package/esm2022/staging/accumulative-shadows/randomized-lights.mjs +208 -0
  105. package/esm2022/staging/angular-three-soba-staging.mjs +1 -1
  106. package/esm2022/staging/bounds/bounds.mjs +307 -0
  107. package/esm2022/staging/camera-shake/camera-shake.mjs +117 -0
  108. package/esm2022/staging/caustics/caustisc.mjs +384 -0
  109. package/esm2022/staging/center/center.mjs +148 -0
  110. package/esm2022/staging/cloud/cloud.mjs +164 -0
  111. package/esm2022/staging/contact-shadows/contact-shadows.mjs +249 -0
  112. package/esm2022/staging/environment/assets.mjs +13 -0
  113. package/esm2022/staging/environment/environment-cube.mjs +49 -0
  114. package/esm2022/staging/environment/environment-ground.mjs +43 -0
  115. package/esm2022/staging/environment/environment-input.mjs +106 -0
  116. package/esm2022/staging/environment/environment-map.mjs +53 -0
  117. package/esm2022/staging/environment/environment-portal.mjs +135 -0
  118. package/esm2022/staging/environment/environment.mjs +78 -0
  119. package/esm2022/staging/environment/utils.mjs +84 -0
  120. package/esm2022/staging/float/float.mjs +82 -0
  121. package/esm2022/staging/index.mjs +18 -18
  122. package/esm2022/staging/sky/sky.mjs +114 -0
  123. package/esm2022/staging/sparkles/sparkles.mjs +161 -0
  124. package/esm2022/staging/spot-light/spot-light-input.mjs +75 -0
  125. package/esm2022/staging/spot-light/spot-light-shadow-mesh-input.mjs +57 -0
  126. package/esm2022/staging/spot-light/spot-light-shadow-mesh.mjs +256 -0
  127. package/esm2022/staging/spot-light/spot-light.mjs +94 -0
  128. package/esm2022/staging/spot-light/volumetric-mesh.mjs +101 -0
  129. package/esm2022/staging/stage/stage.mjs +374 -0
  130. package/esm2022/staging/stars/stars.mjs +148 -0
  131. package/fesm2022/angular-three-soba-abstractions.mjs +1116 -890
  132. package/fesm2022/angular-three-soba-abstractions.mjs.map +1 -1
  133. package/fesm2022/angular-three-soba-cameras.mjs +126 -122
  134. package/fesm2022/angular-three-soba-cameras.mjs.map +1 -1
  135. package/fesm2022/angular-three-soba-controls.mjs +72 -54
  136. package/fesm2022/angular-three-soba-controls.mjs.map +1 -1
  137. package/fesm2022/angular-three-soba-loaders.mjs +147 -131
  138. package/fesm2022/angular-three-soba-loaders.mjs.map +1 -1
  139. package/fesm2022/angular-three-soba-materials.mjs +340 -258
  140. package/fesm2022/angular-three-soba-materials.mjs.map +1 -1
  141. package/fesm2022/angular-three-soba-misc.mjs +140 -123
  142. package/fesm2022/angular-three-soba-misc.mjs.map +1 -1
  143. package/fesm2022/angular-three-soba-performance.mjs +383 -106
  144. package/fesm2022/angular-three-soba-performance.mjs.map +1 -1
  145. package/fesm2022/angular-three-soba-shaders.mjs +57 -9
  146. package/fesm2022/angular-three-soba-shaders.mjs.map +1 -1
  147. package/fesm2022/angular-three-soba-staging.mjs +1609 -1561
  148. package/fesm2022/angular-three-soba-staging.mjs.map +1 -1
  149. package/fesm2022/angular-three-soba.mjs.map +1 -1
  150. package/loaders/gltf-loader/gltf-loader.d.ts +9 -0
  151. package/loaders/index.d.ts +4 -5
  152. package/loaders/{lib/loader → loader}/loader.d.ts +20 -15
  153. package/loaders/progress/progress.d.ts +9 -0
  154. package/loaders/texture-loader/texture-loader.d.ts +7 -0
  155. package/materials/index.d.ts +5 -5
  156. package/materials/{lib/mesh-distort-material → mesh-distort-material}/mesh-distort-material.d.ts +11 -5
  157. package/materials/mesh-reflector-material/mesh-reflector-material.d.ts +81 -0
  158. package/materials/mesh-refraction-material/mesh-refraction-material.d.ts +50 -0
  159. package/materials/{lib/mesh-transmission-material → mesh-transmission-material}/mesh-transmission-material.d.ts +51 -6
  160. package/materials/{lib/mesh-wobble-material → mesh-wobble-material}/mesh-wobble-material.d.ts +9 -3
  161. package/misc/animations/animations.d.ts +13 -0
  162. package/misc/{lib/bake-shadows → bake-shadows}/bake-shadows.d.ts +2 -5
  163. package/misc/depth-buffer/depth-buffer.d.ts +9 -0
  164. package/misc/{lib/fbo → fbo}/fbo.d.ts +4 -2
  165. package/misc/index.d.ts +4 -4
  166. package/package.json +25 -23
  167. package/performance/{lib/adaptive → adaptive}/adaptive-dpr.d.ts +4 -7
  168. package/performance/{lib/adaptive → adaptive}/adaptive-events.d.ts +2 -6
  169. package/performance/detailed/detailed.d.ts +20 -0
  170. package/performance/index.d.ts +6 -4
  171. package/performance/instances/instance.d.ts +9 -0
  172. package/performance/instances/instances.d.ts +35 -0
  173. package/performance/instances/position-mesh.d.ts +10 -0
  174. package/performance/{lib/stats → stats}/stats.d.ts +10 -7
  175. package/plugin/package.json +1 -1
  176. package/plugin/src/generators/init/compat.js.map +1 -1
  177. package/plugin/src/generators/init/init.d.ts +1 -1
  178. package/plugin/src/generators/init/init.js +1 -1
  179. package/plugin/src/generators/init/init.js.map +1 -1
  180. package/plugin/src/index.js.map +1 -1
  181. package/shaders/{lib/blur-pass → blur-pass}/blur-pass.d.ts +2 -2
  182. package/shaders/index.d.ts +14 -14
  183. package/shaders/{lib/mesh-distort-material → mesh-distort-material}/mesh-distort-material.d.ts +1 -1
  184. package/shaders/{lib/mesh-wobble-material → mesh-wobble-material}/mesh-wobble-material.d.ts +1 -0
  185. package/shaders/{lib/soft-shadow-material → soft-shadow-material}/soft-shadow-material.d.ts +2 -2
  186. package/shaders/sparkles-material/sparkles-material.d.ts +3 -0
  187. package/staging/{lib/accumulative-shadows → accumulative-shadows}/accumulative-shadows.d.ts +55 -17
  188. package/staging/{lib/accumulative-shadows → accumulative-shadows}/progressive-light-map.d.ts +2 -2
  189. package/staging/{lib/accumulative-shadows → accumulative-shadows}/randomized-lights.d.ts +45 -10
  190. package/staging/{lib/bounds → bounds}/bounds.d.ts +32 -22
  191. package/staging/{lib/camera-shake → camera-shake}/camera-shake.d.ts +15 -11
  192. package/staging/{lib/caustics/caustics.d.ts → caustics/caustisc.d.ts} +36 -13
  193. package/staging/{lib/center → center}/center.d.ts +30 -8
  194. package/staging/cloud/cloud.d.ts +48 -0
  195. package/staging/{lib/contact-shadows → contact-shadows}/contact-shadows.d.ts +38 -10
  196. package/staging/environment/environment-cube.d.ts +11 -0
  197. package/staging/environment/environment-ground.d.ts +13 -0
  198. package/staging/environment/environment-input.d.ts +68 -0
  199. package/staging/environment/environment-map.d.ts +11 -0
  200. package/staging/{lib/environment → environment}/environment-portal.d.ts +5 -7
  201. package/staging/{lib/environment → environment}/environment.d.ts +2 -2
  202. package/staging/environment/utils.d.ts +7 -0
  203. package/staging/float/float.d.ts +27 -0
  204. package/staging/index.d.ts +17 -17
  205. package/staging/{lib/sky → sky}/sky.d.ts +26 -5
  206. package/staging/{lib/sparkles → sparkles}/sparkles.d.ts +30 -10
  207. package/staging/{lib/spot-light → spot-light}/spot-light-input.d.ts +24 -2
  208. package/staging/{lib/spot-light/shadow-mesh-input.d.ts → spot-light/spot-light-shadow-mesh-input.d.ts} +18 -3
  209. package/staging/spot-light/spot-light-shadow-mesh.d.ts +38 -0
  210. package/staging/{lib/spot-light → spot-light}/spot-light.d.ts +11 -5
  211. package/staging/{lib/spot-light → spot-light}/volumetric-mesh.d.ts +8 -5
  212. package/staging/{lib/stage → stage}/stage.d.ts +33 -14
  213. package/staging/{lib/stars → stars}/stars.d.ts +21 -7
  214. package/abstractions/lib/catmull-rom-line/catmull-rom-line.d.ts +0 -15
  215. package/abstractions/lib/cubic-bezier-line/cubic-bezier-line.d.ts +0 -15
  216. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.d.ts +0 -16
  217. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.d.ts +0 -24
  218. package/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.d.ts +0 -14
  219. package/abstractions/lib/line/line-input.d.ts +0 -19
  220. package/abstractions/lib/line/line.d.ts +0 -21
  221. package/abstractions/lib/text/text.d.ts +0 -21
  222. package/abstractions/lib/text-3d/text-3d.d.ts +0 -39
  223. package/assets/default-spot-light-shadow.glsl +0 -10
  224. package/cameras/lib/cube-camera/cube-camera.d.ts +0 -27
  225. package/esm2022/abstractions/lib/billboard/billboard.mjs +0 -74
  226. package/esm2022/abstractions/lib/catmull-rom-line/catmull-rom-line.mjs +0 -120
  227. package/esm2022/abstractions/lib/cubic-bezier-line/cubic-bezier-line.mjs +0 -99
  228. package/esm2022/abstractions/lib/edges/edges.mjs +0 -96
  229. package/esm2022/abstractions/lib/gizmo-helper/gizmo-helper.mjs +0 -213
  230. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/constants.mjs +0 -31
  231. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-edge.mjs +0 -92
  232. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-face.mjs +0 -184
  233. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube-inputs.mjs +0 -46
  234. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewcube/gizmo-viewcube.mjs +0 -134
  235. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport-axis.mjs +0 -195
  236. package/esm2022/abstractions/lib/gizmo-helper/gizmo-viewport/gizmo-viewport.mjs +0 -267
  237. package/esm2022/abstractions/lib/line/line-input.mjs +0 -76
  238. package/esm2022/abstractions/lib/line/line.mjs +0 -133
  239. package/esm2022/abstractions/lib/quadratic-bezier-line/quadratic-bezier-line.mjs +0 -128
  240. package/esm2022/abstractions/lib/text/text.mjs +0 -115
  241. package/esm2022/abstractions/lib/text-3d/text-3d.mjs +0 -145
  242. package/esm2022/cameras/lib/camera/camera-content.mjs +0 -21
  243. package/esm2022/cameras/lib/camera/camera.mjs +0 -75
  244. package/esm2022/cameras/lib/cube-camera/cube-camera.mjs +0 -131
  245. package/esm2022/cameras/lib/orthographic-camera/orthographic-camera.mjs +0 -93
  246. package/esm2022/cameras/lib/perspective-camera/perspective-camera.mjs +0 -47
  247. package/esm2022/controls/lib/orbit-controls/orbit-controls.mjs +0 -147
  248. package/esm2022/loaders/lib/cube-texture-loader/cube-texture-loader.mjs +0 -10
  249. package/esm2022/loaders/lib/gltf-loader/gltf-loader.mjs +0 -32
  250. package/esm2022/loaders/lib/loader/loader.mjs +0 -134
  251. package/esm2022/loaders/lib/progress/progress.mjs +0 -39
  252. package/esm2022/loaders/lib/texture-loader/texture-loader.mjs +0 -19
  253. package/esm2022/materials/lib/mesh-distort-material/mesh-distort-material.mjs +0 -75
  254. package/esm2022/materials/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -328
  255. package/esm2022/materials/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -158
  256. package/esm2022/materials/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -238
  257. package/esm2022/materials/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -68
  258. package/esm2022/misc/lib/animations/animations.mjs +0 -52
  259. package/esm2022/misc/lib/bake-shadows/bake-shadows.mjs +0 -26
  260. package/esm2022/misc/lib/depth-buffer/depth-buffer.mjs +0 -39
  261. package/esm2022/misc/lib/fbo/fbo.mjs +0 -39
  262. package/esm2022/performance/lib/adaptive/adaptive-dpr.mjs +0 -47
  263. package/esm2022/performance/lib/adaptive/adaptive-events.mjs +0 -37
  264. package/esm2022/performance/lib/detailed/detailed.mjs +0 -54
  265. package/esm2022/performance/lib/stats/stats.mjs +0 -80
  266. package/esm2022/shaders/lib/blur-pass/blur-pass.mjs +0 -61
  267. package/esm2022/shaders/lib/caustics-material/caustics-material.mjs +0 -128
  268. package/esm2022/shaders/lib/caustics-projection-material/caustics-projection-material.mjs +0 -33
  269. package/esm2022/shaders/lib/convolution-material/convolution-material.mjs +0 -94
  270. package/esm2022/shaders/lib/discard-material/discard-material.mjs +0 -3
  271. package/esm2022/shaders/lib/mesh-distort-material/mesh-distort-material.mjs +0 -55
  272. package/esm2022/shaders/lib/mesh-reflector-material/mesh-reflector-material.mjs +0 -223
  273. package/esm2022/shaders/lib/mesh-refraction-material/mesh-refraction-material.mjs +0 -169
  274. package/esm2022/shaders/lib/mesh-transmission-material/mesh-transmission-material.mjs +0 -268
  275. package/esm2022/shaders/lib/mesh-wobble-material/mesh-wobble-material.mjs +0 -37
  276. package/esm2022/shaders/lib/shader-material/shader-material.mjs +0 -34
  277. package/esm2022/shaders/lib/soft-shadow-material/soft-shadow-material.mjs +0 -33
  278. package/esm2022/shaders/lib/spot-light-material/spot-light-material.mjs +0 -86
  279. package/esm2022/shaders/lib/star-field-material/star-field-material.mjs +0 -32
  280. package/esm2022/staging/lib/accumulative-shadows/accumulative-shadows.mjs +0 -249
  281. package/esm2022/staging/lib/accumulative-shadows/progressive-light-map.mjs +0 -108
  282. package/esm2022/staging/lib/accumulative-shadows/randomized-lights.mjs +0 -201
  283. package/esm2022/staging/lib/bounds/bounds.mjs +0 -284
  284. package/esm2022/staging/lib/camera-shake/camera-shake.mjs +0 -122
  285. package/esm2022/staging/lib/caustics/caustics.mjs +0 -364
  286. package/esm2022/staging/lib/center/center.mjs +0 -143
  287. package/esm2022/staging/lib/cloud/cloud.mjs +0 -160
  288. package/esm2022/staging/lib/contact-shadows/contact-shadows.mjs +0 -228
  289. package/esm2022/staging/lib/environment/assets.mjs +0 -13
  290. package/esm2022/staging/lib/environment/environment-cube.mjs +0 -41
  291. package/esm2022/staging/lib/environment/environment-ground.mjs +0 -67
  292. package/esm2022/staging/lib/environment/environment-inputs.mjs +0 -87
  293. package/esm2022/staging/lib/environment/environment-map.mjs +0 -39
  294. package/esm2022/staging/lib/environment/environment-portal.mjs +0 -111
  295. package/esm2022/staging/lib/environment/environment.mjs +0 -165
  296. package/esm2022/staging/lib/environment/utils.mjs +0 -70
  297. package/esm2022/staging/lib/float/float.mjs +0 -77
  298. package/esm2022/staging/lib/sky/sky.mjs +0 -109
  299. package/esm2022/staging/lib/sparkles/sparkles.mjs +0 -210
  300. package/esm2022/staging/lib/spot-light/common.mjs +0 -42
  301. package/esm2022/staging/lib/spot-light/shadow-mesh-input.mjs +0 -51
  302. package/esm2022/staging/lib/spot-light/spot-light-input.mjs +0 -62
  303. package/esm2022/staging/lib/spot-light/spot-light-shadow-no-shader.mjs +0 -74
  304. package/esm2022/staging/lib/spot-light/spot-light-shadow-shader.mjs +0 -126
  305. package/esm2022/staging/lib/spot-light/spot-light-shadow.mjs +0 -63
  306. package/esm2022/staging/lib/spot-light/spot-light.mjs +0 -117
  307. package/esm2022/staging/lib/spot-light/volumetric-mesh.mjs +0 -86
  308. package/esm2022/staging/lib/stage/stage.mjs +0 -368
  309. package/esm2022/staging/lib/stars/stars.mjs +0 -140
  310. package/loaders/lib/cube-texture-loader/cube-texture-loader.d.ts +0 -3
  311. package/loaders/lib/gltf-loader/gltf-loader.d.ts +0 -8
  312. package/loaders/lib/progress/progress.d.ts +0 -16
  313. package/loaders/lib/texture-loader/texture-loader.d.ts +0 -5
  314. package/materials/lib/mesh-reflector-material/mesh-reflector-material.d.ts +0 -41
  315. package/materials/lib/mesh-refraction-material/mesh-refraction-material.d.ts +0 -28
  316. package/misc/lib/animations/animations.d.ts +0 -13
  317. package/misc/lib/depth-buffer/depth-buffer.d.ts +0 -7
  318. package/performance/lib/detailed/detailed.d.ts +0 -13
  319. package/staging/lib/cloud/cloud.d.ts +0 -23
  320. package/staging/lib/environment/environment-cube.d.ts +0 -11
  321. package/staging/lib/environment/environment-ground.d.ts +0 -9
  322. package/staging/lib/environment/environment-inputs.d.ts +0 -28
  323. package/staging/lib/environment/environment-map.d.ts +0 -10
  324. package/staging/lib/environment/utils.d.ts +0 -8
  325. package/staging/lib/float/float.d.ts +0 -16
  326. package/staging/lib/spot-light/common.d.ts +0 -3
  327. package/staging/lib/spot-light/spot-light-shadow-no-shader.d.ts +0 -14
  328. package/staging/lib/spot-light/spot-light-shadow-shader.d.ts +0 -25
  329. package/staging/lib/spot-light/spot-light-shadow.d.ts +0 -6
  330. /package/abstractions/{lib/gizmo-helper → gizmo-helper}/gizmo-viewcube/constants.d.ts +0 -0
  331. /package/cameras/{lib/perspective-camera → perspective-camera}/perspective-camera.d.ts +0 -0
  332. /package/plugin/{README.md → libs/plugin/README.md} +0 -0
  333. /package/shaders/{lib/caustics-material → caustics-material}/caustics-material.d.ts +0 -0
  334. /package/shaders/{lib/caustics-projection-material → caustics-material}/caustics-projection-material.d.ts +0 -0
  335. /package/shaders/{lib/convolution-material → convolution-material}/convolution-material.d.ts +0 -0
  336. /package/shaders/{lib/discard-material → discard-material}/discard-material.d.ts +0 -0
  337. /package/shaders/{lib/mesh-reflector-material → mesh-reflector-material}/mesh-reflector-material.d.ts +0 -0
  338. /package/shaders/{lib/mesh-refraction-material → mesh-refraction-material}/mesh-refraction-material.d.ts +0 -0
  339. /package/shaders/{lib/mesh-transmission-material → mesh-transmission-material}/mesh-transmission-material.d.ts +0 -0
  340. /package/shaders/{lib/shader-material → shader-material}/shader-material.d.ts +0 -0
  341. /package/shaders/{lib/spot-light-material → spot-light-material}/spot-light-material.d.ts +0 -0
  342. /package/shaders/{lib/star-field-material → star-field-material}/star-field-material.d.ts +0 -0
  343. /package/staging/{lib/environment → environment}/assets.d.ts +0 -0
@@ -1,14 +1,13 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, Component, CUSTOM_ELEMENTS_SCHEMA, Input } from '@angular/core';
3
- import { NgtRxStore, injectNgtRef, injectBeforeRender, NgtArgs, extend, NgtStore, startWithUndefined, getLocalState, NgtPush } from 'angular-three';
2
+ import { inject, Component, CUSTOM_ELEMENTS_SCHEMA, Input, computed, effect } from '@angular/core';
3
+ import { NgtSignalStore, injectNgtRef, injectBeforeRender, NgtArgs, extend, NgtStore, getLocalState } from 'angular-three';
4
4
  import { NGTS_DISTORT_MATERIAL_SHADER, MeshReflectorMaterial, BlurPass, MeshRefractionMaterial, MeshTransmissionMaterial, DiscardMaterial, MeshWobbleMaterial } from 'angular-three-soba/shaders';
5
5
  import { NgIf } from '@angular/common';
6
- import { debounceTime, map, combineLatest } from 'rxjs';
7
6
  import * as THREE from 'three';
8
7
  import { MeshBVH, SAH } from 'three-mesh-bvh';
9
8
  import { injectNgtsFBO } from 'angular-three-soba/misc';
10
9
 
11
- class NgtsMeshDistortMaterial extends NgtRxStore {
10
+ class NgtsMeshDistortMaterial extends NgtSignalStore {
12
11
  set time(time) {
13
12
  this.set({ time });
14
13
  }
@@ -21,15 +20,13 @@ class NgtsMeshDistortMaterial extends NgtRxStore {
21
20
  set speed(speed) {
22
21
  this.set({ speed });
23
22
  }
24
- initialize() {
25
- super.initialize();
26
- this.set({ speed: 1, time: 0, distort: 0.4, radius: 1 });
27
- }
28
23
  constructor() {
29
- super();
30
- this.MeshDistortMaterial = inject(NGTS_DISTORT_MATERIAL_SHADER);
31
- this.material = new this.MeshDistortMaterial();
24
+ super({ speed: 1, time: 0, distort: 0.4, radius: 1 });
25
+ this.material = new (inject(NGTS_DISTORT_MATERIAL_SHADER))();
32
26
  this.materialRef = injectNgtRef();
27
+ this.distortTime = this.select('time');
28
+ this.distortDistort = this.select('distort');
29
+ this.distortRadius = this.select('radius');
33
30
  injectBeforeRender(({ clock }) => {
34
31
  this.material.time = clock.getElapsedTime() * this.get('speed');
35
32
  });
@@ -39,9 +36,9 @@ class NgtsMeshDistortMaterial extends NgtRxStore {
39
36
  <ngt-primitive
40
37
  *args="[material]"
41
38
  [ref]="materialRef"
42
- [time]="get('time')"
43
- [distort]="get('distort')"
44
- [radius]="get('radius')"
39
+ [time]="distortTime()"
40
+ [distort]="distortDistort()"
41
+ [radius]="distortRadius()"
45
42
  ngtCompound
46
43
  attach="material"
47
44
  />
@@ -56,9 +53,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
56
53
  <ngt-primitive
57
54
  *args="[material]"
58
55
  [ref]="materialRef"
59
- [time]="get('time')"
60
- [distort]="get('distort')"
61
- [radius]="get('radius')"
56
+ [time]="distortTime()"
57
+ [distort]="distortDistort()"
58
+ [radius]="distortRadius()"
62
59
  ngtCompound
63
60
  attach="material"
64
61
  />
@@ -79,7 +76,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
79
76
  }] } });
80
77
 
81
78
  extend({ MeshReflectorMaterial });
82
- class NgtsMeshReflectorMaterial extends NgtRxStore {
79
+ class NgtsMeshReflectorMaterial extends NgtSignalStore {
83
80
  set resolution(resolution) {
84
81
  this.set({ resolution });
85
82
  }
@@ -119,12 +116,37 @@ class NgtsMeshReflectorMaterial extends NgtRxStore {
119
116
  set reflectorOffset(reflectorOffset) {
120
117
  this.set({ reflectorOffset });
121
118
  }
122
- get reflectorProps() {
123
- return this.get('reflectorEntities', 'reflectorProps');
124
- }
125
- initialize() {
126
- super.initialize();
127
- this.set({
119
+ #store;
120
+ #gl;
121
+ #reflectorPlane;
122
+ #normal;
123
+ #reflectorWorldPosition;
124
+ #cameraWorldPosition;
125
+ #rotationMatrix;
126
+ #lookAtPosition;
127
+ #clipPlane;
128
+ #view;
129
+ #target;
130
+ #q;
131
+ #textureMatrix;
132
+ #virtualCamera;
133
+ #blur;
134
+ #resolution;
135
+ #mirror;
136
+ #mixBlur;
137
+ #mixStrength;
138
+ #minDepthThreshold;
139
+ #maxDepthThreshold;
140
+ #depthScale;
141
+ #depthToBlurRatioBias;
142
+ #distortion;
143
+ #distortionMap;
144
+ #mixContrast;
145
+ #normalizedBlur;
146
+ #hasBlur;
147
+ #reflectorEntities;
148
+ constructor() {
149
+ super({
128
150
  mixBlur: 0,
129
151
  mixStrength: 1,
130
152
  resolution: 256,
@@ -138,42 +160,73 @@ class NgtsMeshReflectorMaterial extends NgtRxStore {
138
160
  mixContrast: 1,
139
161
  reflectorOffset: 0,
140
162
  });
141
- }
142
- constructor() {
143
- super();
144
163
  this.materialRef = injectNgtRef();
145
- this.defines$ = this.select('reflectorEntities', 'reflectorProps', 'defines').pipe(debounceTime(0));
146
- this.store = inject(NgtStore);
147
- this.reflectorPlane = new THREE.Plane();
148
- this.normal = new THREE.Vector3();
149
- this.reflectorWorldPosition = new THREE.Vector3();
150
- this.cameraWorldPosition = new THREE.Vector3();
151
- this.rotationMatrix = new THREE.Matrix4();
152
- this.lookAtPosition = new THREE.Vector3(0, 0, -1);
153
- this.clipPlane = new THREE.Vector4();
154
- this.view = new THREE.Vector3();
155
- this.target = new THREE.Vector3();
156
- this.q = new THREE.Vector4();
157
- this.textureMatrix = new THREE.Matrix4();
158
- this.virtualCamera = new THREE.PerspectiveCamera();
159
- this.connect('normalizedBlur', this.select('blur').pipe(map((blur) => (Array.isArray(blur) ? blur : [blur, blur]))));
160
- this.connect('hasBlur', this.select('normalizedBlur').pipe(map(([x, y]) => x + y > 0)));
161
- this.connect('reflectorEntities', combineLatest([
162
- this.store.select('gl'),
163
- this.select('normalizedBlur'),
164
- this.select('resolution'),
165
- this.select('mirror'),
166
- this.select('hasBlur'),
167
- this.select('mixBlur'),
168
- this.select('mixStrength'),
169
- this.select('minDepthThreshold'),
170
- this.select('maxDepthThreshold'),
171
- this.select('depthScale'),
172
- this.select('depthToBlurRatioBias'),
173
- this.select('distortion'),
174
- this.select('distortionMap').pipe(startWithUndefined()),
175
- this.select('mixContrast'),
176
- ]).pipe(map(([gl, blur, resolution, mirror, hasBlur, mixBlur, mixStrength, minDepthThreshold, maxDepthThreshold, depthScale, depthToBlurRatioBias, distortion, distortionMap, mixContrast,]) => {
164
+ this.reflectorProps = computed(() => this.#reflectorEntities().reflectorProps);
165
+ this.defines = computed(() => this.reflectorProps().defines);
166
+ this.reflectorMirror = computed(() => this.reflectorProps().mirror);
167
+ this.reflectorTextureMatrix = computed(() => this.reflectorProps().textureMatrix);
168
+ this.reflectorMixBlur = computed(() => this.reflectorProps().mixBlur);
169
+ this.reflectorTDiffuse = computed(() => this.reflectorProps().tDiffuse);
170
+ this.reflectorTDepth = computed(() => this.reflectorProps().tDepth);
171
+ this.reflectorTDiffuseBlur = computed(() => this.reflectorProps().tDiffuseBlur);
172
+ this.reflectorHasBlur = computed(() => this.reflectorProps().hasBlur);
173
+ this.reflectorMixStrength = computed(() => this.reflectorProps().mixStrength);
174
+ this.reflectorMinDepthThreshold = computed(() => this.reflectorProps().minDepthThreshold);
175
+ this.reflectorMaxDepthThreshold = computed(() => this.reflectorProps().maxDepthThreshold);
176
+ this.reflectorDepthScale = computed(() => this.reflectorProps().depthScale);
177
+ this.reflectorDepthToBlurRatioBias = computed(() => this.reflectorProps().depthToBlurRatioBias);
178
+ this.reflectorDistortion = computed(() => this.reflectorProps().distortion);
179
+ this.reflectorDistortionMap = computed(() => this.reflectorProps().distortionMap);
180
+ this.reflectorMixContrast = computed(() => this.reflectorProps().mixContrast);
181
+ this.#store = inject(NgtStore);
182
+ this.#gl = this.#store.select('gl');
183
+ this.#reflectorPlane = new THREE.Plane();
184
+ this.#normal = new THREE.Vector3();
185
+ this.#reflectorWorldPosition = new THREE.Vector3();
186
+ this.#cameraWorldPosition = new THREE.Vector3();
187
+ this.#rotationMatrix = new THREE.Matrix4();
188
+ this.#lookAtPosition = new THREE.Vector3(0, 0, -1);
189
+ this.#clipPlane = new THREE.Vector4();
190
+ this.#view = new THREE.Vector3();
191
+ this.#target = new THREE.Vector3();
192
+ this.#q = new THREE.Vector4();
193
+ this.#textureMatrix = new THREE.Matrix4();
194
+ this.#virtualCamera = new THREE.PerspectiveCamera();
195
+ this.#blur = this.select('blur');
196
+ this.#resolution = this.select('resolution');
197
+ this.#mirror = this.select('mirror');
198
+ this.#mixBlur = this.select('mixBlur');
199
+ this.#mixStrength = this.select('mixStrength');
200
+ this.#minDepthThreshold = this.select('minDepthThreshold');
201
+ this.#maxDepthThreshold = this.select('maxDepthThreshold');
202
+ this.#depthScale = this.select('depthScale');
203
+ this.#depthToBlurRatioBias = this.select('depthToBlurRatioBias');
204
+ this.#distortion = this.select('distortion');
205
+ this.#distortionMap = this.select('distortionMap');
206
+ this.#mixContrast = this.select('mixContrast');
207
+ this.#normalizedBlur = computed(() => {
208
+ const blur = this.#blur();
209
+ return Array.isArray(blur) ? blur : [blur, blur];
210
+ });
211
+ this.#hasBlur = computed(() => {
212
+ const [x, y] = this.#normalizedBlur();
213
+ return x + y > 0;
214
+ });
215
+ this.#reflectorEntities = computed(() => {
216
+ const gl = this.#gl();
217
+ const resolution = this.#resolution();
218
+ const blur = this.#normalizedBlur();
219
+ const minDepthThreshold = this.#minDepthThreshold();
220
+ const maxDepthThreshold = this.#maxDepthThreshold();
221
+ const depthScale = this.#depthScale();
222
+ const depthToBlurRatioBias = this.#depthToBlurRatioBias();
223
+ const mirror = this.#mirror();
224
+ const mixBlur = this.#mixBlur();
225
+ const mixStrength = this.#mixStrength();
226
+ const mixContrast = this.#mixContrast();
227
+ const distortion = this.#distortion();
228
+ const distortionMap = this.#distortionMap();
229
+ const hasBlur = this.#hasBlur();
177
230
  const parameters = {
178
231
  minFilter: THREE.LinearFilter,
179
232
  magFilter: THREE.LinearFilter,
@@ -198,7 +251,7 @@ class NgtsMeshReflectorMaterial extends NgtRxStore {
198
251
  });
199
252
  const reflectorProps = {
200
253
  mirror,
201
- textureMatrix: this.textureMatrix,
254
+ textureMatrix: this.#textureMatrix,
202
255
  mixBlur,
203
256
  tDiffuse: fbo1.texture,
204
257
  tDepth: fbo1.depthTexture,
@@ -219,85 +272,30 @@ class NgtsMeshReflectorMaterial extends NgtRxStore {
219
272
  },
220
273
  };
221
274
  return { fbo1, fbo2, blurPass, reflectorProps };
222
- })));
223
- injectBeforeRender(this.onBeforeRender.bind(this));
224
- }
225
- beforeRender(state) {
226
- const parent = getLocalState(this.materialRef.nativeElement).parent;
227
- if (!parent)
228
- return;
229
- const { camera } = state;
230
- this.reflectorWorldPosition.setFromMatrixPosition(parent.matrixWorld);
231
- this.cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);
232
- this.rotationMatrix.extractRotation(parent.matrixWorld);
233
- this.normal.set(0, 0, 1);
234
- this.normal.applyMatrix4(this.rotationMatrix);
235
- this.reflectorWorldPosition.addScaledVector(this.normal, this.get('reflectorOffset'));
236
- this.view.subVectors(this.reflectorWorldPosition, this.cameraWorldPosition);
237
- // Avoid rendering when reflector is facing away
238
- if (this.view.dot(this.normal) > 0)
239
- return;
240
- this.view.reflect(this.normal).negate();
241
- this.view.add(this.reflectorWorldPosition);
242
- this.rotationMatrix.extractRotation(camera.matrixWorld);
243
- this.lookAtPosition.set(0, 0, -1);
244
- this.lookAtPosition.applyMatrix4(this.rotationMatrix);
245
- this.lookAtPosition.add(this.cameraWorldPosition);
246
- this.target.subVectors(this.reflectorWorldPosition, this.lookAtPosition);
247
- this.target.reflect(this.normal).negate();
248
- this.target.add(this.reflectorWorldPosition);
249
- this.virtualCamera.position.copy(this.view);
250
- this.virtualCamera.up.set(0, 1, 0);
251
- this.virtualCamera.up.applyMatrix4(this.rotationMatrix);
252
- this.virtualCamera.up.reflect(this.normal);
253
- this.virtualCamera.lookAt(this.target);
254
- this.virtualCamera.far = camera.far; // Used in WebGLBackground
255
- this.virtualCamera.updateMatrixWorld();
256
- this.virtualCamera.projectionMatrix.copy(camera.projectionMatrix);
257
- // Update the texture matrix
258
- this.textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);
259
- this.textureMatrix.multiply(this.virtualCamera.projectionMatrix);
260
- this.textureMatrix.multiply(this.virtualCamera.matrixWorldInverse);
261
- this.textureMatrix.multiply(parent.matrixWorld);
262
- // Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html
263
- // Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
264
- this.reflectorPlane.setFromNormalAndCoplanarPoint(this.normal, this.reflectorWorldPosition);
265
- this.reflectorPlane.applyMatrix4(this.virtualCamera.matrixWorldInverse);
266
- this.clipPlane.set(this.reflectorPlane.normal.x, this.reflectorPlane.normal.y, this.reflectorPlane.normal.z, this.reflectorPlane.constant);
267
- const projectionMatrix = this.virtualCamera.projectionMatrix;
268
- this.q.x = (Math.sign(this.clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];
269
- this.q.y = (Math.sign(this.clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];
270
- this.q.z = -1.0;
271
- this.q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];
272
- // Calculate the scaled plane vector
273
- this.clipPlane.multiplyScalar(2.0 / this.clipPlane.dot(this.q));
274
- // Replacing the third row of the projection matrix
275
- projectionMatrix.elements[2] = this.clipPlane.x;
276
- projectionMatrix.elements[6] = this.clipPlane.y;
277
- projectionMatrix.elements[10] = this.clipPlane.z + 1.0;
278
- projectionMatrix.elements[14] = this.clipPlane.w;
275
+ });
276
+ injectBeforeRender(this.#onBeforeRender.bind(this));
279
277
  }
280
- onBeforeRender(state) {
278
+ #onBeforeRender(state) {
281
279
  if (!this.materialRef.nativeElement)
282
280
  return;
283
- const parent = getLocalState(this.materialRef.nativeElement).parent;
281
+ const parent = getLocalState(this.materialRef.nativeElement).parent();
284
282
  if (!parent)
285
283
  return;
286
284
  const { gl, scene } = state;
287
- const { hasBlur } = this.get();
288
- const { fbo1, fbo2, blurPass } = this.get('reflectorEntities');
285
+ const hasBlur = this.#hasBlur();
286
+ const { fbo1, fbo2, blurPass } = this.#reflectorEntities();
289
287
  if (fbo1 && fbo2 && blurPass) {
290
288
  parent.visible = false;
291
289
  const currentXrEnabled = gl.xr.enabled;
292
290
  const currentShadowAutoUpdate = gl.shadowMap.autoUpdate;
293
- this.beforeRender(state);
291
+ this.#beforeRender(state);
294
292
  gl.xr.enabled = false;
295
293
  gl.shadowMap.autoUpdate = false;
296
294
  gl.setRenderTarget(fbo1);
297
295
  gl.state.buffers.depth.setMask(true);
298
296
  if (!gl.autoClear)
299
297
  gl.clear();
300
- gl.render(scene, this.virtualCamera);
298
+ gl.render(scene, this.#virtualCamera);
301
299
  if (hasBlur)
302
300
  blurPass.render(gl, fbo1, fbo2);
303
301
  gl.xr.enabled = currentXrEnabled;
@@ -306,33 +304,88 @@ class NgtsMeshReflectorMaterial extends NgtRxStore {
306
304
  gl.setRenderTarget(null);
307
305
  }
308
306
  }
307
+ #beforeRender(state) {
308
+ const parent = getLocalState(this.materialRef.nativeElement).parent();
309
+ if (!parent)
310
+ return;
311
+ const { camera } = state;
312
+ this.#reflectorWorldPosition.setFromMatrixPosition(parent.matrixWorld);
313
+ this.#cameraWorldPosition.setFromMatrixPosition(camera.matrixWorld);
314
+ this.#rotationMatrix.extractRotation(parent.matrixWorld);
315
+ this.#normal.set(0, 0, 1);
316
+ this.#normal.applyMatrix4(this.#rotationMatrix);
317
+ this.#reflectorWorldPosition.addScaledVector(this.#normal, this.get('reflectorOffset'));
318
+ this.#view.subVectors(this.#reflectorWorldPosition, this.#cameraWorldPosition);
319
+ // Avoid rendering when reflector is facing away
320
+ if (this.#view.dot(this.#normal) > 0)
321
+ return;
322
+ this.#view.reflect(this.#normal).negate();
323
+ this.#view.add(this.#reflectorWorldPosition);
324
+ this.#rotationMatrix.extractRotation(camera.matrixWorld);
325
+ this.#lookAtPosition.set(0, 0, -1);
326
+ this.#lookAtPosition.applyMatrix4(this.#rotationMatrix);
327
+ this.#lookAtPosition.add(this.#cameraWorldPosition);
328
+ this.#target.subVectors(this.#reflectorWorldPosition, this.#lookAtPosition);
329
+ this.#target.reflect(this.#normal).negate();
330
+ this.#target.add(this.#reflectorWorldPosition);
331
+ this.#virtualCamera.position.copy(this.#view);
332
+ this.#virtualCamera.up.set(0, 1, 0);
333
+ this.#virtualCamera.up.applyMatrix4(this.#rotationMatrix);
334
+ this.#virtualCamera.up.reflect(this.#normal);
335
+ this.#virtualCamera.lookAt(this.#target);
336
+ this.#virtualCamera.far = camera.far; // Used in WebGLBackground
337
+ this.#virtualCamera.updateMatrixWorld();
338
+ this.#virtualCamera.projectionMatrix.copy(camera.projectionMatrix);
339
+ // Update the texture matrix
340
+ this.#textureMatrix.set(0.5, 0.0, 0.0, 0.5, 0.0, 0.5, 0.0, 0.5, 0.0, 0.0, 0.5, 0.5, 0.0, 0.0, 0.0, 1.0);
341
+ this.#textureMatrix.multiply(this.#virtualCamera.projectionMatrix);
342
+ this.#textureMatrix.multiply(this.#virtualCamera.matrixWorldInverse);
343
+ this.#textureMatrix.multiply(parent.matrixWorld);
344
+ // Now update projection matrix with new clip plane, implementing code from: http://www.terathon.com/code/oblique.html
345
+ // Paper explaining this technique: http://www.terathon.com/lengyel/Lengyel-Oblique.pdf
346
+ this.#reflectorPlane.setFromNormalAndCoplanarPoint(this.#normal, this.#reflectorWorldPosition);
347
+ this.#reflectorPlane.applyMatrix4(this.#virtualCamera.matrixWorldInverse);
348
+ this.#clipPlane.set(this.#reflectorPlane.normal.x, this.#reflectorPlane.normal.y, this.#reflectorPlane.normal.z, this.#reflectorPlane.constant);
349
+ const projectionMatrix = this.#virtualCamera.projectionMatrix;
350
+ this.#q.x = (Math.sign(this.#clipPlane.x) + projectionMatrix.elements[8]) / projectionMatrix.elements[0];
351
+ this.#q.y = (Math.sign(this.#clipPlane.y) + projectionMatrix.elements[9]) / projectionMatrix.elements[5];
352
+ this.#q.z = -1.0;
353
+ this.#q.w = (1.0 + projectionMatrix.elements[10]) / projectionMatrix.elements[14];
354
+ // Calculate the scaled plane vector
355
+ this.#clipPlane.multiplyScalar(2.0 / this.#clipPlane.dot(this.#q));
356
+ // Replacing the third row of the projection matrix
357
+ projectionMatrix.elements[2] = this.#clipPlane.x;
358
+ projectionMatrix.elements[6] = this.#clipPlane.y;
359
+ projectionMatrix.elements[10] = this.#clipPlane.z + 1.0;
360
+ projectionMatrix.elements[14] = this.#clipPlane.w;
361
+ }
309
362
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsMeshReflectorMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
310
363
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsMeshReflectorMaterial, isStandalone: true, selector: "ngts-mesh-reflector-material", inputs: { materialRef: "materialRef", resolution: "resolution", mixBlur: "mixBlur", mixStrength: "mixStrength", blur: "blur", mirror: "mirror", minDepthThreshold: "minDepthThreshold", maxDepthThreshold: "maxDepthThreshold", depthScale: "depthScale", depthToBlurRatioBias: "depthToBlurRatioBias", distortionMap: "distortionMap", distortion: "distortion", mixContrast: "mixContrast", reflectorOffset: "reflectorOffset" }, usesInheritance: true, ngImport: i0, template: `
311
364
  <ngt-mesh-reflector-material
312
365
  ngtCompound
313
366
  attach="material"
314
- *ngIf="defines$ | ngtPush as defines"
367
+ *ngIf="defines()"
315
368
  [ref]="materialRef"
316
- [defines]="defines"
317
- [mirror]="reflectorProps.mirror"
318
- [textureMatrix]="reflectorProps.textureMatrix"
319
- [mixBlur]="reflectorProps.mixBlur"
320
- [tDiffuse]="reflectorProps.tDiffuse"
321
- [tDepth]="reflectorProps.tDepth"
322
- [tDiffuseBlur]="reflectorProps.tDiffuseBlur"
323
- [hasBlur]="reflectorProps.hasBlur"
324
- [mixStrength]="reflectorProps.mixStrength"
325
- [minDepthThreshold]="reflectorProps.minDepthThreshold"
326
- [maxDepthThreshold]="reflectorProps.maxDepthThreshold"
327
- [depthScale]="reflectorProps.depthScale"
328
- [depthToBlurRatioBias]="reflectorProps.depthToBlurRatioBias"
329
- [distortion]="reflectorProps.distortion"
330
- [distortionMap]="reflectorProps.distortionMap"
331
- [mixContrast]="reflectorProps.mixContrast"
369
+ [defines]="defines()"
370
+ [mirror]="reflectorMirror()"
371
+ [textureMatrix]="reflectorTextureMatrix()"
372
+ [mixBlur]="reflectorMixBlur()"
373
+ [tDiffuse]="reflectorTDiffuse()"
374
+ [tDepth]="reflectorTDepth()"
375
+ [tDiffuseBlur]="reflectorTDiffuseBlur()"
376
+ [hasBlur]="reflectorHasBlur()"
377
+ [mixStrength]="reflectorMixStrength()"
378
+ [minDepthThreshold]="reflectorMinDepthThreshold()"
379
+ [maxDepthThreshold]="reflectorMaxDepthThreshold()"
380
+ [depthScale]="reflectorDepthScale()"
381
+ [depthToBlurRatioBias]="reflectorDepthToBlurRatioBias()"
382
+ [distortion]="reflectorDistortion()"
383
+ [distortionMap]="reflectorDistortionMap()"
384
+ [mixContrast]="reflectorMixContrast()"
332
385
  >
333
386
  <ng-content />
334
387
  </ngt-mesh-reflector-material>
335
- `, isInline: true, dependencies: [{ kind: "pipe", type: NgtPush, name: "ngtPush" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
388
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
336
389
  }
337
390
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsMeshReflectorMaterial, decorators: [{
338
391
  type: Component,
@@ -343,29 +396,29 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
343
396
  <ngt-mesh-reflector-material
344
397
  ngtCompound
345
398
  attach="material"
346
- *ngIf="defines$ | ngtPush as defines"
399
+ *ngIf="defines()"
347
400
  [ref]="materialRef"
348
- [defines]="defines"
349
- [mirror]="reflectorProps.mirror"
350
- [textureMatrix]="reflectorProps.textureMatrix"
351
- [mixBlur]="reflectorProps.mixBlur"
352
- [tDiffuse]="reflectorProps.tDiffuse"
353
- [tDepth]="reflectorProps.tDepth"
354
- [tDiffuseBlur]="reflectorProps.tDiffuseBlur"
355
- [hasBlur]="reflectorProps.hasBlur"
356
- [mixStrength]="reflectorProps.mixStrength"
357
- [minDepthThreshold]="reflectorProps.minDepthThreshold"
358
- [maxDepthThreshold]="reflectorProps.maxDepthThreshold"
359
- [depthScale]="reflectorProps.depthScale"
360
- [depthToBlurRatioBias]="reflectorProps.depthToBlurRatioBias"
361
- [distortion]="reflectorProps.distortion"
362
- [distortionMap]="reflectorProps.distortionMap"
363
- [mixContrast]="reflectorProps.mixContrast"
401
+ [defines]="defines()"
402
+ [mirror]="reflectorMirror()"
403
+ [textureMatrix]="reflectorTextureMatrix()"
404
+ [mixBlur]="reflectorMixBlur()"
405
+ [tDiffuse]="reflectorTDiffuse()"
406
+ [tDepth]="reflectorTDepth()"
407
+ [tDiffuseBlur]="reflectorTDiffuseBlur()"
408
+ [hasBlur]="reflectorHasBlur()"
409
+ [mixStrength]="reflectorMixStrength()"
410
+ [minDepthThreshold]="reflectorMinDepthThreshold()"
411
+ [maxDepthThreshold]="reflectorMaxDepthThreshold()"
412
+ [depthScale]="reflectorDepthScale()"
413
+ [depthToBlurRatioBias]="reflectorDepthToBlurRatioBias()"
414
+ [distortion]="reflectorDistortion()"
415
+ [distortionMap]="reflectorDistortionMap()"
416
+ [mixContrast]="reflectorMixContrast()"
364
417
  >
365
418
  <ng-content />
366
419
  </ngt-mesh-reflector-material>
367
420
  `,
368
- imports: [NgtArgs, NgtPush, NgIf],
421
+ imports: [NgtArgs, NgIf],
369
422
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
370
423
  }]
371
424
  }], ctorParameters: function () { return []; }, propDecorators: { materialRef: [{
@@ -400,7 +453,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
400
453
 
401
454
  extend({ MeshRefractionMaterial });
402
455
  const isCubeTexture = (def) => def && def.isCubeTexture;
403
- class NgtsMeshRefractionMaterial extends NgtRxStore {
456
+ class NgtsMeshRefractionMaterial extends NgtSignalStore {
404
457
  /** Environment map */
405
458
  set envMap(envMap) {
406
459
  this.set({ envMap });
@@ -429,19 +482,28 @@ class NgtsMeshRefractionMaterial extends NgtRxStore {
429
482
  set fastChroma(fastChroma) {
430
483
  this.set({ fastChroma });
431
484
  }
432
- initialize() {
433
- super.initialize();
434
- this.set({
435
- aberrationStrength: 0,
436
- fastChroma: true,
437
- });
438
- }
485
+ #store;
486
+ #size;
487
+ #envMap;
439
488
  constructor() {
440
- super();
489
+ super({ aberrationStrength: 0, fastChroma: true });
441
490
  this.materialRef = injectNgtRef();
442
- this.defines$ = this.select('defines');
443
- this.store = inject(NgtStore);
444
- this.connect('defines', combineLatest([this.select('aberrationStrength'), this.select('fastChroma'), this.select('envMap')]).pipe(map(([aberrationStrength, fastChroma, envMap]) => {
491
+ this.refractionEnvMap = this.select('envMap');
492
+ this.refractionBounces = this.select('bounces');
493
+ this.refractionIor = this.select('ior');
494
+ this.refractionFresnel = this.select('fresnel');
495
+ this.refractionAberrationStrength = this.select('aberrationStrength');
496
+ this.refractionColor = this.select('color');
497
+ this.refractionFastChroma = this.select('fastChroma');
498
+ this.#store = inject(NgtStore);
499
+ this.#size = this.#store.select('size');
500
+ this.#envMap = this.select('envMap');
501
+ this.defines = computed(() => {
502
+ const envMap = this.#envMap();
503
+ if (!envMap)
504
+ return null;
505
+ const aberrationStrength = this.refractionAberrationStrength();
506
+ const fastChroma = this.refractionFastChroma();
445
507
  const temp = {};
446
508
  // Sampler2D and SamplerCube need different defines
447
509
  const isCubeMap = isCubeTexture(envMap);
@@ -462,21 +524,22 @@ class NgtsMeshRefractionMaterial extends NgtRxStore {
462
524
  if (fastChroma)
463
525
  temp['FAST_CHROMA'] = '';
464
526
  return temp;
465
- })));
466
- this.connect('resolution', this.store.select('size').pipe(map((size) => [size.width, size.height])));
527
+ });
528
+ this.resolution = computed(() => [this.#size().width, this.#size().height]);
467
529
  injectBeforeRender(({ camera }) => {
468
530
  if (this.materialRef.nativeElement) {
469
531
  this.materialRef.nativeElement.viewMatrixInverse = camera.matrixWorld;
470
532
  this.materialRef.nativeElement.projectionMatrixInverse = camera.projectionMatrixInverse;
471
533
  }
472
534
  });
473
- }
474
- ngOnInit() {
475
- this.setupGeometry();
476
- }
477
- setupGeometry() {
478
- this.hold(this.materialRef.$, (material) => {
479
- const geometry = getLocalState(material).parent?.geometry;
535
+ this.#setupGeometry();
536
+ }
537
+ #setupGeometry() {
538
+ effect(() => {
539
+ const material = this.materialRef.nativeElement;
540
+ if (!material)
541
+ return;
542
+ const geometry = getLocalState(material).parent()?.geometry;
480
543
  if (geometry) {
481
544
  material.bvh.updateFrom(new MeshBVH(geometry.toNonIndexed(), { lazyGeneration: false, strategy: SAH }));
482
545
  }
@@ -485,23 +548,23 @@ class NgtsMeshRefractionMaterial extends NgtRxStore {
485
548
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsMeshRefractionMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
486
549
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsMeshRefractionMaterial, isStandalone: true, selector: "ngts-mesh-refraction-material", inputs: { materialRef: "materialRef", envMap: "envMap", bounces: "bounces", ior: "ior", fresnel: "fresnel", aberrationStrength: "aberrationStrength", color: "color", fastChroma: "fastChroma" }, usesInheritance: true, ngImport: i0, template: `
487
550
  <ngt-mesh-refraction-material
488
- *ngIf="defines$ | ngtPush as defines"
551
+ *ngIf="defines() as defines"
489
552
  [ref]="materialRef"
490
553
  [defines]="defines"
491
- [resolution]="get('resolution')"
492
- [aberrationStrength]="get('aberrationStrength')"
493
- [envMap]="get('envMap')"
494
- [bounces]="get('bounces')"
495
- [ior]="get('ior')"
496
- [fresnel]="get('fresnel')"
497
- [color]="get('color')"
498
- [fastChroma]="get('fastChroma')"
554
+ [resolution]="resolution()"
555
+ [aberrationStrength]="refractionAberrationStrength()"
556
+ [envMap]="refractionEnvMap()"
557
+ [bounces]="refractionBounces()"
558
+ [ior]="refractionIor()"
559
+ [fresnel]="refractionFresnel()"
560
+ [color]="refractionColor()"
561
+ [fastChroma]="refractionFastChroma()"
499
562
  ngtCompound
500
563
  attach="material"
501
564
  >
502
565
  <ng-content />
503
566
  </ngt-mesh-refraction-material>
504
- `, isInline: true, dependencies: [{ kind: "pipe", type: NgtPush, name: "ngtPush" }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
567
+ `, isInline: true, dependencies: [{ kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
505
568
  }
506
569
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsMeshRefractionMaterial, decorators: [{
507
570
  type: Component,
@@ -510,30 +573,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
510
573
  standalone: true,
511
574
  template: `
512
575
  <ngt-mesh-refraction-material
513
- *ngIf="defines$ | ngtPush as defines"
576
+ *ngIf="defines() as defines"
514
577
  [ref]="materialRef"
515
578
  [defines]="defines"
516
- [resolution]="get('resolution')"
517
- [aberrationStrength]="get('aberrationStrength')"
518
- [envMap]="get('envMap')"
519
- [bounces]="get('bounces')"
520
- [ior]="get('ior')"
521
- [fresnel]="get('fresnel')"
522
- [color]="get('color')"
523
- [fastChroma]="get('fastChroma')"
579
+ [resolution]="resolution()"
580
+ [aberrationStrength]="refractionAberrationStrength()"
581
+ [envMap]="refractionEnvMap()"
582
+ [bounces]="refractionBounces()"
583
+ [ior]="refractionIor()"
584
+ [fresnel]="refractionFresnel()"
585
+ [color]="refractionColor()"
586
+ [fastChroma]="refractionFastChroma()"
524
587
  ngtCompound
525
588
  attach="material"
526
589
  >
527
590
  <ng-content />
528
591
  </ngt-mesh-refraction-material>
529
592
  `,
530
- imports: [NgtPush, NgIf],
593
+ imports: [NgIf],
531
594
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
532
595
  }]
533
596
  }], ctorParameters: function () { return []; }, propDecorators: { materialRef: [{
534
597
  type: Input
535
598
  }], envMap: [{
536
- type: Input
599
+ type: Input,
600
+ args: [{ required: true }]
537
601
  }], bounces: [{
538
602
  type: Input
539
603
  }], ior: [{
@@ -549,7 +613,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
549
613
  }] } });
550
614
 
551
615
  extend({ MeshTransmissionMaterial });
552
- class NgtsMeshTranmissionMaterial extends NgtRxStore {
616
+ class NgtsMeshTranmissionMaterial extends NgtSignalStore {
553
617
  /** transmissionSampler, you can use the threejs transmission sampler texture that is
554
618
  * generated once for all transmissive materials. The upside is that it can be faster if you
555
619
  * use multiple MeshPhysical and Transmission materials, the downside is that transmissive materials
@@ -621,12 +685,15 @@ class NgtsMeshTranmissionMaterial extends NgtRxStore {
621
685
  set time(time) {
622
686
  this.set({ time });
623
687
  }
624
- initialize() {
625
- super.initialize();
626
- this.set({
688
+ #discardMaterial;
689
+ #backsideResolution;
690
+ #resolution;
691
+ #fboBackSettings;
692
+ #fboMainSettings;
693
+ constructor() {
694
+ super({
627
695
  transmissionSampler: false,
628
696
  backside: false,
629
- side: THREE.FrontSide,
630
697
  transmission: 1,
631
698
  thickness: 0,
632
699
  backsideThickness: 0,
@@ -639,23 +706,40 @@ class NgtsMeshTranmissionMaterial extends NgtRxStore {
639
706
  temporalDistortion: 0.0,
640
707
  buffer: null,
641
708
  });
642
- }
643
- constructor() {
644
- super();
645
709
  this.materialRef = injectNgtRef();
646
- this.discardMaterial = new DiscardMaterial();
647
- this.fboBackRef = injectNgtsFBO(() => combineLatest([this.select('backsideResolution'), this.select('resolution')]).pipe(map(([backsideResolution, resolution]) => backsideResolution || resolution)));
648
- this.fboMainRef = injectNgtsFBO(() => this.select('resolution'));
710
+ this.transmissionTransmissionSampler = this.select('transmissionSampler');
711
+ this.transmissionBackside = this.select('backside');
712
+ this.transmissionTransmission = this.select('transmission');
713
+ this.transmissionThickness = this.select('thickness');
714
+ this.transmissionBacksideThickness = this.select('backsideThickness');
715
+ this.transmissionSamples = this.select('samples');
716
+ this.transmissionRoughness = this.select('roughness');
717
+ this.transmissionAnisotropy = this.select('anisotropy');
718
+ this.transmissionChromaticAberration = this.select('chromaticAberration');
719
+ this.transmissionDistortion = this.select('distortion');
720
+ this.transmissionDistortionScale = this.select('distortionScale');
721
+ this.transmissionTemporalDistortion = this.select('temporalDistortion');
722
+ this.transmissionBuffer = this.select('buffer');
723
+ this.transmissionTime = this.select('time');
724
+ this.#discardMaterial = new DiscardMaterial();
725
+ this.#backsideResolution = this.select('backsideResolution');
726
+ this.#resolution = this.select('resolution');
727
+ this.#fboBackSettings = computed(() => ({ width: this.#backsideResolution() || this.#resolution() }));
728
+ this.#fboMainSettings = computed(() => ({ width: this.#resolution() }));
729
+ this.fboBackRef = injectNgtsFBO(this.#fboBackSettings);
730
+ this.fboMainRef = injectNgtsFBO(this.#fboMainSettings);
731
+ this.side = THREE.FrontSide;
649
732
  let oldBg;
650
733
  let oldTone;
651
734
  let parent;
652
735
  injectBeforeRender((state) => {
653
- const { transmissionSampler, background, backside, backsideThickness, thickness, side } = this.get();
736
+ if (!this.materialRef.nativeElement)
737
+ return;
738
+ const { transmissionSampler, background, backside, backsideThickness, thickness } = this.get();
654
739
  this.materialRef.nativeElement.time = state.clock.getElapsedTime();
655
740
  // Render only if the buffer matches the built-in and no transmission sampler is set
656
- if (this.materialRef.nativeElement.buffer === this.fboMainRef.nativeElement.texture &&
657
- !transmissionSampler) {
658
- parent = getLocalState(this.materialRef.nativeElement).parent;
741
+ if (this.materialRef.nativeElement.buffer === this.fboMainRef().texture && !transmissionSampler) {
742
+ parent = getLocalState(this.materialRef.nativeElement).parent();
659
743
  if (parent) {
660
744
  // Save defaults
661
745
  oldTone = state.gl.toneMapping;
@@ -666,23 +750,23 @@ class NgtsMeshTranmissionMaterial extends NgtRxStore {
666
750
  state.gl.toneMapping = THREE.NoToneMapping;
667
751
  if (background)
668
752
  state.scene.background = background;
669
- parent['material'] = this.discardMaterial;
753
+ parent['material'] = this.#discardMaterial;
670
754
  if (backside) {
671
755
  // Render into the backside buffer
672
- state.gl.setRenderTarget(this.fboBackRef.nativeElement);
756
+ state.gl.setRenderTarget(this.fboBackRef());
673
757
  state.gl.render(state.scene, state.camera);
674
758
  // And now prepare the material for the main render using the backside buffer
675
759
  parent['material'] = this.materialRef.nativeElement;
676
- parent['material'].buffer = this.fboBackRef.nativeElement.texture;
760
+ parent['material'].buffer = this.fboBackRef().texture;
677
761
  parent['material'].thickness = backsideThickness;
678
762
  parent['material'].side = THREE.BackSide;
679
763
  }
680
764
  // Render into the main buffer
681
- state.gl.setRenderTarget(this.fboMainRef.nativeElement);
765
+ state.gl.setRenderTarget(this.fboMainRef());
682
766
  state.gl.render(state.scene, state.camera);
683
767
  parent['material'].thickness = thickness;
684
- parent['material'].side = side;
685
- parent['material'].buffer = this.fboMainRef.nativeElement.texture;
768
+ parent['material'].side = this.side;
769
+ parent['material'].buffer = this.fboMainRef().texture;
686
770
  // Set old state back
687
771
  state.scene.background = oldBg;
688
772
  state.gl.setRenderTarget(null);
@@ -695,21 +779,21 @@ class NgtsMeshTranmissionMaterial extends NgtRxStore {
695
779
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: NgtsMeshTranmissionMaterial, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
696
780
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: NgtsMeshTranmissionMaterial, isStandalone: true, selector: "ngts-mesh-transmission-material", inputs: { materialRef: "materialRef", transmissionSampler: "transmissionSampler", backside: "backside", backsideThickness: "backsideThickness", resolution: "resolution", backsideResolution: "backsideResolution", samples: "samples", background: "background", transmission: "transmission", thickness: "thickness", roughness: "roughness", chromaticAberration: "chromaticAberration", anisotropy: "anisotropy", distortion: "distortion", distortionScale: "distortionScale", temporalDistortion: "temporalDistortion", buffer: "buffer", time: "time" }, usesInheritance: true, ngImport: i0, template: `
697
781
  <ngt-mesh-transmission-material
698
- *args="[get('samples'), get('transmissionSampler')]"
699
782
  ngtCompound
783
+ *args="[transmissionSamples(), transmissionTransmissionSampler()]"
700
784
  [ref]="materialRef"
701
- [buffer]="get('buffer') || fboMainRef.nativeElement?.texture"
702
- [_transmission]="get('transmission')"
703
- [transmission]="get('transmissionSampler') ? get('transmission') : 0"
704
- [thickness]="get('thickness')"
705
- [side]="get('side')"
706
- [anisotropy]="get('anisotropy')"
707
- [roughness]="get('roughness')"
708
- [chromaticAberration]="get('chromaticAberration')"
709
- [distortion]="get('distortion')"
710
- [distortionScale]="get('distortionScale')"
711
- [temporalDistortion]="get('temporalDistortion')"
712
- [time]="get('time')"
785
+ [buffer]="transmissionBuffer() || fboMainRef()?.texture"
786
+ [_transmission]="transmissionTransmission()"
787
+ [transmission]="transmissionTransmissionSampler() ? transmissionTransmission() : 0"
788
+ [thickness]="transmissionThickness()"
789
+ [side]="side"
790
+ [anisotropy]="transmissionAnisotropy()"
791
+ [roughness]="transmissionRoughness()"
792
+ [chromaticAberration]="transmissionChromaticAberration()"
793
+ [distortion]="transmissionDistortion()"
794
+ [distortionScale]="transmissionDistortionScale()"
795
+ [temporalDistortion]="transmissionTemporalDistortion()"
796
+ [time]="transmissionTime()"
713
797
  />
714
798
  `, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "[args]", inputs: ["args"] }] }); }
715
799
  }
@@ -720,21 +804,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
720
804
  standalone: true,
721
805
  template: `
722
806
  <ngt-mesh-transmission-material
723
- *args="[get('samples'), get('transmissionSampler')]"
724
807
  ngtCompound
808
+ *args="[transmissionSamples(), transmissionTransmissionSampler()]"
725
809
  [ref]="materialRef"
726
- [buffer]="get('buffer') || fboMainRef.nativeElement?.texture"
727
- [_transmission]="get('transmission')"
728
- [transmission]="get('transmissionSampler') ? get('transmission') : 0"
729
- [thickness]="get('thickness')"
730
- [side]="get('side')"
731
- [anisotropy]="get('anisotropy')"
732
- [roughness]="get('roughness')"
733
- [chromaticAberration]="get('chromaticAberration')"
734
- [distortion]="get('distortion')"
735
- [distortionScale]="get('distortionScale')"
736
- [temporalDistortion]="get('temporalDistortion')"
737
- [time]="get('time')"
810
+ [buffer]="transmissionBuffer() || fboMainRef()?.texture"
811
+ [_transmission]="transmissionTransmission()"
812
+ [transmission]="transmissionTransmissionSampler() ? transmissionTransmission() : 0"
813
+ [thickness]="transmissionThickness()"
814
+ [side]="side"
815
+ [anisotropy]="transmissionAnisotropy()"
816
+ [roughness]="transmissionRoughness()"
817
+ [chromaticAberration]="transmissionChromaticAberration()"
818
+ [distortion]="transmissionDistortion()"
819
+ [distortionScale]="transmissionDistortionScale()"
820
+ [temporalDistortion]="transmissionTemporalDistortion()"
821
+ [time]="transmissionTime()"
738
822
  />
739
823
  `,
740
824
  imports: [NgtArgs],
@@ -779,7 +863,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
779
863
  }] } });
780
864
 
781
865
  extend({ MeshWobbleMaterial });
782
- class NgtsMeshWobbleMaterial extends NgtRxStore {
866
+ class NgtsMeshWobbleMaterial extends NgtSignalStore {
783
867
  set time(time) {
784
868
  this.set({ time });
785
869
  }
@@ -789,14 +873,12 @@ class NgtsMeshWobbleMaterial extends NgtRxStore {
789
873
  set speed(speed) {
790
874
  this.set({ speed });
791
875
  }
792
- initialize() {
793
- super.initialize();
794
- this.set({ speed: 1, time: 0, factor: 1 });
795
- }
796
876
  constructor() {
797
- super();
877
+ super({ speed: 1, time: 0, factor: 1 });
798
878
  this.material = new MeshWobbleMaterial();
799
879
  this.materialRef = injectNgtRef();
880
+ this.wobbleTime = this.select('time');
881
+ this.wobbleFactor = this.select('factor');
800
882
  injectBeforeRender(({ clock }) => {
801
883
  this.material.time = clock.getElapsedTime() * this.get('speed');
802
884
  });
@@ -806,8 +888,8 @@ class NgtsMeshWobbleMaterial extends NgtRxStore {
806
888
  <ngt-primitive
807
889
  *args="[material]"
808
890
  [ref]="materialRef"
809
- [time]="get('time')"
810
- [factor]="get('factor')"
891
+ [time]="wobbleTime()"
892
+ [factor]="wobbleFactor()"
811
893
  attach="material"
812
894
  ngtCompound
813
895
  />
@@ -822,8 +904,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImpor
822
904
  <ngt-primitive
823
905
  *args="[material]"
824
906
  [ref]="materialRef"
825
- [time]="get('time')"
826
- [factor]="get('factor')"
907
+ [time]="wobbleTime()"
908
+ [factor]="wobbleFactor()"
827
909
  attach="material"
828
910
  ngtCompound
829
911
  />