Defold: RGBA 16bpp quality regression

Created on 23 Mar 2021  路  4Comments  路  Source: defold/defold

Describe the bug (REQUIRED)
RGBA 16bpp images are dithered with different algorithm in 1.2.180. Overall quality is lower than before.

To Reproduce (REQUIRED)
Look at two demos:

Expected behavior (REQUIRED)
"RGBA 16bpp" images should be dithered with the same algo as before.

Defold version (REQUIRED):

  • Version 1.2.180

Minimal repro case project (OPTIONAL):
https://github.com/aglitchman/defold-basis-quality-test

bug

Most helpful comment

The biggest issue was that I had completely overlooked the dithering, and hadn't replaced it with something similar.
The original lib we used was PVRTexLib, which always was a pain to maintain for all our platforms, and it had served its purpose since it wasn't updated to produce any modern formats anymore. Only use case now was to produce dithered 16 bit images.

Here we implement the Interleaved gradient noise to produce the dithering.
Only thing is that I'm perhaps not completely satisfied with the result for the alpha channel in the "circle image".
But if we figure out which dithering algorithm we wish to replace with, it shouldn't be very hard to do.
(see texc_private.cpp)

Reading materials for the interested:

Shadertoy:

Testbed:

Comparisons:

The result is a tad different, both 179 and 181beta produces the same type of banding, just in slightly different places.
And the 179 version has slightly more banding (e.g. in the logo images). But I think they're more or less the same.

179
image16bpp-179-00

180
image16bpp-180-00

181 beta
image16bpp-beta-fix-00

Here the alpha banding artifacts are slightly more pronounced in the 181beta I think.
I don't particularly like the 179 version either, but I think it might be slightly "smoother"

179
image16bpp-179-01

180
image16bpp-180-01

181 beta
image16bpp-beta-fix-01

In any case, this is ready to go into the beta, as a first fix (since we didn't have any dithering at all!).

If necessary, let's continue the discussion here to figure out what needs to be improved as a step 2.

All 4 comments

This is a real problem as we have a large number of graphics in 16 bit. Other formats are not suitable because there is no alpha, and the RGBA32 format still takes up too much space (twice as much as 16 bit).
When it comes to 8K atlases, this is important!

小泻褉懈薪褕芯褌 2021-03-23 12 46 29
小泻褉懈薪褕芯褌 2021-03-23 13 54 47
小泻褉懈薪褕芯褌 2021-03-23 13 56 43

I agree, and I'll look into it now.

The biggest issue was that I had completely overlooked the dithering, and hadn't replaced it with something similar.
The original lib we used was PVRTexLib, which always was a pain to maintain for all our platforms, and it had served its purpose since it wasn't updated to produce any modern formats anymore. Only use case now was to produce dithered 16 bit images.

Here we implement the Interleaved gradient noise to produce the dithering.
Only thing is that I'm perhaps not completely satisfied with the result for the alpha channel in the "circle image".
But if we figure out which dithering algorithm we wish to replace with, it shouldn't be very hard to do.
(see texc_private.cpp)

Reading materials for the interested:

Shadertoy:

Testbed:

Comparisons:

The result is a tad different, both 179 and 181beta produces the same type of banding, just in slightly different places.
And the 179 version has slightly more banding (e.g. in the logo images). But I think they're more or less the same.

179
image16bpp-179-00

180
image16bpp-180-00

181 beta
image16bpp-beta-fix-00

Here the alpha banding artifacts are slightly more pronounced in the 181beta I think.
I don't particularly like the 179 version either, but I think it might be slightly "smoother"

179
image16bpp-179-01

180
image16bpp-180-01

181 beta
image16bpp-beta-fix-01

In any case, this is ready to go into the beta, as a first fix (since we didn't have any dithering at all!).

If necessary, let's continue the discussion here to figure out what needs to be improved as a step 2.

That's a great solution. I am completely satisfied.

Was this page helpful?
0 / 5 - 0 ratings