completing skybox

This commit is contained in:
Dmitri K 2016-11-09 20:10:09 -05:00
parent a883722d25
commit 487bf12fa7
2 changed files with 15 additions and 17 deletions

View File

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

View File

@ -315,8 +315,8 @@ void Viewer::initShaders()
if ((s_vUvLocation = skyboxRenderShaderProgram->attributeLocation("vUv")) < 0)
qDebug() << "Unable to find shader location for " << "vUv";
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/skybox.jpg"));/*/
s_texture = new QOpenGLTexture(QImage("src/data/uvLayoutGrid.png"));//*/
s_texture->setMinificationFilter(QOpenGLTexture::LinearMipMapLinear);
s_texture->setMagnificationFilter(QOpenGLTexture::Linear);
}
@ -358,27 +358,25 @@ void Viewer::initGeometries()
{ 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] = {
{ 0, 0}, { 0, 0}, { 0, 0},
{ 0, 0}, { 0, 0}, { 0, 0},
{ 1.0, .25 }, { 1.0, .50 }, { .75, .50 },
{ .75, .50 }, { .75, .25 }, { 1.0, .25 },
{ .25 + ux, .25 + vy }, { .50 + ux, .25 + vy }, { .50 + ux, .50 + vy },
{ 0, 0}, { 0, 0}, { 0, 0},
{ .25, .25 }, { .50, .25 }, { .50, .50 },
{ .50, .50 }, { .25, .50 }, { .25, .25 },
{ 0, 0}, { 0, 0}, { 0, 0},
{ 0, 0}, { 0, 0}, { 0, 0},
{ .00, .25}, { .25, .25}, { .25, .50},
{ .25, .50}, { .00, .50}, { .00, .25},
{ 0, 0}, { 0, 0}, { 0, 0},
{ 0, 0}, { 0, 0}, { 0, 0},
{ .75, .25}, { .50, .50}, { .50, .25},
{ .50, .50}, { .75, .25}, { .75, .50},
{ 0, 0}, { 0, 0}, { 0, 0},
{ 0, 0}, { 0, 0}, { 0, 0},
{ .25, .00 }, { .49, .00 }, { .49, .25 },
{ .49, .25 }, { .25, .25 }, { .25, .00 },
{ 0, 0}, { 0, 0}, { 0, 0},
{ 0, 0}, { 0, 0}, { 0, 0},
{ .25, .50 }, { .49, .75 }, { .49, .50 },
{ .49, .75 }, { .25, .50 }, { .25, .75 },
};