Fluffier trees

This commit is contained in:
Paul Mathieu 2021-12-26 13:29:28 -08:00
parent 6a219e7e45
commit d0f1749ef2

View File

@ -44,6 +44,9 @@ varying lowp float vDistance;
void main() {
highp vec4 color = texture2D(uSampler, vTextureCoord);
if (color.a < 0.1) {
discard;
}
lowp float fogamount = smoothstep(40.0, 100.0, vDistance);
gl_FragColor = mix(vec4(vLighting * color.rgb, color.a), vec4(uFogColor, 1.0), fogamount);
}
@ -296,7 +299,7 @@ function makeFaces(chunk, blocks, neighbors) {
}
if (isTransparent(chunk.data[bi])) {
for (const { dir, faceCenter } of neighbors(i, j, k)
.filter(({ block }) => block === BlockType.AIR)
.filter(({ block }) => isTransparent(block) && block !== BlockType.WATER)
) {
if (chunk.data[bi] === BlockType.WATER) {
faceCenter[1] -= 0.15;