diff options
Diffstat (limited to 'public/bluebey-studio/src/face.js')
| -rw-r--r-- | public/bluebey-studio/src/face.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/public/bluebey-studio/src/face.js b/public/bluebey-studio/src/face.js index 7de7c8d..cec7619 100644 --- a/public/bluebey-studio/src/face.js +++ b/public/bluebey-studio/src/face.js @@ -214,6 +214,16 @@ export class Face { // Hiding the mouth has to hide the plane itself, not just stop drawing on // it - otherwise the last drawing stays on screen. this.setMouthVisible(p.mouth.visible !== false); + // A tongue poking over a *closed* lip can reach up behind the 3D nose, which + // would hide it. In that one case let the mouth artwork win the depth test, + // so the tongue reads; otherwise the nose (and an arm) still hide the mouth + // the way they should. The lip line and the rest of the mouth sit clear of + // the nose, so only the tongue can overlap it. + const mouth = p.mouth ?? {}; + const tongueOverLip = (mouth.round ?? 0) <= 0.004 + && (mouth.open ?? 0) <= 0.004 + && (mouth.tongue ?? 1) > 0.01; + this.mouthMesh.material.depthTest = !tongueOverLip; const mode = this.styleMode === 'line' ? 'line' : 'paint'; if (this.eyeSource === 'parametric') { |
