Merge pull request 'feat: add skybox' (#2) from skybox into master
Reviewed-on: #2
@ -1 +1,4 @@
|
||||
grafika_projekt.vcxproj -> J:\source\repos\grafika_projekt\Debug\grafika_projekt.exe
|
||||
main.cpp
|
||||
J:\source\repos\grafika_projekt\grafika_projekt\src\main.cpp(108,10): warning C4244: '=': conversion from 'int' to 'float', possible loss of data
|
||||
J:\source\repos\grafika_projekt\grafika_projekt\src\main.cpp(109,10): warning C4244: '=': conversion from 'int' to 'float', possible loss of data
|
||||
grafika_projekt.vcxproj -> J:\source\repos\grafika_projekt\Debug\grafika_projekt.exe
|
||||
|
BIN
grafika_projekt/Debug/main.obj.enc
Normal file
Before Width: | Height: | Size: 723 KiB After Width: | Height: | Size: 289 KiB |
Before Width: | Height: | Size: 274 KiB After Width: | Height: | Size: 243 KiB |
Before Width: | Height: | Size: 462 KiB After Width: | Height: | Size: 275 KiB |
Before Width: | Height: | Size: 588 KiB After Width: | Height: | Size: 280 KiB |
Before Width: | Height: | Size: 525 KiB After Width: | Height: | Size: 298 KiB |
Before Width: | Height: | Size: 338 KiB After Width: | Height: | Size: 338 KiB |
@ -156,16 +156,17 @@ unsigned int loadCubemap()
|
||||
int width, height, nrChannels;
|
||||
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)
|
||||
{
|
||||
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);
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << stbi_failure_reason() << std::endl;
|
||||
std::cout << "Cubemap tex failed to load at path: " << skyboxTextures[i] << std::endl;
|
||||
stbi_image_free(data);
|
||||
}
|
||||
|