Enable Mipmapping
This commit is contained in:
@@ -9,7 +9,7 @@ Size=894,195
|
||||
Collapsed=0
|
||||
|
||||
[Window][Debug Utils]
|
||||
Pos=-1,6
|
||||
Pos=13,9
|
||||
Size=791,379
|
||||
Collapsed=0
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
"entities": [
|
||||
{
|
||||
"unique_name": "backpack",
|
||||
"model": "backpvack",
|
||||
"model": "backpack",
|
||||
"shaderProgram": "defaultProgram",
|
||||
"position": [0.0, 1.0, 0.0],
|
||||
"rotation": [0.0, 0.0, 0.0],
|
||||
|
||||
@@ -28,9 +28,9 @@ Texture::Texture(const char *texturePath, uint8_t textureType)
|
||||
glGenTextures(1, &textureId);
|
||||
glBindTexture(GL_TEXTURE_2D, textureId);
|
||||
|
||||
//glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_LOD_BIAS, -2.0f);
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
@@ -42,7 +42,7 @@ Texture::Texture(const char *texturePath, uint8_t textureType)
|
||||
}
|
||||
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, textureWidth, textureHeight, 0, dataFormat, GL_UNSIGNED_BYTE, textureBuffer);
|
||||
//glGenerateMipmap(GL_TEXTURE_2D);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
stbi_image_free(textureBuffer);
|
||||
glBindTexture(GL_TEXTURE_2D, 0);
|
||||
|
||||
Reference in New Issue
Block a user