Merge remote-tracking branch 'origin/issues/2-skybox' into issues/4-phong

This commit is contained in:
Riku Avelar 2016-11-09 20:16:16 -05:00
commit 28ccdafce5
2 changed files with 15 additions and 17 deletions

View File

@ -7,5 +7,5 @@ uniform sampler2D skybox;
void main() void main()
{ {
//fColor = texture(skybox, texCoords); //fColor = texture(skybox, texCoords);
fColor = texture(skybox, texCoords); fColor = texture(skybox, texCoords);
} }

View File

@ -328,8 +328,8 @@ void Viewer::initShaders()
if ((s_vUvLocation = skyboxRenderShaderProgram->attributeLocation("vUv")) < 0) if ((s_vUvLocation = skyboxRenderShaderProgram->attributeLocation("vUv")) < 0)
qDebug() << "Unable to find shader location for " << "vUv"; qDebug() << "Unable to find shader location for " << "vUv";
s_texture = new QOpenGLTexture(QImage("src/data/skybox.jpg")); s_texture = new QOpenGLTexture(QImage("src/data/skybox.jpg"));/*/
//s_texture = new QOpenGLTexture(QImage("src/data/uvLayoutGrid.png")); s_texture = new QOpenGLTexture(QImage("src/data/uvLayoutGrid.png"));//*/
s_texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear); s_texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
s_texture->setMagnificationFilter(QOpenGLTexture::Linear); s_texture->setMagnificationFilter(QOpenGLTexture::Linear);
} }
@ -371,27 +371,25 @@ void Viewer::initGeometries()
{ 0.5, -0.5, -0.5 }, { -0.5, -0.5, 0.5 }, { -0.5, -0.5, -0.5 } { 0.5, -0.5, -0.5 }, { -0.5, -0.5, 0.5 }, { -0.5, -0.5, -0.5 }
}; };
float ux = 0;
float vy = 0;
GLfloat uvs[numVerticesCube][2] = { GLfloat uvs[numVerticesCube][2] = {
{ 0, 0}, { 0, 0}, { 0, 0}, { 1.0, .25 }, { 1.0, .50 }, { .75, .50 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .75, .50 }, { .75, .25 }, { 1.0, .25 },
{ .25 + ux, .25 + vy }, { .50 + ux, .25 + vy }, { .50 + ux, .50 + vy }, { .25, .25 }, { .50, .25 }, { .50, .50 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .50, .50 }, { .25, .50 }, { .25, .25 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .00, .25}, { .25, .25}, { .25, .50},
{ 0, 0}, { 0, 0}, { 0, 0}, { .25, .50}, { .00, .50}, { .00, .25},
{ 0, 0}, { 0, 0}, { 0, 0}, { .75, .25}, { .50, .50}, { .50, .25},
{ 0, 0}, { 0, 0}, { 0, 0}, { .50, .50}, { .75, .25}, { .75, .50},
{ 0, 0}, { 0, 0}, { 0, 0}, { .25, .00 }, { .49, .00 }, { .49, .25 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .49, .25 }, { .25, .25 }, { .25, .00 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .25, .50 }, { .49, .75 }, { .49, .50 },
{ 0, 0}, { 0, 0}, { 0, 0}, { .49, .75 }, { .25, .50 }, { .25, .75 },
}; };