Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.2] Fix ETC quality setting #44683

Merged
merged 1 commit into from
Dec 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions modules/etc/image_etc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,15 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f
// prepare parameters to be passed to etc2comp
int num_cpus = OS::get_singleton()->get_processor_count();
int encoding_time = 0;

float effort = 0.0; //default, reasonable time

if (p_lossy_quality > 0.75)
effort = 0.4;
if (p_lossy_quality > 0.95)
effort = 80;
else if (p_lossy_quality > 0.85)
effort = 0.6;
else if (p_lossy_quality > 0.95)
effort = 0.8;
effort = 60;
else if (p_lossy_quality > 0.75)
effort = 40;

Etc::ErrorMetric error_metric = Etc::ErrorMetric::RGBX; // NOTE: we can experiment with other error metrics
Etc::Image::Format etc2comp_etc_format = _image_format_to_etc2comp_format(etc_format);
Expand Down