diff --git a/src/data/skybox.jpg b/src/data/skybox.jpg index bc58273..b895e94 100644 Binary files a/src/data/skybox.jpg and b/src/data/skybox.jpg differ diff --git a/src/data/uvLayoutGrid.png b/src/data/uvLayoutGrid.png new file mode 100644 index 0000000..fadb9f6 Binary files /dev/null and b/src/data/uvLayoutGrid.png differ diff --git a/src/shaders/skyboxshader.frag b/src/shaders/skyboxshader.frag index f1b865c..6d1e725 100644 --- a/src/shaders/skyboxshader.frag +++ b/src/shaders/skyboxshader.frag @@ -7,5 +7,5 @@ uniform sampler2D skybox; void main() { //fColor = texture(skybox, texCoords); - fColor = vec4(1.0, 0, 1.0, 1.0);// * texture(skybox, texCoords); + fColor = texture(skybox, texCoords); } diff --git a/src/viewer/simpleViewer.cpp b/src/viewer/simpleViewer.cpp index f7ced56..f5a1949 100644 --- a/src/viewer/simpleViewer.cpp +++ b/src/viewer/simpleViewer.cpp @@ -228,6 +228,8 @@ void Viewer::init() void Viewer::initShaders() { + + // Load vertex and fragment shaders m_program = new QOpenGLShaderProgram; colorPickerShaderProgram = m_program; @@ -313,7 +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").mirrored()); + 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); } @@ -355,25 +358,28 @@ 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] = { - GLfloat uvs[numVerticesCube][2] = { - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, + { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, + { .25 + ux, .25 + vy }, { .50 + ux, .25 + vy }, { .50 + ux, .50 + vy }, + { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, + { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, + { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, + { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, + + { 0, 0}, { 0, 0}, { 0, 0}, + { 0, 0}, { 0, 0}, { 0, 0}, - { 0, 0 }, { 1, 0 }, { 0, 1 }, - { 1, 1 }, { 0, 0 }, { 1, 0 }, };