Skip to content

Commit

Permalink
rgba
Browse files Browse the repository at this point in the history
  • Loading branch information
JulioJPinto committed May 26, 2024
1 parent bade6d2 commit 29a6539
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engine/src/model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ bool Model::loadTexture() {
// Load image data
int width, height, num_channels;
unsigned char* image_data = stbi_load(this->texture_filepath.data(), &width,
&height, &num_channels, STBI_rgb);
&height, &num_channels, STBI_rgb_alpha);

if (!image_data) {
std::cerr << "Failed to load texture: " << this->texture_filepath
Expand All @@ -140,7 +140,7 @@ bool Model::loadTexture() {

glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
// Upload data to GPU
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB,
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
GL_UNSIGNED_BYTE, image_data);
glGenerateMipmap(GL_TEXTURE_2D);

Expand Down

0 comments on commit 29a6539

Please sign in to comment.