From 94311f9c4e82b7475802b1934cc0c5b243e0cd2f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Wed, 3 Mar 2021 00:08:47 +0000 Subject: Replace Transform with Location Simpler, unbinds the transformation matrices for location, now done just in the shader. --- game/terrain.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'game/terrain.cpp') diff --git a/game/terrain.cpp b/game/terrain.cpp index 44fd41d..bf16439 100644 --- a/game/terrain.cpp +++ b/game/terrain.cpp @@ -3,11 +3,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -121,9 +121,6 @@ Terrain::finish(unsigned int width, unsigned int height, std::vector & v meshes.create(vertices, indices); } -static const Transform identity {}; -static const auto identityModel {identity.GetModel()}; - void Terrain::tick(TickDuration dur) { @@ -133,11 +130,11 @@ Terrain::tick(TickDuration dur) void Terrain::render(const Shader & shader) const { - shader.setModel(identityModel, Shader::Program::LandMass); + shader.setModel(Location {}, Shader::Program::LandMass); grass->Bind(); meshes.apply(&Mesh::Draw); - shader.setModel(identityModel, Shader::Program::Water); + shader.setModel(Location {}, Shader::Program::Water); shader.setUniform("waves", {waveCycle, 0, 0}); water->Bind(); meshes.apply(&Mesh::Draw); -- cgit v1.2.3