@carbonenginejs/runtime-resource 0.8.0 → 0.9.1
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.
- package/LICENSE +21 -21
- package/NOTICE +31 -29
- package/README.md +67 -548
- package/dist/CjsMotherLode.js +1271 -1271
- package/dist/CjsResMan.js +3005 -3005
- package/dist/CjsResManQueue.js +214 -214
- package/dist/CjsResource.js +566 -566
- package/dist/CjsResourceSource.js +68 -59
- package/dist/CjsResourceSource.js.map +1 -1
- package/dist/_virtual/_rollupPluginBabelHelpers.js +153 -153
- package/dist/format/CjsBlueReader.js +269 -269
- package/dist/format/CjsFormat.js +197 -192
- package/dist/format/CjsFormat.js.map +1 -1
- package/dist/format/CjsReader.js +18 -18
- package/dist/format/CjsResourceProbe.js +277 -277
- package/dist/format/payloadContract.js +173 -173
- package/dist/formats/black/CjsBlackFormat.js +278 -278
- package/dist/formats/black/core/CjsBlackBinaryReader.js +157 -153
- package/dist/formats/black/core/CjsBlackBinaryReader.js.map +1 -1
- package/dist/formats/black/core/CjsBlackPropertyReaders.js +387 -382
- package/dist/formats/black/core/CjsBlackPropertyReaders.js.map +1 -1
- package/dist/formats/black/core/CjsBlackReader.js +639 -639
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js +437 -433
- package/dist/formats/black/core/CjsBlackSchemaRegistry.js.map +1 -1
- package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js +4 -0
- package/dist/formats/black/core/black-schema-v1-2026-07-23.json.js.map +1 -0
- package/dist/formats/black/core/blackConstants.js +7 -7
- package/dist/formats/black/core/blackDefinitions.js +10 -10
- package/dist/formats/black/core/blackDefinitions.js.map +1 -1
- package/dist/formats/black/core/blackEnums.js +6 -6
- package/dist/formats/black/core/blackSchema.js +3 -3
- package/dist/formats/black/core/blackVersion.js +22 -22
- package/dist/formats/black/core/helpers.js +182 -182
- package/dist/formats/black/core/schema.js +4 -4
- package/dist/formats/black/index.js +2 -2
- package/dist/formats/bnk/CjsBnkFormat.js +125 -125
- package/dist/formats/bnk/core/graph.js +140 -140
- package/dist/formats/bnk/core/helpers.js +409 -409
- package/dist/formats/bnk/core/musicNodes.js +493 -489
- package/dist/formats/bnk/core/musicNodes.js.map +1 -1
- package/dist/formats/bnk/core/soundbanksInfo.js +246 -246
- package/dist/formats/bnk/index.js +2 -2
- package/dist/formats/cmf/CjsCmfFormat.js +497 -497
- package/dist/formats/cmf/core/binary.js +123 -118
- package/dist/formats/cmf/core/binary.js.map +1 -1
- package/dist/formats/cmf/core/buffers.js +233 -233
- package/dist/formats/cmf/core/constants.js +47 -47
- package/dist/formats/cmf/core/gr2Anim.js +453 -453
- package/dist/formats/cmf/core/helpers.js +287 -287
- package/dist/formats/cmf/core/pack.js +276 -276
- package/dist/formats/cmf/core/schema.js +364 -364
- package/dist/formats/cmf/core/shared.js +268 -268
- package/dist/formats/cmf/core/writer.js +517 -517
- package/dist/formats/cmf/index.js +2 -2
- package/dist/formats/dds/CjsDdsFormat.js +200 -193
- package/dist/formats/dds/CjsDdsFormat.js.map +1 -1
- package/dist/formats/dds/core/bc6h.js +288 -288
- package/dist/formats/dds/core/bc7.js +256 -251
- package/dist/formats/dds/core/bc7.js.map +1 -1
- package/dist/formats/dds/core/helpers.js +815 -815
- package/dist/formats/dds/index.js +2 -2
- package/dist/formats/fbx/CjsFbxFormat.js +266 -266
- package/dist/formats/fbx/core/helpers.js +3911 -3901
- package/dist/formats/fbx/core/helpers.js.map +1 -1
- package/dist/formats/fbx/index.js +2 -2
- package/dist/formats/flac/CjsFlacFormat.js +93 -87
- package/dist/formats/flac/CjsFlacFormat.js.map +1 -1
- package/dist/formats/flac/core/helpers.js +295 -295
- package/dist/formats/flac/index.js +2 -2
- package/dist/formats/gif/CjsGifFormat.js +92 -87
- package/dist/formats/gif/CjsGifFormat.js.map +1 -1
- package/dist/formats/gif/core/helpers.js +360 -360
- package/dist/formats/gif/index.js +2 -2
- package/dist/formats/gltf/CjsGltfFormat.js +290 -290
- package/dist/formats/gltf/core/helpers.js +292 -292
- package/dist/formats/gltf/core/json.js +79 -79
- package/dist/formats/gltf/core/parser.js +666 -666
- package/dist/formats/gltf/core/targets.js +163 -163
- package/dist/formats/gltf/index.js +2 -2
- package/dist/formats/gr2/CjsGr2Format.js +46 -0
- package/dist/formats/gr2/CjsGr2Format.js.map +1 -0
- package/dist/formats/gr2/core/CjsFormatGr2.js +273 -0
- package/dist/formats/gr2/core/CjsFormatGr2.js.map +1 -0
- package/dist/formats/gr2/core/bitknit2.js +280 -0
- package/dist/formats/gr2/core/bitknit2.js.map +1 -0
- package/dist/formats/gr2/core/curves.js +1047 -0
- package/dist/formats/gr2/core/curves.js.map +1 -0
- package/dist/formats/gr2/core/gsf.js +72 -0
- package/dist/formats/gr2/core/gsf.js.map +1 -0
- package/dist/formats/gr2/core/helpers.js +332 -0
- package/dist/formats/gr2/core/helpers.js.map +1 -0
- package/dist/formats/gr2/core/json.js +622 -0
- package/dist/formats/gr2/core/json.js.map +1 -0
- package/dist/formats/gr2/core/oodle1.js +388 -0
- package/dist/formats/gr2/core/oodle1.js.map +1 -0
- package/dist/formats/gr2/core/reader.js +617 -0
- package/dist/formats/gr2/core/reader.js.map +1 -0
- package/dist/formats/gr2/core/tangents.js +48 -0
- package/dist/formats/gr2/core/tangents.js.map +1 -0
- package/dist/formats/gr2/core/targets.js +351 -0
- package/dist/formats/gr2/core/targets.js.map +1 -0
- package/dist/formats/gr2/index.js +3 -0
- package/dist/formats/gr2/index.js.map +1 -0
- package/dist/formats/index.js +30 -23
- package/dist/formats/index.js.map +1 -1
- package/dist/formats/jpeg/CjsJpegFormat.js +212 -206
- package/dist/formats/jpeg/CjsJpegFormat.js.map +1 -1
- package/dist/formats/jpeg/core/helpers.js +350 -350
- package/dist/formats/jpeg/core/jpeg.js +387 -377
- package/dist/formats/jpeg/core/jpeg.js.map +1 -1
- package/dist/formats/jpeg/index.js +2 -2
- package/dist/formats/mp3/CjsMp3Format.js +197 -192
- package/dist/formats/mp3/CjsMp3Format.js.map +1 -1
- package/dist/formats/mp3/core/helpers.js +338 -338
- package/dist/formats/mp3/index.js +2 -2
- package/dist/formats/mp4/CjsMp4Format.js +197 -191
- package/dist/formats/mp4/CjsMp4Format.js.map +1 -1
- package/dist/formats/mp4/core/helpers.js +449 -449
- package/dist/formats/mp4/index.js +2 -2
- package/dist/formats/obj/CjsObjFormat.js +253 -253
- package/dist/formats/obj/core/helpers.js +573 -573
- package/dist/formats/obj/core/json.js +64 -64
- package/dist/formats/obj/core/parser.js +321 -321
- package/dist/formats/obj/index.js +2 -2
- package/dist/formats/ogg/CjsOggFormat.js +94 -88
- package/dist/formats/ogg/CjsOggFormat.js.map +1 -1
- package/dist/formats/ogg/core/helpers.js +387 -387
- package/dist/formats/ogg/core/imdct.js +178 -178
- package/dist/formats/ogg/core/vorbis.js +1004 -999
- package/dist/formats/ogg/core/vorbis.js.map +1 -1
- package/dist/formats/ogg/index.js +2 -2
- package/dist/formats/png/CjsPngFormat.js +201 -195
- package/dist/formats/png/CjsPngFormat.js.map +1 -1
- package/dist/formats/png/core/helpers.js +583 -583
- package/dist/formats/png/index.js +2 -2
- package/dist/formats/red/CjsRedFormat.js +261 -261
- package/dist/formats/red/core/CjsRedReader.js +194 -194
- package/dist/formats/red/core/blackDefinitions.js +3 -3
- package/dist/formats/red/core/helpers.js +139 -139
- package/dist/formats/red/core/redGraph.js +68 -68
- package/dist/formats/red/core/schema.js +4 -4
- package/dist/formats/red/index.js +2 -2
- package/dist/formats/stl/CjsStlFormat.js +365 -365
- package/dist/formats/stl/core/helpers.js +261 -261
- package/dist/formats/stl/core/json.js +51 -51
- package/dist/formats/stl/core/stl.js +634 -629
- package/dist/formats/stl/core/stl.js.map +1 -1
- package/dist/formats/stl/core/targets.js +163 -163
- package/dist/formats/stl/index.js +2 -2
- package/dist/formats/tga/CjsTgaFormat.js +197 -192
- package/dist/formats/tga/CjsTgaFormat.js.map +1 -1
- package/dist/formats/tga/core/helpers.js +446 -446
- package/dist/formats/tga/index.js +2 -2
- package/dist/formats/wav/CjsWavFormat.js +198 -192
- package/dist/formats/wav/CjsWavFormat.js.map +1 -1
- package/dist/formats/wav/core/helpers.js +328 -328
- package/dist/formats/wav/index.js +2 -2
- package/dist/formats/webm/CjsWebmFormat.js +197 -191
- package/dist/formats/webm/CjsWebmFormat.js.map +1 -1
- package/dist/formats/webm/core/helpers.js +537 -537
- package/dist/formats/webm/index.js +2 -2
- package/dist/formats/webp/CjsWebpFormat.js +91 -86
- package/dist/formats/webp/CjsWebpFormat.js.map +1 -1
- package/dist/formats/webp/core/helpers.js +214 -214
- package/dist/formats/webp/index.js +2 -2
- package/dist/formats/wem/CjsWemFormat.js +242 -241
- package/dist/formats/wem/CjsWemFormat.js.map +1 -1
- package/dist/formats/wem/core/bitStream.js +259 -259
- package/dist/formats/wem/core/codebookLibrary.js +164 -164
- package/dist/formats/wem/core/helpers.js +417 -417
- package/dist/formats/wem/core/packedCodebooksAotuv603.js +30 -30
- package/dist/formats/wem/core/ptadpcm.js +77 -77
- package/dist/formats/wem/core/resolve.js +121 -121
- package/dist/formats/wem/core/wemToOgg.js +485 -485
- package/dist/formats/wem/index.js +2 -2
- package/dist/formats/yaml/CjsYamlFormat.js +89 -83
- package/dist/formats/yaml/CjsYamlFormat.js.map +1 -1
- package/dist/formats/yaml/core/CjsYamlReader.js +311 -305
- package/dist/formats/yaml/core/CjsYamlReader.js.map +1 -1
- package/dist/formats/yaml/core/helpers.js +160 -160
- package/dist/formats/yaml/index.js +2 -2
- package/dist/index.js +49 -48
- package/dist/index.js.map +1 -1
- package/dist/resourcePath.js +18 -18
- package/dist/resourceStates.js +9 -9
- package/dist/resources/AudioGeometryResData.js +47 -47
- package/dist/resources/GStateBindingCallbackData.js +31 -31
- package/dist/resources/MeshDecalData.js +37 -37
- package/dist/resources/MeshDecalLodData.js +34 -34
- package/dist/resources/Tr2EffectRes.js +71 -71
- package/dist/resources/Tr2GrannyIntersectionResult.js +60 -60
- package/dist/resources/Tr2GrannyStateRes.js +44 -44
- package/dist/resources/Tr2ImageRes.js +114 -114
- package/dist/resources/Tr2LightProfileRes.js +40 -40
- package/dist/resources/Tr2MaterialArea.js +34 -34
- package/dist/resources/Tr2MaterialMesh.js +31 -31
- package/dist/resources/Tr2MaterialRes.js +34 -34
- package/dist/resources/Tr2ShaderPermutation.js +43 -43
- package/dist/resources/Tr2TextureLodManager.js +80 -80
- package/dist/resources/Tr2TextureLodUpdateRequest.js +37 -37
- package/dist/resources/Tr2TexturePackChannel.js +37 -37
- package/dist/resources/Tr2TexturePipeline.js +52 -52
- package/dist/resources/Tr2TexturePipelineParams.js +34 -34
- package/dist/resources/Tr2TexturePipelineStepCompress.js +40 -40
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js +22 -0
- package/dist/resources/Tr2TexturePipelineStepGenerateMips.js.map +1 -0
- package/dist/resources/Tr2TexturePipelineStepLimitSize.js +34 -34
- package/dist/resources/Tr2TexturePipelineStepLoad.js +31 -31
- package/dist/resources/Tr2TexturePipelineStepPack.js +43 -43
- package/dist/resources/TriGeometryRes.js +239 -239
- package/dist/resources/TriGeometryResAreaData.js +59 -59
- package/dist/resources/TriGeometryResJointData.js +38 -38
- package/dist/resources/TriGeometryResLodData.js +88 -88
- package/dist/resources/TriGeometryResMeshData.js +63 -63
- package/dist/resources/TriGeometryResSkeletonData.js +34 -34
- package/dist/resources/TriGrannyRes.js +43 -43
- package/dist/resources/TriJointBinding.js +38 -38
- package/dist/resources/TriMorphTargetGeometryConstants.js +46 -46
- package/dist/resources/TriRtGeometryConstants.js +88 -88
- package/dist/resources/TriTextureRes.js +304 -304
- package/dist/resources/enums.js +18 -18
- package/dist/resources/resourceBoundary.js +47 -47
- package/dist/resources/texturePipelineBehavior.js +308 -308
- package/dist/texture/CjsTextureArrayRes.js +406 -406
- package/dist/texture/CjsTextureParameterProxy.js +133 -133
- package/docs/README.md +73 -0
- package/docs/architecture.md +86 -0
- package/docs/concepts/resource-lifecycle.md +217 -0
- package/docs/formats/README.md +105 -0
- package/docs/formats/gr2.md +161 -0
- package/{FORMAT-PROVENANCE.md → docs/formats/provenance.md} +173 -155
- package/docs/formats/stl.md +37 -0
- package/docs/formats/wwise.md +44 -0
- package/docs/reference/classes/README.md +33 -0
- package/docs/reference/classes/core.md +106 -0
- package/docs/reference/classes/dropped.md +46 -0
- package/docs/reference/classes/formats.md +522 -0
- package/docs/reference/classes/resources.md +346 -0
- package/docs/reference/classes/texture.md +26 -0
- package/docs/reference/events.md +92 -0
- package/docs/reference/motherlode-cache.md +244 -0
- package/docs/reference/queues.md +102 -0
- package/docs/reference/reload.md +107 -0
- package/docs/reference/texture-arrays.md +113 -0
- package/docs/reference/texture-pipeline.md +53 -0
- package/docs/roadmap.md +104 -0
- package/format-notices/black/LICENSE +21 -21
- package/format-notices/black/NOTICE +47 -47
- package/format-notices/bnk/LICENSE +21 -21
- package/format-notices/bnk/NOTICE +20 -20
- package/format-notices/cmf/LICENSE +21 -21
- package/format-notices/cmf/NOTICE +36 -36
- package/format-notices/dds/LICENSE +21 -21
- package/format-notices/dds/NOTICE +14 -14
- package/format-notices/fbx/LICENSE +21 -21
- package/format-notices/fbx/NOTICE +14 -14
- package/format-notices/flac/LICENSE +21 -21
- package/format-notices/flac/NOTICE +14 -14
- package/format-notices/gif/LICENSE +21 -21
- package/format-notices/gif/NOTICE +14 -14
- package/format-notices/gltf/LICENSE +21 -21
- package/format-notices/gltf/NOTICE +27 -27
- package/format-notices/gr2/LICENSE +21 -0
- package/format-notices/gr2/NOTICE +60 -0
- package/format-notices/gr2/THIRD-PARTY-NOTICES.md +93 -0
- package/format-notices/jpeg/LICENSE +21 -21
- package/format-notices/jpeg/NOTICE +14 -14
- package/format-notices/mp3/LICENSE +21 -21
- package/format-notices/mp3/NOTICE +14 -14
- package/format-notices/mp4/LICENSE +21 -21
- package/format-notices/mp4/NOTICE +14 -14
- package/format-notices/obj/LICENSE +21 -21
- package/format-notices/obj/NOTICE +26 -26
- package/format-notices/ogg/LICENSE +21 -21
- package/format-notices/ogg/NOTICE +28 -28
- package/format-notices/png/LICENSE +21 -21
- package/format-notices/png/NOTICE +14 -14
- package/format-notices/red/LICENSE +21 -21
- package/format-notices/red/NOTICE +31 -31
- package/format-notices/stl/LICENSE +21 -21
- package/format-notices/stl/NOTICE +21 -21
- package/format-notices/tga/LICENSE +21 -21
- package/format-notices/tga/NOTICE +14 -14
- package/format-notices/wav/LICENSE +21 -21
- package/format-notices/wav/NOTICE +14 -14
- package/format-notices/webm/LICENSE +21 -21
- package/format-notices/webm/NOTICE +14 -14
- package/format-notices/webp/LICENSE +21 -21
- package/format-notices/webp/NOTICE +14 -14
- package/format-notices/wem/LICENSE +57 -57
- package/format-notices/wem/NOTICE +33 -33
- package/format-notices/yaml/LICENSE +21 -21
- package/format-notices/yaml/NOTICE +44 -44
- package/package.json +52 -51
- package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js +0 -4
- package/dist/formats/black/core/black-schema-v1-2026-07-11.json.js.map +0 -1
- package/resource-lifecycle.md +0 -679
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
# Resources class catalog
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-resource` classes under `src/resources`
|
|
5
|
+
Audience: Users, maintainers, and automated readers
|
|
6
|
+
Summary: Provides one-sentence purpose descriptors for the Carbon-shaped semantic resource and data classes in src/resources.
|
|
7
|
+
|
|
8
|
+
<!-- class:AudioGeometryResData -->
|
|
9
|
+
## `AudioGeometryResData`
|
|
10
|
+
|
|
11
|
+
Data record mirroring Carbon's per-mesh audio-geometry block: an id plus the vertices, indices, and min/max bounds consumed by audio occlusion.
|
|
12
|
+
|
|
13
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
14
|
+
- Source: `src/resources/AudioGeometryResData.js`
|
|
15
|
+
- Visibility: Public
|
|
16
|
+
- Kind: Faithful Carbon port
|
|
17
|
+
|
|
18
|
+
<!-- class:GStateBindingCallbackData -->
|
|
19
|
+
## `GStateBindingCallbackData`
|
|
20
|
+
|
|
21
|
+
Data record mirroring Carbon's GState binding callback payload, holding the `gsf_path` string that identifies the Granny state file to bind.
|
|
22
|
+
|
|
23
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
24
|
+
- Source: `src/resources/GStateBindingCallbackData.js`
|
|
25
|
+
- Visibility: Public
|
|
26
|
+
- Kind: Faithful Carbon port
|
|
27
|
+
|
|
28
|
+
<!-- class:MeshDecalData -->
|
|
29
|
+
## `MeshDecalData`
|
|
30
|
+
|
|
31
|
+
Data record mirroring Carbon's per-mesh decal block: an index-buffer allocation reference, a LOD mask, and the per-LOD decal ranges.
|
|
32
|
+
|
|
33
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
34
|
+
- Source: `src/resources/MeshDecalData.js`
|
|
35
|
+
- Visibility: Public
|
|
36
|
+
- Kind: Faithful Carbon port
|
|
37
|
+
|
|
38
|
+
<!-- class:MeshDecalLodData -->
|
|
39
|
+
## `MeshDecalLodData`
|
|
40
|
+
|
|
41
|
+
Data record mirroring Carbon's per-LOD decal range, holding the start index and primitive count for one decal LOD.
|
|
42
|
+
|
|
43
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
44
|
+
- Source: `src/resources/MeshDecalLodData.js`
|
|
45
|
+
- Visibility: Public
|
|
46
|
+
- Kind: Faithful Carbon port
|
|
47
|
+
|
|
48
|
+
<!-- class:Tr2EffectRes -->
|
|
49
|
+
## `Tr2EffectRes`
|
|
50
|
+
|
|
51
|
+
Resource record that owns effect/shader payload facts, including the permutation description, while engine packages decide shader-module, pipeline, bind-group, and sampler realization.
|
|
52
|
+
|
|
53
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
54
|
+
- Source: `src/resources/Tr2EffectRes.js`
|
|
55
|
+
- Visibility: Public
|
|
56
|
+
- Kind: Adapted Carbon concept
|
|
57
|
+
|
|
58
|
+
<!-- class:Tr2GrannyIntersectionResult -->
|
|
59
|
+
## `Tr2GrannyIntersectionResult`
|
|
60
|
+
|
|
61
|
+
Data record mirroring Carbon's Granny intersection-query result: hit position, normal, UV, bone index, and mesh/area indices with per-field presence flags.
|
|
62
|
+
|
|
63
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
64
|
+
- Source: `src/resources/Tr2GrannyIntersectionResult.js`
|
|
65
|
+
- Visibility: Public
|
|
66
|
+
- Kind: Faithful Carbon port
|
|
67
|
+
|
|
68
|
+
<!-- class:Tr2GrannyStateRes -->
|
|
69
|
+
## `Tr2GrannyStateRes`
|
|
70
|
+
|
|
71
|
+
Resource that holds a plain GState payload, which may carry additive skeleton/state data without models, and validates that skeleton data or additive animations are present.
|
|
72
|
+
|
|
73
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
74
|
+
- Source: `src/resources/Tr2GrannyStateRes.js`
|
|
75
|
+
- Visibility: Public
|
|
76
|
+
- Kind: Adapted Carbon concept
|
|
77
|
+
|
|
78
|
+
<!-- class:Tr2ImageRes -->
|
|
79
|
+
## `Tr2ImageRes`
|
|
80
|
+
|
|
81
|
+
Resource record that holds a validated canonical RGBA image payload and mirrors its width/height metadata, leaving any device texture realization to engine packages.
|
|
82
|
+
|
|
83
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
84
|
+
- Source: `src/resources/Tr2ImageRes.js`
|
|
85
|
+
- Visibility: Public
|
|
86
|
+
- Kind: Adapted Carbon concept
|
|
87
|
+
|
|
88
|
+
<!-- class:Tr2LightProfileRes -->
|
|
89
|
+
## `Tr2LightProfileRes`
|
|
90
|
+
|
|
91
|
+
Resource that holds a plain light-profile payload, which may be richer than the data retained by the resource or the active engine adapter.
|
|
92
|
+
|
|
93
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
94
|
+
- Source: `src/resources/Tr2LightProfileRes.js`
|
|
95
|
+
- Visibility: Public
|
|
96
|
+
- Kind: Adapted Carbon concept
|
|
97
|
+
|
|
98
|
+
<!-- class:Tr2MaterialArea -->
|
|
99
|
+
## `Tr2MaterialArea`
|
|
100
|
+
|
|
101
|
+
Persisted data record mirroring Carbon's material-area node, pairing a material parameter-store reference with a metatype string.
|
|
102
|
+
|
|
103
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
104
|
+
- Source: `src/resources/Tr2MaterialArea.js`
|
|
105
|
+
- Visibility: Public
|
|
106
|
+
- Kind: Faithful Carbon port
|
|
107
|
+
|
|
108
|
+
<!-- class:Tr2MaterialMesh -->
|
|
109
|
+
## `Tr2MaterialMesh`
|
|
110
|
+
|
|
111
|
+
Persisted data record mirroring Carbon's material-mesh node, holding the dictionary of material areas for one mesh.
|
|
112
|
+
|
|
113
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
114
|
+
- Source: `src/resources/Tr2MaterialMesh.js`
|
|
115
|
+
- Visibility: Public
|
|
116
|
+
- Kind: Faithful Carbon port
|
|
117
|
+
|
|
118
|
+
<!-- class:Tr2MaterialRes -->
|
|
119
|
+
## `Tr2MaterialRes`
|
|
120
|
+
|
|
121
|
+
Persisted data record mirroring Carbon's material resource root, holding a name and the dictionary of material meshes.
|
|
122
|
+
|
|
123
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
124
|
+
- Source: `src/resources/Tr2MaterialRes.js`
|
|
125
|
+
- Visibility: Public
|
|
126
|
+
- Kind: Faithful Carbon port
|
|
127
|
+
|
|
128
|
+
<!-- class:Tr2ShaderPermutation -->
|
|
129
|
+
## `Tr2ShaderPermutation`
|
|
130
|
+
|
|
131
|
+
Data record mirroring Carbon's shader-permutation description: name, option list, default option, description text, and permutation type.
|
|
132
|
+
|
|
133
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
134
|
+
- Source: `src/resources/Tr2ShaderPermutation.js`
|
|
135
|
+
- Visibility: Public
|
|
136
|
+
- Kind: Faithful Carbon port
|
|
137
|
+
|
|
138
|
+
<!-- class:Tr2TextureLodManager -->
|
|
139
|
+
## `Tr2TextureLodManager`
|
|
140
|
+
|
|
141
|
+
CPU-side registry of texture resources participating in LOD management that owns deterministic membership and Carbon-shaped memory counters, while device allocation and budget policy stay in engine packages.
|
|
142
|
+
|
|
143
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
144
|
+
- Source: `src/resources/Tr2TextureLodManager.js`
|
|
145
|
+
- Visibility: Public
|
|
146
|
+
- Kind: Adapted Carbon concept
|
|
147
|
+
|
|
148
|
+
<!-- class:Tr2TextureLodUpdateRequest -->
|
|
149
|
+
## `Tr2TextureLodUpdateRequest`
|
|
150
|
+
|
|
151
|
+
Data record mirroring Carbon's texture-LOD update request: the frame number, requested mip change, and RAM-cache flag.
|
|
152
|
+
|
|
153
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
154
|
+
- Source: `src/resources/Tr2TextureLodUpdateRequest.js`
|
|
155
|
+
- Visibility: Public
|
|
156
|
+
- Kind: Faithful Carbon port
|
|
157
|
+
|
|
158
|
+
<!-- class:Tr2TexturePackChannel -->
|
|
159
|
+
## `Tr2TexturePackChannel`
|
|
160
|
+
|
|
161
|
+
Persisted data record mirroring Carbon's pack-step channel selection: the source channel index, fill value, and source texture path for one output channel.
|
|
162
|
+
|
|
163
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
164
|
+
- Source: `src/resources/Tr2TexturePackChannel.js`
|
|
165
|
+
- Visibility: Public
|
|
166
|
+
- Kind: Faithful Carbon port
|
|
167
|
+
|
|
168
|
+
<!-- class:Tr2TexturePipeline -->
|
|
169
|
+
## `Tr2TexturePipeline`
|
|
170
|
+
|
|
171
|
+
Persisted CPU bitmap-transformation pipeline that executes its ordered steps asynchronously to produce a canonical plain RGBA payload and reports the resource paths its load and pack steps depend on.
|
|
172
|
+
|
|
173
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
174
|
+
- Source: `src/resources/Tr2TexturePipeline.js`
|
|
175
|
+
- Visibility: Public
|
|
176
|
+
- Kind: Adapted Carbon concept
|
|
177
|
+
|
|
178
|
+
<!-- class:Tr2TexturePipelineParams -->
|
|
179
|
+
## `Tr2TexturePipelineParams`
|
|
180
|
+
|
|
181
|
+
Data record mirroring Carbon's texture-pipeline execution parameters, holding the maximum output width and height.
|
|
182
|
+
|
|
183
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
184
|
+
- Source: `src/resources/Tr2TexturePipelineParams.js`
|
|
185
|
+
- Visibility: Public
|
|
186
|
+
- Kind: Faithful Carbon port
|
|
187
|
+
|
|
188
|
+
<!-- class:Tr2TexturePipelineStepCompress -->
|
|
189
|
+
## `Tr2TexturePipelineStepCompress`
|
|
190
|
+
|
|
191
|
+
Persisted pipeline-step record mirroring Carbon's compress step, naming the target pixel format and per-channel error weights.
|
|
192
|
+
|
|
193
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
194
|
+
- Source: `src/resources/Tr2TexturePipelineStepCompress.js`
|
|
195
|
+
- Visibility: Public
|
|
196
|
+
- Kind: Faithful Carbon port
|
|
197
|
+
|
|
198
|
+
<!-- class:Tr2TexturePipelineStepGenerateMips -->
|
|
199
|
+
## `Tr2TexturePipelineStepGenerateMips`
|
|
200
|
+
|
|
201
|
+
Attribute-free persisted marker step mirroring Carbon's mip-generation step; the mip generation itself happens where the pipeline executes.
|
|
202
|
+
|
|
203
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
204
|
+
- Source: `src/resources/Tr2TexturePipelineStepGenerateMips.js`
|
|
205
|
+
- Visibility: Public
|
|
206
|
+
- Kind: Faithful Carbon port
|
|
207
|
+
|
|
208
|
+
<!-- class:Tr2TexturePipelineStepLimitSize -->
|
|
209
|
+
## `Tr2TexturePipelineStepLimitSize`
|
|
210
|
+
|
|
211
|
+
Persisted pipeline-step record mirroring Carbon's size-limit step, holding the maximum width and height the bitmap may keep.
|
|
212
|
+
|
|
213
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
214
|
+
- Source: `src/resources/Tr2TexturePipelineStepLimitSize.js`
|
|
215
|
+
- Visibility: Public
|
|
216
|
+
- Kind: Faithful Carbon port
|
|
217
|
+
|
|
218
|
+
<!-- class:Tr2TexturePipelineStepLoad -->
|
|
219
|
+
## `Tr2TexturePipelineStepLoad`
|
|
220
|
+
|
|
221
|
+
Persisted pipeline-step record mirroring Carbon's load step, holding the source texture path the pipeline reads.
|
|
222
|
+
|
|
223
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
224
|
+
- Source: `src/resources/Tr2TexturePipelineStepLoad.js`
|
|
225
|
+
- Visibility: Public
|
|
226
|
+
- Kind: Faithful Carbon port
|
|
227
|
+
|
|
228
|
+
<!-- class:Tr2TexturePipelineStepPack -->
|
|
229
|
+
## `Tr2TexturePipelineStepPack`
|
|
230
|
+
|
|
231
|
+
Persisted pipeline-step record mirroring Carbon's pack step, naming the target pixel format and the four per-channel pack sources.
|
|
232
|
+
|
|
233
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
234
|
+
- Source: `src/resources/Tr2TexturePipelineStepPack.js`
|
|
235
|
+
- Visibility: Public
|
|
236
|
+
- Kind: Faithful Carbon port
|
|
237
|
+
|
|
238
|
+
<!-- class:TriGeometryRes -->
|
|
239
|
+
## `TriGeometryRes`
|
|
240
|
+
|
|
241
|
+
Resource record that owns geometry payload facts (meshes, optional skeletons and animations) and LOD-force metadata, while engine packages decide device buffers, vertex declarations, and draw-time state.
|
|
242
|
+
|
|
243
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
244
|
+
- Source: `src/resources/TriGeometryRes.js`
|
|
245
|
+
- Visibility: Public
|
|
246
|
+
- Kind: Adapted Carbon concept
|
|
247
|
+
|
|
248
|
+
<!-- class:TriGeometryResAreaData -->
|
|
249
|
+
## `TriGeometryResAreaData`
|
|
250
|
+
|
|
251
|
+
Data record mirroring Carbon's geometry area block: a named draw range with bounds, joint bindings, skinning/morph flags, and ray-tracing structure references.
|
|
252
|
+
|
|
253
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
254
|
+
- Source: `src/resources/TriGeometryResAreaData.js`
|
|
255
|
+
- Visibility: Public
|
|
256
|
+
- Kind: Faithful Carbon port
|
|
257
|
+
|
|
258
|
+
<!-- class:TriGeometryResJointData -->
|
|
259
|
+
## `TriGeometryResJointData`
|
|
260
|
+
|
|
261
|
+
Data record mirroring Carbon's geometry joint entry: a joint name, parent-joint index, and inverse world transform.
|
|
262
|
+
|
|
263
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
264
|
+
- Source: `src/resources/TriGeometryResJointData.js`
|
|
265
|
+
- Visibility: Public
|
|
266
|
+
- Kind: Faithful Carbon port
|
|
267
|
+
|
|
268
|
+
<!-- class:TriGeometryResLodData -->
|
|
269
|
+
## `TriGeometryResLodData`
|
|
270
|
+
|
|
271
|
+
Data record mirroring Carbon's per-LOD geometry block: mesh reference, naming and screen-size selection data, vertex/primitive counts, UV densities, areas, and buffer-allocation references.
|
|
272
|
+
|
|
273
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
274
|
+
- Source: `src/resources/TriGeometryResLodData.js`
|
|
275
|
+
- Visibility: Public
|
|
276
|
+
- Kind: Faithful Carbon port
|
|
277
|
+
|
|
278
|
+
<!-- class:TriGeometryResMeshData -->
|
|
279
|
+
## `TriGeometryResMeshData`
|
|
280
|
+
|
|
281
|
+
Data record mirroring Carbon's per-mesh geometry block: name, vertex layout facts, bounds, joint bindings, audio geometry, decals, and the LOD list.
|
|
282
|
+
|
|
283
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
284
|
+
- Source: `src/resources/TriGeometryResMeshData.js`
|
|
285
|
+
- Visibility: Public
|
|
286
|
+
- Kind: Faithful Carbon port
|
|
287
|
+
|
|
288
|
+
<!-- class:TriGeometryResSkeletonData -->
|
|
289
|
+
## `TriGeometryResSkeletonData`
|
|
290
|
+
|
|
291
|
+
Data record mirroring Carbon's geometry skeleton block, pairing a skeleton name with its joint list.
|
|
292
|
+
|
|
293
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
294
|
+
- Source: `src/resources/TriGeometryResSkeletonData.js`
|
|
295
|
+
- Visibility: Public
|
|
296
|
+
- Kind: Faithful Carbon port
|
|
297
|
+
|
|
298
|
+
<!-- class:TriGrannyRes -->
|
|
299
|
+
## `TriGrannyRes`
|
|
300
|
+
|
|
301
|
+
Resource that owns lifecycle identity for decoded Granny data attached as a plain payload with models or meshes, keeping reader and engine-specific behavior outside the class.
|
|
302
|
+
|
|
303
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
304
|
+
- Source: `src/resources/TriGrannyRes.js`
|
|
305
|
+
- Visibility: Public
|
|
306
|
+
- Kind: Adapted Carbon concept
|
|
307
|
+
|
|
308
|
+
<!-- class:TriJointBinding -->
|
|
309
|
+
## `TriJointBinding`
|
|
310
|
+
|
|
311
|
+
Data record mirroring Carbon's joint binding: a joint name with its oriented-bounding-box minimum and maximum.
|
|
312
|
+
|
|
313
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
314
|
+
- Source: `src/resources/TriJointBinding.js`
|
|
315
|
+
- Visibility: Public
|
|
316
|
+
- Kind: Faithful Carbon port
|
|
317
|
+
|
|
318
|
+
<!-- class:TriMorphTargetGeometryConstants -->
|
|
319
|
+
## `TriMorphTargetGeometryConstants`
|
|
320
|
+
|
|
321
|
+
Data record mirroring Carbon's morph-target geometry constants: vertex-buffer stride, position/tangent offsets and types, and vertex count.
|
|
322
|
+
|
|
323
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
324
|
+
- Source: `src/resources/TriMorphTargetGeometryConstants.js`
|
|
325
|
+
- Visibility: Public
|
|
326
|
+
- Kind: Faithful Carbon port
|
|
327
|
+
|
|
328
|
+
<!-- class:TriRtGeometryConstants -->
|
|
329
|
+
## `TriRtGeometryConstants`
|
|
330
|
+
|
|
331
|
+
Data record mirroring Carbon's ray-tracing geometry constants: index/vertex buffer ids and strides plus attribute offsets and types.
|
|
332
|
+
|
|
333
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
334
|
+
- Source: `src/resources/TriRtGeometryConstants.js`
|
|
335
|
+
- Visibility: Public
|
|
336
|
+
- Kind: Faithful Carbon port
|
|
337
|
+
|
|
338
|
+
<!-- class:TriTextureRes -->
|
|
339
|
+
## `TriTextureRes`
|
|
340
|
+
|
|
341
|
+
Resource record that owns Carbon-style texture identity and validated texture, RGBA, or video payload facts with mirrored dimension/format metadata, while engine packages decide what those facts become on a device.
|
|
342
|
+
|
|
343
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
344
|
+
- Source: `src/resources/TriTextureRes.js`
|
|
345
|
+
- Visibility: Public
|
|
346
|
+
- Kind: Adapted Carbon concept
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Texture class catalog
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-resource` classes under `src/texture`
|
|
5
|
+
Audience: Users, maintainers, and automated readers
|
|
6
|
+
Summary: Provides one-sentence purpose descriptors for the texture-array aggregation classes in src/texture.
|
|
7
|
+
|
|
8
|
+
<!-- class:CjsTextureArrayRes -->
|
|
9
|
+
## `CjsTextureArrayRes`
|
|
10
|
+
|
|
11
|
+
Mutable runtime aggregate resource for an ordered texture-array request that coalesces per-layer path changes and invalidations so a resource manager or engine scheduler can prepare the corresponding immutable texture-array payload on a later frame.
|
|
12
|
+
|
|
13
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
14
|
+
- Source: `src/texture/CjsTextureArrayRes.js`
|
|
15
|
+
- Visibility: Public
|
|
16
|
+
- Kind: Original CarbonEngineJS class
|
|
17
|
+
|
|
18
|
+
<!-- class:CjsTextureParameterProxy -->
|
|
19
|
+
## `CjsTextureParameterProxy`
|
|
20
|
+
|
|
21
|
+
Texture-parameter facade for one array layer that mirrors the public path API while delegating storage, invalidation, readiness, and adapter ownership to its parent `CjsTextureArrayRes`, carrying no shader metadata or backend objects itself.
|
|
22
|
+
|
|
23
|
+
- Export: `@carbonenginejs/runtime-resource`
|
|
24
|
+
- Source: `src/texture/CjsTextureParameterProxy.js`
|
|
25
|
+
- Visibility: Public
|
|
26
|
+
- Kind: Original CarbonEngineJS class
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Event emitter contract
|
|
2
|
+
|
|
3
|
+
Status: Evolving
|
|
4
|
+
Scope: `@carbonenginejs/runtime-resource`
|
|
5
|
+
Audience: Users and integrators
|
|
6
|
+
Summary: Defines the `CjsEventEmitter` API surface used by resource managers and the memory rules that keep listeners from leaking graphs.
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
`CjsEventEmitter` (from `core-types/model`) is a separate base class so
|
|
11
|
+
non-model runtime services can emit events without extending `CjsModel`;
|
|
12
|
+
`CjsResMan` uses that path. CarbonEngineJS exposes one small event-emitter API
|
|
13
|
+
and avoids short generic names such as `On`, `Once`, `Off`, and `Emit` on
|
|
14
|
+
Carbon-shaped classes. There is no separate resource notification/callback
|
|
15
|
+
compatibility layer beside events, and no listener scopes, subscription
|
|
16
|
+
handles, or owner-side `ListenTo()` helpers.
|
|
17
|
+
|
|
18
|
+
## API
|
|
19
|
+
|
|
20
|
+
- `AddEvents(events)`
|
|
21
|
+
- `OnEvent(eventName, listener, source?)`
|
|
22
|
+
- `OnceEvent(eventName, listener, source?)`
|
|
23
|
+
- `OffEvent(eventName = "*", listener?, source?)`
|
|
24
|
+
- `EmitEvent(eventName, ...args)`
|
|
25
|
+
- `HasEvent(eventName = "*", listener?, source?)`
|
|
26
|
+
- `ClearEvent(eventName = "*")`
|
|
27
|
+
- `GetEventNames()` and `GetEventListenerCount(eventName = "*")`
|
|
28
|
+
|
|
29
|
+
The optional `source` is the callback's `this` value and an explicit matching
|
|
30
|
+
identity for removal. Mutating event methods return the emitter for chaining.
|
|
31
|
+
Event names are normalized to lowercase and dispatched by exact match.
|
|
32
|
+
Wildcard names are accepted only by lookup and cleanup methods; there is no
|
|
33
|
+
wildcard listener dispatch, no `family.event` or ancestor routing, and no
|
|
34
|
+
event payload history. Resource classes may emit their own state or domain
|
|
35
|
+
events, but the emitter does not invent a resource lifecycle contract.
|
|
36
|
+
|
|
37
|
+
## Memory rules
|
|
38
|
+
|
|
39
|
+
Event storage is the optional `events` member of the emitter's non-enumerable
|
|
40
|
+
`__state` object:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
emitter.__state (non-enumerable, allocated only when some subsystem needs it)
|
|
44
|
+
events -> eventName -> Set<listenerRecord>
|
|
45
|
+
|
|
46
|
+
listenerRecord
|
|
47
|
+
emitter
|
|
48
|
+
eventName
|
|
49
|
+
listener
|
|
50
|
+
source
|
|
51
|
+
once
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The event map is created only when the first listener is registered and
|
|
55
|
+
deleted when the last record is removed. That does not make listeners weak:
|
|
56
|
+
as long as an emitter is reachable, its event map strongly references
|
|
57
|
+
listener functions and sources, and those listeners can keep whole
|
|
58
|
+
scene/resource graphs alive. The contract is therefore:
|
|
59
|
+
|
|
60
|
+
- `OnceEvent()` removes the listener on first dispatch, even if the callback
|
|
61
|
+
throws.
|
|
62
|
+
- `OffEvent(eventName, listener, source)` removes the exact listener/source
|
|
63
|
+
entry; `target.OffEvent("*", null, source)` removes all of a source's
|
|
64
|
+
records. An external party that no longer observes a target must call
|
|
65
|
+
`OffEvent()`.
|
|
66
|
+
- `Unload()` and `Purge()` are resource state/cache operations, not an
|
|
67
|
+
implied listener-destruction lifecycle.
|
|
68
|
+
- `OnEvent()` returns the emitter; it does not return unsubscribe closures,
|
|
69
|
+
because those closures create another reference path.
|
|
70
|
+
- Deterministic cleanup is the contract; `WeakRef`/`FinalizationRegistry` may
|
|
71
|
+
help diagnostics but are not a lifecycle mechanism.
|
|
72
|
+
|
|
73
|
+
Multiple listeners on the same event are allowed because each event bucket is
|
|
74
|
+
a set of records. A raw `CjsEventEmitter` does not gain model-owned `dirty`
|
|
75
|
+
or `rebuild` state. The target is "easy to debug, hard to leak": clear
|
|
76
|
+
ownership of who subscribed, who unsubscribes, and which cleanup phase clears
|
|
77
|
+
remaining listeners.
|
|
78
|
+
|
|
79
|
+
## Relationship to model dirty state
|
|
80
|
+
|
|
81
|
+
`CjsModel` has dirty-state helpers (`MarkDirty`, `ClearDirty`, `ConsumeDirty`,
|
|
82
|
+
`GetDirtyNotifications`) for model invalidation. `SetValues()` compares
|
|
83
|
+
incoming values with the current field values and only marks dirty when a
|
|
84
|
+
value actually changes. A plain `MarkDirty()` means broad dirty invalidation;
|
|
85
|
+
it does not request a rebuild, and deferred rebuild reasons belong to the
|
|
86
|
+
independent `model.__state.rebuild` set. That model machinery is not a
|
|
87
|
+
resource lifecycle event system; resource lifecycle events remain a
|
|
88
|
+
resource/resman concern.
|
|
89
|
+
|
|
90
|
+
## Related documentation
|
|
91
|
+
|
|
92
|
+
- [MotherLode identity, cache, and retention](motherlode-cache.md)
|