@plasius/gpu-renderer 0.2.52 → 0.2.54
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 +30 -0
- package/README.md +11 -18
- 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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasius/gpu-renderer",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.54",
|
|
4
4
|
"description": "Framework-agnostic WebGPU renderer runtime for Plasius projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"license": "Apache-2.0",
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@plasius/gpu-camera": "^0.1.18",
|
|
56
|
-
"@plasius/gpu-model-core": "^0.
|
|
56
|
+
"@plasius/gpu-model-core": "^0.5.0",
|
|
57
57
|
"@plasius/gpu-shared": "^1.1.1",
|
|
58
58
|
"@plasius/gpu-xr": "^0.1.17",
|
|
59
59
|
"@types/webxr": "^0.5.24"
|
|
@@ -13,6 +13,12 @@ const EXTENSION_TEXTURE_BINDINGS = Object.freeze([
|
|
|
13
13
|
["transmission", "transmission", "transmissionTexture"],
|
|
14
14
|
["sheenColor", "sheen", "sheenColorTexture"],
|
|
15
15
|
["sheenRoughness", "sheen", "sheenRoughnessTexture"],
|
|
16
|
+
["thickness", "volume", "thicknessTexture"],
|
|
17
|
+
["specular", "specular", "specularTexture"],
|
|
18
|
+
["specularColor", "specular", "specularColorTexture"],
|
|
19
|
+
["iridescence", "iridescence", "iridescenceTexture"],
|
|
20
|
+
["iridescenceThickness", "iridescence", "iridescenceThicknessTexture"],
|
|
21
|
+
["anisotropy", "anisotropy", "anisotropyTexture"],
|
|
16
22
|
]);
|
|
17
23
|
|
|
18
24
|
function requireArray(value, label) {
|
|
@@ -38,6 +44,23 @@ function textureSample(binding, textures, label, extra = {}) {
|
|
|
38
44
|
if (!sample) {
|
|
39
45
|
throw new Error(`Missing decoded texture sample ${binding.textureId} for ${label}.`);
|
|
40
46
|
}
|
|
47
|
+
// This boundary supplies only UV0 geometry and has no transform evaluator.
|
|
48
|
+
// Refuse authored interpretations that would otherwise be silently ignored.
|
|
49
|
+
if ((binding.texCoordSet !== undefined && binding.texCoordSet !== 0)
|
|
50
|
+
|| (sample.texCoord !== undefined && sample.texCoord !== 0)) {
|
|
51
|
+
throw new Error("Canonical texture sampling supports only UV set 0.");
|
|
52
|
+
}
|
|
53
|
+
const transform = binding.transform;
|
|
54
|
+
if (transform !== undefined) {
|
|
55
|
+
const identityPair = (value, expected) => value === undefined
|
|
56
|
+
|| (Array.isArray(value) && value.length === 2 && value[0] === expected && value[1] === expected);
|
|
57
|
+
if (!transform || typeof transform !== "object" || Array.isArray(transform)
|
|
58
|
+
|| Object.keys(transform).some(key => !["offset", "scale", "rotationRadians"].includes(key))
|
|
59
|
+
|| !identityPair(transform.offset, 0) || !identityPair(transform.scale, 1)
|
|
60
|
+
|| (transform.rotationRadians !== undefined && transform.rotationRadians !== 0)) {
|
|
61
|
+
throw new Error("Canonical texture transforms require upstream application and identity bindings.");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
41
64
|
const width = Number(sample.width);
|
|
42
65
|
const height = Number(sample.height);
|
|
43
66
|
const data = sample.data;
|