#pragma once #include "../Time.hpp" #include "../GFX/Shading/Program.hpp" #include "../GFX/Shading/Uniform.hpp" #include "../GFX/Camera.hpp" #include "../GFX/Mesh.hpp" namespace MC::World { class Clouds { public: Clouds(Real ascept, Real fov, Real near, Real far, Vector<3, F32> sky_color, Vector<3, F32> sun_direction); void update(const Time& time); void render(const GFX::Camera& camera); 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); static CloudMatrix create_cloud_matrix(); static GFX::Mesh create_mesh(const CloudMatrix& cloud_matrix); static const Char* vertex; static const Char* fragment; Real m_x_offset = 0.0; GFX::Shading::Program m_program; GFX::Mesh m_mesh; GFX::Shading::Uniform m_model_uniform; GFX::Shading::Uniform m_view_uniform; GFX::Shading::Uniform m_projection_uniform; }; }