add skybox
BIN
grafika_projekt/Debug/main.obj.enc
Normal file
Before Width: | Height: | Size: 723 KiB After Width: | Height: | Size: 723 KiB |
BIN
grafika_projekt/models/skybox/New folder/back.jpg
Normal file
After Width: | Height: | Size: 723 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 274 KiB |
BIN
grafika_projekt/models/skybox/New folder/bottom.jpg
Normal file
After Width: | Height: | Size: 274 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 462 KiB |
BIN
grafika_projekt/models/skybox/New folder/front.jpg
Normal file
After Width: | Height: | Size: 462 KiB |
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 588 KiB |
BIN
grafika_projekt/models/skybox/New folder/left.jpg
Normal file
After Width: | Height: | Size: 588 KiB |
Before Width: | Height: | Size: 525 KiB After Width: | Height: | Size: 525 KiB |
BIN
grafika_projekt/models/skybox/New folder/right.jpg
Normal file
After Width: | Height: | Size: 525 KiB |
Before Width: | Height: | Size: 338 KiB After Width: | Height: | Size: 338 KiB |
BIN
grafika_projekt/models/skybox/New folder/top.jpg
Normal file
After Width: | Height: | Size: 338 KiB |
BIN
grafika_projekt/models/skybox/New folder/top1.jpg
Normal file
After Width: | Height: | Size: 338 KiB |
BIN
grafika_projekt/models/skybox/back1.jpg
Normal file
After Width: | Height: | Size: 289 KiB |
BIN
grafika_projekt/models/skybox/bottom1.jpg
Normal file
After Width: | Height: | Size: 243 KiB |
BIN
grafika_projekt/models/skybox/front1.jpg
Normal file
After Width: | Height: | Size: 275 KiB |
BIN
grafika_projekt/models/skybox/left1.jpg
Normal file
After Width: | Height: | Size: 280 KiB |
BIN
grafika_projekt/models/skybox/right1.jpg
Normal file
After Width: | Height: | Size: 298 KiB |
BIN
grafika_projekt/models/skybox/top1.jpg
Normal file
After Width: | Height: | Size: 338 KiB |
@ -30,12 +30,12 @@ glm::mat4 cameraMatrix, perspectiveMatrix;
|
|||||||
Core::Shader_Loader shaderLoader;
|
Core::Shader_Loader shaderLoader;
|
||||||
|
|
||||||
std::string skyboxTextures[6] = {
|
std::string skyboxTextures[6] = {
|
||||||
"models/skybox/right.jpg",
|
"models/skybox/right1.jpg",
|
||||||
"models/skybox/left.jpg",
|
"models/skybox/left1.jpg",
|
||||||
"models/skybox/top.jpg",
|
"models/skybox/top1.jpg",
|
||||||
"models/skybox/bottom.jpg",
|
"models/skybox/bottom1.jpg",
|
||||||
"models/skybox/front.jpg",
|
"models/skybox/front1.jpg",
|
||||||
"models/skybox/back.jpg"
|
"models/skybox/back1.jpg"
|
||||||
};
|
};
|
||||||
|
|
||||||
float skyboxVertices[] = {
|
float skyboxVertices[] = {
|
||||||
@ -156,16 +156,17 @@ unsigned int loadCubemap()
|
|||||||
int width, height, nrChannels;
|
int width, height, nrChannels;
|
||||||
for (unsigned int i = 0; i < 6; i++)
|
for (unsigned int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
unsigned char* data = stbi_load(skyboxTextures[i].c_str(), &width, &height, &nrChannels, 0);
|
unsigned char* data = stbi_load(skyboxTextures[i].c_str(), &width, &height, &nrChannels, STBI_rgb_alpha);
|
||||||
if (data)
|
if (data)
|
||||||
{
|
{
|
||||||
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
|
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i,
|
||||||
0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, data
|
0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data
|
||||||
);
|
);
|
||||||
stbi_image_free(data);
|
stbi_image_free(data);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
std::cout << stbi_failure_reason() << std::endl;
|
||||||
std::cout << "Cubemap tex failed to load at path: " << skyboxTextures[i] << std::endl;
|
std::cout << "Cubemap tex failed to load at path: " << skyboxTextures[i] << std::endl;
|
||||||
stbi_image_free(data);
|
stbi_image_free(data);
|
||||||
}
|
}
|
||||||
|