@plasius/gpu-renderer 0.2.55 → 0.2.56

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/dist/index.js CHANGED
@@ -1558,14 +1558,6 @@ function textureSample(binding, textures, label, extra = {}) {
1558
1558
  }
1559
1559
  function cloneMaterialExtensions(material, textures) {
1560
1560
  const extensions = { ...material.extensions ?? {} };
1561
- if (material.workflow === "unlit") {
1562
- const unlitKey = "KHR_materials_unlit";
1563
- const unlitValue = extensions[unlitKey] ?? extensions.unlit ?? {};
1564
- if (typeof unlitValue !== "object" || unlitValue === null || Array.isArray(unlitValue)) {
1565
- throw new TypeError(`Canonical material extension ${unlitKey} must be an object.`);
1566
- }
1567
- extensions[unlitKey] = { ...unlitValue, enabled: true };
1568
- }
1569
1561
  for (const [bindingName, extensionName, textureKey] of EXTENSION_TEXTURE_BINDINGS) {
1570
1562
  const binding = material.textures?.[bindingName];
1571
1563
  if (!binding) {
@@ -1590,7 +1582,10 @@ function mapMaterial(material, materialRefId, textures) {
1590
1582
  if (material.alphaMode === "mask") {
1591
1583
  throw new Error("Canonical alphaMode mask is unsupported by WavefrontMeshInput.");
1592
1584
  }
1593
- if (material.workflow !== "metallic-roughness" && material.workflow !== "unlit") {
1585
+ if (material.workflow === "unlit" || Object.hasOwn(material.extensions ?? {}, "KHR_materials_unlit") || Object.hasOwn(material.extensions ?? {}, "unlit")) {
1586
+ throw new Error("Canonical unlit materials are unsupported by WavefrontMeshInput; retain an unlit-capable rendering path.");
1587
+ }
1588
+ if (material.workflow !== "metallic-roughness") {
1594
1589
  throw new Error(`Unsupported canonical material workflow: ${material.workflow}.`);
1595
1590
  }
1596
1591
  const mapped = {