From 2bc4bcebc93e7211dfb84303888635f888ba8018 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 20 Feb 2021 00:17:58 +0000 Subject: Custom land and water shaders Create sandy beaches, snow topped mountains and grassy hills with a single texture, coloured according to land height by a custom shader. Also use the land mass mesh with a new water texture and a custom shader to create rather nice looking water effect with depth, waves and motion. --- game/terrain.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'game/terrain.h') diff --git a/game/terrain.h b/game/terrain.h index 1aed1c5..2cec963 100644 --- a/game/terrain.h +++ b/game/terrain.h @@ -20,13 +20,13 @@ public: void render(const Shader & shader) const override; - void tick(TickDuration) override { } + void tick(TickDuration) override; + float waveCycle {0.F}; private: static constexpr unsigned int NUM_BUFFERS {4}; void finish(unsigned int width, unsigned int height, std::vector &); - void addWater(unsigned int width, unsigned int height, unsigned int resolution); Collection meshes; std::shared_ptr grass, water; -- cgit v1.2.3