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. --- gfx/gl/shader.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'gfx/gl/shader.cpp') diff --git a/gfx/gl/shader.cpp b/gfx/gl/shader.cpp index 8c58c39..454ad4b 100644 --- a/gfx/gl/shader.cpp +++ b/gfx/gl/shader.cpp @@ -1,7 +1,11 @@ #include "shader.h" #include #include +#include +#include #include +#include +#include #include #include #include @@ -28,9 +32,17 @@ Shader::ProgramHandle::ProgramHandle(std::initializer_list srcs) : viewP Shader::Shader() : programs {{{ - Source {{basicShader_vs, basicShader_vs_len}, GL_VERTEX_SHADER}.id, - Source {{basicShader_fs, basicShader_fs_len}, GL_FRAGMENT_SHADER}.id, - }}} + Source {{basicShader_vs, basicShader_vs_len}, GL_VERTEX_SHADER}.id, + Source {{basicShader_fs, basicShader_fs_len}, GL_FRAGMENT_SHADER}.id, + }, + { + Source {{waterShader_vs, waterShader_vs_len}, GL_VERTEX_SHADER}.id, + Source {{waterShader_fs, waterShader_fs_len}, GL_FRAGMENT_SHADER}.id, + }, + { + Source {{landmassShader_vs, landmassShader_vs_len}, GL_VERTEX_SHADER}.id, + Source {{landmassShader_fs, landmassShader_fs_len}, GL_FRAGMENT_SHADER}.id, + }}} { } -- cgit v1.2.3