diff options
author | LaG1924 <lag1924@gmail.com> | 2021-11-19 20:29:28 +0100 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-11-19 20:29:28 +0100 |
commit | 83c61036966c4c358a094cabe27c8de60082200d (patch) | |
tree | 6947537bd6af8a1e0d16de6a75f3e07f7db3b268 /src/RendererWorld.cpp | |
parent | Added framebuffer to Gal (diff) | |
download | AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.gz AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.bz2 AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.lz AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.xz AltCraft-83c61036966c4c358a094cabe27c8de60082200d.tar.zst AltCraft-83c61036966c4c358a094cabe27c8de60082200d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/RendererWorld.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index e4a1589..cb4551f 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -8,8 +8,6 @@ #include "Frustum.hpp" #include "Event.hpp" #include "AssetManager.hpp" -#include "Renderer.hpp" -#include "Shader.hpp" #include "GameState.hpp" #include "Section.hpp" #include "RendererSectionData.hpp" @@ -259,8 +257,7 @@ RendererWorld::RendererWorld(std::shared_ptr<Gal::Framebuffer> target) { listener->RegisterHandler("SetMinLightLevel", [this](const Event& eventData) { auto value = eventData.get<float>(); - AssetManager::GetAsset<AssetShader>("/altcraft/shaders/face")->shader->Activate(); - AssetManager::GetAsset<AssetShader>("/altcraft/shaders/face")->shader->SetUniform("MinLightLevel", value); + sectionsPipeline->SetShaderParameter("MinLightLevel", value); }); for (int i = 0; i < numOfWorkers; i++) @@ -282,11 +279,11 @@ RendererWorld::~RendererWorld() { DebugInfo::readyRenderer = 0; } -void RendererWorld::Render(RenderState & renderState) { +void RendererWorld::Render(float screenRatio) { OPTICK_EVENT(); //Common glm::mat4 projection = glm::perspective( - glm::radians(70.0f), (float) renderState.WindowWidth / (float) renderState.WindowHeight, + glm::radians(70.0f), screenRatio, 0.1f, 10000000.0f ); glm::mat4 view = GetGameState()->GetViewMatrix(); @@ -336,8 +333,6 @@ void RendererWorld::Render(RenderState & renderState) { } //Render sky - renderState.TimeOfDay = GetGameState()->GetTimeStatus().timeOfDay; - glm::mat4 model = glm::mat4(1.0); model = glm::translate(model, GetGameState()->GetPlayer()->pos.glm()); const float scale = 1000000.0f; |