Add missing UVs (still missing?)

This commit is contained in:
Riku Avelar 2016-11-09 17:58:45 -05:00
parent 36208f6f26
commit da52327de5
2 changed files with 9 additions and 2 deletions

View File

@ -93,7 +93,7 @@ void Viewer::drawSkybox()
// Increase size of skybox
modelViewMatrix.scale(300);
modelViewMatrix.scale(1);
skyboxRenderShaderProgram->setUniformValue(s_projMatrixLocation, projectionMatrix);
skyboxRenderShaderProgram->setUniformValue(s_mvMatrixLocation, modelViewMatrix);
@ -302,6 +302,9 @@ void Viewer::initShaders()
if ((s_mvMatrixLocation = skyboxRenderShaderProgram->uniformLocation("mvMatrix")) < 0)
qDebug() << "Unable to find shader location for " << "mvMatrix";
if ((s_vUvLocation = skyboxRenderShaderProgram->attributeLocation("vUv")) < 0)
qDebug() << "Unable to find shader location for " << "vUv";
s_texture = new QOpenGLTexture(QImage("src/data/skybox.jpg").mirrored());
s_texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
s_texture->setMagnificationFilter(QOpenGLTexture::Linear);
@ -382,6 +385,10 @@ void Viewer::initGeometries()
glVertexAttribPointer(m_vPositionLocation, 3, GL_FLOAT, GL_FALSE, 0, BUFFER_OFFSET(0));
glEnableVertexAttribArray(m_vPositionLocation);
glVertexAttribPointer(s_vUvLocation, 2, GL_FLOAT,
GL_FALSE, 0, BUFFER_OFFSET(sizeof(verticesCube)));
glEnableVertexAttribArray(s_vUvLocation);
}
void Viewer::visit(Cube &s)

View File

@ -90,7 +90,7 @@ private:
int s_colorLocation;
int s_projMatrixLocation;
int s_skyboxCubemapLocation;
int s_vUv;
int s_vUvLocation;
QOpenGLTexture *s_texture;