@plasius/gpu-renderer 0.2.52 → 0.2.53

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
@@ -1499,7 +1499,13 @@ var EXTENSION_TEXTURE_BINDINGS = Object.freeze([
1499
1499
  ["clearcoatNormal", "clearcoat", "clearcoatNormalTexture"],
1500
1500
  ["transmission", "transmission", "transmissionTexture"],
1501
1501
  ["sheenColor", "sheen", "sheenColorTexture"],
1502
- ["sheenRoughness", "sheen", "sheenRoughnessTexture"]
1502
+ ["sheenRoughness", "sheen", "sheenRoughnessTexture"],
1503
+ ["thickness", "volume", "thicknessTexture"],
1504
+ ["specular", "specular", "specularTexture"],
1505
+ ["specularColor", "specular", "specularColorTexture"],
1506
+ ["iridescence", "iridescence", "iridescenceTexture"],
1507
+ ["iridescenceThickness", "iridescence", "iridescenceThicknessTexture"],
1508
+ ["anisotropy", "anisotropy", "anisotropyTexture"]
1503
1509
  ]);
1504
1510
  function requireArray(value, label) {
1505
1511
  if (!Array.isArray(value)) {
@@ -1521,6 +1527,16 @@ function textureSample(binding, textures, label, extra = {}) {
1521
1527
  if (!sample) {
1522
1528
  throw new Error(`Missing decoded texture sample ${binding.textureId} for ${label}.`);
1523
1529
  }
1530
+ if (binding.texCoordSet !== void 0 && binding.texCoordSet !== 0 || sample.texCoord !== void 0 && sample.texCoord !== 0) {
1531
+ throw new Error("Canonical texture sampling supports only UV set 0.");
1532
+ }
1533
+ const transform = binding.transform;
1534
+ if (transform !== void 0) {
1535
+ const identityPair = (value, expected) => value === void 0 || Array.isArray(value) && value.length === 2 && value[0] === expected && value[1] === expected;
1536
+ if (!transform || typeof transform !== "object" || Array.isArray(transform) || Object.keys(transform).some((key) => !["offset", "scale", "rotationRadians"].includes(key)) || !identityPair(transform.offset, 0) || !identityPair(transform.scale, 1) || transform.rotationRadians !== void 0 && transform.rotationRadians !== 0) {
1537
+ throw new Error("Canonical texture transforms require upstream application and identity bindings.");
1538
+ }
1539
+ }
1524
1540
  const width = Number(sample.width);
1525
1541
  const height = Number(sample.height);
1526
1542
  const data = sample.data;