From 23d88e5f1c8f0c8652a07050fcfa8ff126e85d4a Mon Sep 17 00:00:00 2001 From: Mel Date: Fri, 21 Jul 2023 02:17:03 +0200 Subject: Extremely simple chunk-limited lighting --- src/World/BlockType.hpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/World/BlockType.hpp') diff --git a/src/World/BlockType.hpp b/src/World/BlockType.hpp index edca3d7..a63d96a 100644 --- a/src/World/BlockType.hpp +++ b/src/World/BlockType.hpp @@ -26,14 +26,18 @@ public: operator Value() const { return m_block; } - Bool is_transparent() const { + Bool is_translucent() const { return opacity() != 1.0; } + + Real opacity() const { switch (m_block) { case Air: - case Leaves: + return 0.0; case Water: - return true; + return 0.05; + case Leaves: + return 0.2; default: - return false; + return 1.0; } } -- cgit 1.4.1