The new "-light" masks for beams

Place to get help with not working mods / modding interface.
Post Reply
User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

The new "-light" masks for beams

Post by Deadlock989 »

Really pleased that there is now support for glow-in-the-dark beams. Unfortunately it's broken one of my mods which provides a load of custom beam sprites. One of those things that are a good problem to have because it's a big improvement in the end.

I can see that the new -light overlays are some kind of mask. Would it be possible to get a brief explanation of how they work - are they are a multiplier or some kind of mask that "applies daylight"? Are they literally just a monochrome mask prepared from the basic beam sprites?

For context here is one of my beam sprites (it's rendered in additive mode, hence the black). How do I get from here to a correct -light overlay/underlay/whatever-it-is?
lightning-head.png
lightning-head.png (19.5 KiB) Viewed 646 times
Image

posila
Factorio Staff
Factorio Staff
Posts: 5202
Joined: Thu Jun 11, 2015 1:35 pm
Contact:

Re: The new "-light" masks for beams

Post by posila »

Broken your mods how? The light sprites should be optional.

Lights are additively accumulated onto lightmap, which is multiplicatively rendered on the game world ... with night vision it is little bit more complicated, but don't worry about that.

You could use the exact same sprites as you have them, and if it looks good (test with the lowest Light rendering resolution setting in graphics options) leave it at that. If it doesn't look good, you can try to blur out your spritesheet, to make the shape thicker, and increase contrast or something like that. If there is an option to convert the image to grayscale based on maximum value in R, G or B channels, you could use that.

User avatar
Deadlock989
Smart Inserter
Smart Inserter
Posts: 2528
Joined: Fri Nov 06, 2015 7:41 pm

Re: The new "-light" masks for beams

Post by Deadlock989 »

posila wrote:
Fri Jun 07, 2019 8:33 pm
Broken your mods how? The light sprites should be optional.
Mostly due to poor decisions on my part. New beams are fine but I also changed the existing pair of beams, giving them different frame counts - they no longer match with the frame count in the -light version (and the animation doesn't match either). It's not difficult to fix and totally worth it.
Lights are additively accumulated onto lightmap, which is multiplicatively rendered on the game world ... with night vision it is little bit more complicated, but don't worry about that.

You could use the exact same sprites as you have them, and if it looks good (test with the lowest Light rendering resolution setting in graphics options) leave it at that. If it doesn't look good, you can try to blur out your sprite and increase contrast or something like that. If there is an option to convert the image to grayscale based on maximum value in R, G or B channels, you could use that.
Cool. So basically make a greyscale version and then boost the upper level to maximum white. Gotcha.

Thanks!
Image

Post Reply

Return to “Modding help”