mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-29 07:19:28 -05:00
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:
@@ -72,6 +72,16 @@ void PointGlobe::initialize() {
|
||||
absPath("${MODULE_GLOBEBROWSING}/shaders/pointglobe_fs.glsl")
|
||||
);
|
||||
|
||||
_uniformCache.lightIntensityClamped = _programObject->uniformLocation(
|
||||
"lightIntensityClamped"
|
||||
);
|
||||
_uniformCache.modelView = _programObject->uniformLocation(
|
||||
"modelViewTransform"
|
||||
);
|
||||
_uniformCache.projection = _programObject->uniformLocation(
|
||||
"projectionTransform"
|
||||
);
|
||||
|
||||
glGenVertexArrays(1, &_vaoID);
|
||||
glGenBuffers(1, &_vertexBufferID);
|
||||
|
||||
@@ -145,12 +155,18 @@ void PointGlobe::render(const RenderData& data, RendererTasks&) {
|
||||
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
|
||||
|
||||
|
||||
_programObject->setUniform("lightIntensityClamped", lightIntensityClamped);
|
||||
_programObject->setUniform(
|
||||
_uniformCache.lightIntensityClamped,
|
||||
lightIntensityClamped
|
||||
);
|
||||
//_programObject->setUniform("lightOverflow", lightOverflow);
|
||||
//_programObject->setUniform("directionToSunViewSpace", directionToSunViewSpace);
|
||||
_programObject->setUniform("modelViewTransform", glm::mat4(modelViewTransform));
|
||||
_programObject->setUniform(
|
||||
"projectionTransform",
|
||||
_uniformCache.modelView,
|
||||
glm::mat4(modelViewTransform)
|
||||
);
|
||||
_programObject->setUniform(
|
||||
_uniformCache.projection,
|
||||
data.camera.sgctInternal.projectionMatrix()
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user