Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To compress VRAM textures takes time. b19225b ensured that ETC compression was as fast as possible. However, there were three issues with this change:
godot/modules/etc/image_compress_etc.cpp
Lines 167 to 175 in 545c894
else if
statements will never be true so the higher settings will never be applied.effort
is a value between 0 and 100, not 0 and 1; so even with 0.4 the effort value is effectively 0 (although there is still a difference, as ETC checks if the value is > 0).lossy_quality
setting and theeffort
applied.This PR addresses the first two issues. I haven't addressed the third issue, because I suspect there was a reason for introducing this shift: most of the benefit from ETC compression is obtained between 40 and 65 (reference) and setting it to 100 has little benefit.
Note: This PR leaves the default effort at 0, because the default
lossy_quality
is 0.7. Therefore there will be no impact to most users. However, anyone using a higher value for thelossy_quality
will notice a significant increase in the time it takes to create the VRAM compressed files. As an indication, here are the times in ms I get for importing a 1024x1024 texture to ETC and ETC2 format with this PR:The benefit of course is that the textures will have the expected higher quality; even if the artificial adjustment to the effort remains.