Tint mask memory & performance

Place to get help with not working mods / modding interface.
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 184
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Tint mask memory & performance

Post 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
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Tint mask memory & performance

Post 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.
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 184
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Tint mask memory & performance

Post 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?
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Tint mask memory & performance

Post 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.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Tint mask memory & performance

Post 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?
User avatar
moon69
Fast Inserter
Fast Inserter
Posts: 184
Joined: Sun Sep 18, 2016 6:53 pm
Contact:

Re: Tint mask memory & performance

Post 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.
User avatar
Optera
Smart Inserter
Smart Inserter
Posts: 2920
Joined: Sat Jun 11, 2016 6:41 am
Contact:

Re: Tint mask memory & performance

Post 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.
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Tint mask memory & performance

Post 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.
User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2905
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Tint mask memory & performance

Post 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.
Image
Post Reply

Return to “Modding help”