fix(environment): preserve grass blade colors
🔍 Lint / 🪄 Check lint (pull_request) Has been cancelled
🔍 Lint / 🎨 Check format (pull_request) Has been cancelled
🔍 Lint / 🔎 Typecheck (pull_request) Has been cancelled
📊 Quality / 🔒 Security Audit (pull_request) Has been cancelled
📊 Quality / 📋 Dependency Freshness (pull_request) Has been cancelled
📊 Quality / 📦 Bundle Size (pull_request) Has been cancelled
🔍 Lint / 🏗 Build (pull_request) Has been cancelled

This commit is contained in:
Tom Boullay
2026-05-28 01:12:21 +02:00
parent 57498b9bb1
commit a2fc417be6
3 changed files with 9 additions and 4 deletions
+6 -1
View File
@@ -3,7 +3,11 @@ import { useTexture } from "@react-three/drei";
import { useFrame, useThree } from "@react-three/fiber";
import * as THREE from "three";
import { useWind } from "@/hooks/world/useWind";
import { GRASS_COLORS, GRASS_CONFIG } from "@/world/grass/grassConfig";
import {
GRASS_BASE_COLOR,
GRASS_COLORS,
GRASS_CONFIG,
} from "@/world/grass/grassConfig";
import {
grassFragmentShader,
grassVertexShader,
@@ -125,6 +129,7 @@ function createGrassMaterial(
uDiffuseMap: { value: grassTexture },
uHeightMap: { value: terrainSampler.heightTexture },
uPlayerPosition: { value: new THREE.Vector3() },
uBaseBladeColor: { value: new THREE.Color(GRASS_BASE_COLOR) },
uBoundingBoxMin: {
value: new THREE.Vector3(
terrainSampler.bounds.minX,