random-geek / morelights

Minetest mod adding additional lighting nodes.
GNU Lesser General Public License v3.0
11 stars 11 forks source link

Battle Light Pollution: Add _dim variants to all light nodes. #5

Closed doxygen-spammer closed 3 years ago

doxygen-spammer commented 3 years ago

doxydoxy wants some lights to illuminate his new garden shed, but without emphasizing it. There should be enough light to provide orientation in the inside, but the outside shouldn’t glow.

This pull request adds dim variants to all light nodes. They have a light level of 3–5 units less. This allows to build sceneries with deemphasized lightning, or with a “cozy” ambience.

Screenshot of the modern ceiling light: screenshot_20210909_222831 (The right variant is new, with a light level of 10 instead of 15.)

Futuristic light block: screenshot_20210910_141608

Dim variants have the light part of the texture multiplied with #dddddd. They are drawn darker anyway, because of the lower light level. The additional darkening from the multiply makes a slight anti-glare effect. The regular variants are almost white in the light part, which makes them look very bright no matter the light level.

This darkening also allows to imitate broken lamps. I did not intend this, but in retrospect I think this is a nice idea: screenshot_20210910_003356

There are some new textures. The stairlight and the hanging light bulb have inventory images, which have received the selective darkening for the dim variant. The vintage light block’s texture is now split into a background and a foreground texture, so the dim variant can darken only the foreground part. The background texture was made with inpaint from G'MIC, which works unsurprisingly well. ;) Screenshot: screenshot_20210910_142321 (Dim variant in the lower middle.)

The dim variants can be crafted from two regular lights, and there is a reverce recipe in the same way. These are documented in crafts.md.

doxygen-spammer commented 3 years ago

I am impressed by the code readability in your mod. :+1: If you want some changes in my coding style (like trailing commas, etc.), I will be happy to fix that.

I read that you intend to keep this mod lightweight. This pull request adds 1kB worth of textures, but doubles the number of node definitions. The new nodes also appear in the creative inventory. I don’t know how to measure the impact on the client.

random-geek commented 3 years ago

Hi! Thanks for taking the time to contribute. Avoiding light pollution and adding variety was something I considered when making this mod, which is why table lamps, path lights, hanging bulbs, stair lights, etc. are a few points dimmer than max brightness.

I'm hesitant to merge this. The few additional kB from textures and node definitions might be okay, but I don't want to overcomplicate the user experience. Doubling the number of nodes would just add too much inventory clutter. If there's more demand for this feature, I might make nodes dimmable by right-clicking them or something, but at the moment I'm not super interested.

That said, I'm sure some people would appreciate this addition. Perhaps you could create a fork with more advanced features?

doxygen-spammer commented 3 years ago

Hi, thanks for the reply!

Avoiding light pollution and adding variety was something I considered when making this mod, which is why table lamps, path lights, hanging bulbs, stair lights, etc. are a few points dimmer than max brightness.

Yeah, I like these brightness variations for such “small” lights. :)

If there's more demand for this feature, I might make nodes dimmable by right-clicking them or something, but at the moment I'm not super interested.

Making nodes dimmable using right-click indeed seems like a better idea to me.

What do you think about using the light bulb item for that? It is probably the most light-level related item already present. Right-click with an empty hand also seems sensible to me.

Node definitions could just have an element _morelights_next_variant, and at right-click they are replaced by that variant. Dim variants would be hidden from the creative inventory, and drop the normal variant.

If I change it to right-click would you accept it? Otherwise I will make it an add-on mod. (But change it to right-click anyway.)

doxygen-spammer commented 3 years ago

That said, I'm sure some people would appreciate this addition. Perhaps you could create a fork with more advanced features?

I made an add-on mod called morelights_dim now. (https://invent.kde.org/davidhurka/doxy_morelights_dim, https://content.minetest.net/packages/doxygen_spammer/morelights_dim/)