mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
glHint for compression
This commit is contained in:
parent
31f9d1994e
commit
5a6b6d995c
@ -7067,6 +7067,28 @@ upload_texture(CLP(TextureContext) *gtc, bool force) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (image_compression != Texture::CM_off) {
|
||||||
|
Texture::QualityLevel quality_level = tex->get_quality_level();
|
||||||
|
if (quality_level == Texture::QL_default) {
|
||||||
|
quality_level = texture_quality_level;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (quality_level) {
|
||||||
|
case Texture::QL_fastest:
|
||||||
|
GLP(Hint)(GL_TEXTURE_COMPRESSION_HINT, GL_FASTEST);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Texture::QL_default:
|
||||||
|
case Texture::QL_normal:
|
||||||
|
GLP(Hint)(GL_TEXTURE_COMPRESSION_HINT, GL_DONT_CARE);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case Texture::QL_best:
|
||||||
|
GLP(Hint)(GL_TEXTURE_COMPRESSION_HINT, GL_NICEST);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
GLP(PixelStorei)(GL_UNPACK_ALIGNMENT, 1);
|
GLP(PixelStorei)(GL_UNPACK_ALIGNMENT, 1);
|
||||||
|
|
||||||
bool uses_mipmaps = (tex->uses_mipmaps() && !CLP(ignore_mipmaps)) || CLP(force_mipmaps);
|
bool uses_mipmaps = (tex->uses_mipmaps() && !CLP(ignore_mipmaps)) || CLP(force_mipmaps);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user