Page 1 of 2

Vibrant Lighting

Posted: Sat Feb 01, 2020 22:26
by runs
For me Minetest is better than Minecraft. Well, I adore Minecraft a lot, is a great and eternal game indeed, but Minetest has something special for me.

But the worst thing for me is the lighting. When I play Minecraft I feel it quite diferent. The colors and light in Minetest are "sad" and "dull". I do not know the cause: textures? no shadows? no proper ambient light? no real dynamic lighting? bad fov?

Image
Minecraft

Image
Minetest

In this images the difference is obvious.

:-O

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 01:48
by ShallowDweller
I blame the texture pack you are using in minetest.
Well, I think the lighting could use some improvements, but there has already been a recent discussion about it, so I'm hoping the next MT version will have improved something.

One way to test if it is the texture's fault is by using MC's default resource pack and applying the textures to MT to see if anything feels better (be sure to post some screenshots if you do this test). With MC having access to 32x32 textures and forbiding everything else from doing the same, it could be the texture's sizes' fault.
I personaly don't see the lack of shadows as a problem. Unless a better lighting would require shadows, that is.

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 02:27
by GayJesus
I complained about lighting not long ago. I don't play MC but a family member does and there's no total darkness. I've tried other games http://www.classicube.net/download/ and same. To me it's bad enough that I went back to 4.17.1
viewtopic.php?f=6&t=23843

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 04:06
by paramat
GayJesus,

What you 'complained' about was not a bug or a problem, everything is explained in detail your thread. What you got used to in MT 0.4.16 was the bug and the problem, then you did not like it when that was fixed. Your issue is irrelevant here as this thread is not about darkness in completely dark areas.

runs,

When i looked at your screenshots i actually assumed that MT was the top one and MC the bottom, because the top one looks so much worse: Washed out, little 3D definition, almost no shadow under that bridge, almost no ambient occlusion (ugly textures too).
I am surprised to discover that the screenshots are actually the other way around.
If that is your interpretation of these screenshots i think you have very strange visual taste.

Anyway, MC generally looks much better than your screenshot, so i assume you have chosen a poor example.
Textures have a big effect on appearence and i agree that default MTG textures are not great. Differing textures make this hard to judge.

MC does not have dynamic lighting / shadows as standard, so those features are irrelevant to the comparisom.
Ironically it is actually the MC screenshot here that is lacking shadows =)

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 04:41
by sorcerykid
I suspect the reason you're noticing deficiencies with Minetest lighting is because you are running an extremely obsolete version. The engine has improved a lot since 2013, including fixes to lighting. I would recommend upgrading to at least 0.4.17.

Image

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 05:24
by GayJesus
paramat wrote:GayJesus,

Your issue is irrelevant here as this thread is not about darkness in completely dark areas.
I dunno, I think the lighting sucks to. Seems similar enough to me.

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 16:21
by Hugues Ross
This doesn't affect natural lights, but one thing that makes Minecraft's artificial lighting look much better is the way they color lights. It has been a while since I last played, but iirc artificial light isn't pure white, it gets tinted on a gradient from white (brightest) across the spectrum through yellow/orange/red as it darkens. This gives a more natural/dynamic feeling to the resulting light because it isn't perfectly uniform in color.

It wouldn't be hard to add this to Minetest as well, I actually hacked the feature together in a couple hours as a test a few months back.

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 20:54
by Hume2
Hugues Ross wrote:This doesn't affect natural lights, but one thing that makes Minecraft's artificial lighting look much better is the way they color lights. It has been a while since I last played, but iirc artificial light isn't pure white, it gets tinted on a gradient from white (brightest) across the spectrum through yellow/orange/red as it darkens. This gives a more natural/dynamic feeling to the resulting light because it isn't perfectly uniform in color.

It wouldn't be hard to add this to Minetest as well, I actually hacked the feature together in a couple hours as a test a few months back.
This is a good idea actually. The light is now stored in two numbers: day light and night light. And the actual lighting is also affected by the current time. So it can be like this: (day light/ night light)
0/0 - complete darkness, lighting #000000 in both day and night
0/16 - lit darkness, lighting #FFC080 in both day and night
16/0 in the night - area lit by the Moon, lighting #202040
16/0 in the day - area lit by the Sun, lighting #FFFFFF
And you get the rest by linear combinations.

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 22:40
by voxelproof
runs wrote:For me Minetest is better than Minecraft. Well, I adore Minecraft a lot, is a great and eternal game indeed, but Minetest has something special for me.

But the worst thing for me is the lighting. When I play Minecraft I feel it quite diferent. The colors and light in Minetest are "sad" and "dull". I do not know the cause: textures? no shadows? no proper ambient light? no real dynamic lighting? bad fov?

In this images the difference is obvious.

:-O
Maybe try to experiment a little with the MT advanced settings. As for me, although I'm fully aware of the shortcomings of the MT gfx, it's still good enough to have a pretty good time rambling across the awesome landscapes of the tweaked mapgens.

Image

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 23:25
by sorcerykid
Hugues Ross wrote:This doesn't affect natural lights, but one thing that makes Minecraft's artificial lighting look much better is the way they color lights. It has been a while since I last played, but iirc artificial light isn't pure white, it gets tinted on a gradient from white (brightest) across the spectrum through yellow/orange/red as it darkens. This gives a more natural/dynamic feeling to the resulting light because it isn't perfectly uniform in color.

It wouldn't be hard to add this to Minetest as well, I actually hacked the feature together in a couple hours as a test a few months back.
There was a PR from 2017 that aimed to implement natural vs artificial light, but unfortunately it remains closed. Hopefully someone can pick up the reigns and get it working properly.

https://github.com/minetest/minetest/pull/5687

Re: Vibrant Lighting

Posted: Sun Feb 02, 2020 23:51
by Linuxdirk
Hugues Ross wrote:This doesn't affect natural lights,
Actually this affects natural light, too. Minecraft’ lighting is just perfect. It has different light temperatures depending on what time it is and in what biome you are. This is barely notable but adds a lot to the overall look. Just check out the ice spikes and the swamp biome pictures. The effect is best visible in the sky.

https://minecraft.gamepedia.com/File:Ice_Spikes.png
https://minecraft.gamepedia.com/File:Swamp.png

Just open both images and flip back and forth between them to see the difference.
Hugues Ross wrote:but one thing that makes Minecraft's artificial lighting look much better is the way they color lights.
Absolutely. Colored lights are an absolute must-have in my opinion. Light from torches simply does not have the same color as light from the sun in a desert – which has a different light temperature than a dusky deep forest.

Irrlicht actually supports various colored dynamic lights with proper reflections and shadows but unfortunately this isn’t usable because how Minetest uses Irrlicht.

This guy uses an GLSL shader

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 01:06
by sorcerykid
Seeking core dev opinions:

How hard do you think it would be to implement dynamic lighting capabilities as shown in the video above into the engine?

I'm thinking this could be entirely separate from the existing precalculated lighting system, and would be simply a post-visual effect applied client-side during rendering (hence, getting param1 in mods would still return the current daylight vs nightlight value irrespective of the dynamic lights applied). If it were done that way, would it be feasible?

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 02:06
by Linuxdirk
Yes, colored light being entirely visual in the client would be absolutely enough. Having it in the API so mods can access (read and write) this value would be a bonus (example use case: a mod that adds mobs that are afraid of red light but attracted to green light).

But every step forward would be a good step.

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 07:25
by Hume2
For grass changing colour according to biome:

What if there was a texture modifier like ^[biome which took a file with tints and tinted the texture according the current humidity and temperature? The image with tints could be a square like this one: https://minecraft.gamepedia.com/File:Grasscolor.png

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 17:36
by Astrobe

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 18:29
by Hume2
Today I spent 10 hours by trying to improve the lighting. The lighting code is so bloated, it is being calculated on many different places. And the handling of daylight is poor too, the lights should add up but they override each other instead. (eg. red + blue should result in purple but it results in blue instead) The "alpha" thing in lighting is a crap, there's nothing like translucent light. The light can be stronger or weaker but not translucent. To make the light weaker, reducing all RGB channels should be sufficient. Emitting a black light shouldn't do anything. Currently, Minetest is set so that emitting black light makes a shadow, which is completely wrong!

Re: Vibrant Lighting

Posted: Mon Feb 03, 2020 22:06
by runs
I feel like the sky is better in Minecraft. I mean the blue color, in Minetest is most a gray blue. Also the sunset, in Minecraft is more orangish.

I will be happy with a better sky color.

I think a slight improvement in this area, lighting-coloring would be cool.

Re: Vibrant Lighting

Posted: Tue Feb 04, 2020 06:38
by Hume2
I agree there. Also the sky in Minetest seems to be nearly a plain colour while the other game uses a way more dramatic gradient.

Re: Vibrant Lighting

Posted: Tue Feb 04, 2020 06:58
by Linuxdirk
As posted earlier: Even within Minecraft the sky varies. Not only spectacular lighting in morning/evening situations (looks awesome with mountains in the background) but also between different biomes. It sometimes is barely noticeable but subliminally adds a lot of atmosphere to the game.

Re: Vibrant Lighting

Posted: Tue Feb 04, 2020 06:59
by Hume2
Well, it could vary more then ;)

Re: Vibrant Lighting

Posted: Tue Feb 04, 2020 13:33
by texmex
Have you tried enabling tone mapping?

Re: Vibrant Lighting

Posted: Tue Feb 04, 2020 19:29
by Hume2
texmex wrote:Have you tried enabling tone mapping?
It's slightly better but it doesn't actually solve the problem.

Re: Vibrant Lighting

Posted: Sun Feb 09, 2020 23:12
by sorcerykid
Linuxdirk wrote:Yes, colored light being entirely visual in the client would be absolutely enough. Having it in the API so mods can access (read and write) this value would be a bonus (example use case: a mod that adds mobs that are afraid of red light but attracted to green light).
My thought is that dynamic colored lighting could be implemented as a special type of LuaEntitySAO, therefore no change to the database format or network protocol would even be required (I think). Here is a very basic specification that comes to mind:

Code: Select all

{
    visual = "light",
    visual_size = {x=1, y=1},
    light = {
        type = "spot", 
        color = "#FF000077",
        curve = 0.5
        focus = 1.0
    },
    collisionbox = { -0.5,0.0,-0.5, 0.5, 10.0, 5.0 }
    intensity = 1.0,
    is_visible = true,
}
The collisionbox property specifies the bounding box of the light. The light source is always located at {0,0,0}. In the case of "omni", the falloff is half the shortest dimension. Therefore, the bounding box should be specified as a cuboid with a center of {0,0,0} for an even falloff in all six directions. Otherwise, the falloff will be cropped. In the case of "spot" or "flat", the falloff is calculated as the length of ymax minus ymin. Therefore, the bounding box should be specified as a cuboid with ymin of zero and with a center of zero in the x and z dimensions, otherwise the falloff will be cropped.

The light.type specifies the light source type:
  • "omni" for a point light source
  • "spot" for elliptical beam (like from a par-can fixture)
  • "flat" for rectangular beam (like from a window opening)
  • "gobo" for a textured beam (like from a gobo projector)
The light.color property specifies the color of the light as projected onto the surface of objects. It may include an optional alpha channel for transparency, otherwise it will be rendered fully opaque.

The light.curve property specifies the brightness curve of the light from source to terminus, with 0.0 being fully logarithmic, 1.0 being fully exponential, 0.5 being linear fall-off. The terminus distance is determined by the height of the collisionbox.

The light.focus specifies the sharpness of the beam projection, with 0.0 being fully diffuse and 1.0 being fully sharp. The diffusion is applied inwardly from the collisionbox edges to the center. This property only applies to 'flat' and 'spot' light types.

The textures property specifies an 8-bit gobo mask to project onto the surface of objects tinted with the specified light color. If a spritesheet is defined, then the gobo mask will be animated. This property only applies to 'gobo' type lights.

Re: Vibrant Lighting

Posted: Mon Feb 10, 2020 05:15
by v-rob
I think that we should add colored lighting, but there be a thing in the world file that states that there is colored lighting in that specific world, so Minetest will load the world with or without colored lighting depending on that world setting. If the Minetest world is loaded without color support, then any mods that use the colored lighting API in that world will be ignored or give an error unless the world is updated to the new system.

Of course, if we get true dynamic directional lighting, it either won't be stored in the world file or the world file will be broken anyway, so then will be the time to add colored lighting.

Re: Vibrant Lighting

Posted: Mon Feb 10, 2020 07:12
by Hume2
sorcerykid wrote: It may include an optional alpha channel for transparency, otherwise it will be rendered fully opaque.
What is an opaque light? Does it mean that you can't see through the beams? Or that the light overrides the textures so you can't see them through the light?
v-rob wrote:I think that we should add colored lighting, but there be a thing in the world file that states that there is colored lighting in that specific world, so Minetest will load the world with or without colored lighting depending on that world setting. If the Minetest world is loaded without color support, then any mods that use the colored lighting API in that world will be ignored or give an error unless the world is updated to the new system.
Or the world can be forced to convert into the new lighting format.
v-rob wrote:Of course, if we get true dynamic directional lighting, it either won't be stored in the world file or the world file will be broken anyway, so then will be the time to add colored lighting.
If you leave lighting completely on the renderer, you won't be able to use it in the game logic.