mirror of
https://github.com/ConjureETS/LOG750-LAB2.git
synced 2026-03-24 03:21:19 +00:00
Add missing UVs (still missing?)
This commit is contained in:
parent
36208f6f26
commit
da52327de5
@ -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)
|
||||
|
||||
@ -90,7 +90,7 @@ private:
|
||||
int s_colorLocation;
|
||||
int s_projMatrixLocation;
|
||||
int s_skyboxCubemapLocation;
|
||||
int s_vUv;
|
||||
int s_vUvLocation;
|
||||
|
||||
QOpenGLTexture *s_texture;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user