From cc3096b4f4649915cf89a5bc4f6b943d667369f5 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Sun, 5 Aug 2018 05:15:12 +0500 Subject: Removed previous implementation of texture atlas --- src/RendererWorld.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/RendererWorld.cpp') 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) { -- cgit v1.2.3