Skip to content

Commit 5d355b7

Browse files
adjust transparency threshold (#105)
1 parent d16630b commit 5d355b7

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/skin/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,14 +191,16 @@ class SkinRender extends Render {
191191
let a = pixels[i + 3];
192192
let x = (i / 4) % sourceCanvas.width;
193193
let y = Math.floor((i / 4) / sourceCanvas.width);
194-
if (a > 16 || removeTransparency(x, y)) { // alpha over threshold OR area not supposed to have transparency at all
194+
if (a > 178 || removeTransparency(x, y)) { // alpha over threshold OR area not supposed to have transparency at all
195195
pixels[i + 3] = 255; // max the alpha
196196
}
197197
}
198198

199199
// update destination canvas
200200
opaqueContext.putImageData(imageData, 0, 0);
201201

202+
console.log(opaqueCanvas.toDataURL())
203+
202204
skinTexture = new THREE.CanvasTexture(opaqueCanvas);
203205
}
204206

0 commit comments

Comments
 (0)