summary refs log tree commit diff
path: root/src/World/Clouds.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/World/Clouds.hpp')
-rw-r--r--src/World/Clouds.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/World/Clouds.hpp b/src/World/Clouds.hpp
new file mode 100644
index 0000000..6a91901
--- /dev/null
+++ b/src/World/Clouds.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "../GFX/Binder.hpp"
+#include "../GFX/Shading/Program.hpp"
+#include "../GFX/Shading/Uniform.hpp"
+#include "../GFX/Camera.hpp"
+
+namespace MC::World {
+
+class Clouds {
+public:
+    Clouds(Real ascept, Real fov, Real near, Real far, Vector<3, F32> sky_color);
+
+    void update(U64 time);
+    void render(const GFX::Camera& camera) const;
+private:
+    constexpr static U32 CloudMatrixSize = 128;
+    using CloudMatrix = Matrix<CloudMatrixSize, CloudMatrixSize, Bool>;
+
+    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;
+
+    GFX::Shading::Program m_program;
+    GFX::BindableMesh m_mesh;
+
+    GFX::Shading::Uniform m_model_uniform;
+    GFX::Shading::Uniform m_view_uniform;
+    GFX::Shading::Uniform m_projection_uniform;
+};
+
+}