Page 1 of 1

Get pollution isobands

Posted: Sun Jan 24, 2021 9:57 pm
by darkfrei
Hi devs!

Here is the water pollution layer, that changes the color of water.

Please see screenshot:
2021-01-24T22_51_18-Factorio 1.1.15.jpg
2021-01-24T22_51_18-Factorio 1.1.15.jpg (2.89 MiB) Viewed 1506 times

I've made a mod, that makes pollution isolines. Of course, I want to make isobands too. I am not happy with my isolines right now.

Is it possible to read vanilla isobands for polluted water?

Re: Get pollution isobands

Posted: Mon Jan 25, 2021 4:47 pm
by Rseding91
I don't understand the request. Pollution is a simple value per chunk; we don't store any other information than that. The water coloring is done purely in a shader based off those values.

Re: Get pollution isobands

Posted: Mon Jan 25, 2021 5:42 pm
by darkfrei
Rseding91 wrote:
Mon Jan 25, 2021 4:47 pm
I don't understand the request. Pollution is a simple value per chunk; we don't store any other information than that. The water coloring is done purely in a shader based off those values.
The original mod Smog Visual Pollution also uses just values per chunk. All users ask better graphics, the edge between chunks is too visible.

Image

My idea was to cut the pollution squares to pollution isobands. I've made isolines, but sometimes by random-chunk-update they are not connected anymore.

I've noticed that the vanilla's green water pollution is almost the same as this isolines wanted isobands. I cannot see any edges here.

Re: Get pollution isobands

Posted: Mon Jan 25, 2021 7:12 pm
by bormand
darkfrei wrote:
Mon Jan 25, 2021 5:42 pm
I cannot see any edges here.
They just calculate interpolated value for every pixel.

Unfortunately, draw functions accepts only a single color. So, mods can't do anything like that. If draw_polygon() would accept per-vertex colors and would be able to interpolate between them, your mod can just draw chunk-sized rectangles (just as it does now) and get nice smooth overlay.

Re: Get pollution isobands

Posted: Wed Jan 27, 2021 7:21 pm
by nastyslave
Please DEVs, give us some mod technology that can nicely color the polluted air like game colors water!