Child sprites for building in transparency mode

Discussions about the technical aspects of graphics development, including NewGRF tools and utilities.

Moderator: Graphics Moderators

Post Reply
TadeuszD
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 07 Nov 2011 19:32
Location: PL

Child sprites for building in transparency mode

Post by TadeuszD »

I've created small set of buildings. Those buildings are objects defined as set of:
- ground tile sprite (original OTTD tile),
- child sprite for groung tile (paths and others...),
- building sprite,
- child sprite for building

The building's child sprite contains only the snow on the roof and it is displayed conditionally.
The objects are displayed very well except transparency mode... When transparency is on, the snowed parts of building are darkened two times - first time by the building's sprite, second time by the child sprite. It looks like an old negative film... ;)

Is my idea wrong? Should I abandon dedicated snow sprite and create separate building's sprites with snow and without snow? Or there is a solution for preventing this doubled darkness?
Image
michael blunck
Tycoon
Tycoon
Posts: 5954
Joined: 27 Apr 2005 07:09
Contact:

Re: Child sprites for building in transparency mode

Post by michael blunck »

What exactly is your problem? In the AlpineClimate set I´m also using dedicated snow sprites, in connection with original TTD building sprites, but I don´t see any problems in "transparency mode", other than the usual shadowy display?

regards
Michael
Image
frosch
OpenTTD Developer
OpenTTD Developer
Posts: 991
Joined: 20 Dec 2006 13:31
Location: Aschaffenburg

Re: Child sprites for building in transparency mode

Post by frosch »

Currently there is no method to avoid this behaviour. We could possible add a new flag (simliar to the "draw sprite opaque even in transparent mode") that says "don't draw sprite in transparent mode".

The sets I am somewhat familar with, do not use a snow overlay sprite, but rather switch between a building with and without snow. From a source point of view this is not much different. The original graphics are layered photoshop/gimp images anyway, which allow toggling the snow layer. When exporting there is no difference between exporting the "normal" and "normal+snow" or "normal" and "snow".
⢇⡸⢸⠢⡇⡇⢎⡁⢎⡱⢸⡱⢸⣭⠀⢸⢜⢸⢸⣀⢸⣀⢸⣭⢸⡱⠀⢰⠭⡆⣫⠰⣉⢸⢸⠀⢰⠭⡆⡯⡆⢹⠁⠀⢐⠰⡁
TadeuszD
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 07 Nov 2011 19:32
Location: PL

Re: Child sprites for building in transparency mode

Post by TadeuszD »

Thank You, frosch, for the comprehensive answer.
frosch wrote:...there is no difference between exporting the "normal" and "normal+snow" or "normal" and "snow".
Yes, it is. But separate snow layers allows you to decrease overall number of necessary sprites, especially if you have many views of building.
This is due to the fact that all spritesets used in a layout must have the same number of sprites.

I was late with the picture:
Attachments
transparency.png
transparency.png (5.28 KiB) Viewed 2401 times
Image
TadeuszD
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 07 Nov 2011 19:32
Location: PL

Re: Child sprites for building in transparency mode

Post by TadeuszD »

OK. I have changed the method for displaying the building. Now it looks... more transparent. ;)
Attachments
transparency2.png
transparency2.png (5.28 KiB) Viewed 2327 times
Image
Post Reply

Return to “NewGRF Technical Discussions”

Who is online

Users browsing this forum: No registered users and 21 guests