@forgeax/engine-render 0.1.25 → 0.1.27

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 (87) hide show
  1. package/README.md +18 -0
  2. package/dist/assembly/factory.d.ts +1 -1
  3. package/dist/assembly/factory.d.ts.map +1 -1
  4. package/dist/assembly/material/assembly.d.ts +4 -17
  5. package/dist/assembly/material/assembly.d.ts.map +1 -1
  6. package/dist/assembly/material/standard-layer-projection.d.ts.map +1 -1
  7. package/dist/assembly/material/surface-projection.d.ts.map +1 -1
  8. package/dist/assembly/webgpu-renderer.d.ts +0 -1
  9. package/dist/assembly/webgpu-renderer.d.ts.map +1 -1
  10. package/dist/authoring.mjs +1 -1
  11. package/dist/{chunk-JSEDTZYS.mjs → chunk-GF523LHF.mjs} +6 -6
  12. package/dist/chunk-GF523LHF.mjs.map +1 -0
  13. package/dist/{chunk-TCLDX7SZ.mjs → chunk-TMIASV2N.mjs} +403 -457
  14. package/dist/chunk-TMIASV2N.mjs.map +1 -0
  15. package/dist/{chunk-N3RT2EUR.mjs → chunk-XDP6XE5V.mjs} +104 -56
  16. package/dist/chunk-XDP6XE5V.mjs.map +1 -0
  17. package/dist/construct-renderer.mjs +153 -13
  18. package/dist/construct-renderer.mjs.map +1 -1
  19. package/dist/extract/contracts.d.ts +6 -6
  20. package/dist/extract/contracts.d.ts.map +1 -1
  21. package/dist/index.mjs +1 -1
  22. package/dist/internal.mjs +1 -1
  23. package/dist/pipeline-spec-types.d.ts +2 -0
  24. package/dist/pipeline-spec-types.d.ts.map +1 -1
  25. package/dist/pipeline-spec.d.ts.map +1 -1
  26. package/dist/record/frame.d.ts.map +1 -1
  27. package/dist/record/main-pass-geometry.d.ts +2 -2
  28. package/dist/record/main-pass-geometry.d.ts.map +1 -1
  29. package/dist/record/main-pass-material.d.ts +20 -2
  30. package/dist/record/main-pass-material.d.ts.map +1 -1
  31. package/dist/record/main-pass-sprite-draws.d.ts +3 -3
  32. package/dist/record/main-pass-sprite-draws.d.ts.map +1 -1
  33. package/dist/record/main-pass.d.ts.map +1 -1
  34. package/dist/record/material-uniforms.d.ts +4 -0
  35. package/dist/record/material-uniforms.d.ts.map +1 -0
  36. package/dist/record/render-context.d.ts +2 -2
  37. package/dist/record/render-context.d.ts.map +1 -1
  38. package/dist/record/shadow-pass.d.ts +2 -3
  39. package/dist/record/shadow-pass.d.ts.map +1 -1
  40. package/dist/recovery/render-system-candidate.d.ts.map +1 -1
  41. package/dist/render-system-extract-tail.d.ts +2 -0
  42. package/dist/render-system-extract-tail.d.ts.map +1 -1
  43. package/dist/render-system-extract.d.ts +27 -10
  44. package/dist/render-system-extract.d.ts.map +1 -1
  45. package/dist/render-system.d.ts.map +1 -1
  46. package/dist/temporal/index.mjs +2 -2
  47. package/package.json +20 -20
  48. package/src/__tests__/fixtures/ai-weapon-spirit/README.md +20 -0
  49. package/src/__tests__/fixtures/ai-weapon-spirit/low-poly-toon.wgsl +178 -0
  50. package/src/__tests__/fixtures/ai-weapon-spirit/material.json +97 -0
  51. package/src/__tests__/fixtures/ai-weapon-spirit/painterly-surface.wgsl +55 -0
  52. package/src/__tests__/gpu-driven-view-gpu-evidence.ts +3 -3
  53. package/src/__tests__/gpu-driven-view.browser.test.ts +11 -3
  54. package/src/__tests__/material-contract-inventory.unit.test.ts +43 -0
  55. package/src/__tests__/{material-static-dynamic-route.unit.test.ts → material-layer-projection.unit.test.ts} +30 -47
  56. package/src/__tests__/material-program-dispatch.unit.test.ts +48 -0
  57. package/src/__tests__/renderer-factory-material-contract.unit.test.ts +2 -2
  58. package/src/__tests__/skinned-shadow-caster.test.ts +14 -14
  59. package/src/__tests__/surface-variant-provenance.integration.test.ts +1 -1
  60. package/src/assembly/factory.ts +0 -3
  61. package/src/assembly/material/assembly.ts +8 -40
  62. package/src/assembly/material/standard-layer-projection.ts +3 -1
  63. package/src/assembly/material/surface-projection.ts +2 -1
  64. package/src/assembly/webgpu-renderer.ts +17 -9
  65. package/src/extract/contracts.ts +6 -6
  66. package/src/materials.ts +3 -3
  67. package/src/pipeline-spec-types.ts +2 -0
  68. package/src/pipeline-spec.ts +7 -3
  69. package/src/record/__tests__/standard-pbr-ubo-layout.unit.test.ts +68 -1
  70. package/src/record/frame.ts +7 -1
  71. package/src/record/main-pass-geometry.ts +340 -279
  72. package/src/record/main-pass-material.ts +87 -2
  73. package/src/record/main-pass-sprite-draws.ts +65 -168
  74. package/src/record/main-pass.ts +24 -246
  75. package/src/record/material-uniforms.ts +186 -0
  76. package/src/record/render-context.ts +4 -0
  77. package/src/record/shadow-pass.ts +86 -28
  78. package/src/recovery/render-system-candidate.ts +5 -1
  79. package/src/render-system-extract-tail.ts +54 -13
  80. package/src/render-system-extract.ts +103 -64
  81. package/src/render-system.ts +19 -0
  82. package/dist/assembly/material/pipeline-projection.d.ts +0 -30
  83. package/dist/assembly/material/pipeline-projection.d.ts.map +0 -1
  84. package/dist/chunk-JSEDTZYS.mjs.map +0 -1
  85. package/dist/chunk-N3RT2EUR.mjs.map +0 -1
  86. package/dist/chunk-TCLDX7SZ.mjs.map +0 -1
  87. package/src/assembly/material/pipeline-projection.ts +0 -63
@@ -1,63 +0,0 @@
1
- import type { MaterialRuntimeArtifact } from '@forgeax/engine-shader';
2
- import type { MaterialValue } from '@forgeax/engine-types';
3
- import type { MaterialRenderProjection } from './assembly.js';
4
-
5
- export interface MaterialPipelineProjection {
6
- readonly specializationKey: string;
7
- readonly artifactHash: string;
8
- readonly passes: MaterialRenderProjection['passes'];
9
- }
10
-
11
- export interface MaterialPipelineReady extends MaterialPipelineProjection {
12
- readonly kind: 'ready';
13
- readonly artifact: MaterialRuntimeArtifact;
14
- }
15
-
16
- export interface MaterialPipelineMiss {
17
- readonly kind: 'error';
18
- readonly error: {
19
- readonly code: 'material-specialization-not-cooked';
20
- readonly expected: string;
21
- readonly hint: string;
22
- readonly detail: { readonly specializationKey: string };
23
- };
24
- }
25
-
26
- export function projectMaterialPipeline(
27
- projection: MaterialRenderProjection,
28
- ): MaterialPipelineProjection {
29
- return {
30
- specializationKey: projection.specializationKey,
31
- artifactHash: projection.artifactHash,
32
- passes: projection.passes,
33
- };
34
- }
35
-
36
- export function updateMaterialRuntimeValues(
37
- projection: MaterialRenderProjection,
38
- values: Readonly<Record<string, MaterialValue | null>>,
39
- ): MaterialRenderProjection {
40
- return {
41
- ...projection,
42
- runtimeValues: { ...projection.runtimeValues, ...values },
43
- };
44
- }
45
-
46
- export function routeMaterialPipeline(args: {
47
- readonly projection: MaterialRenderProjection;
48
- readonly lookupArtifact: (key: string) => MaterialRuntimeArtifact | undefined;
49
- }): MaterialPipelineReady | MaterialPipelineMiss {
50
- const artifact = args.lookupArtifact(args.projection.specializationKey);
51
- if (artifact === undefined || artifact.digest !== args.projection.artifactHash) {
52
- return {
53
- kind: 'error',
54
- error: {
55
- code: 'material-specialization-not-cooked',
56
- expected: 'a published artifact for the cooked specialization key',
57
- hint: 'cook and publish the material specialization before rendering it',
58
- detail: { specializationKey: args.projection.specializationKey },
59
- },
60
- };
61
- }
62
- return { kind: 'ready', ...projectMaterialPipeline(args.projection), artifact };
63
- }