fix: stabilize water depth and rounded mask

This commit is contained in:
Tom Boullay
2026-05-26 22:56:50 +02:00
parent 1c27d55e5a
commit d6d3d5b685
9 changed files with 126 additions and 8 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ export const TERRAIN_SURFACE_PROJECTION = {
offsetX: 0,
offsetZ: 0,
};
export const TERRAIN_WATER_HEIGHT = 0;
export const TERRAIN_WATER_HEIGHT = 0.8;
export const TERRAIN_TILE_SIZE = 1;
export const GRASS_BASE_COLOR = "#1a3a1a";
+6 -3
View File
@@ -11,7 +11,10 @@ export interface WaterSurfaceConfig {
export const WATER_SHADER_CONFIG = {
enabled: true,
height: TERRAIN_WATER_HEIGHT,
scale: 0.3,
depthOffset: -0.04,
borderRadius: 0.18,
borderSoftness: 0.035,
scale: 0.4,
smoothness: 0.55,
edgeThreshold: 0.067,
edgeSoftness: 0.01,
@@ -31,9 +34,9 @@ export const WATER_SHADER_CONFIG = {
export const WATER_SURFACES: WaterSurfaceConfig[] = [
{
position: [62, TERRAIN_WATER_HEIGHT, -82],
position: [40, TERRAIN_WATER_HEIGHT, -102],
rotation: [0, 0, 0],
size: [75, 42],
size: [75, 45],
renderOrder: 0,
},
];
+9
View File
@@ -13,3 +13,12 @@ export const WIND_BOUNDS = {
};
export type WindState = typeof WIND_DEFAULTS;
export function getWindVector(wind: WindState): { x: number; z: number } {
const intensity = wind.speed * wind.strength;
return {
x: Math.cos(wind.direction) * intensity,
z: Math.sin(wind.direction) * intensity,
};
}