@bendyline/molen-client 0.0.5 → 0.0.6

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 (2) hide show
  1. package/dist/index.mjs +19 -0
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -1170,6 +1170,7 @@ function textureFrom(image, filter, srgb) {
1170
1170
  /** Upload a BakedMaterial's slots onto a MeshStandardMaterial. */
1171
1171
  function materialFromBaked(baked) {
1172
1172
  for (const image of Object.values(baked.slots)) if (image !== void 0) validateImage(image);
1173
+ if (baked.meta.alphaCoverage && (baked.meta.alphaTest !== void 0 || !baked.slots.baseColor)) throw new Error("alphaCoverage requires baseColor and cannot be combined with alphaTest");
1173
1174
  const material = new THREE.MeshStandardMaterial({
1174
1175
  roughness: 1,
1175
1176
  metalness: 1
@@ -1200,6 +1201,24 @@ function materialFromBaked(baked) {
1200
1201
  material.alphaTest = baked.meta.alphaTest;
1201
1202
  material.transparent = false;
1202
1203
  }
1204
+ if (baked.meta.alphaCoverage) {
1205
+ material.alphaTest = 0;
1206
+ material.transparent = true;
1207
+ material.depthWrite = false;
1208
+ for (const texture of [
1209
+ material.map,
1210
+ material.normalMap,
1211
+ material.roughnessMap,
1212
+ material.metalnessMap,
1213
+ material.emissiveMap,
1214
+ material.aoMap
1215
+ ]) {
1216
+ if (!texture || texture.magFilter === THREE.NearestFilter) continue;
1217
+ texture.generateMipmaps = true;
1218
+ texture.minFilter = THREE.LinearMipmapLinearFilter;
1219
+ texture.needsUpdate = true;
1220
+ }
1221
+ }
1203
1222
  return material;
1204
1223
  }
1205
1224
  const GREY = "#cccccc";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bendyline/molen-client",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -68,7 +68,7 @@
68
68
  ],
69
69
  "dependencies": {
70
70
  "zod": "^4.6.5",
71
- "@bendyline/molen-materials": "0.0.4",
71
+ "@bendyline/molen-materials": "0.0.5",
72
72
  "@bendyline/molen-schema": "0.0.4"
73
73
  },
74
74
  "peerDependencies": {