Skip to content

Commit

Permalink
[ChunkBuilder] Don't apply AO on light sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Jul 17, 2020
1 parent 6db450d commit f42c71a
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/lua-api-sky.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ fog_color = {

Attributes:

- `day`: gog color at midday
- `day`: fog color at midday

### `id`

Expand Down
2 changes: 1 addition & 1 deletion resources/shaders/game.f.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion resources/shaders/game.v.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion source/client/world/ChunkBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f42c71a

Please sign in to comment.