@carbonenginejs/runtime 0.1.0-alpha.4 → 0.1.0-alpha.5

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 (384) hide show
  1. package/dist/global/blue/BlueClasses.js +200 -0
  2. package/dist/global/blue/BlueClasses.js.map +1 -0
  3. package/dist/global/blue/IBlueClasses.js +79 -0
  4. package/dist/global/blue/IBlueClasses.js.map +1 -0
  5. package/dist/global/blue/IBlueDynamicResourceConstructor.js +16 -0
  6. package/dist/global/blue/IBlueDynamicResourceConstructor.js.map +1 -1
  7. package/dist/global/blue/blue.js +8 -2
  8. package/dist/global/blue/blue.js.map +1 -1
  9. package/dist/global/blue/index.js +2 -0
  10. package/dist/global/blue/index.js.map +1 -1
  11. package/dist/global/consts/index.js +0 -1
  12. package/dist/global/consts/index.js.map +1 -1
  13. package/dist/global/consts/renderContext/formats.js +26 -25
  14. package/dist/global/consts/renderContext/formats.js.map +1 -1
  15. package/dist/{trinityal/Tr2BitmapDimensions.js → global/imageio/BitmapDimensions.js} +19 -15
  16. package/dist/global/imageio/BitmapDimensions.js.map +1 -0
  17. package/dist/global/imageio/Cutout.js +28 -0
  18. package/dist/global/imageio/Cutout.js.map +1 -0
  19. package/dist/global/imageio/HostBitmap.js +1106 -0
  20. package/dist/global/imageio/HostBitmap.js.map +1 -0
  21. package/dist/global/imageio/ImageIOResult.js +99 -0
  22. package/dist/global/imageio/ImageIOResult.js.map +1 -0
  23. package/dist/global/imageio/ImageUtility.js +205 -0
  24. package/dist/global/imageio/ImageUtility.js.map +1 -0
  25. package/dist/global/imageio/LoadParameters.js +86 -0
  26. package/dist/global/imageio/LoadParameters.js.map +1 -0
  27. package/dist/global/imageio/Metadata.js +22 -0
  28. package/dist/global/imageio/Metadata.js.map +1 -0
  29. package/dist/global/imageio/index.js +8 -0
  30. package/dist/global/{consts/webgpu → imageio}/index.js.map +1 -1
  31. package/dist/global/index.js +2 -1
  32. package/dist/global/index.js.map +1 -1
  33. package/dist/global/math/color.js +1 -1
  34. package/dist/global/math/color.js.map +1 -1
  35. package/dist/global/schema/CjsSchema.js +8 -0
  36. package/dist/global/schema/CjsSchema.js.map +1 -1
  37. package/dist/index.js +12 -4
  38. package/dist/index.js.map +1 -1
  39. package/dist/resource/CjsResMan.js +47 -7
  40. package/dist/resource/CjsResMan.js.map +1 -1
  41. package/dist/resource/Tr2LightProfileRes.js +37 -0
  42. package/dist/resource/Tr2LightProfileRes.js.map +1 -1
  43. package/dist/resource/format/CjsByteWriter.js +46 -46
  44. package/dist/resource/format/CjsByteWriter.js.map +1 -1
  45. package/dist/resource/format/CjsFormat.js +7 -8
  46. package/dist/resource/format/CjsFormat.js.map +1 -1
  47. package/dist/resource/format/CjsFormatStore.js +8 -8
  48. package/dist/resource/format/CjsFormatStore.js.map +1 -1
  49. package/dist/resource/format/CjsGeometryFormat.js +114 -0
  50. package/dist/resource/format/CjsGeometryFormat.js.map +1 -0
  51. package/dist/resource/format/CjsImageFormat.js +282 -0
  52. package/dist/resource/format/CjsImageFormat.js.map +1 -0
  53. package/dist/resource/format/CjsResourceProbe.js +12 -48
  54. package/dist/resource/format/CjsResourceProbe.js.map +1 -1
  55. package/dist/resource/format/CjsStringTable.js +37 -37
  56. package/dist/resource/format/CjsStringTable.js.map +1 -1
  57. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js +10 -10
  58. package/dist/resource/format/carbonEffect/CjsCarbonEffectReader.js.map +1 -1
  59. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js +37 -37
  60. package/dist/resource/format/carbonEffect/CjsCarbonEffectWriter.js.map +1 -1
  61. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js +35 -7
  62. package/dist/resource/format/carbonEffect/carbonEffectBackendBlock.js.map +1 -1
  63. package/dist/resource/format/index.js +3 -1
  64. package/dist/resource/format/index.js.map +1 -1
  65. package/dist/resource/formats/black/CjsBlackFormat.js +130 -137
  66. package/dist/resource/formats/black/CjsBlackFormat.js.map +1 -1
  67. package/dist/resource/formats/bnk/CjsBnkFormat.js +12 -19
  68. package/dist/resource/formats/bnk/CjsBnkFormat.js.map +1 -1
  69. package/dist/resource/formats/bnk/core/helpers.js +1 -3
  70. package/dist/resource/formats/bnk/core/helpers.js.map +1 -1
  71. package/dist/resource/formats/cmf/CjsCmfFormat.js +19 -82
  72. package/dist/resource/formats/cmf/CjsCmfFormat.js.map +1 -1
  73. package/dist/resource/formats/cmf/core/constants.js +1 -2
  74. package/dist/resource/formats/cmf/core/constants.js.map +1 -1
  75. package/dist/resource/formats/{stl/core/targets.js → cmf/core/flatShared.js} +9 -8
  76. package/dist/resource/formats/cmf/core/flatShared.js.map +1 -0
  77. package/dist/resource/formats/cmf/core/helpers.js +13 -13
  78. package/dist/resource/formats/cmf/core/helpers.js.map +1 -1
  79. package/dist/resource/formats/cmf/core/writer.js +24 -24
  80. package/dist/resource/formats/cmf/core/writer.js.map +1 -1
  81. package/dist/resource/formats/dds/CjsDdsFormat.js +134 -17
  82. package/dist/resource/formats/dds/CjsDdsFormat.js.map +1 -1
  83. package/dist/resource/formats/dds/core/helpers.js +125 -40
  84. package/dist/resource/formats/dds/core/helpers.js.map +1 -1
  85. package/dist/resource/formats/dxbc/CjsDxbcFormat.js +14 -16
  86. package/dist/resource/formats/dxbc/CjsDxbcFormat.js.map +1 -1
  87. package/dist/resource/formats/dxbc/core/{container.js → DxbcContainer.js} +2 -2
  88. package/dist/resource/formats/dxbc/core/DxbcContainer.js.map +1 -0
  89. package/dist/resource/formats/dxbc/core/{errors.js → DxbcReadError.js} +1 -1
  90. package/dist/resource/formats/dxbc/core/DxbcReadError.js.map +1 -0
  91. package/dist/resource/formats/dxbc/core/DxbcReader.js +1 -1
  92. package/dist/resource/formats/dxbc/core/DxbcReader.js.map +1 -1
  93. package/dist/resource/formats/dxbc/core/{program.js → DxbcShaderProgram.js} +2 -2
  94. package/dist/resource/formats/dxbc/core/DxbcShaderProgram.js.map +1 -0
  95. package/dist/resource/formats/dxbc/core/{signature.js → DxbcSignatureChunk.js} +2 -2
  96. package/dist/resource/formats/dxbc/core/DxbcSignatureChunk.js.map +1 -0
  97. package/dist/resource/formats/dxbc/core/decoder.js +2 -2
  98. package/dist/resource/formats/dxbc/core/decoder.js.map +1 -1
  99. package/dist/resource/formats/dxbc/core/helpers.js +3 -3
  100. package/dist/resource/formats/dxbc/core/helpers.js.map +1 -1
  101. package/dist/resource/formats/fbx/CjsFbxFormat.js +18 -20
  102. package/dist/resource/formats/fbx/CjsFbxFormat.js.map +1 -1
  103. package/dist/resource/formats/flac/CjsFlacFormat.js +7 -13
  104. package/dist/resource/formats/flac/CjsFlacFormat.js.map +1 -1
  105. package/dist/resource/formats/fsd/32/CjsFsd32Format.js +29 -29
  106. package/dist/resource/formats/fsd/32/CjsFsd32Format.js.map +1 -1
  107. package/dist/resource/formats/fsd/64/CjsFsd64Format.js +3 -3
  108. package/dist/resource/formats/fsd/64/CjsFsd64Format.js.map +1 -1
  109. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js +23 -23
  110. package/dist/resource/formats/fsd/64/core/CjsFsd64Binary.js.map +1 -1
  111. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js +8 -8
  112. package/dist/resource/formats/fsd/64/core/CjsFsd64Reader.js.map +1 -1
  113. package/dist/resource/formats/fsd/CjsFsdFormat.js +23 -23
  114. package/dist/resource/formats/fsd/CjsFsdFormat.js.map +1 -1
  115. package/dist/resource/formats/gif/CjsGifFormat.js +24 -15
  116. package/dist/resource/formats/gif/CjsGifFormat.js.map +1 -1
  117. package/dist/resource/formats/gltf/CjsGltfFormat.js +33 -98
  118. package/dist/resource/formats/gltf/CjsGltfFormat.js.map +1 -1
  119. package/dist/resource/formats/gltf/core/helpers.js +3 -12
  120. package/dist/resource/formats/gltf/core/helpers.js.map +1 -1
  121. package/dist/resource/formats/gr2/CjsGr2Format.js +27 -91
  122. package/dist/resource/formats/gr2/CjsGr2Format.js.map +1 -1
  123. package/dist/resource/formats/hlsl/CjsHlslFormat.js +22 -25
  124. package/dist/resource/formats/hlsl/CjsHlslFormat.js.map +1 -1
  125. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js +1 -1
  126. package/dist/resource/formats/hlsl/core/carbonDescriptionToRuntime.js.map +1 -1
  127. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js +3 -3
  128. package/dist/resource/formats/hlsl/core/tr2/shader/HlslEffectStageInput.js.map +1 -1
  129. package/dist/resource/formats/ies/CjsIESFormat.js +29 -29
  130. package/dist/resource/formats/ies/CjsIESFormat.js.map +1 -1
  131. package/dist/resource/formats/jpeg/CjsJpegFormat.js +24 -15
  132. package/dist/resource/formats/jpeg/CjsJpegFormat.js.map +1 -1
  133. package/dist/resource/formats/jpeg/core/helpers.js +3 -5
  134. package/dist/resource/formats/jpeg/core/helpers.js.map +1 -1
  135. package/dist/resource/formats/jpeg/core/jpeg.js +58 -58
  136. package/dist/resource/formats/jpeg/core/jpeg.js.map +1 -1
  137. package/dist/resource/formats/jsonl/CjsJsonlFormat.js +3 -3
  138. package/dist/resource/formats/jsonl/CjsJsonlFormat.js.map +1 -1
  139. package/dist/resource/formats/mp3/CjsMp3Format.js +7 -14
  140. package/dist/resource/formats/mp3/CjsMp3Format.js.map +1 -1
  141. package/dist/resource/formats/mp3/core/helpers.js +3 -5
  142. package/dist/resource/formats/mp3/core/helpers.js.map +1 -1
  143. package/dist/resource/formats/mp4/CjsMp4Format.js +7 -13
  144. package/dist/resource/formats/mp4/CjsMp4Format.js.map +1 -1
  145. package/dist/resource/formats/mp4/core/helpers.js +3 -5
  146. package/dist/resource/formats/mp4/core/helpers.js.map +1 -1
  147. package/dist/resource/formats/obj/CjsObjFormat.js +92 -157
  148. package/dist/resource/formats/obj/CjsObjFormat.js.map +1 -1
  149. package/dist/resource/formats/obj/core/helpers.js +5 -113
  150. package/dist/resource/formats/obj/core/helpers.js.map +1 -1
  151. package/dist/resource/formats/ogg/CjsOggFormat.js +7 -14
  152. package/dist/resource/formats/ogg/CjsOggFormat.js.map +1 -1
  153. package/dist/resource/formats/pickle/CjsPickleFormat.js +7 -12
  154. package/dist/resource/formats/pickle/CjsPickleFormat.js.map +1 -1
  155. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js +7 -7
  156. package/dist/resource/formats/pickle/core/CjsPickleProtocol0Reader.js.map +1 -1
  157. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js +7 -7
  158. package/dist/resource/formats/pickle/core/CjsPickleProtocol4Reader.js.map +1 -1
  159. package/dist/resource/formats/png/CjsPngFormat.js +40 -15
  160. package/dist/resource/formats/png/CjsPngFormat.js.map +1 -1
  161. package/dist/resource/formats/png/core/helpers.js +4 -6
  162. package/dist/resource/formats/png/core/helpers.js.map +1 -1
  163. package/dist/resource/formats/red/CjsRedFormat.js +22 -28
  164. package/dist/resource/formats/red/CjsRedFormat.js.map +1 -1
  165. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js +3 -7
  166. package/dist/resource/formats/schemabound/CjsSchemaBoundFormat.js.map +1 -1
  167. package/dist/resource/formats/schemabound/core/schemaBoundValues.js +5 -0
  168. package/dist/resource/formats/schemabound/core/schemaBoundValues.js.map +1 -1
  169. package/dist/resource/formats/sqlite/CjsSqliteFormat.js +4 -9
  170. package/dist/resource/formats/sqlite/CjsSqliteFormat.js.map +1 -1
  171. package/dist/resource/formats/static/CjsStaticFormat.js +4 -4
  172. package/dist/resource/formats/static/CjsStaticFormat.js.map +1 -1
  173. package/dist/resource/formats/stl/CjsStlFormat.js +39 -104
  174. package/dist/resource/formats/stl/CjsStlFormat.js.map +1 -1
  175. package/dist/resource/formats/stl/core/helpers.js +5 -19
  176. package/dist/resource/formats/stl/core/helpers.js.map +1 -1
  177. package/dist/resource/formats/tga/CjsTgaFormat.js +26 -15
  178. package/dist/resource/formats/tga/CjsTgaFormat.js.map +1 -1
  179. package/dist/resource/formats/tga/core/helpers.js +3 -5
  180. package/dist/resource/formats/tga/core/helpers.js.map +1 -1
  181. package/dist/resource/formats/vta/CjsVtaFormat.js +8 -15
  182. package/dist/resource/formats/vta/CjsVtaFormat.js.map +1 -1
  183. package/dist/resource/formats/wav/CjsWavFormat.js +7 -14
  184. package/dist/resource/formats/wav/CjsWavFormat.js.map +1 -1
  185. package/dist/resource/formats/wav/core/helpers.js +3 -5
  186. package/dist/resource/formats/wav/core/helpers.js.map +1 -1
  187. package/dist/resource/formats/webgl/CjsWebglFormat.js +103 -105
  188. package/dist/resource/formats/webgl/CjsWebglFormat.js.map +1 -1
  189. package/dist/resource/formats/webgl/core/{errors.js → WebglReadError.js} +1 -1
  190. package/dist/resource/formats/webgl/core/WebglReadError.js.map +1 -0
  191. package/dist/resource/formats/webgl/core/effectPackage.js +1 -1
  192. package/dist/resource/formats/webgl/core/effectPackage.js.map +1 -1
  193. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +3 -3
  194. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  195. package/dist/resource/formats/webgl/core/glsl/{DxbcGlslHelpers.js → DxbcGlslHelperRegistry.js} +2 -2
  196. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelperRegistry.js.map +1 -0
  197. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js +1 -1
  198. package/dist/resource/formats/webgl/core/glsl/DxbcGlslOperandFormatter.js.map +1 -1
  199. package/dist/resource/formats/webgl/core/glslBackendBlock.js +1 -1
  200. package/dist/resource/formats/webgl/core/glslBackendBlock.js.map +1 -1
  201. package/dist/resource/formats/webgl/core/helpers.js.map +1 -1
  202. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js +28 -29
  203. package/dist/resource/formats/webgpu/CjsWebgpuFormat.js.map +1 -1
  204. package/dist/resource/formats/webgpu/core/{errors.js → WebgpuReadError.js} +1 -1
  205. package/dist/resource/formats/webgpu/core/WebgpuReadError.js.map +1 -0
  206. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js +1 -1
  207. package/dist/resource/formats/webgpu/core/carbonWebgpu/validateContainer.js.map +1 -1
  208. package/dist/resource/formats/webgpu/core/helpers.js +1 -1
  209. package/dist/resource/formats/webgpu/core/helpers.js.map +1 -1
  210. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js +1 -1
  211. package/dist/resource/formats/webgpu/core/ir/lowerDxbcToIr.js.map +1 -1
  212. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js +18 -6
  213. package/dist/resource/formats/webgpu/core/wgsl/buildWgslSet.js.map +1 -1
  214. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js +39 -13
  215. package/dist/resource/formats/webgpu/core/wgsl/lowerBindingLayout.js.map +1 -1
  216. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js +16 -14
  217. package/dist/resource/formats/webgpu/core/wgsl/lowerCreateHistogramsComputeProgram.js.map +1 -1
  218. package/dist/resource/formats/webm/CjsWebmFormat.js +8 -13
  219. package/dist/resource/formats/webm/CjsWebmFormat.js.map +1 -1
  220. package/dist/resource/formats/webm/core/helpers.js +3 -5
  221. package/dist/resource/formats/webm/core/helpers.js.map +1 -1
  222. package/dist/resource/formats/webp/CjsWebpFormat.js +8 -12
  223. package/dist/resource/formats/webp/CjsWebpFormat.js.map +1 -1
  224. package/dist/resource/formats/wem/CjsWemFormat.js +9 -17
  225. package/dist/resource/formats/wem/CjsWemFormat.js.map +1 -1
  226. package/dist/resource/formats/wem/core/bitStream.js +35 -35
  227. package/dist/resource/formats/wem/core/bitStream.js.map +1 -1
  228. package/dist/resource/formats/wem/core/helpers.js +1 -3
  229. package/dist/resource/formats/wem/core/helpers.js.map +1 -1
  230. package/dist/resource/formats/yaml/CjsYamlFormat.js +28 -37
  231. package/dist/resource/formats/yaml/CjsYamlFormat.js.map +1 -1
  232. package/dist/resource/imageio/ImageIO.js +142 -0
  233. package/dist/resource/imageio/ImageIO.js.map +1 -0
  234. package/dist/resource/imageio/index.js +17 -0
  235. package/dist/resource/imageio/index.js.map +1 -0
  236. package/dist/resource/index.js +7 -0
  237. package/dist/resource/index.js.map +1 -1
  238. package/dist/resource/shader/reflection/Tr2EffectResource.js +24 -2
  239. package/dist/resource/shader/reflection/Tr2EffectResource.js.map +1 -1
  240. package/dist/resource/shader/reflection/Tr2Pass.js +76 -5
  241. package/dist/resource/shader/reflection/Tr2Pass.js.map +1 -1
  242. package/dist/resource/texture/CjsTextureArrayConstructor.js +97 -0
  243. package/dist/resource/texture/CjsTextureArrayConstructor.js.map +1 -0
  244. package/dist/resource/texture/CjsTexturePackConstructor.js +160 -0
  245. package/dist/resource/texture/CjsTexturePackConstructor.js.map +1 -0
  246. package/dist/resource/texture/CjsTexturePipelineStepArray.js +72 -0
  247. package/dist/resource/texture/CjsTexturePipelineStepArray.js.map +1 -0
  248. package/dist/resource/texture/CjsTexturePipelineStepConvert.js +73 -0
  249. package/dist/resource/texture/CjsTexturePipelineStepConvert.js.map +1 -0
  250. package/dist/resource/texture/CjsTexturePipelineStepPack.js +71 -0
  251. package/dist/resource/texture/CjsTexturePipelineStepPack.js.map +1 -0
  252. package/dist/resource/texture/CjsTexturePipelineStepResize.js +123 -0
  253. package/dist/resource/texture/CjsTexturePipelineStepResize.js.map +1 -0
  254. package/dist/resource/texture/SolidColorTextureConstructor.js +11 -1
  255. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -1
  256. package/dist/resource/texture/Tr2ImageRes.js +100 -68
  257. package/dist/resource/texture/Tr2ImageRes.js.map +1 -1
  258. package/dist/resource/texture/Tr2TexturePipeline.js +45 -25
  259. package/dist/resource/texture/Tr2TexturePipeline.js.map +1 -1
  260. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js +34 -1
  261. package/dist/resource/texture/Tr2TexturePipelineStepCompress.js.map +1 -1
  262. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js +30 -3
  263. package/dist/resource/texture/Tr2TexturePipelineStepGenerateMips.js.map +1 -1
  264. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js +81 -1
  265. package/dist/resource/texture/Tr2TexturePipelineStepLimitSize.js.map +1 -1
  266. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js +36 -1
  267. package/dist/resource/texture/Tr2TexturePipelineStepLoad.js.map +1 -1
  268. package/dist/resource/texture/Tr2TexturePipelineStepPack.js +146 -24
  269. package/dist/resource/texture/Tr2TexturePipelineStepPack.js.map +1 -1
  270. package/dist/resource/texture/TriTextureRes.js +151 -29
  271. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  272. package/dist/resource/texture/index.js +7 -0
  273. package/dist/resource/texture/index.js.map +1 -1
  274. package/dist/resource/texture/registerTextureResources.js +83 -0
  275. package/dist/resource/texture/registerTextureResources.js.map +1 -0
  276. package/dist/resource/texture/solidColorTexture.js +10 -19
  277. package/dist/resource/texture/solidColorTexture.js.map +1 -1
  278. package/dist/sof/EveSOF.js +39 -7
  279. package/dist/sof/EveSOF.js.map +1 -1
  280. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js +2 -2
  281. package/dist/trinity/core/Tr2GpuResourcePool/Tr2GpuResourcePool.js.map +1 -1
  282. package/dist/trinity/core/Tr2ImageIOHelpers.js +80 -17
  283. package/dist/trinity/core/Tr2ImageIOHelpers.js.map +1 -1
  284. package/dist/trinity/core/Tr2RenderUtils.js +1 -1
  285. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js +49 -62
  286. package/dist/trinity/core/Tr2TextureArray/Tr2TextureArray.js.map +1 -1
  287. package/dist/trinity/core/Tr2TextureReference.js +114 -0
  288. package/dist/trinity/core/Tr2TextureReference.js.map +1 -0
  289. package/dist/trinity/core/device/Tr2DepthStencil.js +2 -2
  290. package/dist/trinity/core/device/Tr2DepthStencil.js.map +1 -1
  291. package/dist/trinity/core/device/Tr2RingBuffer/Tr2RingBuffer.js +1 -1
  292. package/dist/trinity/core/index.js +1 -0
  293. package/dist/trinity/core/index.js.map +1 -1
  294. package/dist/trinity/core/lighting/Tr2LightManager.js +5 -4
  295. package/dist/trinity/core/lighting/Tr2LightManager.js.map +1 -1
  296. package/dist/trinity/core/procedural/GradientTextureConstructor.js +5 -4
  297. package/dist/trinity/core/procedural/GradientTextureConstructor.js.map +1 -1
  298. package/dist/trinity/core/procedural/gradientTexture.js +10 -13
  299. package/dist/trinity/core/procedural/gradientTexture.js.map +1 -1
  300. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js +1 -1
  301. package/dist/trinity/core/volumetrics/Tr2VolumetricsRenderer.js.map +1 -1
  302. package/dist/trinity/eve/EveImpactOverlay.js +102 -50
  303. package/dist/trinity/eve/EveImpactOverlay.js.map +1 -1
  304. package/dist/trinity/eve/EveModularObjectModifier.js +9 -18
  305. package/dist/trinity/eve/EveModularObjectModifier.js.map +1 -1
  306. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js +175 -157
  307. package/dist/trinity/eve/attachment/turrets/EveTurretSet.js.map +1 -1
  308. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js +100 -83
  309. package/dist/trinity/eve/attachment/turrets/EveTurretTarget.js.map +1 -1
  310. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js +26 -20
  311. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMesh.js.map +1 -1
  312. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js +368 -179
  313. package/dist/trinity/eve/child/EveChildInstancedMeshes/EveChildInstancedMeshes.js.map +1 -1
  314. package/dist/trinity/eve/child/EveChildMesh.js +242 -234
  315. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  316. package/dist/trinity/eve/child/EveChildTurret.js +57 -16
  317. package/dist/trinity/eve/child/EveChildTurret.js.map +1 -1
  318. package/dist/trinity/eve/child/EveSpaceObjectChild.js +28 -1
  319. package/dist/trinity/eve/child/EveSpaceObjectChild.js.map +1 -1
  320. package/dist/trinity/eve/index.js +2 -2
  321. package/dist/trinity/eve/overlays/EveDamageOverlay.js +5 -1
  322. package/dist/trinity/eve/overlays/EveDamageOverlay.js.map +1 -1
  323. package/dist/trinity/eve/scene/EveSpaceScene.js +234 -233
  324. package/dist/trinity/eve/scene/EveSpaceScene.js.map +1 -1
  325. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js +2 -0
  326. package/dist/trinity/eve/scene/EveSpaceSceneRenderDriver.js.map +1 -1
  327. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +492 -437
  328. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  329. package/dist/trinity/generated/index.js +0 -1
  330. package/dist/trinity/generated/index.js.map +1 -1
  331. package/dist/trinity/generated/trinityCore/index.js +0 -1
  332. package/dist/trinity/generated/trinityCore/index.js.map +1 -1
  333. package/dist/trinity/index.js +3 -3
  334. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js +10 -1
  335. package/dist/trinity/particle/emitter/Tr2GpuSharedEmitter.js.map +1 -1
  336. package/dist/trinity/shader/Tr2DataTextureManager.js +152 -66
  337. package/dist/trinity/shader/Tr2DataTextureManager.js.map +1 -1
  338. package/dist/trinity/shader/Tr2Material.js +1 -1
  339. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js +5 -5
  340. package/dist/trinityal/Tr2HalHelperStructures/Tr2TextureSubresource.js.map +1 -1
  341. package/dist/trinityal/index.js +1 -1
  342. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js +2 -2
  343. package/dist/trinityal/stub/Tr2RenderContextALStub/Tr2RenderContextALStub.js.map +1 -1
  344. package/dist/trinityal/stub/Tr2SwapChainALStub.js +45 -45
  345. package/dist/trinityal/stub/Tr2SwapChainALStub.js.map +1 -1
  346. package/dist/trinityal/stub/Tr2TextureALStub.js +170 -170
  347. package/dist/trinityal/stub/Tr2TextureALStub.js.map +1 -1
  348. package/dist/trinityal/webgpu/CjsWebgpuDevice.js +234 -164
  349. package/dist/trinityal/webgpu/CjsWebgpuDevice.js.map +1 -1
  350. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js +7 -0
  351. package/dist/trinityal/webgpu/CjsWebgpuRenderContextAL.js.map +1 -1
  352. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js +78 -14
  353. package/dist/trinityal/webgpu/CjsWebgpuTextureAL.js.map +1 -1
  354. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js +94 -0
  355. package/dist/trinityal/webgpu/core/CjsWebgpuUtils.js.map +1 -0
  356. package/dist/trinityal/webgpu/internal.js +1 -0
  357. package/dist/trinityal/webgpu/internal.js.map +1 -1
  358. package/docs/global/reference/classes/README.md +90 -0
  359. package/docs/resource/concepts/format-capabilities.md +3 -3
  360. package/docs/resource/formats/README.md +1 -1
  361. package/docs/resource/reference/classes/core.md +31 -1
  362. package/docs/resource/reference/classes/formats.md +7 -7
  363. package/docs/resource/reference/classes/resources.md +76 -16
  364. package/docs/trinity/reference/classes/generated.md +0 -10
  365. package/docs/trinity/reference/classes/trinity-core.md +1692 -1682
  366. package/docs/trinityal/reference/classes/README.md +0 -10
  367. package/docs/trinityal/webgpu/reference/classes/README.md +276 -266
  368. package/package.json +4 -3
  369. package/dist/global/consts/webgpu/index.js +0 -2
  370. package/dist/global/consts/webgpu/textureFormats.js +0 -180
  371. package/dist/global/consts/webgpu/textureFormats.js.map +0 -1
  372. package/dist/resource/formats/dxbc/core/container.js.map +0 -1
  373. package/dist/resource/formats/dxbc/core/errors.js.map +0 -1
  374. package/dist/resource/formats/dxbc/core/program.js.map +0 -1
  375. package/dist/resource/formats/dxbc/core/signature.js.map +0 -1
  376. package/dist/resource/formats/stl/core/targets.js.map +0 -1
  377. package/dist/resource/formats/webgl/core/errors.js.map +0 -1
  378. package/dist/resource/formats/webgl/core/glsl/DxbcGlslHelpers.js.map +0 -1
  379. package/dist/resource/formats/webgpu/core/errors.js.map +0 -1
  380. package/dist/resource/texture/texturePipelineBehavior.js +0 -332
  381. package/dist/resource/texture/texturePipelineBehavior.js.map +0 -1
  382. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js +0 -40
  383. package/dist/trinity/generated/trinityCore/Tr2TextureReference.js.map +0 -1
  384. package/dist/trinityal/Tr2BitmapDimensions.js.map +0 -1
@@ -9,6 +9,7 @@ import { EveEntity as _EveEntity } from '../EveEntity.js';
9
9
  import { EveComponentRegistry as _EveComponentRegistry } from './components/EveComponentRegistry.js';
10
10
  import { Tr2PostProcess2 as _Tr2PostProcess } from '../../postProcess/Tr2PostProcess2.js';
11
11
  import { Tr2PostProcessAttributes as _Tr2PostProcessAttrib } from '../../postProcess/Tr2PostProcessAttributes.js';
12
+ import { Tr2DataTextureManager as _Tr2DataTextureManage } from '../../shader/Tr2DataTextureManager.js';
12
13
  import { EveComponentType } from '../EveComponentTypes.js';
13
14
  import { EveUpdateContext as _EveUpdateContext } from '../EveUpdateContext.js';
14
15
  import { EveEffectRoot2 as _EveEffectRoot } from '../spaceObject/EveEffectRoot2.js';
@@ -154,13 +155,13 @@ new class extends _identity {
154
155
  /** m_shLightingManager (Tr2ShLightingManagerPtr) [PERSISTONLY] */
155
156
  shLightingManager = (_init_extra_ambientColor(this), _init_shLightingManager(this, null));
156
157
 
157
- /** m_combinedPostProcessAttributes (Tr2PostProcessAttributesPtr) [READ] -
158
- * default-constructed like Carbon's ctor CreateInstance (cpp:297); refreshed
158
+ /** m_combinedPostProcessAttributes (Tr2PostProcessAttributesPtr) [READ] -
159
+ * default-constructed like Carbon's ctor CreateInstance (cpp:297); refreshed
159
160
  * by UpdatePostProcessAttributes' re-export at MEDIUM_PRIORITY (cpp:407). */
160
161
  combinedPostProcessAttributes = (_init_extra_shLightingManager(this), _init_combinedPostProcessAttributes(this, new _Tr2PostProcessAttrib()));
161
162
 
162
163
  /** m_dataTextureMgr (Tr2DataTextureManagerPtr) [READ] */
163
- dataTextureMgr = (_init_extra_combinedPostProcessAttributes(this), _init_dataTextureMgr(this, null));
164
+ dataTextureMgr = (_init_extra_combinedPostProcessAttributes(this), _init_dataTextureMgr(this, new _Tr2DataTextureManage()));
164
165
 
165
166
  /** m_dynamicObjectReflectionEnabled (bool) [READWRITE] */
166
167
  dynamicObjectReflectionEnabled = (_init_extra_dataTextureMgr(this), _init_dynamicObjectReflectionEnabled(this, true));
@@ -168,9 +169,9 @@ new class extends _identity {
168
169
  /** m_componentRegistry (EveComponentRegistryPtr) [READ] */
169
170
  componentRegistry = (_init_extra_dynamicObjectReflectionEnabled(this), _init_componentRegistry(this, new _EveComponentRegistry()));
170
171
 
171
- /** m_cameraAttachmentParent (EveEffectRoot2Ptr) - protected Carbon scene
172
- * entity, default-constructed like Carbon's ctor CreateInstance (cpp:287, no
173
- * further setup applied). Consumers still optional-chain - deserialization
172
+ /** m_cameraAttachmentParent (EveEffectRoot2Ptr) - protected Carbon scene
173
+ * entity, default-constructed like Carbon's ctor CreateInstance (cpp:287, no
174
+ * further setup applied). Consumers still optional-chain - deserialization
174
175
  * may null it. */
175
176
  cameraAttachmentParent = (_init_extra_componentRegistry(this), _init_cameraAttachmentParent(this, new _EveEffectRoot()));
176
177
 
@@ -369,28 +370,28 @@ new class extends _identity {
369
370
  // scene instead of a module global.
370
371
  enablePostProcessDebugging = false;
371
372
 
372
- /**
373
- * Stamps the per-frame frustum/threshold/LOD state onto the scene-owned
374
- * update context (Carbon EveSpaceScene::Update cpp:475-484, identical to the
375
- * already-updated fast path cpp:448-457). Carbon derives the frustum from
376
- * the Tr2Renderer view statics and reads the thresholds from console vars
377
- * divided by m_upscalingAmount (=1 by default, cpp:221); in CarbonEngineJS
378
- * the driver derives the frustum from the same renderContext state it
379
- * stamped and supplies the thresholds explicitly (pre-divided if it ever
380
- * upscales). Defaults are the Carbon console-var defaults (cpp:75-84).
381
- * The raytracing flag is Carbon's `m_shadowQuality == SHADOW_RAYTRACED &&
382
- * m_enableShadows` (cpp:457/484) - the driver computes it; the scene does
383
- * not. Stamps unconditionally: Carbon's same-frame fast path restamps
384
- * regardless of m_update (cpp:444-462); only the cold path skips stamping
385
- * when !m_update (cpp:466 precedes 475) - benign divergence.
386
- * @param {Object} [options]
387
- * @param {Object|null} [options.frustum] - a ready TriFrustum, held by reference
388
- * @param {Number} [options.visibilityThreshold]
389
- * @param {Number} [options.lowDetailThreshold]
390
- * @param {Number} [options.mediumDetailThreshold]
391
- * @param {Number} [options.highDetailThreshold]
392
- * @param {Number} [options.lodFactor]
393
- * @param {Boolean} [options.raytracingEnabled]
373
+ /**
374
+ * Stamps the per-frame frustum/threshold/LOD state onto the scene-owned
375
+ * update context (Carbon EveSpaceScene::Update cpp:475-484, identical to the
376
+ * already-updated fast path cpp:448-457). Carbon derives the frustum from
377
+ * the Tr2Renderer view statics and reads the thresholds from console vars
378
+ * divided by m_upscalingAmount (=1 by default, cpp:221); in CarbonEngineJS
379
+ * the driver derives the frustum from the same renderContext state it
380
+ * stamped and supplies the thresholds explicitly (pre-divided if it ever
381
+ * upscales). Defaults are the Carbon console-var defaults (cpp:75-84).
382
+ * The raytracing flag is Carbon's `m_shadowQuality == SHADOW_RAYTRACED &&
383
+ * m_enableShadows` (cpp:457/484) - the driver computes it; the scene does
384
+ * not. Stamps unconditionally: Carbon's same-frame fast path restamps
385
+ * regardless of m_update (cpp:444-462); only the cold path skips stamping
386
+ * when !m_update (cpp:466 precedes 475) - benign divergence.
387
+ * @param {Object} [options]
388
+ * @param {Object|null} [options.frustum] - a ready TriFrustum, held by reference
389
+ * @param {Number} [options.visibilityThreshold]
390
+ * @param {Number} [options.lowDetailThreshold]
391
+ * @param {Number} [options.mediumDetailThreshold]
392
+ * @param {Number} [options.highDetailThreshold]
393
+ * @param {Number} [options.lodFactor]
394
+ * @param {Boolean} [options.raytracingEnabled]
394
395
  */
395
396
  StampFrameContext({
396
397
  frustum = null,
@@ -411,23 +412,23 @@ new class extends _identity {
411
412
  context.raytracingEnabled = !!raytracingEnabled;
412
413
  }
413
414
 
414
- /**
415
- * Per-frame scene update, ported from Carbon EveSpaceScene::Update: stamps the
416
- * scene-owned frame context (time, origin, data-texture manager), then drives
417
- * every collection in Carbon's order - background objects, warp tunnel,
418
- * starfield, static particles, data textures, distance fields, lensflares,
419
- * virtual camera system, curve sets, then all space/UI objects synchronous
420
- * first and asynchronous second (Carbon parallelizes the async pass on a task
421
- * group; JS runs it sequentially). Then combines the post-process attributes
422
- * (cpp:584) and finally reads the sun direction from the sun ball
423
- * (cpp:589-596).
424
- *
425
- * Adapted - deferred vs Carbon: the recording-frame dedup fast path,
426
- * frustum/threshold/LOD/raytracing stamping (now the driver's job via
427
- * StampFrameContext, called BEFORE Update), planet update (planet
428
- * view-matrix swap unported), and main-thread action flush (N/A).
429
- * @param {Number} realTime
430
- * @param {Number} simTime
415
+ /**
416
+ * Per-frame scene update, ported from Carbon EveSpaceScene::Update: stamps the
417
+ * scene-owned frame context (time, origin, data-texture manager), then drives
418
+ * every collection in Carbon's order - background objects, warp tunnel,
419
+ * starfield, static particles, data textures, distance fields, lensflares,
420
+ * virtual camera system, curve sets, then all space/UI objects synchronous
421
+ * first and asynchronous second (Carbon parallelizes the async pass on a task
422
+ * group; JS runs it sequentially). Then combines the post-process attributes
423
+ * (cpp:584) and finally reads the sun direction from the sun ball
424
+ * (cpp:589-596).
425
+ *
426
+ * Adapted - deferred vs Carbon: the recording-frame dedup fast path,
427
+ * frustum/threshold/LOD/raytracing stamping (now the driver's job via
428
+ * StampFrameContext, called BEFORE Update), planet update (planet
429
+ * view-matrix swap unported), and main-thread action flush (N/A).
430
+ * @param {Number} realTime
431
+ * @param {Number} simTime
431
432
  */
432
433
  Update(realTime, simTime) {
433
434
  if (!this.update) {
@@ -436,7 +437,7 @@ new class extends _identity {
436
437
  const context = this.updateContext;
437
438
  context.SetTime(simTime);
438
439
  context.UpdateOrigin(this.ballpark);
439
- context.dataTextureManager = this.dataTextureMgr;
440
+ context.SetDataTextureManager(this.dataTextureMgr);
440
441
  for (const object of this.backgroundObjects) {
441
442
  object?.UpdateSyncronous(context);
442
443
  }
@@ -504,20 +505,20 @@ new class extends _identity {
504
505
  throw new Error("EveSpaceScene.PickObjectAndAreaID is not implemented in CarbonEngineJS.");
505
506
  }
506
507
 
507
- /**
508
- * Carbon EveSpaceScene::PickInfinity (cpp:4039-4050): the world-space
509
- * DIRECTION a screen pixel points along - the pick ray with nothing to hit,
510
- * which is what a click on empty space resolves to. Pure math, no readback.
511
- *
512
- * @param {Number} x - screen x, in pixels
513
- * @param {Number} y - screen y, in pixels
514
- * @param {Float32Array} projection - the projection matrix
515
- * @param {Float32Array} view - the view matrix
516
- * @param {Object} [viewport] - { x, y, width, height }; the frame's render
517
- * context supplies one when this is omitted
518
- * @param {Float32Array} [out] - caller-owned direction
519
- * @returns {Float32Array|null} the normalized world direction, or null when
520
- * either matrix cannot be inverted
508
+ /**
509
+ * Carbon EveSpaceScene::PickInfinity (cpp:4039-4050): the world-space
510
+ * DIRECTION a screen pixel points along - the pick ray with nothing to hit,
511
+ * which is what a click on empty space resolves to. Pure math, no readback.
512
+ *
513
+ * @param {Number} x - screen x, in pixels
514
+ * @param {Number} y - screen y, in pixels
515
+ * @param {Float32Array} projection - the projection matrix
516
+ * @param {Float32Array} view - the view matrix
517
+ * @param {Object} [viewport] - { x, y, width, height }; the frame's render
518
+ * context supplies one when this is omitted
519
+ * @param {Float32Array} [out] - caller-owned direction
520
+ * @returns {Float32Array|null} the normalized world direction, or null when
521
+ * either matrix cannot be inverted
521
522
  */
522
523
  PickInfinity(x, y, projection, view, viewport = null, out = vec3.create()) {
523
524
  const resolved = viewport ?? this.updateContext?.renderContext?.GetViewport?.();
@@ -526,23 +527,23 @@ new class extends _identity {
526
527
  return ray ? vec3.copy(out, ray.direction) : null;
527
528
  }
528
529
 
529
- /**
530
- * The per-frame CPU visibility pass, ported from the [VISIBILITY] block of
531
- * Carbon EveSpaceScene::GatherBatches (EveSpaceScene.cpp:1443-1467; the
532
- * enclosing display gate is BeginRender cpp:1299-1302). Carbon's
533
- * Tr2ParallelDo loops (objects cpp:1445-1447, staticParticles cpp:1454-1456,
534
- * planets cpp:1458-1460) run sequentially in the same order; the lensflare
535
- * loop is sequential in Carbon too (cpp:1462-1466). LOD stamping (lodLevel,
536
- * isVisible, pixel diameters) happens INSIDE each object's UpdateVisibility;
537
- * per-object display gates live there too - the scene does not pre-filter.
538
- * uiObjects are never visited (Carbon never culls them). The camera parent's
539
- * SetTransform is pure decomposition (EveEffectRoot2.cpp:677-680 Decompose)
540
- * - no composition, so no row-vector operand swap here; this per-gather
541
- * Sync/Async pair is the camera parent's ONLY update, so its world transform
542
- * is the camera pose of the frame being gathered (cpp:1449-1452).
543
- * @param {Float32Array} inverseView - the inverse view matrix
544
- * (updateContext.renderContext.GetInverseViewTransform(); Carbon reads the
545
- * Tr2Renderer static at cpp:1449)
530
+ /**
531
+ * The per-frame CPU visibility pass, ported from the [VISIBILITY] block of
532
+ * Carbon EveSpaceScene::GatherBatches (EveSpaceScene.cpp:1443-1467; the
533
+ * enclosing display gate is BeginRender cpp:1299-1302). Carbon's
534
+ * Tr2ParallelDo loops (objects cpp:1445-1447, staticParticles cpp:1454-1456,
535
+ * planets cpp:1458-1460) run sequentially in the same order; the lensflare
536
+ * loop is sequential in Carbon too (cpp:1462-1466). LOD stamping (lodLevel,
537
+ * isVisible, pixel diameters) happens INSIDE each object's UpdateVisibility;
538
+ * per-object display gates live there too - the scene does not pre-filter.
539
+ * uiObjects are never visited (Carbon never culls them). The camera parent's
540
+ * SetTransform is pure decomposition (EveEffectRoot2.cpp:677-680 Decompose)
541
+ * - no composition, so no row-vector operand swap here; this per-gather
542
+ * Sync/Async pair is the camera parent's ONLY update, so its world transform
543
+ * is the camera pose of the frame being gathered (cpp:1449-1452).
544
+ * @param {Float32Array} inverseView - the inverse view matrix
545
+ * (updateContext.renderContext.GetInverseViewTransform(); Carbon reads the
546
+ * Tr2Renderer static at cpp:1449)
546
547
  */
547
548
  UpdateVisibility(inverseView) {
548
549
  if (!this.display) {
@@ -569,17 +570,17 @@ new class extends _identity {
569
570
  }
570
571
  }
571
572
 
572
- /** Gathers batchable renderables from the scene's objects for the batch
573
- * collection pass - the [GATHER] block of Carbon
574
- * EveSpaceScene::GatherBatches (EveSpaceScene.cpp:1470-1507): m_objects in
575
- * list order (cpp:1470-1475), then cameraAttachmentParent pushed LAST
576
- * (cpp:1476), then the staticParticles leg (cpp:1504-1507; Carbon signature
577
- * `GetRenderables(frustum, renderables)`, EveSceneStaticParticles.h - kept
578
- * with the out-parameter last per convention). Objects self-filter on the
579
- * visibility flags stamped by UpdateVisibility, so the array handed to
580
- * CjsBatchManager.Collect is pre-culled and this aggregation stays GPU-free.
581
- * The impostor-manager argument (cpp:1478-1502) is dropped - engine-owned.
582
- * Gather order matters downstream: the opaque accumulator receives batches
573
+ /** Gathers batchable renderables from the scene's objects for the batch
574
+ * collection pass - the [GATHER] block of Carbon
575
+ * EveSpaceScene::GatherBatches (EveSpaceScene.cpp:1470-1507): m_objects in
576
+ * list order (cpp:1470-1475), then cameraAttachmentParent pushed LAST
577
+ * (cpp:1476), then the staticParticles leg (cpp:1504-1507; Carbon signature
578
+ * `GetRenderables(frustum, renderables)`, EveSceneStaticParticles.h - kept
579
+ * with the out-parameter last per convention). Objects self-filter on the
580
+ * visibility flags stamped by UpdateVisibility, so the array handed to
581
+ * CjsBatchManager.Collect is pre-culled and this aggregation stays GPU-free.
582
+ * The impostor-manager argument (cpp:1478-1502) is dropped - engine-owned.
583
+ * Gather order matters downstream: the opaque accumulator receives batches
583
584
  * in gather order before Finalize sorts. */
584
585
  GetRenderables(out = []) {
585
586
  if (!this.display) {
@@ -593,18 +594,18 @@ new class extends _identity {
593
594
  return out;
594
595
  }
595
596
 
596
- /**
597
- * Refreshes the scene default's attribute snapshot, gathers every registered
598
- * PostProcessOwner's attributes, priority-blends them into the combined
599
- * post-process, copies the six engine effects through from the scene
600
- * default, and re-exports the result (Carbon
601
- * EveSpaceScene::UpdatePostProcessAttributes, EveSpaceScene.cpp:346-413).
602
- * Sort is descending by priority (cpp:372-377); Carbon's std::sort is
603
- * unstable while JS sort is stable - equal-priority ties keep registry
604
- * insertion order, which is blend-order-independent for every Sum-accumulated
605
- * attribute (the whole tie group is normalized together); only MaxWeight
606
- * ties at exactly equal weight (string paths / bools / DoF shape) could
607
- * differ from C++.
597
+ /**
598
+ * Refreshes the scene default's attribute snapshot, gathers every registered
599
+ * PostProcessOwner's attributes, priority-blends them into the combined
600
+ * post-process, copies the six engine effects through from the scene
601
+ * default, and re-exports the result (Carbon
602
+ * EveSpaceScene::UpdatePostProcessAttributes, EveSpaceScene.cpp:346-413).
603
+ * Sort is descending by priority (cpp:372-377); Carbon's std::sort is
604
+ * unstable while JS sort is stable - equal-priority ties keep registry
605
+ * insertion order, which is blend-order-independent for every Sum-accumulated
606
+ * attribute (the whole tie group is normalized together); only MaxWeight
607
+ * ties at exactly equal weight (string paths / bools / DoF shape) could
608
+ * differ from C++.
608
609
  */
609
610
  UpdatePostProcessAttributes() {
610
611
  if (!this.display) {
@@ -666,7 +667,7 @@ new class extends _identity {
666
667
  }
667
668
  }
668
669
 
669
- /** Carbon method GetPostProcess (EveSpaceScene.cpp:420-427): the combined
670
+ /** Carbon method GetPostProcess (EveSpaceScene.cpp:420-427): the combined
670
671
  * post-process, or null while the scene is not displayed. */
671
672
  GetPostProcess() {
672
673
  if (!this.display) {
@@ -675,17 +676,17 @@ new class extends _identity {
675
676
  return this.#combinedPostProcess;
676
677
  }
677
678
 
678
- /**
679
- * Blends every registered EveLightingOverride against the scene baseline and
680
- * stamps currentSunColor / currentNebulaIntensity /
681
- * currentReflectionIntensity - the lighting-override block of Carbon
682
- * EveSpaceScene::BeginRender (EveSpaceScene.cpp:1333-1363). The baseline is
683
- * appended AFTER the sort at raw priority -1 - one below
684
- * SCENE_DEFAULT_PRIORITY=0, outside the legal enum range (Carbon casts -1,
685
- * cpp:1343) - so it always sits last. Scalar/color math only - no matrix
686
- * compositions, no row-vector swaps anywhere in this method. Same
687
- * stable-sort note as UpdatePostProcessAttributes - here fully benign, the
688
- * blend is symmetric within a tie group.
679
+ /**
680
+ * Blends every registered EveLightingOverride against the scene baseline and
681
+ * stamps currentSunColor / currentNebulaIntensity /
682
+ * currentReflectionIntensity - the lighting-override block of Carbon
683
+ * EveSpaceScene::BeginRender (EveSpaceScene.cpp:1333-1363). The baseline is
684
+ * appended AFTER the sort at raw priority -1 - one below
685
+ * SCENE_DEFAULT_PRIORITY=0, outside the legal enum range (Carbon casts -1,
686
+ * cpp:1343) - so it always sits last. Scalar/color math only - no matrix
687
+ * compositions, no row-vector swaps anywhere in this method. Same
688
+ * stable-sort note as UpdatePostProcessAttributes - here fully benign, the
689
+ * blend is symmetric within a tie group.
689
690
  */
690
691
  BlendLightingOverrides() {
691
692
  if (!this.display) {
@@ -723,30 +724,30 @@ new class extends _identity {
723
724
  this.currentReflectionIntensity = over.reflectionIntensity;
724
725
  }
725
726
 
726
- /**
727
- * Runs Carbon's portable froxel-fog blend against the scene-owned registry
728
- * and update context. The frame driver calls this immediately after lighting
729
- * overrides and before visibility/gather.
727
+ /**
728
+ * Runs Carbon's portable froxel-fog blend against the scene-owned registry
729
+ * and update context. The frame driver calls this immediately after lighting
730
+ * overrides and before visibility/gather.
730
731
  */
731
732
  UpdateFogSettings() {
732
733
  this.volumetricsRenderer.UpdateFogSettings(this.componentRegistry, this.updateContext);
733
734
  }
734
735
 
735
- /**
736
- * Drives the injected light manager through Carbon's dynamic-light gather
737
- * (EveSpaceScene::BeginRender, EveSpaceScene.cpp:1396-1416, AFTER
738
- * GatherBatches cpp:1387): shadow quality, clear (runs even with zero owners
739
- * - stale lights must drop), frustum, LOD cutoff, then every registered
740
- * LightOwner's GetLights (Carbon Tr2ParallelFor chunk-20 cpp:1405-1413; JS
741
- * sequential in collection order), then ResolveLightData. No JS
742
- * Tr2LightManager class exists - the manager is a duck and every manager
743
- * call is optional-chained so a partial duck still gets the owner loop.
744
- * Carbon runs the block only when a manager instance exists (dynamic
745
- * lighting on) - a null manager is a no-op. The recording frame number
746
- * Carbon passes to SetShadowQuality and the renderContext it passes to Clear
747
- * are engine recording state - the JS Clear receives the frame's
748
- * renderContext for ducks that want it.
749
- * @param {Object|null} lightManager
736
+ /**
737
+ * Drives the injected light manager through Carbon's dynamic-light gather
738
+ * (EveSpaceScene::BeginRender, EveSpaceScene.cpp:1396-1416, AFTER
739
+ * GatherBatches cpp:1387): shadow quality, clear (runs even with zero owners
740
+ * - stale lights must drop), frustum, LOD cutoff, then every registered
741
+ * LightOwner's GetLights (Carbon Tr2ParallelFor chunk-20 cpp:1405-1413; JS
742
+ * sequential in collection order), then ResolveLightData. No JS
743
+ * Tr2LightManager class exists - the manager is a duck and every manager
744
+ * call is optional-chained so a partial duck still gets the owner loop.
745
+ * Carbon runs the block only when a manager instance exists (dynamic
746
+ * lighting on) - a null manager is a no-op. The recording frame number
747
+ * Carbon passes to SetShadowQuality and the renderContext it passes to Clear
748
+ * are engine recording state - the JS Clear receives the frame's
749
+ * renderContext for ducks that want it.
750
+ * @param {Object|null} lightManager
750
751
  */
751
752
  GatherLights(lightManager) {
752
753
  if (!lightManager || !this.display) {
@@ -762,18 +763,18 @@ new class extends _identity {
762
763
  lightManager.ResolveLightData();
763
764
  }
764
765
 
765
- /**
766
- * Carbon EveSpaceScene::UpdateShLighting (cpp:1685-1703): hands every
767
- * secondary-lighting receiver the scene's SH manager, so each one samples the
768
- * bounce light at its own position. A scene with no manager does nothing, as
769
- * Carbon does.
770
- *
771
- * Carbon runs this at the very END of the gather (cpp:1524, after
772
- * FinalizeBatches), and over a parallel range; the JS pass is sequential
773
- * because the receivers write only their own records and share no state.
774
- *
775
- * @param {Array} objects - the frame's visible objects
776
- * @returns {Number} how many receivers were updated
766
+ /**
767
+ * Carbon EveSpaceScene::UpdateShLighting (cpp:1685-1703): hands every
768
+ * secondary-lighting receiver the scene's SH manager, so each one samples the
769
+ * bounce light at its own position. A scene with no manager does nothing, as
770
+ * Carbon does.
771
+ *
772
+ * Carbon runs this at the very END of the gather (cpp:1524, after
773
+ * FinalizeBatches), and over a parallel range; the JS pass is sequential
774
+ * because the receivers write only their own records and share no state.
775
+ *
776
+ * @param {Array} objects - the frame's visible objects
777
+ * @returns {Number} how many receivers were updated
777
778
  */
778
779
  UpdateShLighting(objects = []) {
779
780
  if (!this.shLightingManager) {
@@ -790,11 +791,11 @@ new class extends _identity {
790
791
  return updated;
791
792
  }
792
793
 
793
- /**
794
- * The scene's own per-frame vertex record (Carbon m_perFrameVS,
795
- * EveSpaceScene.h:300). Persistent, not arena-leased: it is rewritten each
796
- * frame and bound once, and the PS fill reads m_upscalingAmount back out of
797
- * the same pass.
794
+ /**
795
+ * The scene's own per-frame vertex record (Carbon m_perFrameVS,
796
+ * EveSpaceScene.h:300). Persistent, not arena-leased: it is rewritten each
797
+ * frame and bound once, and the PS fill reads m_upscalingAmount back out of
798
+ * the same pass.
798
799
  */
799
800
  #perFrameVS = RawData.create("EveSpaceScenePerFrameVSData");
800
801
 
@@ -811,33 +812,33 @@ new class extends _identity {
811
812
  return this.#perFramePS;
812
813
  }
813
814
 
814
- /**
815
- * Fills the per-frame VERTEX constants (Carbon
816
- * EveSpaceScene::PopulatePerFrameVSData, cpp:3015-3068).
817
- *
818
- * Adapted in one respect, the same way StampFrameContext is: Carbon reads
819
- * the camera off `Tr2Renderer` statics and the render-target/viewport sizes
820
- * off `renderContext.m_esm`, neither of which exists GPU-free here. The
821
- * driver passes them in `frame` instead. Everything the scene itself owns -
822
- * sun, fog, env-map rotation, the previous frame's view/projection - is read
823
- * from the scene, as Carbon does.
824
- *
825
- * Matrices are stored TRANSPOSED because the shaders are column_major, with
826
- * one deliberate exception Carbon calls out at cpp:3023: the value wanted for
827
- * `ViewInverseTransposeMat` is already a transpose, so transposing it again
828
- * cancels and the inverse view goes in as-is.
829
- *
830
- * @param {Object} renderContext - the frame's Tr2RenderContext
831
- * @param {Object} [frame] - the engine-supplied state Carbon reads statically
832
- * @param {Number} [frame.renderTargetWidth]
833
- * @param {Number} [frame.renderTargetHeight]
834
- * @param {Number} [frame.aspectRatio]
835
- * @param {Number} [frame.animationTime] - Tr2Renderer::GetAnimationTime
836
- * @param {Object|null} [frame.deviceViewport] - {width, height}
837
- * @param {Object|null} [frame.projectionTransform] - the NON reversed-depth
838
- * projection, which Carbon uses only to recover the field of view
839
- * @param {Object} [out] - the record to fill; defaults to the scene's own
840
- * @returns {Object} the filled record
815
+ /**
816
+ * Fills the per-frame VERTEX constants (Carbon
817
+ * EveSpaceScene::PopulatePerFrameVSData, cpp:3015-3068).
818
+ *
819
+ * Adapted in one respect, the same way StampFrameContext is: Carbon reads
820
+ * the camera off `Tr2Renderer` statics and the render-target/viewport sizes
821
+ * off `renderContext.m_esm`, neither of which exists GPU-free here. The
822
+ * driver passes them in `frame` instead. Everything the scene itself owns -
823
+ * sun, fog, env-map rotation, the previous frame's view/projection - is read
824
+ * from the scene, as Carbon does.
825
+ *
826
+ * Matrices are stored TRANSPOSED because the shaders are column_major, with
827
+ * one deliberate exception Carbon calls out at cpp:3023: the value wanted for
828
+ * `ViewInverseTransposeMat` is already a transpose, so transposing it again
829
+ * cancels and the inverse view goes in as-is.
830
+ *
831
+ * @param {Object} renderContext - the frame's Tr2RenderContext
832
+ * @param {Object} [frame] - the engine-supplied state Carbon reads statically
833
+ * @param {Number} [frame.renderTargetWidth]
834
+ * @param {Number} [frame.renderTargetHeight]
835
+ * @param {Number} [frame.aspectRatio]
836
+ * @param {Number} [frame.animationTime] - Tr2Renderer::GetAnimationTime
837
+ * @param {Object|null} [frame.deviceViewport] - {width, height}
838
+ * @param {Object|null} [frame.projectionTransform] - the NON reversed-depth
839
+ * projection, which Carbon uses only to recover the field of view
840
+ * @param {Object} [out] - the record to fill; defaults to the scene's own
841
+ * @returns {Object} the filled record
841
842
  */
842
843
  PopulatePerFrameVSData(renderContext, frame = {}, out = this.#perFrameVS) {
843
844
  const view = renderContext.GetViewTransform();
@@ -889,30 +890,30 @@ new class extends _identity {
889
890
  return out;
890
891
  }
891
892
 
892
- /**
893
- * Fills the per-frame PIXEL constants (Carbon
894
- * EveSpaceScene::PopulatePerFramePSData, cpp:3075-3202). Same `frame`
895
- * adaptation as the vertex fill.
896
- *
897
- * The cascaded-shadow block (ShadowMapValues / CascadeRanges /
898
- * ShadowMatrixVal / SplitInfo) is filled only when a shadow map is passed,
899
- * exactly as Carbon's `if( shadowMap )` gate does; without one the record
900
- * leaves the persistent cascade bytes untouched. `ShadowCameraRange` remains
901
- * disabled, so stale cascade bytes are not consumed until a map is supplied
902
- * again.
903
- *
904
- * @param {Object} renderContext - the frame's Tr2RenderContext
905
- * @param {Object} [frame] - as PopulatePerFrameVSData, plus:
906
- * @param {Number} [frame.frameIndex] - Tr2Renderer::GetCurrentFrameCounter
907
- * @param {Number} [frame.gammaBrightness]
908
- * @param {Number} [frame.sceneMipLodBias] - the upscaler's bias, plus the
909
- * scene post-process's own; the upscaling info is engine state
910
- * @param {Number} [frame.inverseShadowMapAtlasSize] - 0 with no light manager
911
- * @param {Number} [frame.shadowMapAtlasEntryMinSizeLog2]
912
- * @param {Tr2ShadowMap|null} [shadowMap=this.cascadedShadowMap] - the owned
913
- * cascaded shadow map; explicit null disables cascade packing
914
- * @param {Object} [out] - the record to fill; defaults to the scene's own
915
- * @returns {Object} the filled record
893
+ /**
894
+ * Fills the per-frame PIXEL constants (Carbon
895
+ * EveSpaceScene::PopulatePerFramePSData, cpp:3075-3202). Same `frame`
896
+ * adaptation as the vertex fill.
897
+ *
898
+ * The cascaded-shadow block (ShadowMapValues / CascadeRanges /
899
+ * ShadowMatrixVal / SplitInfo) is filled only when a shadow map is passed,
900
+ * exactly as Carbon's `if( shadowMap )` gate does; without one the record
901
+ * leaves the persistent cascade bytes untouched. `ShadowCameraRange` remains
902
+ * disabled, so stale cascade bytes are not consumed until a map is supplied
903
+ * again.
904
+ *
905
+ * @param {Object} renderContext - the frame's Tr2RenderContext
906
+ * @param {Object} [frame] - as PopulatePerFrameVSData, plus:
907
+ * @param {Number} [frame.frameIndex] - Tr2Renderer::GetCurrentFrameCounter
908
+ * @param {Number} [frame.gammaBrightness]
909
+ * @param {Number} [frame.sceneMipLodBias] - the upscaler's bias, plus the
910
+ * scene post-process's own; the upscaling info is engine state
911
+ * @param {Number} [frame.inverseShadowMapAtlasSize] - 0 with no light manager
912
+ * @param {Number} [frame.shadowMapAtlasEntryMinSizeLog2]
913
+ * @param {Tr2ShadowMap|null} [shadowMap=this.cascadedShadowMap] - the owned
914
+ * cascaded shadow map; explicit null disables cascade packing
915
+ * @param {Object} [out] - the record to fill; defaults to the scene's own
916
+ * @returns {Object} the filled record
916
917
  */
917
918
  PopulatePerFramePSData(renderContext, frame = {}, shadowMap = this.cascadedShadowMap, out = this.#perFramePS) {
918
919
  if (shadowMap !== null && !(shadowMap instanceof _Tr2ShadowMap)) {
@@ -979,10 +980,10 @@ new class extends _identity {
979
980
  return out;
980
981
  }
981
982
 
982
- /**
983
- * The SunData block both fills share (cpp:3035-3039 / 3085-3089). The
984
- * direction is normalized AND negated: shaders work with the direction TO
985
- * the light, not the direction it travels.
983
+ /**
984
+ * The SunData block both fills share (cpp:3035-3039 / 3085-3089). The
985
+ * direction is normalized AND negated: shaders work with the direction TO
986
+ * the light, not the direction it travels.
986
987
  */
987
988
  #FillSunData(out) {
988
989
  vec3.normalize(sunDirectionScratch, this.sunDirection);
@@ -990,10 +991,10 @@ new class extends _identity {
990
991
  out.Set("Sun.DiffuseColor", this.currentSunColor);
991
992
  }
992
993
 
993
- /**
994
- * FOV both ways - width in x, height in y (cpp:3046-3047 / 3103-3104).
995
- * Carbon recovers it from the NON reversed-depth projection, so a driver
996
- * that reverses depth must pass the original in `frame.projectionTransform`.
994
+ /**
995
+ * FOV both ways - width in x, height in y (cpp:3046-3047 / 3103-3104).
996
+ * Carbon recovers it from the NON reversed-depth projection, so a driver
997
+ * that reverses depth must pass the original in `frame.projectionTransform`.
997
998
  */
998
999
  #FillFovXY(out, frame) {
999
1000
  const source = frame.projectionTransform;
@@ -1001,10 +1002,10 @@ new class extends _identity {
1001
1002
  out.Set("FovXY", [fovY * (frame.aspectRatio ?? 1), fovY]);
1002
1003
  }
1003
1004
 
1004
- /**
1005
- * The cascaded-shadow block (cpp:3163-3190). Each cascade's shadow matrix is
1006
- * rebased into the current view, flipped in y, remapped from (-1,+1) to
1007
- * (0,1), then scaled and offset into its cell of the 8x2 atlas.
1005
+ /**
1006
+ * The cascaded-shadow block (cpp:3163-3190). Each cascade's shadow matrix is
1007
+ * rebased into the current view, flipped in y, remapped from (-1,+1) to
1008
+ * (0,1), then scaled and offset into its cell of the 8x2 atlas.
1008
1009
  */
1009
1010
  #FillShadowCascades(out, shadowMap, renderContext) {
1010
1011
  const split = shadowMap.GetPerSplitData();
@@ -1037,8 +1038,8 @@ new class extends _identity {
1037
1038
  out.Set("SplitInfo", split.SplitInfo);
1038
1039
  }
1039
1040
 
1040
- /** Carbon method ReregisterEntities (MAP_METHOD_AND_WRAP, cpp:4064-4089).
1041
- * Guarded no-op after ClearComponentRegistry has nulled the registry
1041
+ /** Carbon method ReregisterEntities (MAP_METHOD_AND_WRAP, cpp:4064-4089).
1042
+ * Guarded no-op after ClearComponentRegistry has nulled the registry
1042
1043
  * (destroy-only path; Carbon would never call this afterwards). */
1043
1044
  ReregisterEntities() {
1044
1045
  if (!this.componentRegistry) {
@@ -1056,11 +1057,11 @@ new class extends _identity {
1056
1057
  }
1057
1058
  }
1058
1059
 
1059
- /** Carbon method ClearComponentRegistry (EveSpaceScene.cpp:4091-4099, called
1060
- * from the destructor cpp:322). Entity component-state is deliberately NOT
1061
- * cleared beyond what Clear() does - either the scene is being destroyed
1062
- * (entities go too) or entities move to another scene and re-register there.
1063
- * The JS registry Clear() additionally detaches entity.registry when it
1060
+ /** Carbon method ClearComponentRegistry (EveSpaceScene.cpp:4091-4099, called
1061
+ * from the destructor cpp:322). Entity component-state is deliberately NOT
1062
+ * cleared beyond what Clear() does - either the scene is being destroyed
1063
+ * (entities go too) or entities move to another scene and re-register there.
1064
+ * The JS registry Clear() additionally detaches entity.registry when it
1064
1065
  * points at this registry - strictly more hygienic than Carbon; kept. */
1065
1066
  ClearComponentRegistry() {
1066
1067
  this.componentRegistry?.Clear();
@@ -1077,21 +1078,21 @@ new class extends _identity {
1077
1078
  return this.Update(time, time);
1078
1079
  }
1079
1080
 
1080
- /**
1081
- * Carbon SimplePriorityBlend (PriorityBlend.h:371-413) specialized to the
1082
- * IEveLightingOverride::Overrides value type
1083
- * { sunColor: vec4, sunIntensity, backgroundIntensity, reflectionIntensity }
1084
- * (EveChildLightingOverride.h:15-32) - `+` and `* weight` componentwise.
1085
- * Walks the (already priority-desc-sorted) list in equal-priority groups:
1086
- * factor = (1 / max(groupTotal, 1)) * remainingWeight
1087
- * then subtracts the UNCLAMPED group total from remainingWeight. Two quirks
1088
- * preserved exactly: (a) a group with total intensity 0.3 contributes at
1089
- * weight 0.3*remaining and leaves 0.7 for lower priorities; (b) a group with
1090
- * total 2 is normalized to consume exactly remainingWeight and terminates
1091
- * (remaining goes to -1).
1092
- * @param {Array} sources - [{ priority, intensity, value }] sorted high->low
1093
- * @returns {{ sunColor: Float32Array, sunIntensity: Number,
1094
- * backgroundIntensity: Number, reflectionIntensity: Number }}
1081
+ /**
1082
+ * Carbon SimplePriorityBlend (PriorityBlend.h:371-413) specialized to the
1083
+ * IEveLightingOverride::Overrides value type
1084
+ * { sunColor: vec4, sunIntensity, backgroundIntensity, reflectionIntensity }
1085
+ * (EveChildLightingOverride.h:15-32) - `+` and `* weight` componentwise.
1086
+ * Walks the (already priority-desc-sorted) list in equal-priority groups:
1087
+ * factor = (1 / max(groupTotal, 1)) * remainingWeight
1088
+ * then subtracts the UNCLAMPED group total from remainingWeight. Two quirks
1089
+ * preserved exactly: (a) a group with total intensity 0.3 contributes at
1090
+ * weight 0.3*remaining and leaves 0.7 for lower priorities; (b) a group with
1091
+ * total 2 is normalized to consume exactly remainingWeight and terminates
1092
+ * (remaining goes to -1).
1093
+ * @param {Array} sources - [{ priority, intensity, value }] sorted high->low
1094
+ * @returns {{ sunColor: Float32Array, sunIntensity: Number,
1095
+ * backgroundIntensity: Number, reflectionIntensity: Number }}
1095
1096
  */
1096
1097
  }];
1097
1098
  EveVisualizeMethod = EveVisualizeMethod;