@forgeax/engine-shader 0.1.23 → 0.1.25

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 (60) hide show
  1. package/README.md +110 -4
  2. package/dist/ShaderRegistry.d.ts.map +1 -1
  3. package/dist/index.d.ts +10 -2
  4. package/dist/index.d.ts.map +1 -1
  5. package/dist/index.mjs +59 -55
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/material/artifact-registry.d.ts +1 -0
  8. package/dist/material/artifact-registry.d.ts.map +1 -1
  9. package/dist/material-schemas.d.ts +31 -0
  10. package/dist/material-schemas.d.ts.map +1 -1
  11. package/package.json +4 -4
  12. package/src/ShaderRegistry.ts +0 -17
  13. package/src/__tests__/builtin-texture-sampling-contract.test.ts +10 -1
  14. package/src/__tests__/default-standard-pbr-alpha.unit.test.ts +9 -3
  15. package/src/__tests__/default-standard-pbr-transmission.unit.test.ts +48 -166
  16. package/src/__tests__/deferred-lighting-ssao.test.ts +7 -4
  17. package/src/__tests__/ibl-irradiance.unit.test.ts +9 -0
  18. package/src/__tests__/lighting-directional.unit.test.ts +36 -0
  19. package/src/__tests__/lighting-punctual.unit.test.ts +12 -4
  20. package/src/__tests__/material-builtins.unit.test.ts +21 -3
  21. package/src/__tests__/material-contract.unit.test.ts +131 -17
  22. package/src/__tests__/physical-clearcoat.unit.test.ts +65 -0
  23. package/src/__tests__/probe-lighting-composition.unit.test.ts +3 -2
  24. package/src/__tests__/shader-manifest-transmission.unit.test.ts +8 -10
  25. package/src/__tests__/shader.unit.test.ts +52 -87
  26. package/src/__tests__/spot-cookie-composition.unit.test.ts +2 -1
  27. package/src/__tests__/standard-pbr-webgl2-interface.unit.test.ts +33 -0
  28. package/src/__tests__/standard-physical-layer.unit.test.ts +16 -0
  29. package/src/__tests__/standard-surface-pass-evaluation.integration.test.ts +38 -0
  30. package/src/__tests__/standard-webgl2-varying-budget.unit.test.ts +17 -0
  31. package/src/__tests__/surface-lighting-provenance.integration.test.ts +59 -0
  32. package/src/__tests__/surface-pass-templates.integration.test.ts +28 -0
  33. package/src/__tests__/surface-v1-negative.unit.test.ts +37 -0
  34. package/src/__tests__/surface-v1.unit.test.ts +83 -0
  35. package/src/__tests__/transmission-thickness-scale.unit.test.ts +2 -6
  36. package/src/__tests__/vertex-color-variant.unit.test.ts +16 -5
  37. package/src/default-standard-pbr-skin.wgsl +704 -192
  38. package/src/default-standard-pbr.wgsl +563 -279
  39. package/src/default_standard_surface.wgsl +88 -0
  40. package/src/hdrp-cluster-forward.wgsl +225 -0
  41. package/src/ibl-irradiance.wgsl +43 -8
  42. package/src/ibl-prefilter.wgsl +13 -3
  43. package/src/ibl-shared.wgsl +9 -2
  44. package/src/index.ts +37 -3
  45. package/src/lighting-directional.wgsl +3 -1
  46. package/src/lighting-spot-modifiers.wgsl +8 -1
  47. package/src/lighting-spot-projector.wgsl +31 -0
  48. package/src/material/artifact-registry.ts +20 -1
  49. package/src/material/artifact-types.ts +2 -2
  50. package/src/material/physical/anisotropy.wgsl +26 -0
  51. package/src/material/physical/clearcoat.wgsl +24 -0
  52. package/src/material/physical/iridescence.wgsl +23 -0
  53. package/src/material/physical/sheen.wgsl +17 -0
  54. package/src/material/standard-physical-layer.wgsl +12 -0
  55. package/src/material-schemas.ts +65 -30
  56. package/src/register-default-standard-pbr-skin.ts +2 -2
  57. package/src/shadow_caster.wgsl +80 -6
  58. package/src/standard-cluster.wgsl +1 -36
  59. package/src/surface_v1.wgsl +26 -0
  60. package/src/unlit.wgsl +12 -0
package/README.md CHANGED
@@ -22,6 +22,82 @@ second manifest or registry.
22
22
  > Runtime 只查找已发布的 content-addressed artifact;恢复沿 producer、cook
23
23
  > 与 catalog 的 owner 边界进行,不在 app 侧复制 shader artifact。
24
24
 
25
+ ## Standard Surface contract
26
+
27
+ Standard material 的作者只需要通过 `#import` 使用
28
+ [`surface_v1.wgsl`](./src/surface_v1.wgsl),并实现唯一的
29
+ `evaluate_surface(SurfaceInput) -> SurfaceData`。`SurfaceData` 是 Standard
30
+ BRDF 的输入,不是最终颜色;Engine-owned Standard pass family 负责顶点、光照、
31
+ 阴影、Forward/Deferred、G-buffer、雾和输出。内建默认值位于
32
+ [`default_standard_surface.wgsl`](./src/default_standard_surface.wgsl)。
33
+
34
+ ### Minimal authoring shape
35
+
36
+ `SurfaceData` is deliberately base-only. Its frozen field order is:
37
+
38
+ | Order | Field | Meaning |
39
+ |:--:|:--|:--|
40
+ | 1 | `baseColor: vec3<f32>` | Base reflectance color |
41
+ | 2 | `normalWS: vec3<f32>` | World-space shading normal |
42
+ | 3 | `metallic: f32` | Metallic factor |
43
+ | 4 | `roughness: f32` | Roughness factor |
44
+ | 5 | `emissive: vec3<f32>` | Emissive contribution |
45
+ | 6 | `occlusion: f32` | Ambient occlusion factor |
46
+ | 7 | `opacity: f32` | Surface opacity |
47
+ | 8 | `alphaClipThreshold: f32` | Alpha-test threshold |
48
+
49
+ ```wgsl
50
+ #import forgeax_material::surface_v1::{SurfaceInput, SurfaceData}
51
+
52
+ fn evaluate_surface(input: SurfaceInput) -> SurfaceData {
53
+ return SurfaceData(
54
+ vec3<f32>(0.45, 0.18, 0.06), input.geometricNormalWS, 0.8, 0.42,
55
+ vec3<f32>(0.0), 1.0, 1.0, 0.5,
56
+ );
57
+ }
58
+ ```
59
+
60
+ The matching TypeScript entry is also import-first: the caller names the
61
+ compiled Surface module and supplies only its parameters and values. The
62
+ Engine still owns stage entry points, bindings, BRDF composition, and pass
63
+ projection.
64
+
65
+ ```ts
66
+ import { Materials } from '@forgeax/engine-render';
67
+
68
+ const rustedIron = Materials.standard({
69
+ surfaceModule: 'game_3d::rusted_iron_surface',
70
+ parameters: [
71
+ { name: 'ironColor', type: 'color' },
72
+ { name: 'rustDark', type: 'color' },
73
+ { name: 'rustBright', type: 'color' },
74
+ { name: 'noiseScale', type: 'f32', default: 1.85 },
75
+ ],
76
+ values: {
77
+ ironColor: [0.4, 0.45, 0.47, 1],
78
+ rustDark: [0.42, 0.085, 0.018, 1],
79
+ rustBright: [0.95, 0.34, 0.055, 1],
80
+ noiseScale: 1.85,
81
+ },
82
+ });
83
+ ```
84
+
85
+ For the complete source-to-runtime example, see the
86
+ [`game-3d` rusted-iron fixture](../../templates/game-3d/README.md#import-first-surface-material-example).
87
+
88
+ > [!CAUTION]
89
+ > Surface is a base-facts function only. Do not add `clearcoat`,
90
+ > `clearcoatRoughness`, other physical-layer fields, stage entries, resource
91
+ > bindings, Engine entry points, or vertex-position mutation. Physical layers
92
+ > and pass admission remain Engine-owned.
93
+
94
+ 渐进导航:`Materials.standard()` → `moduleSlots.surface` → build-time
95
+ `#import` composition / reflection → Pack cook → runtime GUID readiness。
96
+ Surface source 不声明 stage entry、`@group/@binding` 或 vertex mutation;参数
97
+ 资源由同一 `MaterialAsset.parameters` contract 派生。编译或 cook 失败时读取
98
+ `code`、`detail`、`hint`,修复 authored source 或 producer 后重新 cook,不在
99
+ runtime 读取 raw WGSL 或创建 app-local artifact。
100
+
25
101
  > [!IMPORTANT]
26
102
  > A custom material starts as WGSL source plus one `MaterialAsset` contract. The build manifest publishes the composed module and the material cook publishes the resolved record, artifact bytes, references, and receipt. Runtime resolves those facts from the catalog; application code does not install or duplicate shader artifacts. The recovery route is always source or cook repair.
27
103
 
@@ -101,10 +177,19 @@ code-specific `detail` and `hint`:
101
177
  | `shader-module-not-found` | The published module is absent | Add it to the build source catalog and rebuild |
102
178
  | `material-specialization-not-cooked` | No runtime artifact exists for the selection | Run the cook path and publish its record |
103
179
  | `material-specialization-stale-generation` | A dependency changed after cooking | Wait for dependencies to settle and re-cook |
180
+ | `material-surface-slot-missing` | Standard pass has no `surface` module slot | Add the slot to the authored pass and re-cook |
181
+ | `material-surface-abi-mismatch` | Surface export does not match `surface_v1` | Repair `evaluate_surface` signature and re-cook |
182
+ | `material-surface-forbidden-interface` | Surface declares a stage, resource, or vertex mutation | Remove the forbidden interface and re-cook |
183
+ | `material-physical-contract-invalid` | A root physical layer is incomplete or unsupported | Repair the root parameter fragment before composing or cooking |
104
184
 
105
185
  Never hide one of these errors by creating an app-local artifact or changing a
106
186
  demo's material shape.
107
187
 
188
+ For the canonical error detail and executable recovery fields, use
189
+ [`material/errors.ts`](../types/src/material/errors.ts). The producer recovery
190
+ path is `inspect -> repair authored source -> cold-cook -> verify publication`;
191
+ runtime does not reinterpret a Surface error.
192
+
108
193
  ## Temporal-v1 accessor
109
194
 
110
195
  `forgeax_scene_temporal` is the single WGSL accessor ABI for the
@@ -159,13 +244,34 @@ state supplies render inspection and recovery evidence.
159
244
  ## Built-in PBR contract
160
245
 
161
246
  The built-in PBR shader has named coordinate records for base color, metallic
162
- roughness, normal, specular tint, emissive, and occlusion. Each record carries
163
- offset, scale, rotation, coordinate set, and physical extent metadata. The
164
- render package projects the records into the UBO; the shader selects the
165
- declared vertex coordinate input per slot.
247
+ roughness, normal, specular weight/color, emissive, occlusion, transmission,
248
+ and the declared physical texture slots. Each record carries offset, scale,
249
+ rotation, coordinate set, and physical extent metadata. The render package
250
+ projects the records into the UBO; the shader selects the declared vertex
251
+ coordinate input per slot. `specular`/`specularColor` replace the removed
252
+ The former specular-tint vocabulary was removed in one cut; no compatibility alias is supported.
253
+
254
+ Physical layer declarations are lowered from the Standard root contract. The
255
+ compiler appends only authored physical resources after the engine-owned IBL
256
+ and transmission region, so a base-only root has no physical binding or sample
257
+ and retains its Deferred pass. The five glTF extensions use the same schema and
258
+ the same Forward physical evaluator; runtime never compiles or patches this
259
+ layout.
166
260
 
167
261
  ## References
168
262
 
169
263
  - [`@forgeax/engine-types` MaterialAsset](../types/README.md#materialasset-route)
170
264
  - [`@forgeax/engine-pack` cook contract](../pack/README.md#materialasset-cook-contract)
171
265
  - [`MaterialAsset migration`](https://github.com/ForgeaXGame/forgeax-engine-harness/blob/main/docs/material-asset-migration.md)
266
+
267
+ ## Surface authoring checklist
268
+
269
+ - [x] Import `forgeax_material::surface_v1` and return the eight-field `SurfaceData`.
270
+ - [x] Read generated material parameters through `forgeax_material::parameters`.
271
+ - [x] Keep vertex, light, BRDF, pass, binding, and output ownership in Engine modules.
272
+ - [x] Let the root parameter contract determine physical layers and pass admission.
273
+ - [ ] Add an engine entry point or resource binding to a Surface module.
274
+
275
+ The final unchecked item is intentionally forbidden. If an effect needs its own
276
+ entry points or render targets, declare an explicit full-custom material and
277
+ publish its pass/lane provenance instead of disguising it as a Standard Surface.
@@ -1 +1 @@
1
- {"version":3,"file":"ShaderRegistry.d.ts","sourceRoot":"","sources":["../src/ShaderRegistry.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAC1E,OAAO,KAAK,EACV,8BAA8B,EAC9B,aAAa,EACb,gBAAgB,EAChB,+BAA+B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,MAAM,IAAI,YAAY,EAE5B,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,YAAY,CAAC;AAI9D;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,CAAC,IAAI,EAAE;QACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QACtB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;KACrC,GAAG,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;CACpC;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,EAAG,WAAoB,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;CACnD;AAED,+EAA+E;AAC/E,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE,QAAQ,CAAC,qBAAqB,EAAE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QAAQ,GAAG,WAAW,CAAC;IA2C/D;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB,GAAG,IAAI;IAsC7E;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAClB,UAAU,EAAE,MAAM,GACjB,YAAY,CAAC,6BAA6B,EAAE,WAAW,CAAC;IAc3D;;;;OAIG;IACH,yBAAyB,IAAI,gBAAgB,CAAC,MAAM,CAAC;IAIrD,uEAAuE;IACvE,0BAA0B,IAAI,+BAA+B;IAI7D;;;;;;;;;;;OAWG;IACH,6BAA6B,IAAI,gBAAgB,CAAC,2BAA2B,CAAC;CAG/E"}
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ export { err, manifestMalformed, materialShaderNotFound, ok, type Result, type R
5
5
  export { generateLtcTables, hashLtcTable, LTC_SOURCE_PROVENANCE, LTC_TABLE_HASHES, LTC_TABLE_HEIGHT, LTC_TABLE_INPUT_HASHES, LTC_TABLE_WIDTH, LTC_TABLES, } from './ltc/tables.js';
6
6
  export { type MaterialArtifactConflictError, type MaterialArtifactInspection, MaterialArtifactRegistry, type MaterialRuntimeArtifact, } from './material/artifact-registry.js';
7
7
  export { createStandardPbrArtifactReceipt, isMaterialShaderArtifact, type MaterialShaderArtifact, type MaterialShaderArtifactReceipt, type MaterialShaderResourceSlot, type MaterialShaderVertexInput, } from './material/artifact-types.js';
8
- export { DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, DEFAULT_UNLIT_PARAM_SCHEMA, STANDARD_PBR_ALPHA_CUTOFF_DEFAULT, STANDARD_PBR_ARTIFACT_RECEIPT, STANDARD_PBR_SKIN_ARTIFACT_RECEIPT, } from './material-schemas.js';
8
+ export { DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, DEFAULT_UNLIT_PARAM_SCHEMA, STANDARD_BASE_PARAM_SCHEMA, STANDARD_PBR_ALPHA_CUTOFF_DEFAULT, STANDARD_PBR_ARTIFACT_RECEIPT, STANDARD_PBR_SKIN_ARTIFACT_RECEIPT, STANDARD_PHYSICAL_LAYER_PARAM_SCHEMA, STANDARD_PHYSICAL_TEXTURE_FIELDS, STANDARD_PIPELINE_PARAM_SCHEMA, type StandardPhysicalTextureField, standardPhysicalTextureFields, } from './material-schemas.js';
9
9
  export { registerDefaultSpriteLit, type SpriteLitCaps, } from './register-default-sprite-lit.js';
10
10
  export { registerDefaultStandardPbrSkin } from './register-default-standard-pbr-skin.js';
11
11
  export declare const RECT_AREA_LTC_SHADER_MODULE: "forgeax::lighting-rect-area";
@@ -16,13 +16,21 @@ export declare const BUILTIN_MATERIAL_MODULES: {
16
16
  readonly unlit: "forgeax_material::unlit";
17
17
  readonly sprite: "forgeax_material::sprite";
18
18
  };
19
+ /**
20
+ * The engine-owned Standard Surface selected by a built-in Standard material.
21
+ * Keep this explicit in the authored pass so the build-time cooker sees the
22
+ * same slot contract as Materials.standard().
23
+ */
24
+ export declare const DEFAULT_STANDARD_SURFACE_MODULE: "forgeax_material::default_standard_surface";
19
25
  /** Stable build-time module id for the temporal-v1 accessor owner. */
20
26
  export declare const SCENE_DATA_TEMPORAL_V1_SHADER_MODULE: "forgeax_scene_temporal";
21
27
  /**
22
28
  * Material modules whose shader source and parameter contract are owned by
23
29
  * the Engine. They live in the runtime ShaderRegistry, so a Pack containing
24
30
  * one of these materials carries authored values only and does not require a
25
- * project material-cook artifact.
31
+ * project material-cook artifact. A Standard pass with a project Surface slot
32
+ * is deliberately excluded: its root composition is project-owned and must
33
+ * arrive with a cooked material publication.
26
34
  */
27
35
  export declare const ENGINE_MATERIAL_MODULES: readonly ["forgeax::default-standard-pbr", "forgeax::pbr-skin", "forgeax::default-standard-pbr-skin", "forgeax::default-unlit", "forgeax::default-shadow-caster", "forgeax::sprite", "forgeax::sprite-lit", "forgeax::msdf-text", "forgeax_material::standard", "forgeax_material::unlit", "forgeax_material::sprite", "forgeax_material::sprite-lit"];
28
36
  /** Names of the zero-binding Standard reflection-probe shader helpers. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAsBA,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAE7E,OAAO,KAAK,EAAE,aAAa,EAAoC,MAAM,uBAAuB,CAAC;AAG7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EACL,GAAG,EACH,iBAAiB,EACjB,sBAAsB,EACtB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,QAAQ,EACb,WAAW,EACX,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,cAAc,GACf,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,sBAAsB,EACtB,eAAe,EACf,UAAU,GACX,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,wBAAwB,EACxB,KAAK,uBAAuB,GAC7B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,gCAAgC,EAChC,wBAAwB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,GAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,0BAA0B,EAC1B,iCAAiC,EACjC,6BAA6B,EAC7B,kCAAkC,GACnC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,EACxB,KAAK,aAAa,GACnB,MAAM,kCAAkC,CAAC;AA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BAAoB,EACzB,KAAK,oBAAoB,IAAI,mBAAmB,EAChD,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,IAAI,oBAAoB,GACnD,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,GACnC,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,wBAAwB;;;;CAI3B,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,EAC1C,4CAAqD,CAAC;AAExD,sEAAsE;AACtE,eAAO,MAAM,oCAAoC,EAAG,wBAAiC,CAAC;AAEtF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,wVAa1B,CAAC;AAEX,0EAA0E;AAC1E,eAAO,MAAM,+BAA+B,2DAGjC,CAAC;AAEZ,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,GAAG,OAAO,CAWjF;AAED,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,wBAAwB,CAAC;AA0BxE,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,mBAAmB,GAAG,aAAa,CAiBnF;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,yBAAyB,UAAO,CAAC;AAE9C,OAAO,EAAE,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,cAAc,CAAC"}
package/dist/index.mjs CHANGED
@@ -1,14 +1,16 @@
1
- import { ok, err, ParamSchemaProjectionOwner, findUndeclaredSampledTextures } from '@forgeax/engine-types';
2
- export { MATERIAL_PARAM_TYPES } from '@forgeax/engine-types';
1
+ import { STANDARD_MATERIAL_PARAM_SCHEMA, STANDARD_PHYSICAL_PARAMETER_NAMES, ok, err, ParamSchemaProjectionOwner, findUndeclaredSampledTextures } from '@forgeax/engine-types';
2
+ export { MATERIAL_PARAM_TYPES, STANDARD_PHYSICAL_TEXTURE_FIELDS, standardPhysicalTextureFields } from '@forgeax/engine-types';
3
3
  import { ok as ok$1, err as err$1 } from '@forgeax/engine-rhi';
4
4
  export { err, ok } from '@forgeax/engine-rhi';
5
5
 
6
+ // src/material-schemas.ts
7
+
6
8
  // src/material/artifact-types.ts
7
9
  var STANDARD_PBR_TEXTURES = [
8
10
  "baseColorTexture",
9
11
  "metallicRoughnessTexture",
10
12
  "normalTexture",
11
- "specularTintTexture",
13
+ "specularColorTexture",
12
14
  "emissiveTexture",
13
15
  "occlusionTexture",
14
16
  "transmissionTexture",
@@ -28,7 +30,7 @@ var STANDARD_PBR_NUMERIC_FIELDS = [
28
30
  "alphaCutoff",
29
31
  "clearcoat",
30
32
  "clearcoatRoughness",
31
- "specularTint",
33
+ "specularColor",
32
34
  "normalScale",
33
35
  "transmission",
34
36
  "ior",
@@ -91,39 +93,27 @@ function isMaterialShaderArtifact(value) {
91
93
  const artifact = value;
92
94
  return typeof artifact.material === "string" && typeof artifact.pass === "string" && typeof artifact.wgsl === "string" && typeof artifact.layoutIdentity === "string" && Array.isArray(artifact.bindings) && Array.isArray(artifact.deps) && Array.isArray(artifact.vertexInputs);
93
95
  }
94
-
95
- // src/material-schemas.ts
96
96
  var STANDARD_PBR_ALPHA_CUTOFF_DEFAULT = 0;
97
- var DEFAULT_STANDARD_PBR_PARAM_SCHEMA = [
98
- { name: "baseColor", type: "color", default: [1, 1, 1, 1] },
99
- { name: "metallic", type: "f32", default: 0 },
100
- { name: "roughness", type: "f32", default: 0.5 },
101
- { name: "metallicChannel", type: "f32", default: 2 },
102
- { name: "roughnessChannel", type: "f32", default: 1 },
103
- { name: "aoChannel", type: "f32", default: 0 },
104
- { name: "extraChannel", type: "f32", default: 0 },
105
- { name: "emissive", type: "vec3", colorSpace: "srgb", default: [0, 0, 0] },
106
- { name: "emissiveIntensity", type: "f32", default: 0 },
107
- { name: "occlusionStrength", type: "f32", default: 1 },
108
- { name: "alphaCutoff", type: "f32", default: STANDARD_PBR_ALPHA_CUTOFF_DEFAULT },
109
- { name: "clearcoat", type: "f32", default: 0 },
110
- { name: "clearcoatRoughness", type: "f32", default: 0.5 },
111
- { name: "specularTint", type: "vec3", colorSpace: "srgb", default: [1, 1, 1] },
112
- { name: "normalScale", type: "f32", default: 1 },
113
- { name: "transmission", type: "f32", default: 0 },
114
- { name: "ior", type: "f32", default: 1.5 },
115
- { name: "thickness", type: "f32", default: 0 },
116
- { name: "attenuationColor", type: "vec3", colorSpace: "linear", default: [1, 1, 1] },
117
- { name: "attenuationDistance", type: "f32" },
118
- { name: "baseColorTexture", type: "texture2d" },
119
- { name: "metallicRoughnessTexture", type: "texture2d" },
120
- { name: "normalTexture", type: "texture2d" },
121
- { name: "specularTintTexture", type: "texture2d" },
122
- { name: "emissiveTexture", type: "texture2d" },
123
- { name: "occlusionTexture", type: "texture2d" },
124
- { name: "transmissionTexture", type: "texture2d" },
125
- { name: "thicknessTexture", type: "texture2d" }
126
- ];
97
+ var DEFAULT_STANDARD_PBR_PARAM_SCHEMA = STANDARD_MATERIAL_PARAM_SCHEMA;
98
+ var STANDARD_PHYSICAL_LAYER_PARAM_SCHEMA = DEFAULT_STANDARD_PBR_PARAM_SCHEMA.filter(
99
+ (entry) => STANDARD_PHYSICAL_PARAMETER_NAMES.has(entry.name)
100
+ );
101
+ var STANDARD_BASE_PARAM_SCHEMA = DEFAULT_STANDARD_PBR_PARAM_SCHEMA.filter(
102
+ (entry) => !STANDARD_PHYSICAL_PARAMETER_NAMES.has(entry.name) && ![
103
+ "transmission",
104
+ "thickness",
105
+ "attenuationColor",
106
+ "attenuationDistance",
107
+ "transmissionTexture",
108
+ "thicknessTexture"
109
+ ].includes(entry.name)
110
+ );
111
+ var STANDARD_PIPELINE_PARAM_SCHEMA = DEFAULT_STANDARD_PBR_PARAM_SCHEMA.filter(
112
+ // The canonical Standard UBO keeps every numeric root coordinate,
113
+ // including the physical-layer tail. Physical map pairs are engine-owned
114
+ // resources and are injected after the stable user region.
115
+ (entry) => !(STANDARD_PHYSICAL_PARAMETER_NAMES.has(entry.name) && entry.type.startsWith("texture"))
116
+ );
127
117
  var STANDARD_PBR_ARTIFACT_RECEIPT = createStandardPbrArtifactReceipt();
128
118
  var STANDARD_PBR_SKIN_ARTIFACT_RECEIPT = createStandardPbrArtifactReceipt(true);
129
119
  var DEFAULT_UNLIT_PARAM_SCHEMA = [
@@ -33116,18 +33106,35 @@ function hashLtcTable(table) {
33116
33106
  function equalBytes(left, right) {
33117
33107
  return left.length === right.length && left.every((value, index) => value === right[index]);
33118
33108
  }
33109
+ function equalParamSchema(left, right) {
33110
+ return JSON.stringify(left.metadata?.paramSchema) === JSON.stringify(right.metadata?.paramSchema);
33111
+ }
33119
33112
  var MaterialArtifactRegistry = class {
33120
33113
  #artifacts = /* @__PURE__ */ new Map();
33121
33114
  register(artifact) {
33122
33115
  const previous = this.#artifacts.get(artifact.key);
33123
33116
  if (previous !== void 0) {
33124
- if (equalBytes(previous.bytes, artifact.bytes)) return ok(previous);
33117
+ if (equalBytes(previous.bytes, artifact.bytes)) {
33118
+ if (equalParamSchema(previous, artifact)) return ok(previous);
33119
+ return err({
33120
+ code: "material-artifact-conflict",
33121
+ expected: "one immutable parameter schema per specialization key",
33122
+ hint: "re-cook the conflicting specialization with one canonical parameter schema",
33123
+ detail: {
33124
+ key: artifact.key,
33125
+ dimension: "param-schema",
33126
+ ...previous.digest ? { existingDigest: previous.digest } : {},
33127
+ ...artifact.digest ? { incomingDigest: artifact.digest } : {}
33128
+ }
33129
+ });
33130
+ }
33125
33131
  return err({
33126
33132
  code: "material-artifact-conflict",
33127
33133
  expected: "one immutable artifact byte sequence per specialization key",
33128
33134
  hint: "re-cook the conflicting specialization and publish one artifact digest",
33129
33135
  detail: {
33130
33136
  key: artifact.key,
33137
+ dimension: "bytes",
33131
33138
  ...previous.digest ? { existingDigest: previous.digest } : {},
33132
33139
  ...artifact.digest ? { incomingDigest: artifact.digest } : {}
33133
33140
  }
@@ -33166,7 +33173,7 @@ var RESERVED_ID2 = "forgeax::pbr-skin";
33166
33173
  function registerDefaultStandardPbrSkin(registry, composedWgsl, caps) {
33167
33174
  registry.installMaterialArtifact(RESERVED_ID2, {
33168
33175
  source: composedWgsl,
33169
- paramSchema: DEFAULT_STANDARD_PBR_PARAM_SCHEMA
33176
+ paramSchema: STANDARD_PIPELINE_PARAM_SCHEMA
33170
33177
  });
33171
33178
  }
33172
33179
  var FORGEAX_RESERVED_PATH_PREFIX = "forgeax::";
@@ -33343,20 +33350,6 @@ var ShaderRegistry = class {
33343
33350
  }
33344
33351
  variantKeys.add(variant.definesKey);
33345
33352
  }
33346
- if (ms.identifier === "forgeax::default-standard-pbr") {
33347
- const transmissionStates = new Set(
33348
- ms.variants.filter((variant) => "TRANSMISSION_AVAILABLE" in variant.defines).map((variant) => variant.defines.TRANSMISSION_AVAILABLE)
33349
- );
33350
- if (!transmissionStates.has(false) || !transmissionStates.has(true)) {
33351
- return err$1(
33352
- manifestMalformed({
33353
- message: "ShaderRegistry: Standard material shader is missing a transmission variant state",
33354
- hint: "forgeax::default-standard-pbr must declare TRANSMISSION_AVAILABLE=false and true",
33355
- reason: `declared transmission states: ${JSON.stringify([...transmissionStates])}`
33356
- })
33357
- );
33358
- }
33359
- }
33360
33353
  validatedMaterialShaderEntries.push(ms);
33361
33354
  }
33362
33355
  }
@@ -33609,6 +33602,7 @@ var BUILTIN_MATERIAL_MODULES = {
33609
33602
  unlit: "forgeax_material::unlit",
33610
33603
  sprite: "forgeax_material::sprite"
33611
33604
  };
33605
+ var DEFAULT_STANDARD_SURFACE_MODULE = "forgeax_material::default_standard_surface";
33612
33606
  var SCENE_DATA_TEMPORAL_V1_SHADER_MODULE = "forgeax_scene_temporal";
33613
33607
  var ENGINE_MATERIAL_MODULES = [
33614
33608
  "forgeax::default-standard-pbr",
@@ -33633,7 +33627,9 @@ function isEngineMaterialModule(module) {
33633
33627
  }
33634
33628
  function isEngineMaterial(material) {
33635
33629
  const passes = material.passes ?? [];
33636
- return passes.length > 0 && passes.every((pass) => isEngineMaterialModule(pass.program.module));
33630
+ return passes.length > 0 && passes.every(
33631
+ (pass) => isEngineMaterialModule(pass.program.module) && (pass.program.moduleSlots?.surface === void 0 || pass.program.moduleSlots.surface === DEFAULT_STANDARD_SURFACE_MODULE)
33632
+ );
33637
33633
  }
33638
33634
  var BUILTIN_PARAMETERS = {
33639
33635
  standard: [
@@ -33658,13 +33654,21 @@ var BUILTIN_VALUES = {
33658
33654
  function createBuiltinMaterialAsset(kind) {
33659
33655
  return {
33660
33656
  kind: "material",
33661
- passes: [{ name: "forward", program: { module: BUILTIN_MATERIAL_MODULES[kind] } }],
33657
+ passes: [
33658
+ {
33659
+ name: "forward",
33660
+ program: {
33661
+ module: BUILTIN_MATERIAL_MODULES[kind],
33662
+ ...kind === "standard" ? { moduleSlots: { surface: DEFAULT_STANDARD_SURFACE_MODULE } } : {}
33663
+ }
33664
+ }
33665
+ ],
33662
33666
  parameters: BUILTIN_PARAMETERS[kind],
33663
33667
  values: BUILTIN_VALUES[kind]
33664
33668
  };
33665
33669
  }
33666
33670
  var TONEMAP_LUMINANCE_EPSILON = 1e-5;
33667
33671
 
33668
- export { BUILTIN_MATERIAL_MODULES, DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, DEFAULT_UNLIT_PARAM_SCHEMA, ENGINE_MATERIAL_MODULES, FORGEAX_RESERVED_PATH_PREFIX, LTC_SOURCE_PROVENANCE, LTC_TABLES, LTC_TABLE_HASHES, LTC_TABLE_HEIGHT, LTC_TABLE_INPUT_HASHES, LTC_TABLE_WIDTH, MaterialArtifactRegistry, RECT_AREA_LTC_SHADER_MODULE, REFLECTION_PROBE_SHADER_HELPERS, SCENE_DATA_TEMPORAL_V1_SHADER_MODULE, STANDARD_PBR_ALPHA_CUTOFF_DEFAULT, STANDARD_PBR_ARTIFACT_RECEIPT, STANDARD_PBR_SKIN_ARTIFACT_RECEIPT, ShaderRegistry as ShaderCatalog, ShaderError, ShaderRegistry, TONEMAP_LUMINANCE_EPSILON, TONEMAP_SHADER_MODE, createBuiltinMaterialAsset, createStandardPbrArtifactReceipt, findVariantByKey, generateLtcTables, hashLtcTable, isEngineMaterial, isEngineMaterialModule, isMaterialShaderArtifact, manifestMalformed, materialShaderNotFound, registerDefaultSpriteLit, registerDefaultStandardPbrSkin, shaderNotFound };
33672
+ export { BUILTIN_MATERIAL_MODULES, DEFAULT_MSDF_TEXT_PARAM_SCHEMA, DEFAULT_SPRITE_PARAM_SCHEMA, DEFAULT_STANDARD_PBR_PARAM_SCHEMA, DEFAULT_STANDARD_SURFACE_MODULE, DEFAULT_UNLIT_PARAM_SCHEMA, ENGINE_MATERIAL_MODULES, FORGEAX_RESERVED_PATH_PREFIX, LTC_SOURCE_PROVENANCE, LTC_TABLES, LTC_TABLE_HASHES, LTC_TABLE_HEIGHT, LTC_TABLE_INPUT_HASHES, LTC_TABLE_WIDTH, MaterialArtifactRegistry, RECT_AREA_LTC_SHADER_MODULE, REFLECTION_PROBE_SHADER_HELPERS, SCENE_DATA_TEMPORAL_V1_SHADER_MODULE, STANDARD_BASE_PARAM_SCHEMA, STANDARD_PBR_ALPHA_CUTOFF_DEFAULT, STANDARD_PBR_ARTIFACT_RECEIPT, STANDARD_PBR_SKIN_ARTIFACT_RECEIPT, STANDARD_PHYSICAL_LAYER_PARAM_SCHEMA, STANDARD_PIPELINE_PARAM_SCHEMA, ShaderRegistry as ShaderCatalog, ShaderError, ShaderRegistry, TONEMAP_LUMINANCE_EPSILON, TONEMAP_SHADER_MODE, createBuiltinMaterialAsset, createStandardPbrArtifactReceipt, findVariantByKey, generateLtcTables, hashLtcTable, isEngineMaterial, isEngineMaterialModule, isMaterialShaderArtifact, manifestMalformed, materialShaderNotFound, registerDefaultSpriteLit, registerDefaultStandardPbrSkin, shaderNotFound };
33669
33673
  //# sourceMappingURL=index.mjs.map
33670
33674
  //# sourceMappingURL=index.mjs.map