feat(renderer): compute ambient and sunlight colors based on sun height

This commit is contained in:
2026-06-18 18:53:45 +08:00
parent 83f1077ecd
commit 72011d2551
2 changed files with 15 additions and 3 deletions

View File

@@ -12,6 +12,7 @@ layout (binding = 1) uniform sampler2DArray samp;
uniform float ambientStrength;
uniform vec3 sunlightColor;
uniform vec3 ambientColor;
uniform vec3 sunlightDir;
uniform vec3 cameraPos;
uniform bool shader_on;
@@ -281,7 +282,7 @@ void main(void) {
vec3 H =
normalize(lightDir + V);
vec3 ambient = ambientStrength * sunlightColor;
vec3 ambient = ambientStrength * ambientColor;
float diff = max(dot(norm, lightDir), 0.0);