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

Fix pvrtc encoder #28563

Merged
merged 1 commit into from
May 1, 2019
Merged

Conversation

DrMoriarty
Copy link
Contributor

@DrMoriarty DrMoriarty commented May 1, 2019

Always resize image to square of power2
Enable mipmaps only if original texture has it enabled
Fix #28534, fix #28541

Always resize image to square of power2
Enable mipmaps only if original texture has it enabled
Fix godotengine#28534, godotengine#28541
@akien-mga akien-mga added this to the 3.2 milestone May 1, 2019
@akien-mga akien-mga requested a review from reduz May 1, 2019 10:44
@akien-mga akien-mga mentioned this pull request May 1, 2019
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes seem good, just need a quick check from @reduz to confirm if there was any reason to modulate by 8 instead of po2.

@akien-mga
Copy link
Member

Comments from @reduz on IRC:

13:58 <reduz> Akien: well, technically po2 is only needed when you use mipmaps on GLES2
14:15 <@Akien> reduz: so they should keep the previous logic with % 8 when there's no mipmaps I guess?
14:15 <reduz> Akien: i think so, but the importer I think already resizes to po2
14:15 <reduz> Akien: so i am not quite sure what the problem is

@DrMoriarty
Copy link
Contributor Author

@akien-mga may be somebody should fix thirdparty pvrtc encoder?
file godot3/thirdparty/pvrtccompressor/PvrTcEncoder.cpp:

 267|void PvrTcEncoder::EncodeRgb4Bpp(void* result, const RgbaBitmap& bitmap)
 268|{
 269|    assert(bitmap.GetBitmapWidth() == bitmap.GetBitmapHeight());
 270|    assert(BitUtility::IsPowerOf2(bitmap.GetBitmapWidth()));

@DrMoriarty
Copy link
Contributor Author

@akien-mga I'm looking around the Internet and can not find open pvrtc encoder which doesn't require square pow2 texture input.

@akien-mga
Copy link
Member

Could not get another answer from @reduz, so let's stick to what the thirdparty library requires. Thanks for looking into this :)

@akien-mga akien-mga merged commit 1d9a207 into godotengine:master May 1, 2019
@akien-mga
Copy link
Member

Thanks!

@akien-mga
Copy link
Member

Cherry-picked for 3.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange checking power of two in pvrtc encoder. Editor crash in pvrtc compressor.
2 participants