I discovered that jMonkeyEngine 3.4 does not support the BC7 compression of DDS textures. This compression, introduced with DirectX11, provides the best quality.
If anybody is willing to take the (summer?) challenge, I’ll beta test it.
Here is the error that you get when you try to load a BC7 texture:
com.jme3.asset.AssetLoadException: An exception has occurred while loading asset: ...
Caused by: java.io.IOException: Unsupported DX10 format: 98
at com.jme3.texture.plugins.DDSLoader.loadDX10Header(DDSLoader.java:149)
at com.jme3.texture.plugins.DDSLoader.loadHeader(DDSLoader.java:231)
at com.jme3.texture.plugins.DDSLoader.load(DDSLoader.java:121)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:272)
... 18 more
This is the reference C code from Microsoft, not sure if useful:
My BC7 without flipping are drawn upside down. I’ve checked Compressonator but I can’t find an option to convert texture in “unflipped” form… any suggestion? Thanks!
You are converting PNGs, right? Flip, convert to BC7, open a beer and enjoy! This is either way a little faster. All flipping is done in Java code before uploading the data to GPU, so there is a small performance penalty with jME flip.
Please note that most of these tools are useless because they rotate, rather than flip, the image
Now, a bit of theory behind this code:
Texture2D t = (Texture2D)assetManager.loadTexture(new TextureKey(“myTexture.dds”, false));
If I understand correctly, I disable the flipping on the assetManager, meaning that by default all image are flipped at runtime? And by disabling this, I’m saving CPU/GPU cycles?
Yeah, sorry, didn’t think too much But glad you got your tool going.
I don’t know if there is a global flip switch. But that only concerns one texture, the code. Not the asset manager as a whole. I guess the flipping is default since many models are for DX by default, not OpenGL. And it has become a standard way anyhow?
What comes to any CPU savings, yes, you’ll save few cycles. I doubt it is noticeable. The flipping is just Java code, with those BCx formats it is a bit complicated. Eventually the data is sent to GPU. And asset manager by default caches so the impact is very minimal I’d say, without actually measuring.
In terms of NOT flipping, the gains:
GPU savings, 0
CPU savings, very little
using cool encoding, priceless (you probably already know the general benefits of using BC7)