Feat/map-environment #6

Merged
math-pixel merged 116 commits from feat/map-environment into develop 2026-05-29 00:00:51 +00:00
2 changed files with 12 additions and 1 deletions
Showing only changes of commit fd558db034 - Show all commits
+4
View File
@@ -3,7 +3,9 @@ import type { Vector3Tuple } from "@/types/three/three";
export interface WaterSurfaceConfig {
position: Vector3Tuple;
rotation: Vector3Tuple;
size: [number, number];
renderOrder: number;
}
export const WATER_SHADER_CONFIG = {
@@ -30,6 +32,8 @@ export const WATER_SHADER_CONFIG = {
export const WATER_SURFACES: WaterSurfaceConfig[] = [
{
position: [62, TERRAIN_WATER_HEIGHT, -82],
rotation: [0, 0, 0],
size: [75, 42],
renderOrder: 0,
},
];
+8 -1
View File
@@ -10,6 +10,8 @@ import {
export function WaterSurface({
position,
renderOrder,
rotation,
size,
}: WaterSurfaceConfig): React.JSX.Element {
const materialRef = useRef<THREE.ShaderMaterial>(null);
@@ -46,11 +48,16 @@ export function WaterSurface({
});
return (
<mesh position={position} rotation={[-Math.PI / 2, 0, 0]} renderOrder={1}>
<mesh
position={position}
rotation={[-Math.PI / 2 + rotation[0], rotation[1], rotation[2]]}
renderOrder={renderOrder}
>
<planeGeometry args={size} />
<shaderMaterial
ref={materialRef}
attach="material"
depthTest
depthWrite={false}
fragmentShader={WATER_FRAGMENT_SHADER}
side={THREE.FrontSide}