@zephyr3d/scene 0.9.4 → 0.9.6

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 (517) hide show
  1. package/dist/animation/animationmask.js +224 -0
  2. package/dist/animation/animationmask.js.map +1 -0
  3. package/dist/animation/animationset.js +268 -67
  4. package/dist/animation/animationset.js.map +1 -1
  5. package/dist/animation/animationtrack.js.map +1 -1
  6. package/dist/animation/eulerrotationtrack.js +3 -0
  7. package/dist/animation/eulerrotationtrack.js.map +1 -1
  8. package/dist/animation/fixed_geometry_cache_track.js +7 -0
  9. package/dist/animation/fixed_geometry_cache_track.js.map +1 -1
  10. package/dist/animation/ik_modifier.js.map +1 -1
  11. package/dist/animation/joint_dynamics/collision.js +6 -4
  12. package/dist/animation/joint_dynamics/collision.js.map +1 -1
  13. package/dist/animation/joint_dynamics/controller.js +390 -43
  14. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  15. package/dist/animation/joint_dynamics/joint_dynamics_system.js +62 -3
  16. package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
  17. package/dist/animation/joint_dynamics/solver.js +4 -3
  18. package/dist/animation/joint_dynamics/solver.js.map +1 -1
  19. package/dist/animation/joint_dynamics/types.js.map +1 -1
  20. package/dist/animation/joint_dynamics_modifier.js +2 -0
  21. package/dist/animation/joint_dynamics_modifier.js.map +1 -1
  22. package/dist/animation/morphtarget.js +3 -72
  23. package/dist/animation/morphtarget.js.map +1 -1
  24. package/dist/animation/morphtrack.js +3 -0
  25. package/dist/animation/morphtrack.js.map +1 -1
  26. package/dist/animation/pca_geometry_cache_track.js +3 -0
  27. package/dist/animation/pca_geometry_cache_track.js.map +1 -1
  28. package/dist/animation/proptrack.js +3 -0
  29. package/dist/animation/proptrack.js.map +1 -1
  30. package/dist/animation/rotationtrack.js +3 -0
  31. package/dist/animation/rotationtrack.js.map +1 -1
  32. package/dist/animation/scaletrack.js +3 -0
  33. package/dist/animation/scaletrack.js.map +1 -1
  34. package/dist/animation/skeleton.js +254 -79
  35. package/dist/animation/skeleton.js.map +1 -1
  36. package/dist/animation/skeleton_modifier.js.map +1 -1
  37. package/dist/animation/spring_modifier.js.map +1 -1
  38. package/dist/animation/translationtrack.js +3 -0
  39. package/dist/animation/translationtrack.js.map +1 -1
  40. package/dist/app/engine.js +171 -107
  41. package/dist/app/engine.js.map +1 -1
  42. package/dist/app/scriptregistry.js +251 -80
  43. package/dist/app/scriptregistry.js.map +1 -1
  44. package/dist/asset/assetmanager.js +344 -365
  45. package/dist/asset/assetmanager.js.map +1 -1
  46. package/dist/asset/loaders/loader.js +1 -6
  47. package/dist/asset/loaders/loader.js.map +1 -1
  48. package/dist/asset/loaders/zabc/zabc_loader.js.map +1 -1
  49. package/dist/asset/model.js +1000 -131
  50. package/dist/asset/model.js.map +1 -1
  51. package/dist/avatar/wardrobe.js +474 -0
  52. package/dist/avatar/wardrobe.js.map +1 -0
  53. package/dist/index.d.ts +1126 -199
  54. package/dist/index.js +3 -2
  55. package/dist/index.js.map +1 -1
  56. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +6 -3
  57. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  58. package/dist/material/mixins/pbr/common.js +72 -15
  59. package/dist/material/mixins/pbr/common.js.map +1 -1
  60. package/dist/material/msdf_text.js +3 -3
  61. package/dist/material/msdf_text.js.map +1 -1
  62. package/dist/material/msdf_text_sprite.js +4 -4
  63. package/dist/material/msdf_text_sprite.js.map +1 -1
  64. package/dist/material/pbrblueprint.js +102 -102
  65. package/dist/material/pbrblueprint.js.map +1 -1
  66. package/dist/render/envlight.js +54 -1
  67. package/dist/render/envlight.js.map +1 -1
  68. package/dist/render/sky.js +9 -0
  69. package/dist/render/sky.js.map +1 -1
  70. package/dist/scene/batchgroup.js +11 -13
  71. package/dist/scene/batchgroup.js.map +1 -1
  72. package/dist/scene/environment.js +15 -2
  73. package/dist/scene/environment.js.map +1 -1
  74. package/dist/scene/mesh.js +79 -16
  75. package/dist/scene/mesh.js.map +1 -1
  76. package/dist/scene/scene.js +1 -0
  77. package/dist/scene/scene.js.map +1 -1
  78. package/dist/scene/scene_node.js +203 -2
  79. package/dist/scene/scene_node.js.map +1 -1
  80. package/dist/text/font/cff_font.js +890 -0
  81. package/dist/text/font/cff_font.js.map +1 -0
  82. package/dist/text/font/font_asset.js +17 -3
  83. package/dist/text/font/font_asset.js.map +1 -1
  84. package/dist/text/msdf/generator.js.map +1 -1
  85. package/dist/text/msdf/shape.js +4 -1
  86. package/dist/text/msdf/shape.js.map +1 -1
  87. package/dist/text/runtime/msdf_text_atlas_manager.js +4 -1
  88. package/dist/text/runtime/msdf_text_atlas_manager.js.map +1 -1
  89. package/dist/utility/blueprint/material/inputs.js +1157 -1154
  90. package/dist/utility/blueprint/material/inputs.js.map +1 -1
  91. package/dist/utility/bounding_volume.js.map +1 -1
  92. package/dist/utility/pmrem.js +34 -8
  93. package/dist/utility/pmrem.js.map +1 -1
  94. package/dist/utility/serialization/manager.js +22 -9
  95. package/dist/utility/serialization/manager.js.map +1 -1
  96. package/dist/utility/serialization/scene/animation.js +700 -7
  97. package/dist/utility/serialization/scene/animation.js.map +1 -1
  98. package/dist/utility/serialization/scene/mesh.js +64 -4
  99. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  100. package/dist/utility/serialization/scene/node.js +187 -8
  101. package/dist/utility/serialization/scene/node.js.map +1 -1
  102. package/dist/utility/serialization/types.js.map +1 -1
  103. package/dist/utility/textures/sheenlut.js +138 -0
  104. package/dist/utility/textures/sheenlut.js.map +1 -0
  105. package/package.json +2 -2
  106. package/dist/animation/ik/ik_chain_builder.js +0 -68
  107. package/dist/animation/ik/ik_chain_builder.js.map +0 -1
  108. package/dist/animation/ik/ik_pole_constraint.js +0 -123
  109. package/dist/animation/ik/ik_pole_constraint.js.map +0 -1
  110. package/dist/animation/ik/ik_track.js +0 -96
  111. package/dist/animation/ik/ik_track.js.map +0 -1
  112. package/dist/animation/ik_postprocessor.js +0 -71
  113. package/dist/animation/ik_postprocessor.js.map +0 -1
  114. package/dist/animation/joint_dynamics/math.js +0 -16
  115. package/dist/animation/joint_dynamics/math.js.map +0 -1
  116. package/dist/animation/manual_transform_processor.js +0 -156
  117. package/dist/animation/manual_transform_processor.js.map +0 -1
  118. package/dist/animation/skeleton_postprocessor.js +0 -50
  119. package/dist/animation/skeleton_postprocessor.js.map +0 -1
  120. package/dist/animation/spring2/collision.js +0 -469
  121. package/dist/animation/spring2/collision.js.map +0 -1
  122. package/dist/animation/spring2/constraints.js +0 -329
  123. package/dist/animation/spring2/constraints.js.map +0 -1
  124. package/dist/animation/spring2/controller.js +0 -434
  125. package/dist/animation/spring2/controller.js.map +0 -1
  126. package/dist/animation/spring2/math.js +0 -16
  127. package/dist/animation/spring2/math.js.map +0 -1
  128. package/dist/animation/spring2/solver.js +0 -624
  129. package/dist/animation/spring2/solver.js.map +0 -1
  130. package/dist/animation/spring2/spring_system.js +0 -118
  131. package/dist/animation/spring2/spring_system.js.map +0 -1
  132. package/dist/animation/spring2/types.js +0 -19
  133. package/dist/animation/spring2/types.js.map +0 -1
  134. package/dist/animation/spring_postprocessor.js +0 -54
  135. package/dist/animation/spring_postprocessor.js.map +0 -1
  136. package/dist/asset/loaders/gltf/gltf_loader.js +0 -1273
  137. package/dist/asset/loaders/gltf/gltf_loader.js.map +0 -1
  138. package/dist/asset/loaders/gltf/helpers.js +0 -331
  139. package/dist/asset/loaders/gltf/helpers.js.map +0 -1
  140. package/dist/material/sprite3d.js +0 -301
  141. package/dist/material/sprite3d.js.map +0 -1
  142. package/dist/material/sprite3d_std.js +0 -116
  143. package/dist/material/sprite3d_std.js.map +0 -1
  144. package/dist/material/sprite3dblueprint.js +0 -235
  145. package/dist/material/sprite3dblueprint.js.map +0 -1
  146. package/dist/material/sprite_sdf.js +0 -106
  147. package/dist/material/sprite_sdf.js.map +0 -1
  148. package/dist/material/terrainmaterial.js +0 -368
  149. package/dist/material/terrainmaterial.js.map +0 -1
  150. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +0 -38
  151. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +0 -1
  152. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +0 -10
  153. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +0 -1
  154. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +0 -127
  155. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +0 -1
  156. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +0 -263
  157. package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +0 -1
  158. package/dist/render/deferredlightpass.js +0 -510
  159. package/dist/render/deferredlightpass.js.map +0 -1
  160. package/dist/render/deferredshadowlightpass.js +0 -428
  161. package/dist/render/deferredshadowlightpass.js.map +0 -1
  162. package/dist/render/gbufferpass.js +0 -50
  163. package/dist/render/gbufferpass.js.map +0 -1
  164. package/dist/scene/sdftextsprite.js +0 -322
  165. package/dist/scene/sdftextsprite.js.map +0 -1
  166. package/dist/scene/sprite3d.js +0 -18
  167. package/dist/scene/sprite3d.js.map +0 -1
  168. package/dist/scene/terrain/grass.js +0 -280
  169. package/dist/scene/terrain/grass.js.map +0 -1
  170. package/dist/scene/terrain/heightfield.js +0 -475
  171. package/dist/scene/terrain/heightfield.js.map +0 -1
  172. package/dist/scene/terrain/patch.js +0 -532
  173. package/dist/scene/terrain/patch.js.map +0 -1
  174. package/dist/scene/terrain/quadtree.js +0 -461
  175. package/dist/scene/terrain/quadtree.js.map +0 -1
  176. package/dist/scene/terrain/terrain.js +0 -231
  177. package/dist/scene/terrain/terrain.js.map +0 -1
  178. package/dist/src/animation/animation.js +0 -127
  179. package/dist/src/animation/animation.js.map +0 -1
  180. package/dist/src/animation/animationset.js +0 -255
  181. package/dist/src/animation/animationset.js.map +0 -1
  182. package/dist/src/animation/animationtrack.js +0 -34
  183. package/dist/src/animation/animationtrack.js.map +0 -1
  184. package/dist/src/animation/eulerrotationtrack.js +0 -52
  185. package/dist/src/animation/eulerrotationtrack.js.map +0 -1
  186. package/dist/src/animation/morphtarget.js +0 -93
  187. package/dist/src/animation/morphtarget.js.map +0 -1
  188. package/dist/src/animation/morphtrack.js +0 -70
  189. package/dist/src/animation/morphtrack.js.map +0 -1
  190. package/dist/src/animation/proptrack.js +0 -161
  191. package/dist/src/animation/proptrack.js.map +0 -1
  192. package/dist/src/animation/rotationtrack.js +0 -51
  193. package/dist/src/animation/rotationtrack.js.map +0 -1
  194. package/dist/src/animation/scaletrack.js +0 -50
  195. package/dist/src/animation/scaletrack.js.map +0 -1
  196. package/dist/src/animation/skeleton.js +0 -204
  197. package/dist/src/animation/skeleton.js.map +0 -1
  198. package/dist/src/animation/translationtrack.js +0 -50
  199. package/dist/src/animation/translationtrack.js.map +0 -1
  200. package/dist/src/app/app.js +0 -129
  201. package/dist/src/app/app.js.map +0 -1
  202. package/dist/src/app/inputmgr.js +0 -267
  203. package/dist/src/app/inputmgr.js.map +0 -1
  204. package/dist/src/asset/assetmanager.js +0 -404
  205. package/dist/src/asset/assetmanager.js.map +0 -1
  206. package/dist/src/asset/builtin.js +0 -337
  207. package/dist/src/asset/builtin.js.map +0 -1
  208. package/dist/src/asset/loaders/dds/dds.js +0 -470
  209. package/dist/src/asset/loaders/dds/dds.js.map +0 -1
  210. package/dist/src/asset/loaders/dds/dds_loader.js +0 -28
  211. package/dist/src/asset/loaders/dds/dds_loader.js.map +0 -1
  212. package/dist/src/asset/loaders/gltf/gltf_loader.js +0 -1265
  213. package/dist/src/asset/loaders/gltf/gltf_loader.js.map +0 -1
  214. package/dist/src/asset/loaders/gltf/helpers.js +0 -327
  215. package/dist/src/asset/loaders/gltf/helpers.js.map +0 -1
  216. package/dist/src/asset/loaders/hdr/hdr.js +0 -180
  217. package/dist/src/asset/loaders/hdr/hdr.js.map +0 -1
  218. package/dist/src/asset/loaders/image/tga_Loader.js +0 -116
  219. package/dist/src/asset/loaders/image/tga_Loader.js.map +0 -1
  220. package/dist/src/asset/loaders/image/webimage_loader.js +0 -63
  221. package/dist/src/asset/loaders/image/webimage_loader.js.map +0 -1
  222. package/dist/src/asset/loaders/loader.js +0 -45
  223. package/dist/src/asset/loaders/loader.js.map +0 -1
  224. package/dist/src/asset/model.js +0 -414
  225. package/dist/src/asset/model.js.map +0 -1
  226. package/dist/src/blitter/bilateralblur.js +0 -221
  227. package/dist/src/blitter/bilateralblur.js.map +0 -1
  228. package/dist/src/blitter/blitter.js +0 -390
  229. package/dist/src/blitter/blitter.js.map +0 -1
  230. package/dist/src/blitter/box.js +0 -118
  231. package/dist/src/blitter/box.js.map +0 -1
  232. package/dist/src/blitter/copy.js +0 -22
  233. package/dist/src/blitter/copy.js.map +0 -1
  234. package/dist/src/blitter/gaussianblur.js +0 -228
  235. package/dist/src/blitter/gaussianblur.js.map +0 -1
  236. package/dist/src/camera/base.js +0 -92
  237. package/dist/src/camera/base.js.map +0 -1
  238. package/dist/src/camera/camera.js +0 -1005
  239. package/dist/src/camera/camera.js.map +0 -1
  240. package/dist/src/camera/fps.js +0 -238
  241. package/dist/src/camera/fps.js.map +0 -1
  242. package/dist/src/camera/orbit.js +0 -245
  243. package/dist/src/camera/orbit.js.map +0 -1
  244. package/dist/src/camera/orthocamera.js +0 -167
  245. package/dist/src/camera/orthocamera.js.map +0 -1
  246. package/dist/src/camera/perspectivecamera.js +0 -141
  247. package/dist/src/camera/perspectivecamera.js.map +0 -1
  248. package/dist/src/index.js +0 -120
  249. package/dist/src/index.js.map +0 -1
  250. package/dist/src/material/blinn.js +0 -81
  251. package/dist/src/material/blinn.js.map +0 -1
  252. package/dist/src/material/grassmaterial.js +0 -113
  253. package/dist/src/material/grassmaterial.js.map +0 -1
  254. package/dist/src/material/lambert.js +0 -92
  255. package/dist/src/material/lambert.js.map +0 -1
  256. package/dist/src/material/material.js +0 -301
  257. package/dist/src/material/material.js.map +0 -1
  258. package/dist/src/material/meshmaterial.js +0 -704
  259. package/dist/src/material/meshmaterial.js.map +0 -1
  260. package/dist/src/material/mixins/albedocolor.js +0 -76
  261. package/dist/src/material/mixins/albedocolor.js.map +0 -1
  262. package/dist/src/material/mixins/foliage.js +0 -47
  263. package/dist/src/material/mixins/foliage.js.map +0 -1
  264. package/dist/src/material/mixins/lightmodel/blinnphong.js +0 -112
  265. package/dist/src/material/mixins/lightmodel/blinnphong.js.map +0 -1
  266. package/dist/src/material/mixins/lightmodel/lambert.js +0 -58
  267. package/dist/src/material/mixins/lightmodel/lambert.js.map +0 -1
  268. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +0 -178
  269. package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +0 -1
  270. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +0 -139
  271. package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +0 -1
  272. package/dist/src/material/mixins/lit.js +0 -476
  273. package/dist/src/material/mixins/lit.js.map +0 -1
  274. package/dist/src/material/mixins/pbr/common.js +0 -918
  275. package/dist/src/material/mixins/pbr/common.js.map +0 -1
  276. package/dist/src/material/mixins/texture.js +0 -172
  277. package/dist/src/material/mixins/texture.js.map +0 -1
  278. package/dist/src/material/mixins/vertexcolor.js +0 -56
  279. package/dist/src/material/mixins/vertexcolor.js.map +0 -1
  280. package/dist/src/material/particle.js +0 -178
  281. package/dist/src/material/particle.js.map +0 -1
  282. package/dist/src/material/pbrmr.js +0 -97
  283. package/dist/src/material/pbrmr.js.map +0 -1
  284. package/dist/src/material/pbrsg.js +0 -97
  285. package/dist/src/material/pbrsg.js.map +0 -1
  286. package/dist/src/material/shader/helper.js +0 -1209
  287. package/dist/src/material/shader/helper.js.map +0 -1
  288. package/dist/src/material/terrain-cm.js +0 -606
  289. package/dist/src/material/terrain-cm.js.map +0 -1
  290. package/dist/src/material/terrainmaterial.js +0 -375
  291. package/dist/src/material/terrainmaterial.js.map +0 -1
  292. package/dist/src/material/unlit.js +0 -41
  293. package/dist/src/material/unlit.js.map +0 -1
  294. package/dist/src/material/water.js +0 -417
  295. package/dist/src/material/water.js.map +0 -1
  296. package/dist/src/posteffect/bloom.js +0 -361
  297. package/dist/src/posteffect/bloom.js.map +0 -1
  298. package/dist/src/posteffect/compositor.js +0 -226
  299. package/dist/src/posteffect/compositor.js.map +0 -1
  300. package/dist/src/posteffect/fxaa.js +0 -273
  301. package/dist/src/posteffect/fxaa.js.map +0 -1
  302. package/dist/src/posteffect/grayscale.js +0 -69
  303. package/dist/src/posteffect/grayscale.js.map +0 -1
  304. package/dist/src/posteffect/motionblur.js +0 -96
  305. package/dist/src/posteffect/motionblur.js.map +0 -1
  306. package/dist/src/posteffect/posteffect.js +0 -126
  307. package/dist/src/posteffect/posteffect.js.map +0 -1
  308. package/dist/src/posteffect/sao.js +0 -324
  309. package/dist/src/posteffect/sao.js.map +0 -1
  310. package/dist/src/posteffect/ssr.js +0 -489
  311. package/dist/src/posteffect/ssr.js.map +0 -1
  312. package/dist/src/posteffect/taa.js +0 -172
  313. package/dist/src/posteffect/taa.js.map +0 -1
  314. package/dist/src/posteffect/tonemap.js +0 -94
  315. package/dist/src/posteffect/tonemap.js.map +0 -1
  316. package/dist/src/render/abuffer_oit.js +0 -361
  317. package/dist/src/render/abuffer_oit.js.map +0 -1
  318. package/dist/src/render/clipmap.js +0 -851
  319. package/dist/src/render/clipmap.js.map +0 -1
  320. package/dist/src/render/cluster_light.js +0 -333
  321. package/dist/src/render/cluster_light.js.map +0 -1
  322. package/dist/src/render/cull_visitor.js +0 -187
  323. package/dist/src/render/cull_visitor.js.map +0 -1
  324. package/dist/src/render/depthpass.js +0 -68
  325. package/dist/src/render/depthpass.js.map +0 -1
  326. package/dist/src/render/drawable_mixin.js +0 -227
  327. package/dist/src/render/drawable_mixin.js.map +0 -1
  328. package/dist/src/render/envlight.js +0 -463
  329. package/dist/src/render/envlight.js.map +0 -1
  330. package/dist/src/render/fbm_wavegenerator.js +0 -251
  331. package/dist/src/render/fbm_wavegenerator.js.map +0 -1
  332. package/dist/src/render/fft_wavegenerator.js +0 -1006
  333. package/dist/src/render/fft_wavegenerator.js.map +0 -1
  334. package/dist/src/render/fullscreenquad.js +0 -38
  335. package/dist/src/render/fullscreenquad.js.map +0 -1
  336. package/dist/src/render/gerstner_wavegenerator.js +0 -314
  337. package/dist/src/render/gerstner_wavegenerator.js.map +0 -1
  338. package/dist/src/render/globalbindgroup_allocator.js +0 -60
  339. package/dist/src/render/globalbindgroup_allocator.js.map +0 -1
  340. package/dist/src/render/hzb.js +0 -273
  341. package/dist/src/render/hzb.js.map +0 -1
  342. package/dist/src/render/lightpass.js +0 -172
  343. package/dist/src/render/lightpass.js.map +0 -1
  344. package/dist/src/render/objectcolorpass.js +0 -51
  345. package/dist/src/render/objectcolorpass.js.map +0 -1
  346. package/dist/src/render/primitive.js +0 -364
  347. package/dist/src/render/primitive.js.map +0 -1
  348. package/dist/src/render/render_queue.js +0 -467
  349. package/dist/src/render/render_queue.js.map +0 -1
  350. package/dist/src/render/renderbundle_wrapper.js +0 -152
  351. package/dist/src/render/renderbundle_wrapper.js.map +0 -1
  352. package/dist/src/render/renderer.js +0 -455
  353. package/dist/src/render/renderer.js.map +0 -1
  354. package/dist/src/render/renderpass.js +0 -200
  355. package/dist/src/render/renderpass.js.map +0 -1
  356. package/dist/src/render/shadowmap_pass.js +0 -56
  357. package/dist/src/render/shadowmap_pass.js.map +0 -1
  358. package/dist/src/render/sky.js +0 -1103
  359. package/dist/src/render/sky.js.map +0 -1
  360. package/dist/src/render/weightedblended_oit.js +0 -168
  361. package/dist/src/render/weightedblended_oit.js.map +0 -1
  362. package/dist/src/scene/batchgroup.js +0 -162
  363. package/dist/src/scene/batchgroup.js.map +0 -1
  364. package/dist/src/scene/environment.js +0 -209
  365. package/dist/src/scene/environment.js.map +0 -1
  366. package/dist/src/scene/graph_node.js +0 -72
  367. package/dist/src/scene/graph_node.js.map +0 -1
  368. package/dist/src/scene/light.js +0 -416
  369. package/dist/src/scene/light.js.map +0 -1
  370. package/dist/src/scene/mesh.js +0 -341
  371. package/dist/src/scene/mesh.js.map +0 -1
  372. package/dist/src/scene/octree.js +0 -649
  373. package/dist/src/scene/octree.js.map +0 -1
  374. package/dist/src/scene/particlesys.js +0 -738
  375. package/dist/src/scene/particlesys.js.map +0 -1
  376. package/dist/src/scene/raycast_visitor.js +0 -103
  377. package/dist/src/scene/raycast_visitor.js.map +0 -1
  378. package/dist/src/scene/scene.js +0 -284
  379. package/dist/src/scene/scene.js.map +0 -1
  380. package/dist/src/scene/scene_node.js +0 -732
  381. package/dist/src/scene/scene_node.js.map +0 -1
  382. package/dist/src/scene/terrain/grass.js +0 -278
  383. package/dist/src/scene/terrain/grass.js.map +0 -1
  384. package/dist/src/scene/terrain/heightfield.js +0 -475
  385. package/dist/src/scene/terrain/heightfield.js.map +0 -1
  386. package/dist/src/scene/terrain/patch.js +0 -530
  387. package/dist/src/scene/terrain/patch.js.map +0 -1
  388. package/dist/src/scene/terrain/quadtree.js +0 -461
  389. package/dist/src/scene/terrain/quadtree.js.map +0 -1
  390. package/dist/src/scene/terrain/terrain.js +0 -246
  391. package/dist/src/scene/terrain/terrain.js.map +0 -1
  392. package/dist/src/scene/terrain-cm/grass.js +0 -594
  393. package/dist/src/scene/terrain-cm/grass.js.map +0 -1
  394. package/dist/src/scene/terrain-cm/grassmaterial.js +0 -159
  395. package/dist/src/scene/terrain-cm/grassmaterial.js.map +0 -1
  396. package/dist/src/scene/terrain-cm/terrain-cm.js +0 -538
  397. package/dist/src/scene/terrain-cm/terrain-cm.js.map +0 -1
  398. package/dist/src/scene/water.js +0 -374
  399. package/dist/src/scene/water.js.map +0 -1
  400. package/dist/src/shaders/atmosphere.js +0 -957
  401. package/dist/src/shaders/atmosphere.js.map +0 -1
  402. package/dist/src/shaders/fog.js +0 -112
  403. package/dist/src/shaders/fog.js.map +0 -1
  404. package/dist/src/shaders/misc.js +0 -266
  405. package/dist/src/shaders/misc.js.map +0 -1
  406. package/dist/src/shaders/noise.js +0 -222
  407. package/dist/src/shaders/noise.js.map +0 -1
  408. package/dist/src/shaders/pbr.js +0 -51
  409. package/dist/src/shaders/pbr.js.map +0 -1
  410. package/dist/src/shaders/shadow.js +0 -636
  411. package/dist/src/shaders/shadow.js.map +0 -1
  412. package/dist/src/shaders/ssr.js +0 -490
  413. package/dist/src/shaders/ssr.js.map +0 -1
  414. package/dist/src/shaders/temporal.js +0 -215
  415. package/dist/src/shaders/temporal.js.map +0 -1
  416. package/dist/src/shaders/water.js +0 -756
  417. package/dist/src/shaders/water.js.map +0 -1
  418. package/dist/src/shadow/esm.js +0 -237
  419. package/dist/src/shadow/esm.js.map +0 -1
  420. package/dist/src/shadow/pcf_opt.js +0 -181
  421. package/dist/src/shadow/pcf_opt.js.map +0 -1
  422. package/dist/src/shadow/pcf_pd.js +0 -189
  423. package/dist/src/shadow/pcf_pd.js.map +0 -1
  424. package/dist/src/shadow/shader.js +0 -37
  425. package/dist/src/shadow/shader.js.map +0 -1
  426. package/dist/src/shadow/shadow_impl.js +0 -15
  427. package/dist/src/shadow/shadow_impl.js.map +0 -1
  428. package/dist/src/shadow/shadowmapper.js +0 -790
  429. package/dist/src/shadow/shadowmapper.js.map +0 -1
  430. package/dist/src/shadow/ssm.js +0 -159
  431. package/dist/src/shadow/ssm.js.map +0 -1
  432. package/dist/src/shadow/vsm.js +0 -297
  433. package/dist/src/shadow/vsm.js.map +0 -1
  434. package/dist/src/shapes/box.js +0 -386
  435. package/dist/src/shapes/box.js.map +0 -1
  436. package/dist/src/shapes/cylinder.js +0 -125
  437. package/dist/src/shapes/cylinder.js.map +0 -1
  438. package/dist/src/shapes/plane.js +0 -88
  439. package/dist/src/shapes/plane.js.map +0 -1
  440. package/dist/src/shapes/shape.js +0 -87
  441. package/dist/src/shapes/shape.js.map +0 -1
  442. package/dist/src/shapes/sphere.js +0 -114
  443. package/dist/src/shapes/sphere.js.map +0 -1
  444. package/dist/src/shapes/tetrahedron.js +0 -188
  445. package/dist/src/shapes/tetrahedron.js.map +0 -1
  446. package/dist/src/shapes/torus.js +0 -111
  447. package/dist/src/shapes/torus.js.map +0 -1
  448. package/dist/src/utility/aabbtree.js +0 -400
  449. package/dist/src/utility/aabbtree.js.map +0 -1
  450. package/dist/src/utility/bounding_volume.js +0 -29
  451. package/dist/src/utility/bounding_volume.js.map +0 -1
  452. package/dist/src/utility/debug.js +0 -28
  453. package/dist/src/utility/debug.js.map +0 -1
  454. package/dist/src/utility/draco/decoder.js +0 -116
  455. package/dist/src/utility/draco/decoder.js.map +0 -1
  456. package/dist/src/utility/misc.js +0 -105
  457. package/dist/src/utility/misc.js.map +0 -1
  458. package/dist/src/utility/panorama.js +0 -163
  459. package/dist/src/utility/panorama.js.map +0 -1
  460. package/dist/src/utility/pmrem.js +0 -354
  461. package/dist/src/utility/pmrem.js.map +0 -1
  462. package/dist/src/utility/rendermipmap.js +0 -115
  463. package/dist/src/utility/rendermipmap.js.map +0 -1
  464. package/dist/src/utility/serialization/json.js +0 -402
  465. package/dist/src/utility/serialization/json.js.map +0 -1
  466. package/dist/src/utility/serialization/manager.js +0 -623
  467. package/dist/src/utility/serialization/manager.js.map +0 -1
  468. package/dist/src/utility/serialization/scene/animation.js +0 -248
  469. package/dist/src/utility/serialization/scene/animation.js.map +0 -1
  470. package/dist/src/utility/serialization/scene/batch.js +0 -59
  471. package/dist/src/utility/serialization/scene/batch.js.map +0 -1
  472. package/dist/src/utility/serialization/scene/camera.js +0 -790
  473. package/dist/src/utility/serialization/scene/camera.js.map +0 -1
  474. package/dist/src/utility/serialization/scene/common.js +0 -222
  475. package/dist/src/utility/serialization/scene/common.js.map +0 -1
  476. package/dist/src/utility/serialization/scene/light.js +0 -575
  477. package/dist/src/utility/serialization/scene/light.js.map +0 -1
  478. package/dist/src/utility/serialization/scene/material.js +0 -1111
  479. package/dist/src/utility/serialization/scene/material.js.map +0 -1
  480. package/dist/src/utility/serialization/scene/mesh.js +0 -148
  481. package/dist/src/utility/serialization/scene/mesh.js.map +0 -1
  482. package/dist/src/utility/serialization/scene/misc.js +0 -39
  483. package/dist/src/utility/serialization/scene/misc.js.map +0 -1
  484. package/dist/src/utility/serialization/scene/node.js +0 -451
  485. package/dist/src/utility/serialization/scene/node.js.map +0 -1
  486. package/dist/src/utility/serialization/scene/particle.js +0 -425
  487. package/dist/src/utility/serialization/scene/particle.js.map +0 -1
  488. package/dist/src/utility/serialization/scene/primitive.js +0 -692
  489. package/dist/src/utility/serialization/scene/primitive.js.map +0 -1
  490. package/dist/src/utility/serialization/scene/scene.js +0 -704
  491. package/dist/src/utility/serialization/scene/scene.js.map +0 -1
  492. package/dist/src/utility/serialization/scene/terrain.js +0 -488
  493. package/dist/src/utility/serialization/scene/terrain.js.map +0 -1
  494. package/dist/src/utility/serialization/scene/water.js +0 -465
  495. package/dist/src/utility/serialization/scene/water.js.map +0 -1
  496. package/dist/src/utility/shprojector.js +0 -297
  497. package/dist/src/utility/shprojector.js.map +0 -1
  498. package/dist/src/utility/textures/ggxlut.js +0 -213
  499. package/dist/src/utility/textures/ggxlut.js.map +0 -1
  500. package/dist/src/utility/textures/gradientnoise.js +0 -62
  501. package/dist/src/utility/textures/gradientnoise.js.map +0 -1
  502. package/dist/src/utility/textures/randomnoise.js +0 -41
  503. package/dist/src/utility/textures/randomnoise.js.map +0 -1
  504. package/dist/src/values.js +0 -162
  505. package/dist/src/values.js.map +0 -1
  506. package/dist/utility/blueprint/material/common.js +0 -7
  507. package/dist/utility/blueprint/material/common.js.map +0 -1
  508. package/dist/utility/serialization/blueprint/constants.js +0 -255
  509. package/dist/utility/serialization/blueprint/constants.js.map +0 -1
  510. package/dist/utility/serialization/blueprint/material/constants.js +0 -203
  511. package/dist/utility/serialization/blueprint/material/constants.js.map +0 -1
  512. package/dist/utility/serialization/blueprint/material/texture.js +0 -165
  513. package/dist/utility/serialization/blueprint/material/texture.js.map +0 -1
  514. package/dist/utility/serialization/scene/cloth_script.js +0 -834
  515. package/dist/utility/serialization/scene/cloth_script.js.map +0 -1
  516. package/dist/utility/serialization/scene/spring_script.js +0 -596
  517. package/dist/utility/serialization/scene/spring_script.js.map +0 -1
@@ -1,178 +0,0 @@
1
- import { applyMaterialMixins } from '../../meshmaterial.js';
2
- import { mixinTextureProps } from '../texture.js';
3
- import { mixinPBRCommon } from '../pbr/common.js';
4
- import { Vector4 } from '@zephyr3d/base';
5
- import { mixinLight } from '../lit.js';
6
- import { ShaderHelper } from '../../shader/helper.js';
7
- import { MaterialVaryingFlags } from '../../../values.js';
8
-
9
- /**
10
- * PBRMetallicRoughness lighting model mixin
11
- * @param BaseCls - Class to mix in
12
- * @returns Mixed class
13
- * @public
14
- */ function mixinPBRMetallicRoughness(BaseCls) {
15
- if (BaseCls.pbrMetallicRoughnessMixed) {
16
- return BaseCls;
17
- }
18
- const S = applyMaterialMixins(BaseCls, mixinPBRCommon, mixinLight, mixinTextureProps('metallicRoughness'), mixinTextureProps('specular'), mixinTextureProps('specularColor'));
19
- const METALLIC_UNIFORM = S.defineInstanceUniform('metallic', 'float');
20
- const ROUGHNESS_UNIFORM = S.defineInstanceUniform('roughness', 'float');
21
- const SPECULAR_FACTOR_UNFORM = S.defineInstanceUniform('specularFactor', 'vec4');
22
- return class extends S {
23
- static pbrMetallicRoughnessMixed = true;
24
- _metallic;
25
- _roughness;
26
- _specularFactor;
27
- constructor(){
28
- super();
29
- this._metallic = 1;
30
- this._roughness = 1;
31
- this._specularFactor = Vector4.one();
32
- }
33
- copyFrom(other) {
34
- super.copyFrom(other);
35
- this.metallic = other.metallic;
36
- this.roughness = other.roughness;
37
- this.specularFactor = other.specularFactor;
38
- }
39
- get metallic() {
40
- return this._metallic;
41
- }
42
- set metallic(val) {
43
- if (val !== this._metallic) {
44
- this._metallic = val;
45
- this.uniformChanged();
46
- }
47
- }
48
- get roughness() {
49
- return this._roughness;
50
- }
51
- set roughness(val) {
52
- if (val !== this._roughness) {
53
- this._roughness = val;
54
- this.uniformChanged();
55
- }
56
- }
57
- get specularFactor() {
58
- return this._specularFactor;
59
- }
60
- set specularFactor(val) {
61
- if (!val.equalsTo(this._specularFactor)) {
62
- this._specularFactor.set(val);
63
- this.uniformChanged();
64
- }
65
- }
66
- PBRLight(scope, worldPos, normal, viewVec, albedo, TBN, outRoughness) {
67
- const pb = scope.$builder;
68
- const funcName = 'Z_PBRMetallicRoughnessLight';
69
- const that = this;
70
- pb.func(funcName, [
71
- pb.vec3('worldPos'),
72
- pb.vec3('normal'),
73
- pb.mat3('TBN'),
74
- pb.vec3('viewVec'),
75
- pb.vec4('albedo'),
76
- ...outRoughness ? [
77
- pb.vec4('outRoughness').out()
78
- ] : []
79
- ], function() {
80
- this.$l.pbrData = that.getCommonData(this, this.albedo, this.normal, this.viewVec, this.TBN);
81
- this.$l.lightingColor = pb.vec3(0);
82
- this.$l.emissiveColor = that.calculateEmissiveColor(this);
83
- if (outRoughness) {
84
- that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor, this.outRoughness);
85
- } else {
86
- that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor);
87
- }
88
- that.forEachLight(this, function(type, posRange, dirCutoff, colorIntensity, shadow) {
89
- this.$l.diffuse = pb.vec3();
90
- this.$l.specular = pb.vec3();
91
- this.$l.lightAtten = that.calculateLightAttenuation(this, type, this.worldPos, posRange, dirCutoff);
92
- this.$l.lightDir = that.calculateLightDirection(this, type, this.worldPos, posRange, dirCutoff);
93
- this.$l.NoL = pb.clamp(pb.dot(this.normal, this.lightDir), 0, 1);
94
- this.$l.lightColor = pb.mul(colorIntensity.rgb, colorIntensity.a, this.lightAtten, this.NoL);
95
- if (shadow) {
96
- this.lightColor = pb.mul(this.lightColor, that.calculateShadow(this, this.worldPos, this.NoL));
97
- }
98
- that.directLighting(this, this.lightDir, this.lightColor, this.normal, this.viewVec, this.pbrData, this.lightingColor);
99
- });
100
- this.$return(pb.add(this.lightingColor, this.emissiveColor));
101
- });
102
- return outRoughness ? pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo, outRoughness) : pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo);
103
- }
104
- vertexShader(scope) {
105
- super.vertexShader(scope);
106
- if (this.needFragmentColor() && this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING) {
107
- scope.$outputs.zMetallic = this.getInstancedUniform(scope, METALLIC_UNIFORM);
108
- scope.$outputs.zRoughness = this.getInstancedUniform(scope, ROUGHNESS_UNIFORM);
109
- scope.$outputs.zSpecularFactor = this.getInstancedUniform(scope, SPECULAR_FACTOR_UNFORM);
110
- }
111
- }
112
- fragmentShader(scope) {
113
- super.fragmentShader(scope);
114
- if (this.needFragmentColor()) {
115
- const pb = scope.$builder;
116
- if (!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING)) {
117
- scope.zMetallic = pb.float().uniform(2);
118
- scope.zRoughness = pb.float().uniform(2);
119
- scope.zSpecularFactor = pb.vec4().uniform(2);
120
- }
121
- }
122
- }
123
- applyUniformValues(bindGroup, ctx, pass) {
124
- super.applyUniformValues(bindGroup, ctx, pass);
125
- if (this.needFragmentColor(ctx)) {
126
- if (!(ctx.materialFlags & MaterialVaryingFlags.INSTANCING)) {
127
- bindGroup.setValue('zMetallic', this._metallic);
128
- bindGroup.setValue('zRoughness', this._roughness);
129
- bindGroup.setValue('zSpecularFactor', this._specularFactor);
130
- }
131
- }
132
- }
133
- calculateMetallic(scope, _albedo, _normal) {
134
- const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);
135
- return instancing ? scope.$inputs.zMetallic : scope.zMetallic;
136
- }
137
- calculateRoughness(scope, _albedo, _normal) {
138
- const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);
139
- return instancing ? scope.$inputs.zRoughness : scope.zRoughness;
140
- }
141
- calculateSpecularFactor(scope, _albedo, _normal) {
142
- const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);
143
- return instancing ? scope.$inputs.zSpecularFactor : scope.zSpecularFactor;
144
- }
145
- calculateCommonData(scope, albedo, normal, viewVec, TBN, data) {
146
- const pb = scope.$builder;
147
- const metallic = this.calculateMetallic(scope, albedo, normal);
148
- const roughness = this.calculateRoughness(scope, albedo, normal);
149
- const specularFactor = this.calculateSpecularFactor(scope, albedo, normal);
150
- if (this.metallicRoughnessTexture) {
151
- scope.$l.metallicRoughnessSample = this.sampleMetallicRoughnessTexture(scope);
152
- data.metallic = pb.mul(metallic, scope.metallicRoughnessSample.z);
153
- data.roughness = pb.mul(roughness, scope.metallicRoughnessSample.y);
154
- } else {
155
- data.metallic = metallic;
156
- data.roughness = roughness;
157
- }
158
- data.roughness = pb.mul(data.roughness, ShaderHelper.getCameraRoughnessFactor(scope));
159
- if (this.specularColorTexture) {
160
- scope.$l.specularColor = pb.mul(specularFactor.rgb, this.sampleSpecularColorTexture(scope).rgb);
161
- } else {
162
- scope.$l.specularColor = specularFactor.rgb;
163
- }
164
- if (this.specularTexture) {
165
- data.specularWeight = pb.mul(specularFactor.a, this.sampleSpecularTexture(scope).a);
166
- } else {
167
- data.specularWeight = specularFactor.a;
168
- }
169
- data.f0 = pb.vec4(pb.mix(pb.min(pb.mul(this.getF0(scope).rgb, scope.specularColor), pb.vec3(1)), albedo.rgb, data.metallic), this.getF0(scope).a);
170
- data.f90 = pb.vec3(1);
171
- data.diffuse = pb.vec4(pb.mix(albedo.rgb, pb.vec3(0), data.metallic), albedo.a);
172
- super.calculateCommonData(scope, albedo, normal, viewVec, TBN, data);
173
- }
174
- };
175
- }
176
-
177
- export { mixinPBRMetallicRoughness };
178
- //# sourceMappingURL=pbrmetallicroughness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbrmetallicroughness.js","sources":["../../../../../src/material/mixins/lightmodel/pbrmetallicroughness.ts"],"sourcesContent":["import type { BindGroup, PBFunctionScope, PBInsideFunctionScope, PBShaderExp } from '@zephyr3d/device';\r\nimport type { MeshMaterial } from '../../meshmaterial';\r\nimport { applyMaterialMixins } from '../../meshmaterial';\r\nimport type { TextureMixinInstanceTypes } from '../texture';\r\nimport { mixinTextureProps } from '../texture';\r\nimport type { IMixinPBRCommon } from '../pbr/common';\r\nimport { mixinPBRCommon } from '../pbr/common';\r\nimport type { DrawContext } from '../../../render';\r\nimport { Vector4 } from '@zephyr3d/base';\r\nimport type { IMixinLight } from '../lit';\r\nimport { mixinLight } from '../lit';\r\nimport { ShaderHelper } from '../../shader/helper';\r\nimport { MaterialVaryingFlags } from '../../../values';\r\n\r\n/**\r\n * Interface for PBRMetallicRoughness lighting model mixin\r\n * @public\r\n */\r\nexport type IMixinPBRMetallicRoughness = {\r\n metallic: number;\r\n roughness: number;\r\n specularFactor: Vector4;\r\n PBRLight(\r\n scope: PBInsideFunctionScope,\r\n worldPos: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n albedo: PBShaderExp,\r\n TBN: PBShaderExp,\r\n outRoughness?: PBShaderExp\r\n ): PBShaderExp;\r\n calculateMetallic(scope: PBInsideFunctionScope, albedo: PBShaderExp, normal: PBShaderExp): PBShaderExp;\r\n calculateRoughness(scope: PBInsideFunctionScope, albedo: PBShaderExp, normal: PBShaderExp): PBShaderExp;\r\n calculateSpecularFactor(scope: PBInsideFunctionScope, albedo: PBShaderExp, normal: PBShaderExp);\r\n calculateCommonData(\r\n scope: PBInsideFunctionScope,\r\n albedo: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n TBN: PBShaderExp,\r\n data: PBShaderExp\r\n ): void;\r\n} & IMixinPBRCommon &\r\n IMixinLight &\r\n TextureMixinInstanceTypes<['metallicRoughness', 'occlusion', 'specular', 'specularColor']>;\r\n\r\n/**\r\n * PBRMetallicRoughness lighting model mixin\r\n * @param BaseCls - Class to mix in\r\n * @returns Mixed class\r\n * @public\r\n */\r\nexport function mixinPBRMetallicRoughness<T extends typeof MeshMaterial>(BaseCls: T) {\r\n if ((BaseCls as any).pbrMetallicRoughnessMixed) {\r\n return BaseCls as T & { new (...args: any[]): IMixinPBRMetallicRoughness };\r\n }\r\n const S = applyMaterialMixins(\r\n BaseCls,\r\n mixinPBRCommon,\r\n mixinLight,\r\n mixinTextureProps('metallicRoughness'),\r\n mixinTextureProps('specular'),\r\n mixinTextureProps('specularColor')\r\n );\r\n const METALLIC_UNIFORM = S.defineInstanceUniform('metallic', 'float');\r\n const ROUGHNESS_UNIFORM = S.defineInstanceUniform('roughness', 'float');\r\n const SPECULAR_FACTOR_UNFORM = S.defineInstanceUniform('specularFactor', 'vec4');\r\n\r\n return class extends S {\r\n static readonly pbrMetallicRoughnessMixed = true;\r\n private _metallic: number;\r\n private _roughness: number;\r\n private readonly _specularFactor: Vector4;\r\n constructor() {\r\n super();\r\n this._metallic = 1;\r\n this._roughness = 1;\r\n this._specularFactor = Vector4.one();\r\n }\r\n copyFrom(other: this): void {\r\n super.copyFrom(other);\r\n this.metallic = other.metallic;\r\n this.roughness = other.roughness;\r\n this.specularFactor = other.specularFactor;\r\n }\r\n get metallic(): number {\r\n return this._metallic;\r\n }\r\n set metallic(val: number) {\r\n if (val !== this._metallic) {\r\n this._metallic = val;\r\n this.uniformChanged();\r\n }\r\n }\r\n get roughness(): number {\r\n return this._roughness;\r\n }\r\n set roughness(val: number) {\r\n if (val !== this._roughness) {\r\n this._roughness = val;\r\n this.uniformChanged();\r\n }\r\n }\r\n get specularFactor(): Vector4 {\r\n return this._specularFactor;\r\n }\r\n set specularFactor(val: Vector4) {\r\n if (!val.equalsTo(this._specularFactor)) {\r\n this._specularFactor.set(val);\r\n this.uniformChanged();\r\n }\r\n }\r\n PBRLight(\r\n scope: PBInsideFunctionScope,\r\n worldPos: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n albedo: PBShaderExp,\r\n TBN: PBShaderExp,\r\n outRoughness?: PBShaderExp\r\n ): PBShaderExp {\r\n const pb = scope.$builder;\r\n const funcName = 'Z_PBRMetallicRoughnessLight';\r\n const that = this;\r\n pb.func(\r\n funcName,\r\n [\r\n pb.vec3('worldPos'),\r\n pb.vec3('normal'),\r\n pb.mat3('TBN'),\r\n pb.vec3('viewVec'),\r\n pb.vec4('albedo'),\r\n ...(outRoughness ? [pb.vec4('outRoughness').out()] : [])\r\n ],\r\n function () {\r\n this.$l.pbrData = that.getCommonData(this, this.albedo, this.normal, this.viewVec, this.TBN);\r\n this.$l.lightingColor = pb.vec3(0);\r\n this.$l.emissiveColor = that.calculateEmissiveColor(this);\r\n if (outRoughness) {\r\n that.indirectLighting(\r\n this,\r\n this.normal,\r\n this.viewVec,\r\n this.pbrData,\r\n this.lightingColor,\r\n this.outRoughness\r\n );\r\n } else {\r\n that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor);\r\n }\r\n that.forEachLight(this, function (type, posRange, dirCutoff, colorIntensity, shadow) {\r\n this.$l.diffuse = pb.vec3();\r\n this.$l.specular = pb.vec3();\r\n this.$l.lightAtten = that.calculateLightAttenuation(\r\n this,\r\n type,\r\n this.worldPos,\r\n posRange,\r\n dirCutoff\r\n );\r\n this.$l.lightDir = that.calculateLightDirection(this, type, this.worldPos, posRange, dirCutoff);\r\n this.$l.NoL = pb.clamp(pb.dot(this.normal, this.lightDir), 0, 1);\r\n this.$l.lightColor = pb.mul(colorIntensity.rgb, colorIntensity.a, this.lightAtten, this.NoL);\r\n if (shadow) {\r\n this.lightColor = pb.mul(this.lightColor, that.calculateShadow(this, this.worldPos, this.NoL));\r\n }\r\n that.directLighting(\r\n this,\r\n this.lightDir,\r\n this.lightColor,\r\n this.normal,\r\n this.viewVec,\r\n this.pbrData,\r\n this.lightingColor\r\n );\r\n });\r\n this.$return(pb.add(this.lightingColor, this.emissiveColor));\r\n }\r\n );\r\n return outRoughness\r\n ? pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo, outRoughness)\r\n : pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo);\r\n }\r\n vertexShader(scope: PBFunctionScope): void {\r\n super.vertexShader(scope);\r\n if (this.needFragmentColor() && this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING) {\r\n scope.$outputs.zMetallic = this.getInstancedUniform(scope, METALLIC_UNIFORM);\r\n scope.$outputs.zRoughness = this.getInstancedUniform(scope, ROUGHNESS_UNIFORM);\r\n scope.$outputs.zSpecularFactor = this.getInstancedUniform(scope, SPECULAR_FACTOR_UNFORM);\r\n }\r\n }\r\n fragmentShader(scope: PBFunctionScope): void {\r\n super.fragmentShader(scope);\r\n if (this.needFragmentColor()) {\r\n const pb = scope.$builder;\r\n if (!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING)) {\r\n scope.zMetallic = pb.float().uniform(2);\r\n scope.zRoughness = pb.float().uniform(2);\r\n scope.zSpecularFactor = pb.vec4().uniform(2);\r\n }\r\n }\r\n }\r\n applyUniformValues(bindGroup: BindGroup, ctx: DrawContext, pass: number): void {\r\n super.applyUniformValues(bindGroup, ctx, pass);\r\n if (this.needFragmentColor(ctx)) {\r\n if (!(ctx.materialFlags & MaterialVaryingFlags.INSTANCING)) {\r\n bindGroup.setValue('zMetallic', this._metallic);\r\n bindGroup.setValue('zRoughness', this._roughness);\r\n bindGroup.setValue('zSpecularFactor', this._specularFactor);\r\n }\r\n }\r\n }\r\n calculateMetallic(scope: PBInsideFunctionScope, _albedo: PBShaderExp, _normal: PBShaderExp): PBShaderExp {\r\n const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);\r\n return instancing ? scope.$inputs.zMetallic : scope.zMetallic;\r\n }\r\n calculateRoughness(\r\n scope: PBInsideFunctionScope,\r\n _albedo: PBShaderExp,\r\n _normal: PBShaderExp\r\n ): PBShaderExp {\r\n const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);\r\n return instancing ? scope.$inputs.zRoughness : scope.zRoughness;\r\n }\r\n calculateSpecularFactor(\r\n scope: PBInsideFunctionScope,\r\n _albedo: PBShaderExp,\r\n _normal: PBShaderExp\r\n ): PBShaderExp {\r\n const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);\r\n return instancing ? scope.$inputs.zSpecularFactor : scope.zSpecularFactor;\r\n }\r\n calculateCommonData(\r\n scope: PBInsideFunctionScope,\r\n albedo: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n TBN: PBShaderExp,\r\n data: PBShaderExp\r\n ): void {\r\n const pb = scope.$builder;\r\n const metallic = this.calculateMetallic(scope, albedo, normal);\r\n const roughness = this.calculateRoughness(scope, albedo, normal);\r\n const specularFactor = this.calculateSpecularFactor(scope, albedo, normal);\r\n if (this.metallicRoughnessTexture) {\r\n scope.$l.metallicRoughnessSample = this.sampleMetallicRoughnessTexture(scope);\r\n data.metallic = pb.mul(metallic, scope.metallicRoughnessSample.z);\r\n data.roughness = pb.mul(roughness, scope.metallicRoughnessSample.y);\r\n } else {\r\n data.metallic = metallic;\r\n data.roughness = roughness;\r\n }\r\n data.roughness = pb.mul(data.roughness, ShaderHelper.getCameraRoughnessFactor(scope));\r\n if (this.specularColorTexture) {\r\n scope.$l.specularColor = pb.mul(specularFactor.rgb, this.sampleSpecularColorTexture(scope).rgb);\r\n } else {\r\n scope.$l.specularColor = specularFactor.rgb;\r\n }\r\n if (this.specularTexture) {\r\n data.specularWeight = pb.mul(specularFactor.a, this.sampleSpecularTexture(scope).a);\r\n } else {\r\n data.specularWeight = specularFactor.a;\r\n }\r\n data.f0 = pb.vec4(\r\n pb.mix(\r\n pb.min(pb.mul(this.getF0(scope).rgb, scope.specularColor), pb.vec3(1)),\r\n albedo.rgb,\r\n data.metallic\r\n ),\r\n this.getF0(scope).a\r\n );\r\n data.f90 = pb.vec3(1);\r\n data.diffuse = pb.vec4(pb.mix(albedo.rgb, pb.vec3(0), data.metallic), albedo.a);\r\n super.calculateCommonData(scope, albedo, normal, viewVec, TBN, data);\r\n }\r\n } as unknown as T & { new (...args: any[]): IMixinPBRMetallicRoughness };\r\n}\r\n"],"names":["mixinPBRMetallicRoughness","BaseCls","pbrMetallicRoughnessMixed","S","applyMaterialMixins","mixinPBRCommon","mixinLight","mixinTextureProps","METALLIC_UNIFORM","defineInstanceUniform","ROUGHNESS_UNIFORM","SPECULAR_FACTOR_UNFORM","_metallic","_roughness","_specularFactor","Vector4","one","copyFrom","other","metallic","roughness","specularFactor","val","uniformChanged","equalsTo","set","PBRLight","scope","worldPos","normal","viewVec","albedo","TBN","outRoughness","pb","$builder","funcName","that","func","vec3","mat3","vec4","out","$l","pbrData","getCommonData","lightingColor","emissiveColor","calculateEmissiveColor","indirectLighting","forEachLight","type","posRange","dirCutoff","colorIntensity","shadow","diffuse","specular","lightAtten","calculateLightAttenuation","lightDir","calculateLightDirection","NoL","clamp","dot","lightColor","mul","rgb","a","calculateShadow","directLighting","$return","add","getGlobalScope","vertexShader","needFragmentColor","drawContext","materialFlags","MaterialVaryingFlags","INSTANCING","$outputs","zMetallic","getInstancedUniform","zRoughness","zSpecularFactor","fragmentShader","float","uniform","applyUniformValues","bindGroup","ctx","pass","setValue","calculateMetallic","_albedo","_normal","instancing","$inputs","calculateRoughness","calculateSpecularFactor","calculateCommonData","data","metallicRoughnessTexture","metallicRoughnessSample","sampleMetallicRoughnessTexture","z","y","ShaderHelper","getCameraRoughnessFactor","specularColorTexture","specularColor","sampleSpecularColorTexture","specularTexture","specularWeight","sampleSpecularTexture","f0","mix","min","getF0","f90"],"mappings":";;;;;;;;AA8CA;;;;;IAMO,SAASA,yBAAAA,CAAyDC,OAAU,EAAA;IACjF,IAAKA,OAAgBC,CAAAA,yBAAyB,EAAE;QAC9C,OAAOD,OAAAA;AACT;IACA,MAAME,CAAAA,GAAIC,oBACRH,OACAI,EAAAA,cAAAA,EACAC,YACAC,iBAAkB,CAAA,mBAAA,CAAA,EAClBA,iBAAkB,CAAA,UAAA,CAAA,EAClBA,iBAAkB,CAAA,eAAA,CAAA,CAAA;AAEpB,IAAA,MAAMC,gBAAmBL,GAAA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AAAA;AACjE;AACF,KAAA;AACF;;;;"}
@@ -1,139 +0,0 @@
1
- import { applyMaterialMixins } from '../../meshmaterial.js';
2
- import { mixinTextureProps } from '../texture.js';
3
- import { mixinPBRCommon } from '../pbr/common.js';
4
- import { Vector3 } from '@zephyr3d/base';
5
- import { mixinLight } from '../lit.js';
6
- import { ShaderHelper } from '../../shader/helper.js';
7
- import { MaterialVaryingFlags } from '../../../values.js';
8
-
9
- /**
10
- * PBRSpecularGlossiness mixin
11
- *
12
- * @param BaseCls - Base class to mix in
13
- * @returns Mixed class
14
- *
15
- * @public
16
- */ function mixinPBRSpecularGlossness(BaseCls) {
17
- if (BaseCls.pbrSpecularGlossnessMixed) {
18
- return BaseCls;
19
- }
20
- const S = applyMaterialMixins(BaseCls, mixinPBRCommon, mixinLight, mixinTextureProps('specular'));
21
- const SPECULAR_FACTOR_UNFORM = S.defineInstanceUniform('specularFactor', 'rgb');
22
- const GLOSSINESS_FACTOR_UNIFORM = S.defineInstanceUniform('glossinessFactor', 'float');
23
- return class extends S {
24
- static pbrSpecularGlossnessMixed = true;
25
- _specularFactor;
26
- _glossinessFactor;
27
- constructor(){
28
- super();
29
- this._specularFactor = Vector3.one();
30
- this._glossinessFactor = 1;
31
- }
32
- copyFrom(other) {
33
- super.copyFrom(other);
34
- this.specularFactor = other.specularFactor;
35
- this.glossinessFactor = other.glossinessFactor;
36
- }
37
- get specularFactor() {
38
- return this._specularFactor;
39
- }
40
- set specularFactor(val) {
41
- if (!val.equalsTo(this._specularFactor)) {
42
- this._specularFactor.set(val);
43
- this.uniformChanged();
44
- }
45
- }
46
- get glossinessFactor() {
47
- return this._glossinessFactor;
48
- }
49
- set glossinessFactor(val) {
50
- if (val !== this._glossinessFactor) {
51
- this._glossinessFactor = val;
52
- this.uniformChanged();
53
- }
54
- }
55
- vertexShader(scope) {
56
- super.vertexShader(scope);
57
- if (this.needFragmentColor() && this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING) {
58
- scope.$outputs.zSpecularFactor = this.getInstancedUniform(scope, SPECULAR_FACTOR_UNFORM);
59
- scope.$outputs.zGlossinessFactor = this.getInstancedUniform(scope, GLOSSINESS_FACTOR_UNIFORM);
60
- }
61
- }
62
- fragmentShader(scope) {
63
- super.fragmentShader(scope);
64
- if (this.needFragmentColor() && !(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING)) {
65
- const pb = scope.$builder;
66
- scope.zSpecularFactor = pb.vec3().uniform(2);
67
- scope.zGlossinessFactor = pb.float().uniform(2);
68
- }
69
- }
70
- applyUniformValues(bindGroup, ctx, pass) {
71
- super.applyUniformValues(bindGroup, ctx, pass);
72
- if (this.needFragmentColor(ctx) && !(ctx.materialFlags & MaterialVaryingFlags.INSTANCING)) {
73
- bindGroup.setValue('zSpecularFactor', this._specularFactor);
74
- bindGroup.setValue('zGlossinessFactor', this._glossinessFactor);
75
- }
76
- }
77
- PBRLight(scope, worldPos, normal, viewVec, albedo, TBN, outRoughness) {
78
- const pb = scope.$builder;
79
- const funcName = 'Z_PBRSpecularGlossinessLight';
80
- const that = this;
81
- pb.func(funcName, [
82
- pb.vec3('worldPos'),
83
- pb.vec3('normal'),
84
- pb.mat3('TBN'),
85
- pb.vec3('viewVec'),
86
- pb.vec4('albedo'),
87
- ...outRoughness ? [
88
- pb.vec4('outRoughness').out()
89
- ] : []
90
- ], function() {
91
- this.$l.pbrData = that.getCommonData(this, this.albedo, this.normal, this.viewVec, this.TBN);
92
- this.$l.lightingColor = pb.vec3(0);
93
- this.$l.emissiveColor = that.calculateEmissiveColor(this);
94
- if (outRoughness) {
95
- that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor, this.outRoughness);
96
- } else {
97
- that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor);
98
- }
99
- that.forEachLight(this, function(type, posRange, dirCutoff, colorIntensity, shadow) {
100
- this.$l.diffuse = pb.vec3();
101
- this.$l.specular = pb.vec3();
102
- this.$l.lightAtten = that.calculateLightAttenuation(this, type, this.worldPos, posRange, dirCutoff);
103
- this.$l.lightDir = that.calculateLightDirection(this, type, this.worldPos, posRange, dirCutoff);
104
- this.$l.NoL = pb.clamp(pb.dot(this.normal, this.lightDir), 0, 1);
105
- this.$l.lightColor = pb.mul(colorIntensity.rgb, colorIntensity.a, this.lightAtten, this.NoL);
106
- if (shadow) {
107
- this.lightColor = pb.mul(this.lightColor, that.calculateShadow(this, this.worldPos, this.NoL));
108
- }
109
- that.directLighting(this, this.lightDir, this.lightColor, this.normal, this.viewVec, this.pbrData, this.lightingColor);
110
- });
111
- this.$return(pb.add(this.lightingColor, this.emissiveColor));
112
- });
113
- return outRoughness ? pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo, outRoughness) : pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo);
114
- }
115
- calculateCommonData(scope, albedo, normal, viewVec, TBN, data) {
116
- super.calculateCommonData(scope, albedo, normal, viewVec, TBN, data);
117
- const pb = scope.$builder;
118
- const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);
119
- const specularFactor = instancing ? scope.$inputs.zSpecularFactor : scope.zSpecularFactor;
120
- const glossinessFactor = instancing ? scope.$inputs.zGlossinessFactor : scope.zGlossinessFactor;
121
- if (this.specularTexture) {
122
- scope.$l.specularTextureSample = this.sampleSpecularTexture(scope);
123
- data.roughness = pb.sub(1, pb.mul(glossinessFactor, scope.specularTextureSample.a));
124
- data.f0 = pb.vec4(pb.mul(scope.specularTextureSample.rgb, specularFactor), this.getF0(scope).a);
125
- } else {
126
- data.roughness = pb.sub(1, glossinessFactor);
127
- data.f0 = pb.vec4(specularFactor, this.getF0(scope).a);
128
- }
129
- data.roughness = pb.mul(data.roughness, ShaderHelper.getCameraRoughnessFactor(scope));
130
- data.metallic = pb.max(pb.max(data.f0.r, data.f0.g), data.f0.b);
131
- data.diffuse = pb.vec4(pb.mul(albedo.rgb, pb.sub(1, data.metallic)), albedo.a);
132
- data.specularWeight = 1;
133
- data.f90 = pb.vec3(1);
134
- }
135
- };
136
- }
137
-
138
- export { mixinPBRSpecularGlossness };
139
- //# sourceMappingURL=pbrspecularglossness.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pbrspecularglossness.js","sources":["../../../../../src/material/mixins/lightmodel/pbrspecularglossness.ts"],"sourcesContent":["import type { BindGroup, PBFunctionScope, PBInsideFunctionScope, PBShaderExp } from '@zephyr3d/device';\r\nimport type { MeshMaterial } from '../../meshmaterial';\r\nimport { applyMaterialMixins } from '../../meshmaterial';\r\nimport type { TextureMixinInstanceTypes } from '../texture';\r\nimport { mixinTextureProps } from '../texture';\r\nimport type { IMixinPBRCommon } from '../pbr/common';\r\nimport { mixinPBRCommon } from '../pbr/common';\r\nimport type { DrawContext } from '../../../render';\r\nimport { Vector3 } from '@zephyr3d/base';\r\nimport type { IMixinLight } from '../lit';\r\nimport { mixinLight } from '../lit';\r\nimport { ShaderHelper } from '../../shader/helper';\r\nimport { MaterialVaryingFlags } from '../../../values';\r\n\r\n/**\r\n * Interface for PBRSpecularGlossiness mixin\r\n * @public\r\n */\r\nexport type IMixinPBRSpecularGlossiness = {\r\n specularFactor: Vector3;\r\n glossinessFactor: number;\r\n PBRLight(\r\n scope: PBInsideFunctionScope,\r\n worldPos: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n albedo: PBShaderExp,\r\n TBN: PBShaderExp,\r\n outRoughness?: PBShaderExp\r\n ): PBShaderExp;\r\n calculateCommonData(\r\n scope: PBInsideFunctionScope,\r\n albedo: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n TBN: PBShaderExp,\r\n data: PBShaderExp\r\n ): void;\r\n} & IMixinPBRCommon &\r\n IMixinLight &\r\n TextureMixinInstanceTypes<['specular']>;\r\n\r\n/**\r\n * PBRSpecularGlossiness mixin\r\n *\r\n * @param BaseCls - Base class to mix in\r\n * @returns Mixed class\r\n *\r\n * @public\r\n */\r\nexport function mixinPBRSpecularGlossness<T extends typeof MeshMaterial>(BaseCls: T) {\r\n if ((BaseCls as any).pbrSpecularGlossnessMixed) {\r\n return BaseCls as T & { new (...args: any[]): IMixinPBRSpecularGlossiness };\r\n }\r\n const S = applyMaterialMixins(BaseCls, mixinPBRCommon, mixinLight, mixinTextureProps('specular'));\r\n const SPECULAR_FACTOR_UNFORM = S.defineInstanceUniform('specularFactor', 'rgb');\r\n const GLOSSINESS_FACTOR_UNIFORM = S.defineInstanceUniform('glossinessFactor', 'float');\r\n return class extends S {\r\n static readonly pbrSpecularGlossnessMixed = true;\r\n private readonly _specularFactor: Vector3;\r\n private _glossinessFactor: number;\r\n constructor() {\r\n super();\r\n this._specularFactor = Vector3.one();\r\n this._glossinessFactor = 1;\r\n }\r\n copyFrom(other: this): void {\r\n super.copyFrom(other);\r\n this.specularFactor = other.specularFactor;\r\n this.glossinessFactor = other.glossinessFactor;\r\n }\r\n get specularFactor(): Vector3 {\r\n return this._specularFactor;\r\n }\r\n set specularFactor(val: Vector3) {\r\n if (!val.equalsTo(this._specularFactor)) {\r\n this._specularFactor.set(val);\r\n this.uniformChanged();\r\n }\r\n }\r\n get glossinessFactor(): number {\r\n return this._glossinessFactor;\r\n }\r\n set glossinessFactor(val: number) {\r\n if (val !== this._glossinessFactor) {\r\n this._glossinessFactor = val;\r\n this.uniformChanged();\r\n }\r\n }\r\n vertexShader(scope: PBFunctionScope): void {\r\n super.vertexShader(scope);\r\n if (this.needFragmentColor() && this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING) {\r\n scope.$outputs.zSpecularFactor = this.getInstancedUniform(scope, SPECULAR_FACTOR_UNFORM);\r\n scope.$outputs.zGlossinessFactor = this.getInstancedUniform(scope, GLOSSINESS_FACTOR_UNIFORM);\r\n }\r\n }\r\n fragmentShader(scope: PBFunctionScope): void {\r\n super.fragmentShader(scope);\r\n if (this.needFragmentColor() && !(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING)) {\r\n const pb = scope.$builder;\r\n scope.zSpecularFactor = pb.vec3().uniform(2);\r\n scope.zGlossinessFactor = pb.float().uniform(2);\r\n }\r\n }\r\n applyUniformValues(bindGroup: BindGroup, ctx: DrawContext, pass: number): void {\r\n super.applyUniformValues(bindGroup, ctx, pass);\r\n if (this.needFragmentColor(ctx) && !(ctx.materialFlags & MaterialVaryingFlags.INSTANCING)) {\r\n bindGroup.setValue('zSpecularFactor', this._specularFactor);\r\n bindGroup.setValue('zGlossinessFactor', this._glossinessFactor);\r\n }\r\n }\r\n PBRLight(\r\n scope: PBInsideFunctionScope,\r\n worldPos: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n albedo: PBShaderExp,\r\n TBN: PBShaderExp,\r\n outRoughness?: PBShaderExp\r\n ): PBShaderExp {\r\n const pb = scope.$builder;\r\n const funcName = 'Z_PBRSpecularGlossinessLight';\r\n const that = this;\r\n pb.func(\r\n funcName,\r\n [\r\n pb.vec3('worldPos'),\r\n pb.vec3('normal'),\r\n pb.mat3('TBN'),\r\n pb.vec3('viewVec'),\r\n pb.vec4('albedo'),\r\n ...(outRoughness ? [pb.vec4('outRoughness').out()] : [])\r\n ],\r\n function () {\r\n this.$l.pbrData = that.getCommonData(this, this.albedo, this.normal, this.viewVec, this.TBN);\r\n this.$l.lightingColor = pb.vec3(0);\r\n this.$l.emissiveColor = that.calculateEmissiveColor(this);\r\n if (outRoughness) {\r\n that.indirectLighting(\r\n this,\r\n this.normal,\r\n this.viewVec,\r\n this.pbrData,\r\n this.lightingColor,\r\n this.outRoughness\r\n );\r\n } else {\r\n that.indirectLighting(this, this.normal, this.viewVec, this.pbrData, this.lightingColor);\r\n }\r\n that.forEachLight(this, function (type, posRange, dirCutoff, colorIntensity, shadow) {\r\n this.$l.diffuse = pb.vec3();\r\n this.$l.specular = pb.vec3();\r\n this.$l.lightAtten = that.calculateLightAttenuation(\r\n this,\r\n type,\r\n this.worldPos,\r\n posRange,\r\n dirCutoff\r\n );\r\n this.$l.lightDir = that.calculateLightDirection(this, type, this.worldPos, posRange, dirCutoff);\r\n this.$l.NoL = pb.clamp(pb.dot(this.normal, this.lightDir), 0, 1);\r\n this.$l.lightColor = pb.mul(colorIntensity.rgb, colorIntensity.a, this.lightAtten, this.NoL);\r\n if (shadow) {\r\n this.lightColor = pb.mul(this.lightColor, that.calculateShadow(this, this.worldPos, this.NoL));\r\n }\r\n that.directLighting(\r\n this,\r\n this.lightDir,\r\n this.lightColor,\r\n this.normal,\r\n this.viewVec,\r\n this.pbrData,\r\n this.lightingColor\r\n );\r\n });\r\n this.$return(pb.add(this.lightingColor, this.emissiveColor));\r\n }\r\n );\r\n return outRoughness\r\n ? pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo, outRoughness)\r\n : pb.getGlobalScope()[funcName](worldPos, normal, TBN, viewVec, albedo);\r\n }\r\n calculateCommonData(\r\n scope: PBInsideFunctionScope,\r\n albedo: PBShaderExp,\r\n normal: PBShaderExp,\r\n viewVec: PBShaderExp,\r\n TBN: PBShaderExp,\r\n data: PBShaderExp\r\n ): void {\r\n super.calculateCommonData(scope, albedo, normal, viewVec, TBN, data);\r\n const pb = scope.$builder;\r\n const instancing = !!(this.drawContext.materialFlags & MaterialVaryingFlags.INSTANCING);\r\n const specularFactor = instancing ? scope.$inputs.zSpecularFactor : scope.zSpecularFactor;\r\n const glossinessFactor = instancing ? scope.$inputs.zGlossinessFactor : scope.zGlossinessFactor;\r\n if (this.specularTexture) {\r\n scope.$l.specularTextureSample = this.sampleSpecularTexture(scope);\r\n data.roughness = pb.sub(1, pb.mul(glossinessFactor, scope.specularTextureSample.a));\r\n data.f0 = pb.vec4(pb.mul(scope.specularTextureSample.rgb, specularFactor), this.getF0(scope).a);\r\n } else {\r\n data.roughness = pb.sub(1, glossinessFactor);\r\n data.f0 = pb.vec4(specularFactor, this.getF0(scope).a);\r\n }\r\n data.roughness = pb.mul(data.roughness, ShaderHelper.getCameraRoughnessFactor(scope));\r\n data.metallic = pb.max(pb.max(data.f0.r, data.f0.g), data.f0.b);\r\n data.diffuse = pb.vec4(pb.mul(albedo.rgb, pb.sub(1, data.metallic)), albedo.a);\r\n data.specularWeight = 1;\r\n data.f90 = pb.vec3(1);\r\n }\r\n } as unknown as T & { new (...args: any[]): IMixinPBRSpecularGlossiness };\r\n}\r\n"],"names":["mixinPBRSpecularGlossness","BaseCls","pbrSpecularGlossnessMixed","S","applyMaterialMixins","mixinPBRCommon","mixinLight","mixinTextureProps","SPECULAR_FACTOR_UNFORM","defineInstanceUniform","GLOSSINESS_FACTOR_UNIFORM","_specularFactor","_glossinessFactor","Vector3","one","copyFrom","other","specularFactor","glossinessFactor","val","equalsTo","set","uniformChanged","vertexShader","scope","needFragmentColor","drawContext","materialFlags","MaterialVaryingFlags","INSTANCING","$outputs","zSpecularFactor","getInstancedUniform","zGlossinessFactor","fragmentShader","pb","$builder","vec3","uniform","float","applyUniformValues","bindGroup","ctx","pass","setValue","PBRLight","worldPos","normal","viewVec","albedo","TBN","outRoughness","funcName","that","func","mat3","vec4","out","$l","pbrData","getCommonData","lightingColor","emissiveColor","calculateEmissiveColor","indirectLighting","forEachLight","type","posRange","dirCutoff","colorIntensity","shadow","diffuse","specular","lightAtten","calculateLightAttenuation","lightDir","calculateLightDirection","NoL","clamp","dot","lightColor","mul","rgb","a","calculateShadow","directLighting","$return","add","getGlobalScope","calculateCommonData","data","instancing","$inputs","specularTexture","specularTextureSample","sampleSpecularTexture","roughness","sub","f0","getF0","ShaderHelper","getCameraRoughnessFactor","metallic","max","r","g","b","specularWeight","f90"],"mappings":";;;;;;;;AAyCA;;;;;;;IAQO,SAASA,yBAAAA,CAAyDC,OAAU,EAAA;IACjF,IAAKA,OAAgBC,CAAAA,yBAAyB,EAAE;QAC9C,OAAOD,OAAAA;AACT;AACA,IAAA,MAAME,CAAIC,GAAAA,mBAAAA,CAAoBH,OAASI,EAAAA,cAAAA,EAAgBC,YAAYC,iBAAkB,CAAA,UAAA,CAAA,CAAA;AACrF,IAAA,MAAMC,sBAAyBL,GAA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