Page 1 of 1

[posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 11:44 am
by Deadlock989
Wondered about reporting this as a bug but not 100% certain the issue isn't at my end.

Have fielded multiple reports of a single sprite being garbled. The glitches only occur when "Texture compression: Low quality" is enabled in Factorio graphics settings. High quality compression or zero compression do not produce the artifacts. The entity uses a non-animated base sprite and an animated working visualisation in additive render mode, I'm assuming it's the working visualisation that's garbled because the garbling changes per frame. There is nothing different as far as I know about the method used to produce these sprites, I used exactly the same methods on at least 10 other entities which all work well in low quality compression mode, although none of them are this size (320x384 per frame). The resulting sprite sheet is therefore large (3200x2304), 60 frames in 32-bit colour, although a fair amount of the sheet is transparent space which is trimmed away by Factorio - however there is one other entity in the mod which is even larger and uses the same additive render method with no artifacts produced, although in that case it's not a working visualisation, it's a lab with on_animation and off_animation. The file is compressed to maximum lossless compression with PNGOpt, same as every other sprite in the mod.

If anyone has any insight, please let me know.

Re: [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 11:53 am
by posila
It's a bug (probably too large numerical error somewhere) in GPU-accelerated texture compression code path for low-quality compression. It seems to show up in regions that have extreme color values ({255,0,0}, {255,0,255}, ...) but are not white (I guess white doesn't compress corectly either).

I noticed it recently while working on something else and planned to look into it. Since now I know it has been observed also in the wild, I'll try to fix it ASAP.

Re: [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 11:53 am
by Deadlock989
Have just discovered the same issue with the other large entity, a lab, which does not use an additive mode render layer, but a single-layer normal render mode on_animation and off_animation.

Again, the garbling is at the very brightest part of the sprite (in the centre of the orb).

Re: [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 11:54 am
by Deadlock989
posila wrote:
Wed Oct 23, 2019 11:53 am
It's a bug (probably too large numerical error somewhere) in GPU-accelerated texture compression code path for low-quality compression. It seems to show up in regions that have extreme color values ({255,0,0}, {255,0,255}, ...) but are not white.

I noticed it recently while working on something else and planned to look into it. Since now I know it has been observed also in the wild, I'll try to fix it ASAP.
Oh great, thanks. I wasn't certain I hadn't exceeded some limit that shouldn't have been exceeded. It's odd that it doesn't seem to happen with a number of other entities which are smaller than 5x5.

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 12:32 pm
by BlueTemplar
Congratz, you broke physics with your mad science projects :
https://www.youtube.com/watch?v=vB46XpnwhrA

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 12:43 pm
by eradicator
That looks like the same thing that happens to my biter spawns after the biter changes broke find_non_colliding_position.

Code: Select all

/sudo god() spawn('small-biter',100)
100-small-biters.png
100-small-biters.png (44.79 KiB) Viewed 3848 times

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 1:11 pm
by posila
It's fixed for 0.17.73. Thanks for the report.

@eradicator: that's something else :)

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 1:40 pm
by Deadlock989
posila wrote:
Wed Oct 23, 2019 1:11 pm
It's fixed for 0.17.73. Thanks for the report.
Nice one, thank you.

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 1:45 pm
by BlueTemplar
They're evolving and trying to break free from the simulation ! :o

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 2:13 pm
by Dev-iL
Deadlock989 wrote:
Wed Oct 23, 2019 1:40 pm
posila wrote:
Wed Oct 23, 2019 1:11 pm
It's fixed for 0.17.73. Thanks for the report.
Nice one, thank you.
Thanks for the report and the fix!

Re: [posila] [0.17.72] Low quality texture compression issue

Posted: Wed Oct 23, 2019 3:52 pm
by eradicator
posila wrote:
Wed Oct 23, 2019 1:11 pm
It's fixed for 0.17.73. Thanks for the report.

@eradicator: that's something else :)
Well then, i made a new thread for it: viewtopic.php?f=7&t=77134
Feel free to bash my igpu as usual :p.