Support blend_mode in Types/IconData

Things that we aren't going to implement
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 431
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Support blend_mode in Types/IconData

Post by kirazy »

Item in world (defined with pictures)
Image

Item in world, looking very faded (defined with icons)
Image

Item in inventory, looking very faded (defined with icons)
Image

Looking into it, the difference in outcomes is because blend_mode is not a supported property for IconData.

Is it possible to add it as a supported property?

(Or is there another way to do this that allows me to have my cake and eat it too?)
posila
Former Staff
Former Staff
Posts: 5448
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: Support blend_mode in Types/IconData

Post by posila »

Blend mode switching is bad for sprite batching, so it won't be added for icons, sorry.

You can achieve additive blending by just setting the alpha value of your tint to zero, due to the game expecting all color values have premultiplied alpha: https://www.factorio.com/blog/post/fff-172

That is actually what the game will do when loading sprite definition with additive blend mode - uses default premultiplied alpha blending and overrides tint alpha to zero without modifying color channels. That way sprites with default blend mode and additive blend mode can be batched into single draw call.

EDIT: In addition to that ... it would make it impossible to bake the layered icons in the future, as different blending modes might not be associative.
User avatar
kirazy
Filter Inserter
Filter Inserter
Posts: 431
Joined: Tue Mar 06, 2018 12:18 am
Contact:

Re: Support blend_mode in Types/IconData

Post by kirazy »

posila wrote: Wed May 13, 2020 6:24 amYou can achieve additive blending by just setting the alpha value of your tint to zero
Ah! That worked. :D Thanks a lot.
Post Reply

Return to “Won't implement”