diff options
| author | Mel <einebeere@gmail.com> | 2023-07-12 03:39:01 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-07-12 03:39:01 +0200 |
| commit | f09e5791837bb003f7c5db8c0e3162636bc9a9c2 (patch) | |
| tree | 36b9a007f119388bb7943489e8d203de04269483 /src/World/Clouds.hpp | |
| parent | 0ce26f2a49fd6d64a690b84b1932126edfbfbee6 (diff) | |
| download | meowcraft-f09e5791837bb003f7c5db8c0e3162636bc9a9c2.tar.zst meowcraft-f09e5791837bb003f7c5db8c0e3162636bc9a9c2.zip | |
3D Clouds
Diffstat (limited to 'src/World/Clouds.hpp')
| -rw-r--r-- | src/World/Clouds.hpp | 10 |
1 files changed, 8 insertions, 2 deletions
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<CloudMatrixSize, CloudMatrixSize, Bool>; + 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; |
