From c891299737dd0c73a54f9bd1510dc00d6f140f1f Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Thu, 22 Oct 2026 14:58:33 +0900 Subject: bluebey-studio: 横から見たとき口が体を透ける問題を修正 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 正面判定を内積>0から>0.5に変更し、真横(内積がほぼ0)では深度テストを有効に戻すようにした。 --- public/bluebey-studio/src/main.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'public') diff --git a/public/bluebey-studio/src/main.js b/public/bluebey-studio/src/main.js index 9178427..6507bf4 100644 --- a/public/bluebey-studio/src/main.js +++ b/public/bluebey-studio/src/main.js @@ -1428,8 +1428,11 @@ async function init() { && (mouth.tongue ?? 1) > 0.01; mouthMesh.getWorldDirection(mouthNormal); mouthMesh.getWorldPosition(mouthToCamera); - mouthToCamera.subVectors(view.camera.position, mouthToCamera); - const facing = mouthNormal.dot(mouthToCamera) > 0; + mouthToCamera.subVectors(view.camera.position, mouthToCamera).normalize(); + // Only let the artwork win the depth test when the camera is actually in + // front of the face. At a side view the dot product is near zero, and the + // mouth must lose to the body (or it shows through the far side). + const facing = mouthNormal.dot(mouthToCamera) > 0.5; const wallOn = state.render.wall?.on === true || state.render.wall2?.on === true; const depthTest = !tongueOverLip || !facing || wallOn; if (mouthMesh.material.depthTest !== depthTest) { -- cgit v1.3.1