Re: Add "overlay" as a supported blending mode
Posted: Wed Mar 11, 2020 11:22 am
In https://www.factorio.com/blog/post/fff-172 I mentioned formulas that are used for blending. Tinting only removes color, so if you have a white highlight, it can't be in layer that has tint as that would make it not white. Deadlock's suggestion to make the highlight another layer is pretty good ... it might be worth thinking if the highlight can be in the base sprite and mask transparent in regions that are supposed to have the highlight.
Our artists usually tint masks with non-premultiplied alpha 0.5, making them semi-additive.
But sometimes one mask is not enough. Biters and spitters have two masks, and I tried to do the math to see if I can combine them with identical result, but I can't. Which is a pitty because units are most VRAM hungry entities due to size and shear amount of different animations combined with 16 rotations. Luckily, rendering backend overhaul and texture compression improvements in 0.17 seem to have been effective as we didn't get usual wave of "The new update is uplayable for me with my <insert mid-range GPU from 5 years ago> with high res sprites" posts while at the same time the update had the largest amount of sprites updated to high resolution. What I am trying to get to ... you probably don't need to try to be super optimal, and it won't be problem with most people. And people with poor computers probably don't expect to be able to mod the game heavily.
Our artists usually tint masks with non-premultiplied alpha 0.5, making them semi-additive.
But sometimes one mask is not enough. Biters and spitters have two masks, and I tried to do the math to see if I can combine them with identical result, but I can't. Which is a pitty because units are most VRAM hungry entities due to size and shear amount of different animations combined with 16 rotations. Luckily, rendering backend overhaul and texture compression improvements in 0.17 seem to have been effective as we didn't get usual wave of "The new update is uplayable for me with my <insert mid-range GPU from 5 years ago> with high res sprites" posts while at the same time the update had the largest amount of sprites updated to high resolution. What I am trying to get to ... you probably don't need to try to be super optimal, and it won't be problem with most people. And people with poor computers probably don't expect to be able to mod the game heavily.