mirror of
https://github.com/Linloir/SceneEditor.git
synced 2025-12-16 23:18:12 +08:00
[CORE][FIX] Fix sky box rotation
This commit is contained in:
parent
957713cda7
commit
44417cd6ec
@ -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++)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
#version 330 core
|
||||
#version 430 core
|
||||
out vec4 FragColor;
|
||||
|
||||
in vec3 TexCoords;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user