summaryrefslogtreecommitdiffstats
path: root/src/RendererWorld.cpp
diff options
context:
space:
mode:
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) {