@plasius/gpu-renderer 0.2.51 → 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/CHANGELOG.md +32 -0
- package/README.md +115 -915
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +17 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/canonical-wavefront-meshes.js +23 -0
package/dist/index.cjs
CHANGED
|
@@ -1595,7 +1595,13 @@ var EXTENSION_TEXTURE_BINDINGS = Object.freeze([
|
|
|
1595
1595
|
["clearcoatNormal", "clearcoat", "clearcoatNormalTexture"],
|
|
1596
1596
|
["transmission", "transmission", "transmissionTexture"],
|
|
1597
1597
|
["sheenColor", "sheen", "sheenColorTexture"],
|
|
1598
|
-
["sheenRoughness", "sheen", "sheenRoughnessTexture"]
|
|
1598
|
+
["sheenRoughness", "sheen", "sheenRoughnessTexture"],
|
|
1599
|
+
["thickness", "volume", "thicknessTexture"],
|
|
1600
|
+
["specular", "specular", "specularTexture"],
|
|
1601
|
+
["specularColor", "specular", "specularColorTexture"],
|
|
1602
|
+
["iridescence", "iridescence", "iridescenceTexture"],
|
|
1603
|
+
["iridescenceThickness", "iridescence", "iridescenceThicknessTexture"],
|
|
1604
|
+
["anisotropy", "anisotropy", "anisotropyTexture"]
|
|
1599
1605
|
]);
|
|
1600
1606
|
function requireArray(value, label) {
|
|
1601
1607
|
if (!Array.isArray(value)) {
|
|
@@ -1617,6 +1623,16 @@ function textureSample(binding, textures, label, extra = {}) {
|
|
|
1617
1623
|
if (!sample) {
|
|
1618
1624
|
throw new Error(`Missing decoded texture sample ${binding.textureId} for ${label}.`);
|
|
1619
1625
|
}
|
|
1626
|
+
if (binding.texCoordSet !== void 0 && binding.texCoordSet !== 0 || sample.texCoord !== void 0 && sample.texCoord !== 0) {
|
|
1627
|
+
throw new Error("Canonical texture sampling supports only UV set 0.");
|
|
1628
|
+
}
|
|
1629
|
+
const transform = binding.transform;
|
|
1630
|
+
if (transform !== void 0) {
|
|
1631
|
+
const identityPair = (value, expected) => value === void 0 || Array.isArray(value) && value.length === 2 && value[0] === expected && value[1] === expected;
|
|
1632
|
+
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) {
|
|
1633
|
+
throw new Error("Canonical texture transforms require upstream application and identity bindings.");
|
|
1634
|
+
}
|
|
1635
|
+
}
|
|
1620
1636
|
const width = Number(sample.width);
|
|
1621
1637
|
const height = Number(sample.height);
|
|
1622
1638
|
const data = sample.data;
|