修改后的天空盒

This commit is contained in:
胤龙 2022-12-18 11:09:49 +08:00
parent fe28e220ea
commit 15bcb698bd
2 changed files with 4 additions and 3 deletions

View File

@ -110,7 +110,7 @@ void SceneViewer::paintGL() {
glm::mat4 view = _camera.viewMatrix();
glm::mat4 projection = glm::perspective(glm::radians(_camera.zoomVal()), (float)width() / (float)height(), 0.1f, 100.0f);
Model = glm::translate(Model, glm::vec3(0.0f, -5.0f, 0.0f));
Model = glm::scale(Model, glm::vec3(10.0f));
Model = glm::scale(Model, glm::vec3(100.0f));
terrainShader.setUniform("view", view);
terrainShader.setUniform("projection", projection);
terrainShader.setUniform("model", Model);

View File

@ -11,8 +11,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");
@ -43,7 +43,8 @@ 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++)