diff --git a/src/AcDream.App/Rendering/Shaders/mesh.frag b/src/AcDream.App/Rendering/Shaders/mesh.frag index 28503bb..42d2d96 100644 --- a/src/AcDream.App/Rendering/Shaders/mesh.frag +++ b/src/AcDream.App/Rendering/Shaders/mesh.frag @@ -9,9 +9,13 @@ uniform sampler2D uDiffuse; // gives scenery and building faces enough differentiation to read as 3D instead // of looking like paper cutouts. Hardcoded for now; a later phase can route // light parameters through uniforms driven by the game's time-of-day. -const vec3 SUN_DIR = normalize(vec3(0.4, 0.3, 0.8)); -const float AMBIENT = 0.4; -const float DIFFUSE = 0.6; +// Sun direction tuned after Phase 3a verification: (0.4,0.3,0.8) was too +// vertical — roofs and ground both landed near peak brightness and only +// walls dropped, so the contrast was hard to read through textures. More +// oblique + lower ambient + higher diffuse = contrast ratio ~3.3x. +const vec3 SUN_DIR = normalize(vec3(0.5, 0.4, 0.6)); +const float AMBIENT = 0.25; +const float DIFFUSE = 0.75; void main() { vec4 sampled = texture(uDiffuse, vTex); diff --git a/src/AcDream.App/Rendering/Shaders/terrain.frag b/src/AcDream.App/Rendering/Shaders/terrain.frag index f3ebbe4..76a8db0 100644 --- a/src/AcDream.App/Rendering/Shaders/terrain.frag +++ b/src/AcDream.App/Rendering/Shaders/terrain.frag @@ -6,14 +6,12 @@ out vec4 fragColor; uniform sampler2DArray uAtlas; -// Phase 3a: shared lighting model with mesh.frag. Terrain normals are currently -// flat UnitZ (Phase 2b set this when building LandblockMesh vertices) so every -// terrain fragment gets the same ndotl contribution — terrain will look a bit -// flatter than hill-shaded terrain, which is a Phase 3b concern (compute -// per-vertex normals from the 9x9 heightmap to get relief lighting). -const vec3 SUN_DIR = normalize(vec3(0.4, 0.3, 0.8)); -const float AMBIENT = 0.4; -const float DIFFUSE = 0.6; +// Shared lighting model with mesh.frag — must stay in sync. Phase 3b gave +// terrain real per-vertex normals via central differences on the heightmap, +// so hills catch and shade the sun just like static meshes do. +const vec3 SUN_DIR = normalize(vec3(0.5, 0.4, 0.6)); +const float AMBIENT = 0.25; +const float DIFFUSE = 0.75; void main() { vec4 sampled = texture(uAtlas, vec3(vTex, float(vLayer)));