RenderableRings's VBO only needs to contain two values for size

This commit is contained in:
Alexander Bock
2016-10-29 17:45:18 +02:00
parent c7809cb6cf
commit 64cb9bce0d
2 changed files with 11 additions and 11 deletions
+9 -9
View File
@@ -263,22 +263,22 @@ void RenderableRings::loadTexture() {
void RenderableRings::createPlane() {
const GLfloat size = _size.value();
const GLfloat vertex_data[] = {
// x y z w s t
-size, -size, 0.f, 0.f, 0.f, 0.f,
size, size, 0.f, 0.f, 1.f, 1.f,
-size, size, 0.f, 0.f, 0.f, 1.f,
-size, -size, 0.f, 0.f, 0.f, 0.f,
size, -size, 0.f, 0.f, 1.f, 0.f,
size, size, 0.f, 0.f, 1.f, 1.f,
// x y s t
-size, -size, 0.f, 0.f,
size, size, 1.f, 1.f,
-size, size, 0.f, 1.f,
-size, -size, 0.f, 0.f,
size, -size, 1.f, 0.f,
size, size, 1.f, 1.f,
};
glBindVertexArray(_quad); // bind array
glBindBuffer(GL_ARRAY_BUFFER, _vertexPositionBuffer); // bind buffer
glBufferData(GL_ARRAY_BUFFER, sizeof(vertex_data), vertex_data, GL_STATIC_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(0));
glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 4, reinterpret_cast<void*>(0));
glEnableVertexAttribArray(1);
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 6, reinterpret_cast<void*>(sizeof(GLfloat) * 4));
glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, sizeof(GLfloat) * 4, reinterpret_cast<void*>(sizeof(GLfloat) * 2));
}
} // namespace openspace
+2 -2
View File
@@ -26,7 +26,7 @@
#include "PowerScaling/powerScaling_vs.hglsl"
layout(location = 0) in vec4 in_position;
layout(location = 0) in vec2 in_position;
layout(location = 1) in vec2 in_st;
out vec2 vs_st;
@@ -38,7 +38,7 @@ void main() {
vs_st = in_st;
vs_position = z_normalization(
modelViewProjectionTransform * vec4(in_position.xyz * pow(10, in_position.w), 1.0)
modelViewProjectionTransform * vec4(in_position.xy, 0.0, 1.0)
);
gl_Position = vs_position;