summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLaG1924 <lag1924@gmail.com>2021-11-20 12:35:20 +0100
committerLaG1924 <lag1924@gmail.com>2021-11-20 12:35:20 +0100
commite02d3dbd590810df98b08c17fd81e6ce28711af8 (patch)
tree4c08adf91d6e1f1ef1cdd9023769ed89a0ff6b24 /src
parentFixed missing APIENTRY linux build (diff)
downloadAltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar.gz
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar.bz2
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar.lz
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar.xz
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.tar.zst
AltCraft-e02d3dbd590810df98b08c17fd81e6ce28711af8.zip
Diffstat (limited to 'src')
-rw-r--r--src/Gal.hpp2
-rw-r--r--src/GalOgl.cpp4
-rw-r--r--src/Render.cpp16
-rw-r--r--src/RendererWorld.cpp1
4 files changed, 15 insertions, 8 deletions
diff --git a/src/Gal.hpp b/src/Gal.hpp
index f448c89..4757e37 100644
--- a/src/Gal.hpp
+++ b/src/Gal.hpp
@@ -106,6 +106,8 @@ namespace Gal {
virtual void SetScissor(bool enabled) = 0;
+ virtual void SetWireframe(bool enabled) = 0;
+
virtual std::shared_ptr<Buffer> CreateBuffer() = 0;
diff --git a/src/GalOgl.cpp b/src/GalOgl.cpp
index 052c68a..29e7fc0 100644
--- a/src/GalOgl.cpp
+++ b/src/GalOgl.cpp
@@ -1055,6 +1055,10 @@ struct ImplOgl : public Impl {
glCheckError();
}
+ virtual void SetWireframe(bool enabled) override {
+ glPolygonMode(GL_FRONT_AND_BACK, enabled ? GL_LINE : GL_FILL);
+ }
+
virtual std::shared_ptr<Buffer> CreateBuffer() override {
auto buff = std::make_shared<BufferOgl>();
diff --git a/src/Render.cpp b/src/Render.cpp
index 6301ff5..02f56ff 100644
--- a/src/Render.cpp
+++ b/src/Render.cpp
@@ -142,13 +142,13 @@ void Render::PrepareToRendering() {
auto dsTexConf = gal->CreateTexture2DConfig(scaledW, scaledH, Gal::Format::D24S8);
- dsTexConf->SetMinFilter(Gal::Filtering::Nearest);
- dsTexConf->SetMaxFilter(Gal::Filtering::Nearest);
+ dsTexConf->SetMinFilter(Gal::Filtering::Bilinear);
+ dsTexConf->SetMaxFilter(Gal::Filtering::Bilinear);
fbDepthStencil = gal->BuildTexture(dsTexConf);
auto texConf = gal->CreateTexture2DConfig(scaledW, scaledH, Gal::Format::R8G8B8A8);
- texConf->SetMinFilter(Gal::Filtering::Nearest);
- texConf->SetMaxFilter(Gal::Filtering::Nearest);
+ texConf->SetMinFilter(Gal::Filtering::Bilinear);
+ texConf->SetMaxFilter(Gal::Filtering::Bilinear);
fbColor = gal->BuildTexture(texConf);
auto fbConf = gal->CreateFramebufferConfig();
@@ -223,12 +223,12 @@ void Render::RenderFrame() {
Gal::GetImplementation()->GetDefaultFramebuffer()->Clear();
framebuffer->Clear();
- //if (isWireframe)
- //glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
+ if (isWireframe)
+ Gal::GetImplementation()->SetWireframe(true);
if (renderWorld)
world->Render(static_cast<float>(windowWidth) / static_cast<float>(windowHeight));
- //if (isWireframe)
- //glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+ if (isWireframe)
+ Gal::GetImplementation()->SetWireframe(false);
fbPipeline->Activate();
fbPipelineInstance->Activate();
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index cb4551f..561578f 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -381,6 +381,7 @@ void RendererWorld::Render(float screenRatio) {
sectionsPipeline->Activate();
sectionsPipeline->SetShaderParameter("DayTime", mixLevel);
sectionsPipeline->SetShaderParameter("projView", projView);
+ sectionsPipeline->SetShaderParameter("GlobalTime", globalTime);
Frustum frustum(projView);