mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-24 13:08:49 -05:00
Remove caching of inverse model transform for every scene graph node
This commit is contained in:
@@ -521,7 +521,9 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe,
|
||||
);
|
||||
return;
|
||||
}
|
||||
const glm::dmat4 inverseModelTransform = globeSceneGraphNode->inverseModelTransform();
|
||||
const glm::dmat4 inverseModelTransform = glm::inverse(
|
||||
globeSceneGraphNode->modelTransform()
|
||||
);
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe.calculateSurfacePositionHandle(
|
||||
@@ -551,7 +553,9 @@ void GlobeBrowsingModule::goToGeodetic2(const globebrowsing::RenderableGlobe& gl
|
||||
LERROR("Error when going to Geodetic2");
|
||||
}
|
||||
|
||||
const glm::dmat4 inverseModelTransform = globeSceneGraphNode->inverseModelTransform();
|
||||
const glm::dmat4 inverseModelTransform = glm::inverse(
|
||||
globeSceneGraphNode->modelTransform()
|
||||
);
|
||||
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
|
||||
@@ -329,7 +329,7 @@ int getGeoPositionForCamera(lua_State* L) {
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
|
||||
const SceneGraphNode* anchor =
|
||||
global::navigationHandler.orbitalNavigator().anchorNode();
|
||||
const glm::dmat4 inverseModelTransform = anchor->inverseModelTransform();
|
||||
const glm::dmat4 inverseModelTransform = glm::inverse(anchor->modelTransform());
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe->calculateSurfacePositionHandle(
|
||||
|
||||
@@ -153,7 +153,7 @@ void DashboardItemGlobeLocation::render(glm::vec2& penPosition) {
|
||||
}
|
||||
|
||||
const glm::dvec3 cameraPosition = global::navigationHandler.camera()->positionVec3();
|
||||
const glm::dmat4 inverseModelTransform = n->inverseModelTransform();
|
||||
const glm::dmat4 inverseModelTransform = glm::inverse(n->modelTransform());
|
||||
const glm::dvec3 cameraPositionModelSpace =
|
||||
glm::dvec3(inverseModelTransform * glm::dvec4(cameraPosition, 1.0));
|
||||
const SurfacePositionHandle posHandle = globe->calculateSurfacePositionHandle(
|
||||
|
||||
@@ -843,6 +843,8 @@ void RenderableGlobe::render(const RenderData& data, RendererTasks& rendererTask
|
||||
}
|
||||
|
||||
void RenderableGlobe::update(const UpdateData& data) {
|
||||
ZoneScoped
|
||||
|
||||
if (_localRenderer.program && _localRenderer.program->isDirty()) {
|
||||
_localRenderer.program->rebuildFromFile();
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <ghoul/font/fontrenderer.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <ghoul/misc/profiling.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
@@ -379,6 +380,8 @@ void RingsComponent::draw(const RenderData& data,
|
||||
}
|
||||
|
||||
void RingsComponent::update(const UpdateData& data) {
|
||||
ZoneScoped
|
||||
|
||||
if (_shader && _shader->isDirty()) {
|
||||
compileShadowShader();
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/io/texture/texturereader.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <ghoul/misc/profiling.h>
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/textureunit.h>
|
||||
@@ -437,6 +438,8 @@ void ShadowComponent::end() {
|
||||
}
|
||||
|
||||
void ShadowComponent::update(const UpdateData&) {
|
||||
ZoneScoped
|
||||
|
||||
_sunPosition = global::renderEngine.scene()->sceneGraphNode("Sun")->worldPosition();
|
||||
|
||||
glm::ivec2 renderingResolution = global::renderEngine.renderingResolution();
|
||||
|
||||
Reference in New Issue
Block a user