Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function configureSkinPreviewMesh(mesh: THREE.Mesh) {
materials.forEach((material) => {
if (!(material instanceof THREE.MeshStandardMaterial) || material.name === 'cape') return

material.transparent = false
material.transparent = isSkinLayer
material.alphaTest = 0.1
material.depthTest = true
material.depthWrite = true
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/src/utils/webgl/skin-rendering.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ export function applyTexture(model: THREE.Object3D, texture: THREE.Texture): voi
model.traverse((child) => {
if ((child as THREE.Mesh).isMesh) {
const mesh = child as THREE.Mesh
const isSkinLayer = mesh.name.endsWith('_Layer')
const materials = Array.isArray(mesh.material) ? mesh.material : [mesh.material]

materials.forEach((mat: THREE.Material) => {
Expand All @@ -168,7 +169,7 @@ export function applyTexture(model: THREE.Object3D, texture: THREE.Texture): voi
flatShading: true,
side: THREE.FrontSide,
toneMapped: false,
transparent: false,
transparent: isSkinLayer,
})

setCommonMaterialProperties(mat)
Expand Down
Loading