@carbonenginejs/runtime 0.1.0-alpha.2 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/global/model/CjsModel.js +3 -1
  2. package/dist/global/model/CjsModel.js.map +1 -1
  3. package/dist/global/model/document/CjsDocumentHydrator.js +5 -1
  4. package/dist/global/model/document/CjsDocumentHydrator.js.map +1 -1
  5. package/dist/global/schema/CjsSchema.js +98 -18
  6. package/dist/global/schema/CjsSchema.js.map +1 -1
  7. package/dist/global/schema/hydration.js +10 -8
  8. package/dist/global/schema/hydration.js.map +1 -1
  9. package/dist/index.js +2 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/resource/CjsResMan.js +177 -4
  12. package/dist/resource/CjsResMan.js.map +1 -1
  13. package/dist/resource/format/CjsBlueReader.js +8 -1
  14. package/dist/resource/format/CjsBlueReader.js.map +1 -1
  15. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js +7 -1
  16. package/dist/resource/formats/webgl/core/glsl/DxbcGlslEmitter.js.map +1 -1
  17. package/dist/resource/index.js +2 -0
  18. package/dist/resource/index.js.map +1 -1
  19. package/dist/resource/texture/SolidColorTextureConstructor.js +46 -0
  20. package/dist/resource/texture/SolidColorTextureConstructor.js.map +1 -0
  21. package/dist/resource/texture/TriTextureRes.js +43 -0
  22. package/dist/resource/texture/TriTextureRes.js.map +1 -1
  23. package/dist/resource/texture/index.js +2 -0
  24. package/dist/resource/texture/index.js.map +1 -1
  25. package/dist/resource/texture/solidColorTexture.js +111 -0
  26. package/dist/resource/texture/solidColorTexture.js.map +1 -0
  27. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js +19 -8
  28. package/dist/trinity/eve/attachment/decal/EveSpaceObjectDecal.js.map +1 -1
  29. package/dist/trinity/eve/child/EveChildMesh.js +17 -3
  30. package/dist/trinity/eve/child/EveChildMesh.js.map +1 -1
  31. package/dist/trinity/eve/locator/EveLocatorSets.js +12 -3
  32. package/dist/trinity/eve/locator/EveLocatorSets.js.map +1 -1
  33. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js +15 -2
  34. package/dist/trinity/eve/spaceObject/EveSpaceObject2.js.map +1 -1
  35. package/dist/trinity/eve/spaceObject/IEveSpaceObject2ParentData.js +44 -52
  36. package/dist/trinity/eve/spaceObject/IEveSpaceObject2ParentData.js.map +1 -1
  37. package/docs/resource/concepts/resource-lifecycle.md +10 -8
  38. package/docs/resource/formats/geometry-interchange.md +50 -0
  39. package/docs/resource/formats/webgl/decl-io.md +241 -397
  40. package/docs/resource/formats/webgl/memory-structured.md +91 -128
  41. package/docs/resource/formats/webgl/texture-sample.md +306 -469
  42. package/docs/resource/reference/classes/texture.md +11 -1
  43. package/docs/resource/reference/motherlode-cache.md +24 -11
  44. package/docs/resource/reference/queues.md +23 -1
  45. package/package.json +1 -1
@@ -3,7 +3,7 @@
3
3
  Status: Evolving
4
4
  Scope: `@carbonenginejs/runtime/resource` classes under `src/resource/texture`
5
5
  Audience: Users, maintainers, and automated readers
6
- Summary: Provides one-sentence purpose descriptors for the texture-array aggregation classes in src/resource/texture.
6
+ Summary: Provides one-sentence purpose descriptors for the texture-array aggregation and procedural texture constructor classes in src/resource/texture.
7
7
 
8
8
  <!-- class:CjsTextureArrayRes -->
9
9
  ## `CjsTextureArrayRes`
@@ -24,3 +24,13 @@ Mutable runtime aggregate resource for an ordered texture-array request that coa
24
24
  - Source: `src/resource/texture/CjsTextureArrayResParameterProxy.js`
25
25
  - Visibility: Public
26
26
  - Kind: Original CarbonEngineJS class
27
+
28
+ <!-- class:SolidColorTextureConstructor -->
29
+ ## `SolidColorTextureConstructor`
30
+
31
+ Carbon's `dynamic:/color` resource constructor, which builds the 1x1 `TriTextureRes` a `dynamic:/color/r,g,b,a` path names and is registered on a manager through `RegisterSolidColorTexture`.
32
+
33
+ - Export: `@carbonenginejs/runtime/resource`
34
+ - Source: `src/resource/texture/SolidColorTextureConstructor.js`
35
+ - Visibility: Public
36
+ - Kind: Faithful Carbon port
@@ -1,7 +1,7 @@
1
1
  # MotherLode identity, cache, and retention
2
2
 
3
3
  Status: Evolving
4
- Scope: `@carbonenginejs/runtime/resource`
4
+ Scope: `@carbonenginejs/runtime/resource`
5
5
  Audience: Users and integrators
6
6
  Summary: Defines canonical resource identity, ownership and replacement, the recorded-byte cache, payload retention, read-cache provenance, and purge contracts.
7
7
 
@@ -49,9 +49,9 @@ byte pressure.
49
49
  `PURGED` is not terminal for the handle. Purge deletes the payload, but the
50
50
  handle revives itself: `IsGood()` renews activity through `KeepAlive()`, and
51
51
  `KeepAlive()` reloads a purged resource along the ordinary first-load path. A
52
- consumer can recover through ordinary liveness checks: asking whether the
53
- resource is good keeps it or brings it back. Purge remains observable through
54
- `IsPurged()` and resource events; callers may also manage retention explicitly.
52
+ consumer can recover through ordinary liveness checks: asking whether the
53
+ resource is good keeps it or brings it back. Purge remains observable through
54
+ `IsPurged()` and resource events; callers may also manage retention explicitly.
55
55
 
56
56
  Liveness follows visibility. Something being drawn is asked about every frame
57
57
  and stays live; something that stops being drawn stops being renewed, ages out,
@@ -77,7 +77,7 @@ weak-reference and refcount transitions. JavaScript cannot reproduce that
77
77
  ownership test reliably, so `CjsMotherLode` budgets only entries that a caller
78
78
  explicitly classifies with `{ cached: true, bytes }`; JavaScript reachability
79
79
  is never inferred. The byte value is an exact caller-supplied safe-integer
80
- eviction weight, not a heuristic walk of the resource graph; the resource layer
80
+ eviction weight, not a heuristic walk of the resource graph; the resource layer
81
81
  does not walk arbitrary cyclic/shared object graphs or invoke payload getters
82
82
  to guess size.
83
83
 
@@ -99,11 +99,11 @@ remaining over-budget state. Trimming never reads, prepares, or reloads data.
99
99
 
100
100
  ## Payload retention
101
101
 
102
- Readers and converters return plain transient payloads, not resource classes
103
- or DTO models. Payloads may exceed a consumer's needs: each resource validates
104
- required fields before publication and retains needed scalars and references;
105
- adapters may retain additional references in adapter-owned state. Prefer referencing payload-owned
106
- typed arrays to copying them merely to change ownership.
102
+ Readers and converters return plain transient payloads, not resource classes
103
+ or DTO models. Payloads may exceed a consumer's needs: each resource validates
104
+ required fields before publication and retains needed scalars and references;
105
+ adapters may retain additional references in adapter-owned state. Prefer referencing payload-owned
106
+ typed arrays to copying them merely to change ownership.
107
107
 
108
108
  The lifecycle treats resource residency and payload residency independently:
109
109
 
@@ -178,9 +178,22 @@ WebGPU adapters side by side should normally pass the same payload to both
178
178
  consumers and retain it until both have finished. Copying is an explicit
179
179
  consumer operation, justified when a consumer must mutate data, transfer and
180
180
  detach an `ArrayBuffer`, or retain an independently writable snapshot. The
181
- consumer should copy only the fields it requires; the resource layer does not
181
+ consumer should copy only the fields it requires; the resource layer does not
182
182
  automatically deep-clone payload or typed-array bundles.
183
183
 
184
+ One kind of route is the exception, because it hands out objects rather than
185
+ data. An OBJECT-mode extension route that hydrates a `Target` (or an `Identify`
186
+ result) follows Carbon's `BlueResMan::LoadObject`, which caches a builder and
187
+ creates a new object on every call. Its payload is the decoded plain values,
188
+ and every `GetObject()`, `LoadObject()`, `FetchObject()` and `Ready()` caller
189
+ receives its own object hydrated from a structured copy of them, so no two
190
+ callers share a nested array or typed array. Nothing is re-read. Callers
191
+ joining an in-flight load also receive their own object, so for these routes
192
+ the operation's promise is not shared. Values that cannot be structured-copied
193
+ fail the load with `CJS_RESOURCE_EXTENSION_TARGET_FAILED`. Routes without a
194
+ Target, RESOURCE-mode routes, and `Identify` results of `true` keep the shared
195
+ read-only rule above.
196
+
184
197
  ## Read-cache provenance
185
198
 
186
199
  Source and parsed-format caches use explicit provenance, separate from
@@ -1,7 +1,7 @@
1
1
  # Queues, publication, and the Wait fence
2
2
 
3
3
  Status: Evolving
4
- Scope: `@carbonenginejs/runtime/resource`
4
+ Scope: `@carbonenginejs/runtime/resource`
5
5
  Audience: Users and integrators
6
6
  Summary: Defines the two manager-owned queues, publication budgeting, registration, and the `Wait()` fence semantics.
7
7
 
@@ -197,6 +197,28 @@ the same registered constructor.
197
197
  `RegisterObjectLoader` remains the direct legacy byte-to-value registration for
198
198
  an extension without an explicit route.
199
199
 
200
+ ## Dynamic resources
201
+
202
+ A `dynamic:/<name>/<query>` path is built by a registered constructor rather
203
+ than read from a source, as in Carbon's `BlueResMan::GetResourceHelper`.
204
+ `RegisterResourceConstructor(name, constructor)` registers an object whose
205
+ `GetResource(query)` returns a resource; names are lowercased, and
206
+ `UnregisterResourceConstructor(name)` removes one. The lookup sits below the
207
+ MotherLode lookup, so identical queries share one resource, and the resource is
208
+ inserted not cacheable (Carbon's `CACHING_NOT_ALLOWED`). A dynamic resource never
209
+ falls back to a source read. An unknown name raises
210
+ `CJS_RESMAN_DYNAMIC_CONSTRUCTOR_MISSING`, a constructor that returns no resource
211
+ raises `CJS_RESMAN_DYNAMIC_RESOURCE_UNAVAILABLE`, and `GetObject()` on a dynamic
212
+ resource without a payload rejects with that resource's error.
213
+
214
+ `RegisterSolidColorTexture(resMan)` registers Carbon's `color` constructor. It is
215
+ an explicit composition call, like `RegisterShaderResources`, rather than
216
+ Carbon's static registration. `dynamic:/color/r,g,b,a` is a 1x1 `TriTextureRes`
217
+ whose `rgba32float` payload holds the colour quantized through the half-float
218
+ codec, parsed exactly as Carbon's `ParseColor`; a malformed query fails the
219
+ texture with `CJS_TEXTURE_PROCEDURAL_PATH_INVALID`. The WebGPU device does not
220
+ yet upload `rgba32float` payloads, and `dynamic:/gradient_1d/` is not ported.
221
+
200
222
  ## Related documentation
201
223
 
202
224
  - [Resource lifecycle concepts](../concepts/resource-lifecycle.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carbonenginejs/runtime",
3
- "version": "0.1.0-alpha.2",
3
+ "version": "0.1.0-alpha.3",
4
4
  "private": false,
5
5
  "description": "Browser-safe CarbonEngineJS runtime: resource and format readers, the Trinity/EVE object graph, SOF, audio, character, and the WebGPU renderer.",
6
6
  "type": "module",