summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-09 04:50:40 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-09 07:37:18 +0200
commitb6dfe86cadaa9e38b4265d69972fb7dff5b73fff (patch)
treef5dcf90197a7b24a70a742c16c4538ae2c3e6fe3 /src/RendererWorld.cpp
parentRefactored Block (diff)
downloadAltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.gz
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.bz2
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.lz
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.xz
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.tar.zst
AltCraft-b6dfe86cadaa9e38b4265d69972fb7dff5b73fff.zip
Diffstat (limited to '')
-rw-r--r--src/RendererWorld.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index dcfcc24..2ed2620 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -243,6 +243,11 @@ RendererWorld::RendererWorld(GameState* ptr) {
sections.erase(it);
});
+ listener->RegisterHandler("SetMinLightLevel", [this](const Event& eventData) {
+ auto value = eventData.get<float>();
+ glUniform1f(glGetUniformLocation(blockShader->Program, "MinLightLevel"), value);
+ });
+
for (int i = 0; i < numOfWorkers; i++)
workers.push_back(std::thread(&RendererWorld::WorkerFunction, this, i));
@@ -421,6 +426,7 @@ void RendererWorld::PrepareRender() {
blockShader = new Shader("./shaders/face.vs", "./shaders/face.fs");
blockShader->Use();
glUniform1i(glGetUniformLocation(blockShader->Program, "textureAtlas"), 0);
+ glUniform1f(glGetUniformLocation(blockShader->Program, "MinLightLevel"), 0.2f);
entityShader = new Shader("./shaders/entity.vs", "./shaders/entity.fs");