植物补光
This commit is contained in:
@@ -169,9 +169,40 @@ export class VegetationSystem {
|
||||
plant.options.bark.tint = this.jitterColor(plant.options.bark.tint, tintJitter * 0.04);
|
||||
plant.options.leaves.tint = this.jitterColor(plant.options.leaves.tint, tintJitter * 0.08);
|
||||
plant.generate();
|
||||
this.tunePlantMaterials(plant);
|
||||
return plant;
|
||||
}
|
||||
|
||||
tunePlantMaterials(plant) {
|
||||
plant.traverse((child) => {
|
||||
if (!child.isMesh || !child.material) return;
|
||||
|
||||
const materials = Array.isArray(child.material) ? child.material : [child.material];
|
||||
|
||||
materials.forEach((material) => {
|
||||
if (material.name === 'branches') {
|
||||
material.color.multiplyScalar(1.6);
|
||||
material.emissive = new THREE.Color(0x6a4a34);
|
||||
material.emissiveIntensity = 0.38;
|
||||
material.shininess = 26;
|
||||
}
|
||||
|
||||
if (material.name === 'leaves') {
|
||||
material.color.multiplyScalar(1.2);
|
||||
material.emissive = new THREE.Color(0x355326);
|
||||
material.emissiveIntensity = 0.18;
|
||||
material.alphaTest = 0.42;
|
||||
}
|
||||
|
||||
material.needsUpdate = true;
|
||||
});
|
||||
|
||||
if (child.material?.name === 'branches') {
|
||||
child.receiveShadow = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
createGrassBladeGeometry(rotationY) {
|
||||
const width = 0.24;
|
||||
const height = 1.4;
|
||||
|
||||
Reference in New Issue
Block a user