Skip to content

Commit f283ab2

Browse files
fix: draw order
1 parent 26e543b commit f283ab2

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

src/trees.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,15 @@ export class TreePlanter {
372372
// @ts-expect-error
373373
const instanced = new THREE.InstancedMesh(geo, child.material.clone(), count);
374374

375+
if (level === maxLevel) {
376+
const mat = instanced.material as THREE.Material;
377+
mat.alphaTest = 0;
378+
mat.alphaToCoverage = true;
379+
mat.transparent = false;
380+
mat.depthWrite = true;
381+
mat.side = THREE.DoubleSide;
382+
}
383+
375384
instanced.instanceMatrix.needsUpdate = true;
376385
instanced.castShadow = level !== maxLevel;
377386
instanced.receiveShadow = false;

0 commit comments

Comments
 (0)