From f09e5791837bb003f7c5db8c0e3162636bc9a9c2 Mon Sep 17 00:00:00 2001 From: Mel Date: Wed, 12 Jul 2023 03:39:01 +0200 Subject: 3D Clouds --- src/World/Clouds.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/World/Clouds.hpp') diff --git a/src/World/Clouds.hpp b/src/World/Clouds.hpp index 6a91901..b2d5a10 100644 --- a/src/World/Clouds.hpp +++ b/src/World/Clouds.hpp @@ -9,21 +9,27 @@ namespace MC::World { class Clouds { public: - Clouds(Real ascept, Real fov, Real near, Real far, Vector<3, F32> sky_color); + Clouds(Real ascept, Real fov, Real near, Real far, Vector<3, F32> sky_color, Vector<3, F32> sun_direction); void update(U64 time); void render(const GFX::Camera& camera) const; private: constexpr static U32 CloudMatrixSize = 128; + constexpr static Int Height = 200; + constexpr static Real Scale = 15; + constexpr static Real TileSize = CloudMatrixSize * Scale; + using CloudMatrix = Matrix; + void render_single_instance(const GFX::Camera& camera, Int x, Int y) const; + static CloudMatrix create_cloud_matrix(); static GFX::Mesh create_mesh(const CloudMatrix& cloud_matrix); static const Char* vertex; static const Char* fragment; - Vector<3> m_position; + Real m_x_offset = 0.0; GFX::Shading::Program m_program; GFX::BindableMesh m_mesh; -- cgit 1.4.1