diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/RendererSectionData.cpp | 11 | ||||
-rw-r--r-- | src/RendererSectionData.hpp | 9 | ||||
-rw-r--r-- | src/RendererWorld.cpp | 9 |
3 files changed, 13 insertions, 16 deletions
diff --git a/src/RendererSectionData.cpp b/src/RendererSectionData.cpp index c7d922e..979858e 100644 --- a/src/RendererSectionData.cpp +++ b/src/RendererSectionData.cpp @@ -65,11 +65,14 @@ void AddFacesByBlockModel(RendererSectionData &data, const BlockFaces &model, co vertexData.uvs[2] = TransformTextureCoord(face.texture, glm::vec2(1, 1), face.frames); vertexData.uvs[3] = TransformTextureCoord(face.texture, glm::vec2(0, 1), face.frames); - vertexData.uvLayers = face.layer; - vertexData.animations = face.frames; + vertexData.layerAnimationAo.r = face.layer; + vertexData.layerAnimationAo.g = face.frames; vertexData.colors = face.color; - vertexData.lights = lightness; - vertexData.ambientOcclusion = model.ambientOcclusion ? 1.0f : 0.0f; + vertexData.lights[0] = lightness; + vertexData.lights[1] = lightness; + vertexData.lights[2] = lightness; + vertexData.lights[3] = lightness; + vertexData.layerAnimationAo.b = model.ambientOcclusion ? 1.0f : 0.0f; } } diff --git a/src/RendererSectionData.hpp b/src/RendererSectionData.hpp index 390200c..efc6cad 100644 --- a/src/RendererSectionData.hpp +++ b/src/RendererSectionData.hpp @@ -32,14 +32,11 @@ struct SectionsData { struct VertexData { glm::vec3 positions[4]; - glm::vec3 normal; glm::vec2 uvs[4]; - float uvLayers; - float animations; + glm::vec2 lights[4]; + glm::vec3 normal; glm::vec3 colors; - glm::vec2 lights; - float ambientOcclusion; - uint8_t padding[4]; + glm::vec3 layerAnimationAo; //R - uvLayer, G - animation, B - ambientOcclusion }; struct RendererSectionData { diff --git a/src/RendererWorld.cpp b/src/RendererWorld.cpp index 2ffb57f..21f0db2 100644 --- a/src/RendererWorld.cpp +++ b/src/RendererWorld.cpp @@ -457,14 +457,11 @@ void RendererWorld::PrepareRender(std::shared_ptr<Gal::Framebuffer> target, bool sectionsPLC->SetPrimitive(Gal::Primitive::TriangleFan); sectionsBufferBinding = sectionsPLC->BindVertexBuffer({ {"pos", Gal::Type::Vec3, 4, 1}, - {"normal", Gal::Type::Vec3, 1, 1}, {"uv", Gal::Type::Vec2, 4, 1}, - {"uvLayer", Gal::Type::Float, 1, 1}, - {"animation", Gal::Type::Float, 1, 1}, + {"light", Gal::Type::Vec2, 4, 1}, + {"normal", Gal::Type::Vec3, 1, 1}, {"color", Gal::Type::Vec3, 1, 1}, - {"light", Gal::Type::Vec2, 1, 1}, - {"ambientOcclusion", Gal::Type::Float, 1, 1}, - {"", Gal::Type::Uint8, 4, 1} + {"layerAnimationAo", Gal::Type::Vec3, 1, 1}, }); sectionsPipeline = gal->BuildPipeline(sectionsPLC); } |