Skip to content

Commit

Permalink
[ClientChunk] Water is now visible from the inside.
Browse files Browse the repository at this point in the history
  • Loading branch information
Unarelith committed Feb 11, 2020
1 parent c1ccb2f commit a8a2440
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
5 changes: 0 additions & 5 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ TODO
• TODO: Blocks can be placed inside the player (check for AABB?)
• TODO: Sometimes it’s possible to aim between two blocks and right-clicking will replace one

# Code improvements

• TODO: If possible, `Cube` should inherit from `ItemWidget` or `Widget`
• TODO: Unify cube coords in `BlockCursor`, `Cube`, `ChunkBuilder`

# Refactorings

• TODO: Add a mesh system, either here or in `GameKit`
Expand Down
3 changes: 2 additions & 1 deletion client/source/world/ChunkBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ inline void ChunkBuilder::addFace(u8 x, u8 y, u8 z, u8 i, const ClientChunk &chu
// Skip hidden faces
if (surroundingBlock && surroundingBlock->id()
&& ((block->drawType() == BlockDrawType::Solid && surroundingBlock->drawType() == BlockDrawType::Solid && surroundingBlock->isOpaque())
|| (block->id() == surroundingBlock->id() && (block->drawType() == BlockDrawType::Liquid || block->drawType() == BlockDrawType::Glass))))
|| (block->id() == surroundingBlock->id() && (block->drawType() == BlockDrawType::Liquid || block->drawType() == BlockDrawType::Glass))
|| (block->drawType() == BlockDrawType::Liquid && surroundingBlock->drawType() == BlockDrawType::Solid)))
return;

static glm::vec3 a, b, c, v1, v2, normal;
Expand Down
2 changes: 1 addition & 1 deletion client/source/world/ClientChunk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void ClientChunk::drawLayer(gk::RenderTarget &target, gk::RenderStates states, u

states.texture = &m_textureAtlas.texture();

if (layer == ChunkBuilder::Layer::Flora)
if (layer == ChunkBuilder::Layer::Flora || (layer == ChunkBuilder::Layer::Liquid && areAllNeighboursInitialized()))
glCheck(glDisable(GL_CULL_FACE));
else
glCheck(glEnable(GL_CULL_FACE));
Expand Down

0 comments on commit a8a2440

Please sign in to comment.