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

Optimize AtlasTexture packing by minimal perimeter (fixes #19307) #22215

Merged
merged 1 commit into from Sep 18, 2018

Conversation

Projects
None yet
2 participants
@DrMoriarty
Copy link
Contributor

commented Sep 18, 2018

For atlas efficiency now used minimal perimeter instead of minimal area.
fix #19307

2018-09-18 15 46 28

@akien-mga akien-mga added this to the 2.1 milestone Sep 18, 2018

@akien-mga

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

Thanks! Could you amend the commit (git commit --amend and then git push --force) to give it a more explicit description? The commit title should say what it does beyond the GitHub issue reference, e.g.

Optimize AtlasTexture packing by minimal perimeter

Fixes #19307.
}
}

if (best < 0) {
print_line("Atlas processing failed!");

This comment has been minimized.

Copy link
@akien-mga

akien-mga Sep 18, 2018

Member

You could use ERR_PRINT here instead.


for (int i = 0; i < results.size(); i++) {

float h = results[i].max_h;
float w = results[i].max_w;
float efficiency = float(w * h) / float(next_power_of_2(w) * next_power_of_2(h));
if (efficiency > max_eff) {
//float efficiency = float(w * h) / float(next_power_of_2(w) * next_power_of_2(h));

This comment has been minimized.

Copy link
@akien-mga

akien-mga Sep 18, 2018

Member

Maybe drop this comment if no longer relevant.

@DrMoriarty DrMoriarty force-pushed the DrMoriarty:fix_atlas branch from 88ec34b to 9b992dd Sep 18, 2018

@DrMoriarty

This comment has been minimized.

Copy link
Contributor Author

commented Sep 18, 2018

@akien-mga done

@akien-mga

This comment has been minimized.

Copy link
Member

commented Sep 18, 2018

Thanks!

@akien-mga akien-mga changed the title fix #19307 Optimize AtlasTexture packing by minimal perimeter (fixes #19307) Sep 18, 2018

@akien-mga akien-mga merged commit 9b7009b into godotengine:2.1 Sep 18, 2018

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.