[ChunkBuilder] Now disabling fallback AO when smooth lighting is enabled.

This commit is contained in:
Quentin Bazin 2020-06-30 19:15:42 +02:00
parent b0aa1ad7a8
commit db6f775ae7
2 changed files with 1 additions and 9 deletions

View File

@ -52,12 +52,6 @@ void main() {
// Very cheap "transparency": don't draw pixels with a low alpha value // Very cheap "transparency": don't draw pixels with a low alpha value
if(color.a < 0.3 && blockFace > -1.) discard; 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; float minBrightness = 2.0 / 16.0;
if (lightCheck != -1.) { if (lightCheck != -1.) {
float ambientIntensity = max(max(v_lightValue.x, v_lightValue.y) / 16.0, minBrightness); 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); ambientIntensity = max(ambientIntensity * 0.9, minBrightness);
color = light(color, vec3(1.0, 1.0, 1.0), v_coord3d, ambientIntensity, diffuseIntensity); 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; color.rgb *= v_ambientOcclusion;

View File

@ -253,7 +253,7 @@ inline void ChunkBuilder::addFace(s8f x, s8f y, s8f z, s8f f, const ClientChunk
} }
auto addVertex = [&](u8 v) { auto addVertex = [&](u8 v) {
if (!Config::isAmbientOcclusionEnabled) if (!Config::isAmbientOcclusionEnabled || Config::isSmoothLightingEnabled)
vertices[v].ambientOcclusion = 5; vertices[v].ambientOcclusion = 5;
if (block.drawType() == BlockDrawType::Liquid) if (block.drawType() == BlockDrawType::Liquid)