Page 1 of 1

Problem - Ambient Light Persists After Light Source Removed

PostPosted: Sat Sep 29, 2012 21:31
by LazyJ
I'm developing an underground area. Using worldedit I put searchlights (lights mod) across the entire ceiling.

But then I wasn't able to place any nodes/blocks on the floor. When I tried the node would disappear. The only way to place a node was to fly up and punch a section of searchlights off.

I got tired of doing this so I used worldedit again to replace the searchlights with the default torches.

OK, now I can place nodes on the floor. However, I noticed something curious during the transistion between searchlights and torches - even though the light source was gone the ambient light persisted.

To further test this I removed all the lights from the ceiling.

The underground area should have gone pitch black but instead it was bright as day. Also, the stone ceiling now has a checkerboard light effect.

I've tried replacing the stone ceiling with different nodes, even air, but the ambient light and the checkerboard effect still persist.

I've attached a screenshot to help better illustrate.

(NOTE: I turned the "smooth lighting" option off in the settings for a bump up in speed. Turning smooth lighting off and on didn't fix the problem.)

Any ideas?

Thanks.

Image

PostPosted: Sat Sep 29, 2012 21:47
by rubenwardy
lighting is not updated on light source changing, but on node changing.

Restart the game, or place some nodes around there

PostPosted: Sat Sep 29, 2012 22:09
by Echo
Same problem in my walking-light mod. I had to remove the light node, replace it with a non-transparent node (cobble) and replace that with air.

PostPosted: Sat Sep 29, 2012 22:32
by rubenwardy
should be two new lua functions added.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.force_update(pos) -- does all the active block stuff at pos

minetest.force_update_light(pos) -- re-does light rendering in that zone

PostPosted: Sun Sep 30, 2012 07:57
by sfan5
+1

PostPosted: Tue Oct 02, 2012 13:15
by LazyJ
rubenwardy wrote:should be two new lua functions added.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.force_update(pos) -- does all the active block stuff at pos

minetest.force_update_light(pos) -- re-does light rendering in that zone



Added to the walking_light mod or as a seperate init.lua file?

I copy/pasted the lines (as is) into the walking_light mod's init.lua and Minetest refused to run when it tried to load that mod.

I don't understand Lua well enough yet to implement this myself. If you wouldn't mind, please post where and how these lines are to be added.

Thanks.

PostPosted: Tue Oct 02, 2012 13:37
by PilzAdam
LazyJ wrote:
rubenwardy wrote:should be two new lua functions added.

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
minetest.force_update(pos) -- does all the active block stuff at pos

minetest.force_update_light(pos) -- re-does light rendering in that zone



Added to the walking_light mod or as a seperate init.lua file?

I copy/pasted the lines (as is) into the walking_light mod's init.lua and Minetest refused to run when it tried to load that mod.

I don't understand Lua well enough yet to implement this myself. If you wouldn't mind, please post where and how these lines are to be added.

Thanks.

The functions dont exist. Its a feature request from rubenwardy.

PostPosted: Tue Oct 02, 2012 14:06
by GloopMaster
uh... you people do know you can directly call nodeupdate(pos), right...?

PostPosted: Tue Oct 02, 2012 14:20
by PilzAdam
GloopMaster wrote:uh... you people do know you can directly call nodeupdate(pos), right...?

Thats only for falling nodes (make falling nodes fall): https://github.com/celeron55/minetest_game/blob/master/mods/default/init.lua#L1727