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

Expand support for GL ES / WebGL compatible formats. #2101

Merged
merged 3 commits into from
Jan 19, 2024

Conversation

riccardobl
Copy link
Member

This pr expand the compatible format list for gl es 3 and adds ETC2 support.
The DDS loader can now load ETC DDSs converted with compressonator (basically old header dds with custom pixel formats).

limitations:

  • ETC flipping is not supported: i couldn't figure out how to flip etc compressed textures without decompressing them first, even though it is probably possible (similar to dxt flipping). I don't this this is very important, since compressed textures are usually considered in their final form and they can be flipped during compression if needed, also we didn't even had dxt flipping for a long time. I plan to open an issue for this and hopefully someone that is knowledgeable about etc formats can contribute with the missing code one day.

@stephengold
Copy link
Member

The new file (ETCFlipper.java) needs some javadoc describing its purpose.

@stephengold stephengold added this to the Future Release milestone Oct 25, 2023
public static ByteBuffer flipDXT(ByteBuffer img, int w, int h, Format format) {
if (format == Format.ETC1 || format == Format.ETC2 || format == Format.ETC2_ALPHA1) {
logger.warning("This is not a DXT format, but ETC. Use flipETC instead.");
return ETCFlipper.flipETC(img, w, h, format);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why call ETCFlipper.flipETC(img, w, h, format); if it doesn't do anything? why not just return img?

Copy link
Member Author

Choose a reason for hiding this comment

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

ETC flipping is not supported: i couldn't figure out how to flip etc compressed textures without decompressing them first, even though it is probably possible (similar to dxt flipping). I don't this this is very important, since compressed textures are usually considered in their final form and they can be flipped during compression if needed, also we didn't even had dxt flipping for a long time. I plan to open an issue for this and hopefully someone that is knowledgeable about etc formats can contribute with the missing code one day.

Basically i don't know how to implement compressed etc flipping, so i wrote all the supporting code in the hope that someone can go into ETCFlipper some day and write the missing piece without the need to understand and modify the dds loader code that has some jme specific logic inside.
We could open a bounty for it.

@scenemax3d scenemax3d modified the milestones: Future Release, v3.7.0 Jan 13, 2024
@scenemax3d scenemax3d merged commit 70f9da9 into jMonkeyEngine:master Jan 19, 2024
14 checks passed
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.

3 participants