summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 02:15:12 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 02:15:12 +0200
commitcc3096b4f4649915cf89a5bc4f6b943d667369f5 (patch)
tree4de6e88338b65f3c66c2fdea29a067ec042012d2 /src/RendererWorld.cpp
parentReplaced usage of old texture atlas (diff)
downloadAltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar.gz
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar.bz2
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar.lz
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar.xz
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.tar.zst
AltCraft-cc3096b4f4649915cf89a5bc4f6b943d667369f5.zip
Diffstat (limited to 'src/RendererWorld.cpp')
-rw-r--r--src/RendererWorld.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp
index 5d0d6a8..ed4a4a3 100644
--- a/src/RendererWorld.cpp
+++ b/src/RendererWorld.cpp
@@ -427,12 +427,14 @@ void RendererWorld::PrepareRender() {
skyShader = new Shader("./shaders/sky.vs", "./shaders/sky.fs");
skyShader->Use();
glUniform1i(glGetUniformLocation(skyShader->Program, "textureAtlas"), 0);
- TextureCoordinates sunTexture = AssetManager::Instance().GetTextureByAssetName("minecraft/textures/environment/sun");
+ TextureCoord sunTexture = AssetManager::Instance().GetTexture("/minecraft/textures/environment/sun");
glUniform4f(glGetUniformLocation(skyShader->Program, "sunTexture"), sunTexture.x, sunTexture.y, sunTexture.w, sunTexture.h);
- TextureCoordinates moonTexture = AssetManager::Instance().GetTextureByAssetName("minecraft/textures/environment/moon_phases");
+ glUniform1f(glGetUniformLocation(skyShader->Program, "sunTextureLayer"), sunTexture.layer);
+ TextureCoord moonTexture = AssetManager::Instance().GetTexture("/minecraft/textures/environment/moon_phases");
moonTexture.w /= 4.0f; //First phase will be fine for now
moonTexture.h /= 2.0f;
glUniform4f(glGetUniformLocation(skyShader->Program, "moonTexture"), moonTexture.x, moonTexture.y, moonTexture.w, moonTexture.h);
+ glUniform1f(glGetUniformLocation(skyShader->Program, "moonTextureLayer"), moonTexture.layer);
}
void RendererWorld::Update(double timeToUpdate) {