Skip to content

Commit d1dfe64

Browse files
committed
fix: reduce Three.js shader contrast and increase glass opacity for better readability
- Lower caustic brightness (0.2→0.07) and shadow depth (0.75→0.88) in SandBackground so light-mode caustic flickers don't compete with text - Reduce WaterBackground specular (0.5→0.18), Fresnel (0.4→0.2), and light intensities (ambient 1.4→1.0, directional 2.0→1.2) for a darker, calmer dark-mode water - Raise glass card opacity from 0.20→0.72 (light) and 0.40→0.78 (dark) so UI panels have a solid enough backing to read clearly over the animated 3D backgrounds
1 parent 5eb4138 commit d1dfe64

3 files changed

Lines changed: 13 additions & 13 deletions

File tree

frontend/src/components/SandBackground.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class BeachTextureMaterial extends THREE.ShaderMaterial {
8686
float shadowMask = smoothstep(0.2, 0.6, shadowN); // Soft shadows
8787
8888
// Darken sand where there are shadows
89-
sandBase = mix(sandBase, sandBase * 0.75, shadowMask);
89+
sandBase = mix(sandBase, sandBase * 0.88, shadowMask);
9090
9191
// --- Water Hybrid (Silk + Caustics) ---
9292
// Hybrid approach:
@@ -123,8 +123,8 @@ class BeachTextureMaterial extends THREE.ShaderMaterial {
123123
// but keep enough definition to look like water
124124
float caustic = pow(ridges, 4.0);
125125
126-
// Reduced intensity to avoid "burning" white look (was 0.6)
127-
float totalLight = caustic * 0.2;
126+
// Reduced intensity to avoid "burning" white look (was 0.2)
127+
float totalLight = caustic * 0.07;
128128
129129
// --- Refraction ---
130130
// Distort sand based on water pattern
@@ -142,7 +142,7 @@ class BeachTextureMaterial extends THREE.ShaderMaterial {
142142
// Re-compose sand with refraction
143143
vec3 finalSand = uSandColor + vec3(refractedGrain * 0.04);
144144
// finalSand = mix(finalSand, stoneColor, refractedStones * 0.5);
145-
finalSand = mix(finalSand, finalSand * 0.75, refractedShadowMask);
145+
finalSand = mix(finalSand, finalSand * 0.88, refractedShadowMask);
146146
147147
// --- Composition ---
148148
vec3 finalColor = mix(finalSand, uWaterTint, 0.15);

frontend/src/components/WaterBackground.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,11 +146,11 @@ class WaterMaterial extends THREE.ShaderMaterial {
146146
float spec = pow(max(dot(vNormal, halfDir), 0.0), 100.0);
147147
148148
// Add specular highlight
149-
color += uColorHighlight * spec * 0.5;
150-
149+
color += uColorHighlight * spec * 0.18;
150+
151151
// Fresnel-ish effect (lighter at edges/angles)
152152
float fresnel = pow(1.0 - dot(vNormal, viewDir), 3.0);
153-
color = mix(color, uColorShallow, fresnel * 0.4);
153+
color = mix(color, uColorShallow, fresnel * 0.2);
154154
155155
gl_FragColor = vec4(color, 1.0);
156156
}
@@ -195,8 +195,8 @@ export default function WaterBackground() {
195195
dpr={[1, 2]}
196196
>
197197
<color attach="background" args={["#2A6F97"]} />
198-
<ambientLight intensity={1.4} />
199-
<directionalLight position={[2, 5, 2]} intensity={2.0} />
198+
<ambientLight intensity={1.0} />
199+
<directionalLight position={[2, 5, 2]} intensity={1.2} />
200200
<Water />
201201
</Canvas>
202202
</div>

frontend/src/index.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
--color-badge: #e6e4dc;
1414

1515
/* Glassmorphism - Light theme */
16-
--color-glass: rgba(239, 235, 228, 0.2);
17-
--color-glass-border: rgba(205, 200, 192, 0.3);
16+
--color-glass: rgba(239, 235, 228, 0.72);
17+
--color-glass-border: rgba(205, 200, 192, 0.5);
1818

1919
/* Quality colors */
2020
--color-quality-excellent: #1f6fb2;
@@ -41,8 +41,8 @@
4141
--color-badge: #1e4057;
4242

4343
/* Glassmorphism - Dark theme (ocean-tinted) */
44-
--color-glass: rgba(20, 60, 90, 0.4);
45-
--color-glass-border: rgba(56, 189, 248, 0.2);
44+
--color-glass: rgba(20, 60, 90, 0.78);
45+
--color-glass-border: rgba(56, 189, 248, 0.25);
4646

4747
/* Quality colors for dark mode - need lighter shades for contrast */
4848
--color-quality-unknown: #9ca3af;

0 commit comments

Comments
 (0)