mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
glHint for compression
This commit is contained in:
parent
31f9d1994e
commit
5a6b6d995c
@ -6990,7 +6990,7 @@ upload_texture(CLP(TextureContext) *gtc, bool force) {
|
||||
if (!get_supports_compressed_texture_format(image_compression)) {
|
||||
image = tex->get_uncompressed_ram_image();
|
||||
image_compression = Texture::CM_off;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
if (image.is_null()) {
|
||||
@ -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);
|
||||
|
||||
bool uses_mipmaps = (tex->uses_mipmaps() && !CLP(ignore_mipmaps)) || CLP(force_mipmaps);
|
||||
|
Loading…
x
Reference in New Issue
Block a user