From db6f775ae731a44dc09eb5fdbd6f6ba7009de730 Mon Sep 17 00:00:00 2001 From: Quentin Bazin Date: Tue, 30 Jun 2020 19:15:42 +0200 Subject: [PATCH] [ChunkBuilder] Now disabling fallback AO when smooth lighting is enabled. --- resources/shaders/game.f.glsl | 8 -------- source/client/world/ChunkBuilder.cpp | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/resources/shaders/game.f.glsl b/resources/shaders/game.f.glsl index 18114e832..9859790bf 100644 --- a/resources/shaders/game.f.glsl +++ b/resources/shaders/game.f.glsl @@ -52,12 +52,6 @@ void main() { // Very cheap "transparency": don't draw pixels with a low alpha value if(color.a < 0.3 && blockFace > -1.) discard; - // FIXME: FINISH THIS WITH PROPER CODE AND SUN BASIC DISPLAY - // int maxTime = 5 * 1000; - // float time = mod(u_lightPosition, maxTime) / maxTime * 2 - 1; - // vec3 lightPosition = vec3(0.0, sin(time) * 40, cos(time) * 40); - // color *= light(vec3(1.0, 1.0, 1.0), vec4(lightPosition, 1.0), 0.5, 0.5); - float minBrightness = 2.0 / 16.0; if (lightCheck != -1.) { float ambientIntensity = max(max(v_lightValue.x, v_lightValue.y) / 16.0, minBrightness); @@ -75,8 +69,6 @@ void main() { ambientIntensity = max(ambientIntensity * 0.9, minBrightness); color = light(color, vec3(1.0, 1.0, 1.0), v_coord3d, ambientIntensity, diffuseIntensity); - - // color = vec4(0, 0, v_lightValue.x / 16.0, 1); } color.rgb *= v_ambientOcclusion; diff --git a/source/client/world/ChunkBuilder.cpp b/source/client/world/ChunkBuilder.cpp index 45d069f76..ec5b0e068 100644 --- a/source/client/world/ChunkBuilder.cpp +++ b/source/client/world/ChunkBuilder.cpp @@ -253,7 +253,7 @@ inline void ChunkBuilder::addFace(s8f x, s8f y, s8f z, s8f f, const ClientChunk } auto addVertex = [&](u8 v) { - if (!Config::isAmbientOcclusionEnabled) + if (!Config::isAmbientOcclusionEnabled || Config::isSmoothLightingEnabled) vertices[v].ambientOcclusion = 5; if (block.drawType() == BlockDrawType::Liquid)