News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

Patch: change zooming routine

Started by Dwachs, January 21, 2018, 09:56:51 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dwachs

While trying to fight some pixel glitches, I came up with the following patch. It changes the behavior of the zooming routine. There, from pixels on NxN (N=2,3,4,8) patches,
one pixel in the zoomed image is calculated. Currently, this pixel will be transparent if all pixels in the patch are transparent. In the patch, I changes this to make pixels transparent even if the patch is not completely transparent. The motivation was that tile images should be still of the same tile shape after zooming.

Here are two images: pak64 savegame, full zoom out.

Unpatched

Patched


What do you think?

Edit: here is a patched executable for windows: https://simutrans-germany.com/files/upload/sim-gdi-patched-zoom.exe.zip
Parsley, sage, rosemary, and maggikraut.

Leartin

#1
So currently, when you use dithering or transparency on the edge of an object, it becomes a solid shape when you zoom out - eg. dithered tree shadows. Do I understand correctly that this patch would somewhat help with that?

As far as these screenshots go, I think it looks much cleaner. I suppose zoomed out that far, it will make some things disappear, but since this is not intended to be used for playing, just for an overview, that should be fine.


EDIT: Will Look at the Executable first

Soooo... I couldn't look at much, since even after I thought I deactivated my Antivirus it still got deleted due to Sprisky.U!cl, probably a false positive.

But yes, it does fix an issue I had with transparent/dithered objects, which now slowly disappear instead of becoming more prominent, as they should. Eg. Winter forests are no longer a black mess due to all the branches. Other than that, I still think it looks a lot cleaner.
It's perhaps a bit problematic that the border of the mouse cursor disappears as well, as it makes it a lot harder to see the tinted tile. Not knowing much about how it works, would it be possible to have some elements like the mouse, perhaps a tile grid if activated, use the old zoom logic instead to make sure they stay visible?

Dwachs

Here is a screenshot of pak192.comic winter trees. In current trunk, some trees degenerate to black blurbs.

You are right, markers, cursors, tile borders, etc, should be zoomed differently.
Parsley, sage, rosemary, and maggikraut.

Ters

Maybe Simutrans should have pre-calculated mipmaps?

Dwachs

You mean: zoom levels provided by pak files?
Parsley, sage, rosemary, and maggikraut.

Ters

Yes, but rather than another level of imagelists, it would be internal to an image through to simgraph, so they don't have their own image id.

prissi

I think the real challenge are the intermediate levels. For me, the zoomed out world looks too empty, almost like a minimap. Maybe one rather needs a threshold in between other than none or all. With transparency it would be possible ...

Leartin

Quote from: Dwachs on January 21, 2018, 11:06:40 AM
Here is a screenshot of pak192.comic winter trees. In current trunk, some trees degenerate to black blurbs.
Dead/Winter trees currently become large black blobs. With this patch, they become black stumps on largest zoom. Neither is ideal, but I prefer small black stumps over large black blobs ;)

Quote from: prissi on January 21, 2018, 01:49:03 PM
I think the real challenge are the intermediate levels. For me, the zoomed out world looks too empty, almost like a minimap.
Which isn't that bad - If there actually was a zoom into a minimap-esque mode, that would be amazing.

TurfIt

Static screenshots don't capture the effect of this patch at all...
At zoom 9, with the patch, quite a bit of detail goes missing - the tree trunks. When zooming in from there, I get the sensation of the trees growing faster than the terrain.
Without the patch, zooming in from 9, I get the effect of the trees staying large, and simply spacing farther apart.

IMHO, overall with patch is better than without, but It'd be nice if a little more detail could be maintained at zoom 9.

DrSuperGood

#9
If Simutrans graphics were not stuck in pre 2000 this probably would not be a problem. As it is, Simutrans alpha is a hack and not true alpha as it falsely assumes linear RGB colour all the way (result is bad/poor blending logic).

For screen shots maybe a special screenshot mode which uses area averaging or captures a higher resolution image?