Make use of UniformCache in many Renderables and switch from setUniform(const std::string&, ...) to setUniform(GLint, ...) in those cases

This commit is contained in:
Alexander Bock
2017-12-31 17:31:10 -05:00
parent 8ea5837f00
commit 47233b8e6f
41 changed files with 1329 additions and 855 deletions
@@ -31,6 +31,7 @@
#include <openspace/util/updatestructures.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <ghoul/glm.h>
#include <map>
@@ -112,6 +113,7 @@ private:
std::unique_ptr<ghoul::opengl::ProgramObject> _hdrBackGroundProgram;
std::unique_ptr<ghoul::opengl::ProgramObject> _resolveProgram;
UniformCache(mainColorTexture, blackoutFactor, nAaSamples) _uniformCache;
GLuint _screenQuad;
GLuint _vertexPositionBuffer;
@@ -28,6 +28,7 @@
#include <ghoul/glm.h>
#include <ghoul/misc/boolean.h>
#include <ghoul/opengl/ghoul_gl.h>
#include <ghoul/opengl/uniformcache.h>
#include <memory>
#include <mutex>
@@ -95,6 +96,8 @@ private:
int _nItems;
std::unique_ptr<ghoul::opengl::ProgramObject> _program;
UniformCache(logoTexture, useTexture, color) _uniformCache;
std::unique_ptr<ghoul::opengl::Texture> _logoTexture;
std::shared_ptr<ghoul::fontrendering::Font> _loadingFont;
@@ -35,6 +35,7 @@
#include <ghoul/opengl/programobject.h>
#include <ghoul/opengl/texture.h>
#include <ghoul/opengl/textureunit.h>
#include <ghoul/opengl/uniformcache.h>
#include <memory>
@@ -112,6 +113,7 @@ protected:
GLuint _quad;
GLuint _vertexPositionBuffer;
std::unique_ptr<ghoul::opengl::Texture> _texture;
UniformCache(occlusionDepth, alpha, modelTransform, viewProj, texture) _uniformCache;
std::unique_ptr<ghoul::opengl::ProgramObject> _shader;
bool _useEuclideanCoordinates;