[CORE][FIX] Fix sky box rotation

This commit is contained in:
Linloir 2022-12-18 11:01:10 +08:00
parent 957713cda7
commit 44417cd6ec
No known key found for this signature in database
GPG Key ID: 58EEB209A0F2C366
3 changed files with 4 additions and 5 deletions

View File

@ -10,8 +10,8 @@ SkyBox::SkyBox(std::string path){
faces.clear();
faces.push_back(path + "/right.jpg");
faces.push_back(path + "/left.jpg");
faces.push_back(path + "/bottom.jpg");
faces.push_back(path + "/top.jpg");
faces.push_back(path + "/bottom.jpg");
faces.push_back(path + "/front.jpg");
faces.push_back(path + "/back.jpg");
@ -42,7 +42,7 @@ unsigned int SkyBox::loadCubemap(std::vector<std::string> faces)
unsigned int textureID;
OPENGL_FUNCTIONS->glGenTextures(1, &textureID);
OPENGL_FUNCTIONS->glBindTexture(GL_TEXTURE_CUBE_MAP, textureID);
stbi_set_flip_vertically_on_load(true);
stbi_set_flip_vertically_on_load(false);
int width, height, nrChannels;
for (unsigned int i = 0; i < faces.size(); i++)

View File

@ -1,4 +1,4 @@
#version 330 core
#version 430 core
out vec4 FragColor;
in vec3 TexCoords;

View File

@ -1,4 +1,4 @@
#version 330 core
#version 430 core
layout (location = 0) in vec3 aPos;
out vec3 TexCoords;
@ -11,5 +11,4 @@ void main()
TexCoords = aPos;
vec4 pos = projection * view * vec4(aPos, 1.0);
gl_Position = pos.xyww;
gl_Position.y = -gl_Position.y;
}