summaryrefslogtreecommitdiffstats
path: root/src/RendererSection.cpp
diff options
context:
space:
mode:
authorLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 01:40:01 +0200
committerLaG1924 <12997935+LaG1924@users.noreply.github.com>2018-08-05 01:40:01 +0200
commitc0b81150298ce9f2f21da42f26a57fe59a93bb77 (patch)
tree15304e4c36093a5beb524e67c976a241c5c556f3 /src/RendererSection.cpp
parentImplemented texture atlas (diff)
downloadAltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.gz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.bz2
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.lz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.xz
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.tar.zst
AltCraft-c0b81150298ce9f2f21da42f26a57fe59a93bb77.zip
Diffstat (limited to '')
-rw-r--r--src/RendererSection.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp
index 21c2714..bbf24ff 100644
--- a/src/RendererSection.cpp
+++ b/src/RendererSection.cpp
@@ -73,6 +73,14 @@ RendererSection::RendererSection(const RendererSectionData &data) {
glVertexAttribDivisor(textureAttribPos, 1);
glCheckError();
+ //TextureLayers
+ GLuint layerAttribPos = 14;
+ glBindBuffer(GL_ARRAY_BUFFER, Vbo[LAYERS]);
+ glVertexAttribPointer(layerAttribPos, 1, GL_FLOAT, GL_FALSE, sizeof(GLfloat), nullptr);
+ glEnableVertexAttribArray(layerAttribPos);
+ glVertexAttribDivisor(layerAttribPos, 1);
+ glCheckError();
+
//Blocks models
GLuint matAttribPos = 8;
size_t sizeOfMat4 = 4 * 4 * sizeof(GLfloat);
@@ -156,6 +164,9 @@ void RendererSection::UpdateData(const RendererSectionData & data) {
glBindBuffer(GL_ARRAY_BUFFER, Vbo[TEXTURES]);
glBufferData(GL_ARRAY_BUFFER, data.textures.size() * sizeof(glm::vec4), data.textures.data(), GL_DYNAMIC_DRAW);
+ glBindBuffer(GL_ARRAY_BUFFER, Vbo[LAYERS]);
+ glBufferData(GL_ARRAY_BUFFER, data.textureLayers.size() * 1* sizeof(GLfloat), data.textureLayers.data(), GL_DYNAMIC_DRAW);
+
glBindBuffer(GL_ARRAY_BUFFER, Vbo[MODELS]);
glBufferData(GL_ARRAY_BUFFER, data.models.size() * sizeof(glm::mat4), data.models.data(), GL_DYNAMIC_DRAW);