From 5a6aaf633ce217f828d981cd8c55951ada67e2df Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Sun, 27 Jun 2021 21:31:00 +0500 Subject: Moved block face model matrix transformation to CPU --- src/RendererSectionData.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/RendererSectionData.cpp') diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp index 69ed665..cf05528 100644 --- a/src/RendererSectionData.cpp +++ b/src/RendererSectionData.cpp @@ -37,7 +37,13 @@ void AddFacesByBlockModel(RendererSectionData &data, const BlockFaces &model, co continue; lightness = glm::vec2(light.face[faceDirection], skyLight.face[faceDirection]); } - data.models.push_back(transform * model.transform * face.transform); + glm::mat4 transformed = transform * model.transform * face.transform; + data.positions.push_back(transformed * glm::vec4(0, 0, 0, 1)); + data.positions.push_back(transformed * glm::vec4(1, 0, 1, 1)); + data.positions.push_back(transformed * glm::vec4(1, 0, 0, 1)); + data.positions.push_back(transformed * glm::vec4(0, 0, 0, 1)); + data.positions.push_back(transformed * glm::vec4(0, 0, 1, 1)); + data.positions.push_back(transformed * glm::vec4(1, 0, 1, 1)); data.textures.push_back(face.texture); data.textureLayers.push_back(face.layer); data.textureFrames.push_back(face.frames); @@ -137,7 +143,7 @@ RendererSectionData ParseSection(const SectionsData §ions) { } data.textures.shrink_to_fit(); data.textureLayers.shrink_to_fit(); - data.models.shrink_to_fit(); + data.positions.shrink_to_fit(); data.colors.shrink_to_fit(); return data; -- cgit v1.2.3