diff options
Diffstat (limited to '')
-rw-r--r-- | src/RendererWorld.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index 846788b..2108ba6 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -278,15 +278,20 @@ RendererWorld::~RendererWorld() { void RendererWorld::Render(float screenRatio) { OPTICK_EVENT(); //Common - glm::mat4 projection = glm::perspective( + + auto globalSpb = Gal::GetImplementation()->GetGlobalShaderParameters(); + + auto& projection = globalSpb->Get<GlobalShaderParameters>()->proj; + projection = glm::perspective( glm::radians(70.0f), screenRatio, 0.1f, 10000000.0f ); - glm::mat4 view = GetGameState()->GetViewMatrix(); - glm::mat4 projView = projection * view; - auto globalSpb = Gal::GetImplementation()->GetGlobalShaderParameters(); - globalSpb->Get<GlobalShaderParameters>()->projView = projView; + auto& view = globalSpb->Get<GlobalShaderParameters>()->view; + view = GetGameState()->GetViewMatrix(); + + auto& projView = globalSpb->Get<GlobalShaderParameters>()->projView; + projView = projection * view; //Render Entities constexpr size_t entitiesVerticesCount = 240; |