Skip to content

Commit

Permalink
Terrain High shader: Better match tile brightness / ambient occlusion…
Browse files Browse the repository at this point in the history
… with other modes
  • Loading branch information
past-due committed Sep 8, 2023
1 parent be0df66 commit 1abe673
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion data/base/shaders/terrain_combined_high.frag
Expand Up @@ -133,7 +133,7 @@ vec4 doBumpMapping(BumpData b, vec3 lightDir, vec3 halfVec) {
float visibility = pow(getShadowVisibility(), 2.f);
vec4 lightmap_vec4 = texture(lightmap_tex, uvLightmap, 0.f);

float adjustedTileBrightness = pow(lightmap_vec4.a, 1.5f); // ... * tile brightness / ambient occlusion (stored in lightmap.a)
float adjustedTileBrightness = pow(lightmap_vec4.a, 2.f-lightmap_vec4.a); // ... * tile brightness / ambient occlusion (stored in lightmap.a)

vec4 light = (ambientLight + visibility*diffuseLight*lambertTerm) * adjustedTileBrightness;
light.rgb = blendAddEffectLighting(light.rgb, (lightmap_vec4.rgb / 1.5f)); // additive color (from environmental point lights / effects)
Expand Down
2 changes: 1 addition & 1 deletion data/base/shaders/vk/terrain_combined_high.frag
Expand Up @@ -75,7 +75,7 @@ vec4 doBumpMapping(BumpData b, vec3 lightDir, vec3 halfVec) {
float visibility = pow(getShadowVisibility(), 2.f);
vec4 lightmap_vec4 = texture(lightmap_tex, frag.uvLightmap, 0.f);

float adjustedTileBrightness = pow(lightmap_vec4.a, 1.5f); // ... * tile brightness / ambient occlusion (stored in lightmap.a)
float adjustedTileBrightness = pow(lightmap_vec4.a, 2.f-lightmap_vec4.a); // ... * tile brightness / ambient occlusion (stored in lightmap.a)

vec4 light = (ambientLight + visibility*diffuseLight*lambertTerm) * adjustedTileBrightness;
light.rgb = blendAddEffectLighting(light.rgb, (lightmap_vec4.rgb / 1.5f)); // additive color (from environmental point lights / effects)
Expand Down

0 comments on commit 1abe673

Please sign in to comment.