Feature/matrix maintenance (#2875)

* Split RenderableSphere class into a local and an online sphere

* Make the video sphere derive from the regular sphere

* Make RenderableTimeVaryingSphere derive from RenderableSphere

* Some clean up

* Add general functions for renderable matrix calculations

* Make RenderableSphere and Plane use them

* Fix an issue with the RenderablePlane shader

* Make one function that returns all three types of render matrices

* Make more Renderables use the general matric calculation function

* Make more Renderable use the general matrix function

* Simplify alternative transforms for matrix calculations

* Small clean-up

* Update RenderableModel (again) to use new transform functions

* Make calc all matrix function to return tuple

* Update some more places
This commit is contained in:
Malin E
2023-09-21 14:22:36 +02:00
committed by GitHub
parent 36ee6840b5
commit ce789fcd22
42 changed files with 270 additions and 317 deletions

View File

@@ -125,10 +125,14 @@ void RenderablePlaneProjection::render(const RenderData& data, RendererTasks&) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.modelTransform.translation) *
glm::dmat4(_stateMatrix);
glm::mat4 mvp = data.camera.projectionMatrix() *
glm::mat4(data.camera.combinedViewMatrix() * modelTransform);
_shader->setUniform("modelViewProjectionTransform", mvp);
const glm::dmat4 ModelViewProjectionTransform =
calcModelViewProjectionTransform(data, modelTransform);
_shader->setUniform(
"modelViewProjectionTransform",
glm::mat4(ModelViewProjectionTransform)
);
ghoul::opengl::TextureUnit unit;
unit.activate();