From cf647ebf504eb523d822fa79622cb59d009680da Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Tue, 13 Mar 2018 19:30:05 +0500 Subject: Implemented basic lighting --- src/RendererSectionData.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/RendererSectionData.cpp') diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp index 1ed1099..067728f 100644 --- a/src/RendererSectionData.cpp +++ b/src/RendererSectionData.cpp @@ -289,7 +289,7 @@ RendererSectionData ParseSection(World * world, Vector sectionPosition) const BlockModel* model = GetInternalBlockModel(block, idModels); if (model) { - AddFacesByBlockModel(sectionsList, world, Vector(x, y, z), *model, transform, section.GetBlockLight(Vector(x, y, z)), section.GetBlockSkyLight(Vector(x, y, z)), blockVisibility, textureName, data); + AddFacesByBlockModel(sectionsList, world, Vector(x, y, z), *model, transform, world->GetBlockLight(Vector(x, y, z) + sectionPosition * 16), world->GetBlockSkyLight(Vector(x, y, z) + sectionPosition * 16), blockVisibility, textureName, data); } else { transform = glm::translate(transform, glm::vec3(0, 1, 0)); @@ -304,7 +304,7 @@ RendererSectionData ParseSection(World * world, Vector sectionPosition) data.models.push_back(transform); data.colors.push_back(glm::vec3(0, 0, 0)); - data.lights.push_back(glm::vec2(16, 16)); + data.lights.push_back(glm::vec2(world->GetBlockLight(Vector(x, y, z) + sectionPosition * 16), world->GetBlockSkyLight(Vector(x, y, z) + sectionPosition * 16))); } } -- cgit v1.2.3