From 00d054ba7a9d0bd599ec9e92fc6237b58beaa48e Mon Sep 17 00:00:00 2001 From: Quentin Bazin Date: Fri, 17 Jul 2020 19:44:28 +0200 Subject: [PATCH] [ChunkBuilder] Don't apply AO on light sources. --- README.md | 2 +- resources/shaders/game.f.glsl | 2 +- resources/shaders/game.v.glsl | 2 +- source/client/world/ChunkBuilder.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index bc42f8e98..9fb3ca438 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ See also the roadmap for 1.0.0 [here](https://github.com/Unarelith/OpenMiner/wik - Fluid propagation ([#62](https://github.com/Unarelith/OpenMiner/issues/62)) - Seed-based worldgen ([#116](https://github.com/Unarelith/OpenMiner/issues/116)) - Cave tunnels ([#118](https://github.com/Unarelith/OpenMiner/issues/118)) -- Clouds ([#52](https://github.com/Unarelith/OpenMiner/pull/52)) +- Clouds ([#156](https://github.com/Unarelith/OpenMiner/issues/156)) - Particle system ([#155](https://github.com/Unarelith/OpenMiner/issues/155)) ## Screenshots diff --git a/resources/shaders/game.f.glsl b/resources/shaders/game.f.glsl index 0ad478e0a..714baacb6 100644 --- a/resources/shaders/game.f.glsl +++ b/resources/shaders/game.f.glsl @@ -73,7 +73,7 @@ void main() { if (blockFace == 2. || blockFace == 3.) ambientIntensity = max(ambientIntensity * 0.9, minBrightness); - float lightval = clamp(sunlight / 16.0, v_lightValue.y / 16.0, 1.0); + float lightval = clamp(sunlight / 15.0, v_lightValue.y / 15.0, 1.0); color = light(color, vec3(lightval, lightval, lightval), v_coord3d, ambientIntensity, diffuseIntensity); } diff --git a/resources/shaders/game.v.glsl b/resources/shaders/game.v.glsl index 09d89bcfd..1205300a3 100644 --- a/resources/shaders/game.v.glsl +++ b/resources/shaders/game.v.glsl @@ -49,7 +49,7 @@ void main() { v_lightValue = lightValue; if (ambientOcclusion != 5) { - const float aovalues[] = float[](0.25, 0.5, 0.75, 1.0); + const float aovalues[] = float[](0.2, 0.45, 0.75, 1.0); v_ambientOcclusion = aovalues[int(ambientOcclusion)]; } else { v_ambientOcclusion = 1.0; diff --git a/source/client/world/ChunkBuilder.cpp b/source/client/world/ChunkBuilder.cpp index 3d6d954d8..6aabef520 100644 --- a/source/client/world/ChunkBuilder.cpp +++ b/source/client/world/ChunkBuilder.cpp @@ -260,7 +260,7 @@ inline void ChunkBuilder::addFace(s8f x, s8f y, s8f z, s8f f, const ClientChunk } auto addVertex = [&](u8 v) { - if (Config::ambientOcclusion != 1) + if (Config::ambientOcclusion != 1 || blockState.isLightSource()) vertices[v].ambientOcclusion = 5; if (blockState.drawType() == BlockDrawType::Liquid)