diff options
author | LaG1924 <lag1924@gmail.com> | 2021-06-28 18:31:26 +0200 |
---|---|---|
committer | LaG1924 <lag1924@gmail.com> | 2021-06-28 18:31:26 +0200 |
commit | 08337925fe048d2e8b746bbc82493f4c2b8603d6 (patch) | |
tree | dbedfb5aae51c59423fbc590b2c2f322f9362a79 /src/RendererSection.cpp | |
parent | Implemented vertex data iterleaving (diff) | |
download | AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.gz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.bz2 AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.lz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.xz AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.tar.zst AltCraft-08337925fe048d2e8b746bbc82493f4c2b8603d6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/RendererSection.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/RendererSection.cpp b/src/RendererSection.cpp index 397a660..cc58676 100644 --- a/src/RendererSection.cpp +++ b/src/RendererSection.cpp @@ -21,19 +21,19 @@ RendererSection::RendererSection(const RendererSectionData &data) { { //Cube vertices GLuint VertAttribPos = 0; - glVertexAttribPointer(VertAttribPos, 4, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[0])); + glVertexAttribPointer(VertAttribPos, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[0])); glEnableVertexAttribArray(VertAttribPos); glVertexAttribDivisor(VertAttribPos, 1); - glVertexAttribPointer(VertAttribPos + 1, 4, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[1])); + glVertexAttribPointer(VertAttribPos + 1, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[1])); glEnableVertexAttribArray(VertAttribPos + 1); glVertexAttribDivisor(VertAttribPos + 1, 1); - glVertexAttribPointer(VertAttribPos + 2, 4, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[2])); + glVertexAttribPointer(VertAttribPos + 2, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[2])); glEnableVertexAttribArray(VertAttribPos + 2); glVertexAttribDivisor(VertAttribPos + 2, 1); - glVertexAttribPointer(VertAttribPos + 3, 4, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[3])); + glVertexAttribPointer(VertAttribPos + 3, 3, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, positions[3])); glEnableVertexAttribArray(VertAttribPos + 3); glVertexAttribDivisor(VertAttribPos + 3, 1); glCheckError(); @@ -64,7 +64,7 @@ RendererSection::RendererSection(const RendererSectionData &data) { //Animation GLuint animationAttribPos = 9; - glVertexAttribPointer(animationAttribPos, 2, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, animations)); + glVertexAttribPointer(animationAttribPos, 1, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, animations)); glEnableVertexAttribArray(animationAttribPos); glVertexAttribDivisor(animationAttribPos, 1); @@ -74,9 +74,6 @@ RendererSection::RendererSection(const RendererSectionData &data) { glEnableVertexAttribArray(colorAttribPos); glVertexAttribDivisor(colorAttribPos, 1); - size_t m = sizeof(VertexData); - size_t d = offsetof(VertexData, lights); - //Light GLuint lightAttribPos = 11; glVertexAttribPointer(lightAttribPos, 2, GL_FLOAT, GL_FALSE, sizeof(VertexData), (void*)offsetof(VertexData, lights)); |