-
Notifications
You must be signed in to change notification settings - Fork 246
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
Questions about ASTC compression in two special cases #430
Comments
The My first step on complex images is to try the In general for alpha transparency you want to extrude the edge color value in to the transparent region. Filling transparent areas with e.g. black or white tends to be a bad solution (and fails with post-multiplied blending used in GPUs when filtered, even without compression). Failing that I would suggest tweaking the channel weighting for mask textures using the Can you share an example texture (uncompressed input so I can try to reproduce here)? What is the full command line you are using?
Why does texture resolution matter? A 4x4 block is a 4x4 block, no matter if the image is 2Kx2K or 16x16. Compress everything, unless you have a compelling case where you might not want to that actually show problems. Text font atlases are about the only case where I'd worry. |
I just use the example picture you have used in #208 with latest v4.5.0 build. the original picture i download from github is: |
This is a good example of failures that are mostly caused by lack of edge color extrusion into the transparent region (it's a hard edge, with the transparent region RGB values set to black). Preprocessing the texture to extrude the nearest edge color into the the transparent zone helps a lot of reduce the block artefacts because it reduces the magnitude of the color diffs. The image in this later comment on that thread is a better example of an extruded edge and has significantly lower artefacts around the edges. Worth noting, this image is not perfect example - the black and red streaks in the extrude are outliers that are different to the leaf color and ideally wouldn't be present. Most texture tools can do better. |
Seems i misunderstood that |
All Making |
Raised #431 to track the auto-extrude optimization. |
Very glad to heard that we will have an easier way to prevent edge block artifacts, as changing all mask textures with an ideal extrusion would be a tough work in our pipeline. Back to my second question, in fact we found many issues about using 8x8 block low-resolution images. They are in fact high level mipmaps, so were generated from a box filter, when we render them in mobile platform, the blocky edge often blend color between different sampling areas (same situation in texture atlas) that's why i'm wonderng whether should apply such compression on those small textures. |
8x8 is a low bitrate encoding (2 bits/texel) so will naturally struggle with blocks that contain high frequency changes. Low bitrate encodings are mostly useful for low frequency data sources that lack hard edges, such as light maps, or textures with fewer channels, such as luminance textures. There is no magic fix unfortunately; if you need to preserve higher frequency edges you will need to use a higher bitrate. I normally recommend a 6x6 block size as the default starting point for LDR color textures and normal maps, and 4x4 for HDR color textures. Reducing below that needs to be considered on a case-by-case basis depending on the type of data being compressed. |
Also, remember that if you want to go below 6x6, there are non-square sizes you can try which give smaller reductions in bitrate than jumping straight to 8x8 e.g. 8x5 or 8x6. |
In fact the cases we are facing are more challenge as many textures have composite channel like roughness or AO, so the bitrate often cannot fit a satisfying quality. Also we saw many bleeding color issues in unreal's lightmaps using 6x6 block with mipmap resolution reduction and a shadowmask in alpha, which is also annoying. Seems that |
That's not how the encoding works unfortunately - the bitstream can skip encoding channels completely (for a set of specific channel orderings) but for the channels that are encoded it always uses the same number of bits per channel. |
Storing a non-correlated packed channel nearly always needs a higher bitrate - I wouldn't expect 8x8 to be a good fit for these. |
-a 2
option but astcenc produced identical results. Does-a
option need to build from source with some defines? And how should i measure the radius properly?The text was updated successfully, but these errors were encountered: