Feature: baked pews shadow
This commit is contained in:
parent
6952e6463b
commit
ed47fb9fdc
@ -59,6 +59,18 @@ export class Pews extends SceneFeature {
|
||||
rightSupport.position.set(pewLength / 2, supportHeight / 2, -supportDepth / 2 + 0.1);
|
||||
pewGroup.add(leftSupport, rightSupport);
|
||||
|
||||
// Add a simple "baked" shadow plane underneath
|
||||
const shadowGeo = new THREE.PlaneGeometry(pewLength, supportDepth);
|
||||
const shadowMaterial = new THREE.MeshBasicMaterial({
|
||||
color: 0x000000,
|
||||
transparent: true,
|
||||
opacity: 0.3
|
||||
});
|
||||
const shadowMesh = new THREE.Mesh(shadowGeo, shadowMaterial);
|
||||
shadowMesh.rotation.x = -Math.PI / 2;
|
||||
shadowMesh.position.y = 0.01; // Place it just above the floor to prevent z-fighting
|
||||
pewGroup.add(shadowMesh);
|
||||
|
||||
pewGroup.traverse(child => {
|
||||
if (child.isMesh) {
|
||||
child.castShadow = true;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user