PNG Texture2D compression format for BlazorGL? #1917
Replies: 3 comments 2 replies
-
That's a good feature, Adding a ColorPng TextureFormat that would decompress to Color on runtime. There's also QOI format which has quick decoding compared to PNG. but worst compression ratio. In our case a high decoding speed might be better that a high compression ratio. Anyways, if you want to proceed -png or not-, I'd be happy to include it. |
Beta Was this translation helpful? Give feedback.
-
Some more thoughts on this... xnb already has compression with the same characteristics as QOI, fast decompression, medium ratio. The net result might be equal. PNG specialized in compressing images but with extra cost in decoding. Another idea is to extend the compression algorithm in XNBs (Lz4), and use the build in compression libraries on .net. |
Beta Was this translation helpful? Give feedback.
-
A quick test on compressing SpriteFont data.
taking Lz4 as the baseline:
The Spritefont :
|
Beta Was this translation helpful? Give feedback.
-
The content pipeline produces huge xnb files for textures by default, which is not ideal for a web game. For example, I have a 700K texture that becomes a 16MB xnb that has to be downloaded on first load, which is not great on a mobile device.
The pipeline supports some texture compression options, but they are all lossy and in my case my game cannot tolerate this because the textures have data used by shaders.
Ideally, I would like to use the PNG file format but this currently requires code changes to load content from a stream, which is a complication for cross-platform projects.
It seems like the ideal solution would be for the content pipeline to support PNG as an alternative compression format for textures so the differences between the content types on different platforms could be handled in the content pipeline rather than in platform-specific code.
@nkast Would you be open to this change? I'd be happy to implement it, but I don't want to spend time on it if you wouldn't accept the change.
Beta Was this translation helpful? Give feedback.
All reactions