Page 1 of 1
Tint mask memory & performance
Posted: Fri Mar 08, 2019 1:39 pm
by moon69
I am creating some entities that are visually identical other than their colour.
Is there significant memory or performance difference if I use one sprite sheet with tint mask Vs seperate pre-coloured sprite sheets for each?
If I do use tint masks, what is the impact of leaving the (mostly transparent) mask sheet the same dimensions as main sprite sheet?
In other words, is it worth the effort of cropping each mask frame to remove the excess transparent bits, and then use Shift to align the mask & sprite in game?
Cheers,
Moon
Re: Tint mask memory & performance
Posted: Fri Mar 08, 2019 2:41 pm
by posila
moon69 wrote: Fri Mar 08, 2019 1:39 pmIs there significant memory or performance difference if I use one sprite sheet with tint mask Vs seperate pre-coloured sprite sheets for each?
Sprites referenced from multiple entities will be loaded just once, if that is what are you asking. So base sprite sheet + one tinted layer, used for 3 different entities is less video memory used than each entity having unique spritesheet.
moon69 wrote: Fri Mar 08, 2019 1:39 pmIf I do use tint masks, what is the impact of leaving the (mostly transparent) mask sheet the same dimensions as main sprite sheet? In other words, is it worth the effort of cropping each mask frame to remove the excess transparent bits, and then use Shift to align the mask & sprite in game?
Unless you use flags = { "no-crop" }, the game will crop out transparent areas on edges so you won't save any extra memory by doing that by yourself. That said ... smaller spritesheets load faster.
Re: Tint mask memory & performance
Posted: Fri Mar 08, 2019 4:38 pm
by moon69
Thanks Posila.
posila wrote: Fri Mar 08, 2019 2:41 pmSo base sprite sheet + one tinted layer, used for 3 different entities is less video memory used than each entity having unique spritesheet.
Just to be sure I understand... the above tinted layer can have a different tint applied in each entity and still get the less memory benefit?
Re: Tint mask memory & performance
Posted: Fri Mar 08, 2019 4:40 pm
by posila
moon69 wrote: Fri Mar 08, 2019 4:38 pmJust to be sure I understand... the above tinted layer can have a different tint applied in each entity and still get the less memory benefit?
Yes. Tint is applied runtime during rendering.
Re: Tint mask memory & performance
Posted: Fri Mar 08, 2019 5:06 pm
by Optera
posila wrote: Fri Mar 08, 2019 2:41 pm
moon69 wrote: Fri Mar 08, 2019 1:39 pmIs there significant memory or performance difference if I use one sprite sheet with tint mask Vs seperate pre-coloured sprite sheets for each?
Sprites referenced from multiple entities will be loaded just once, if that is what are you asking. So base sprite sheet + one tinted layer, used for 3 different entities is less video memory used than each entity having unique spritesheet.
moon69 wrote: Fri Mar 08, 2019 1:39 pmIf I do use tint masks, what is the impact of leaving the (mostly transparent) mask sheet the same dimensions as main sprite sheet? In other words, is it worth the effort of cropping each mask frame to remove the excess transparent bits, and then use Shift to align the mask & sprite in game?
Unless you use flags = { "no-crop" }, the game will crop out transparent areas on edges so you won't save any extra memory by doing that by yourself. That said ... smaller spritesheets load faster.
That again brings up the question bothering me since I discovered tinting masks.
Why are assembling machines not using tinted bodies?
Re: Tint mask memory & performance
Posted: Sun Mar 10, 2019 8:49 pm
by moon69
Optera wrote: Fri Mar 08, 2019 5:06 pm
Why are assembling machines not using tinted bodies?
Each assembling machine has different gears & gizmo animations on top if you look closely.
Re: Tint mask memory & performance
Posted: Sun Mar 10, 2019 8:54 pm
by Optera
moon69 wrote: Sun Mar 10, 2019 8:49 pm
Optera wrote: Fri Mar 08, 2019 5:06 pm
Why are assembling machines not using tinted bodies?
Each assembling machine has different gears & gizmo animations on top if you look closely.
hence why i explicitly wrote tinted bodies.
Re: Tint mask memory & performance
Posted: Sun Mar 10, 2019 9:15 pm
by posila
Artists don't like to use tints too much as it doesn't give them enough control over all the hues in the result.
Re: Tint mask memory & performance
Posted: Mon Mar 11, 2019 8:14 am
by darkfrei
posila wrote: Sun Mar 10, 2019 9:15 pm
Artists don't like to use tints too much as it doesn't give them enough control over all the hues in the result.
But such thing as electric furnace _can_ be done with normal layer and second, tinted layer (some blue for vanilla).
It would be much easier for all modders and all mods will be more vanilla-looking, without super experience in sprite creation.
