Skip to content

Commit 6982a00

Browse files
committed
test2
1 parent 56a7ed9 commit 6982a00

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

src/main.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ const renderer = new THREE.WebGLRenderer({ canvas, antialias: false });
2222
renderer.setPixelRatio(window.devicePixelRatio);
2323
renderer.setSize(window.innerWidth, window.innerHeight);
2424
renderer.outputColorSpace = THREE.SRGBColorSpace;
25-
renderer.shadowMap.enabled = true;
26-
renderer.shadowMap.type = THREE.PCFSoftShadowMap;
27-
renderer.shadowMap.enabled = true;
25+
//renderer.shadowMap.enabled = true;
26+
//renderer.shadowMap.type = THREE.PCFSoftShadowMap;
27+
//renderer.shadowMap.enabled = true;
2828

2929
// Scene + Background
3030
const scene = new THREE.Scene();
@@ -82,23 +82,23 @@ const tiles: THREE.Mesh[] = [];
8282

8383
const evenColor = new THREE.Color(0.082, 0.509, 0.690).convertSRGBToLinear();
8484
const oddColor = new THREE.Color(0.286, 0.851, 0.882).convertSRGBToLinear();;
85-
85+
const mat = new THREE.MeshStandardMaterial(
86+
{
87+
metalness: 0.1,
88+
roughness: 0.35
89+
}
90+
);
8691
// === Scene setup ===
8792
async function init() {
8893
const tile_mesh = (await loadGLB("/models/box.glb")).children[0]!;
8994

9095
for (let x = 0; x < boardSize; x++) {
9196
for (let z = 0; z < boardSize; z++) {
92-
const mat = new THREE.MeshStandardMaterial(
93-
{
94-
metalness: 0.1,
95-
roughness: 0.35
96-
}
97-
);
97+
9898
const tile = tile_mesh.clone() as THREE.Mesh;
9999
tile.scale.multiplyScalar(0.98);
100-
tile.castShadow = false;
101-
tile.receiveShadow = true;
100+
//tile.castShadow = false;
101+
//tile.receiveShadow = true;
102102
tile.position.set(
103103
(x - boardSize / 2 + 0.5) * tileSize,
104104
0,
@@ -113,14 +113,14 @@ async function init() {
113113
}
114114
}
115115

116-
// Shadow receiver
117-
const shadowPlane = new THREE.Mesh(
118-
new THREE.PlaneGeometry(boardSize * tileSize, boardSize * tileSize),
119-
new THREE.ShadowMaterial({ opacity: 0.25 })
120-
);
121-
shadowPlane.rotation.x = -Math.PI / 2;
122-
shadowPlane.receiveShadow = true;
123-
scene.add(shadowPlane);
116+
// // Shadow receiver
117+
// const shadowPlane = new THREE.Mesh(
118+
// new THREE.PlaneGeometry(boardSize * tileSize, boardSize * tileSize),
119+
// new THREE.ShadowMaterial({ opacity: 0.25 })
120+
// );
121+
// shadowPlane.rotation.x = -Math.PI / 2;
122+
// shadowPlane.receiveShadow = true;
123+
// scene.add(shadowPlane);
124124

125125
// === Effect ===
126126
let composer: EffectComposer | undefined;

0 commit comments

Comments
 (0)