The International Simutrans Forum

Development => Bug Reports => Topic started by: poppo on January 10, 2026, 11:59:51 AM

Title: Do not clip anything other than tree on ground
Post by: poppo on January 10, 2026, 11:59:51 AM
On the ground field and there are anything over that tile, objects' images are clipped.
I know this is to prevent trees shining through bridges, but I do not like corrupted images of station roofs, catenaries, staircases, etc.
So, I propose anything other than tree should not be clipped.no-clip-other-than-tree.patch
before.png

after.png
Title: Re: Do not clip anything other than tree on ground
Post by: prissi on January 10, 2026, 12:49:39 PM
The outcome greatly varies with the object in question. It works well with bridges but not well with less massive structures like powerlines and monorails. Maybe we need a new flag for the stuff above (clip_below=yes|no)? Then one could set this to no for powerlines and thin monorails but yes for massive bridges (or set this as default for those.)

EDIT: I have added a flag to in r11863 makeobj for ways and bridge "clip_below" Default is 1 but if set to zero, no clipping will be done below.
Title: Re: Do not clip anything other than tree on ground
Post by: poppo on January 10, 2026, 01:02:47 PM
In tunnel or on the elevated way, the image of the catenary and buildings are not clipped. So, I want them on the ground to be drawn in the same way.
Title: Re: Do not clip anything other than tree on ground
Post by: prissi on January 10, 2026, 01:46:46 PM
The elevated monorail in pak64 does not look good without clipping if there are buildings below. So it really depends on the pak set and graphics. Same for the elevated rails in pak128. With the above patch, you can set ways/bridges for clipping and not clipping. I think this is more flexible but I am open to discussion.
Title: Re: Do not clip anything other than tree on ground
Post by: poppo on January 11, 2026, 03:25:08 AM
In my opinion, clip gound object or not should be depends on the ground building addon, not on the elevated way.

Normal bridge and elevated-way must cover the ground and buildings under the bridge must be covered by them.
However, some buildings and trees which height is over paksize/4 pixels can pierce way above.

Building should have some flags:
- avoid construct the way on top of it.
- clip its image if there is the way on top of it.
Title: Re: Do not clip anything other than tree on ground
Post by: poppo on January 11, 2026, 03:44:19 AM
https://drive.google.com/file/d/1sX3Fj0a3FiVi06q-8p6J5tIxOeE3r80j/view?usp=sharing
This is the demo with same bridge, different buildings

If the building pixel height<paksize/4, they should not be clipped.
However, if the building higher than paksize/4, they should be clipped.
Title: Re: Do not clip anything other than tree on ground
Post by: prissi on January 11, 2026, 07:48:33 AM
Ok, check r11867, which only clips if the building or tree is too high. It will not apply to objects that cannot convert to buildings or trees.