What can cause these shadows?

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

What can cause these shadows?

by burli » Post

Sometimes Minetest generates shadows without any obvious reason. Currently I try to fix this in the lua version of the v6 cavegen.

Image

If I fly above these shadows the wield hand gets dark. If I fly up the shadow ends always exactly at 44.0 or at 124.0

I have disabled caves, dungeons and decorations and I use vanilla mc game 0.4.14 with valleys mapgen. The only installed mod is the lua version of v6 caves.

Any idea what can cause these shadows?
Attachments
screenshot_20160521_160837.jpg
(318.6 KiB) Not downloaded yet

User avatar
Krock
Developer
Posts: 4556
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: What can cause these shadows?

by Krock » Post

Did you forget to update the lightening like this in the Lua code?

Code: Select all

vm:set_lighting({day=0, night=0})
vm:calc_lighting()
vm:write_to_map(data)
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

No. Check this code.
https://github.com/duane-r/fun_caves/blob/v6/mapgen.lua

I fixed some bugs, but I didn't touch this. And yes, debug is set to false

KCoombes
Member
Posts: 412
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt
Location: SW Florida, USA

Re: What can cause these shadows?

by KCoombes » Post


User avatar
Krock
Developer
Posts: 4556
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: What can cause these shadows?

by Krock » Post

burli wrote:No. Check this code.<snip>
That's strange because it updates the light after writing the node data. Does anything change when you add "vm:update_map()" after "vm:write_to_map()"?
KCoombes wrote:This will fix it.
You misunderstood the main topic. It is about fixing the lightening bug in a Lua mod.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

No, it wont. It removes the shadows, but does not fix the bug. I don't want to run mapfix evey minute

But I get closer. The shadows always appear in the corners of a mapchunk. And I think the size is 16x16 nodes

Image

But they thend to appear on water, but also on solid nodes

Image

Even larger shadows an at a chunk border

Image

I think it has something to do with the overgeneration of some mods. The extra 16 nodes around the chunk. The v6 cavegen use this, and I think moretrees also use this

Will try something with moretrees tomorow
Attachments
screenshot_20160521_225422.jpg
(113.36 KiB) Not downloaded yet
screenshot_20160521_223303.jpg
(44.42 KiB) Not downloaded yet
screenshot_20160521_222701.jpg
(80.71 KiB) Not downloaded yet

User avatar
kaadmy
Member
Posts: 706
Joined: Thu Aug 27, 2015 23:07
GitHub: kaadmy
IRC: KaadmY
In-game: KaadmY kaadmy NeD

Re: What can cause these shadows?

by kaadmy » Post

I think I've had shadows like that with <16x16 sizes. might be wrong though.
Never paint white stripes on roads near Zebra crossings.

Pixture

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

The 'fun caves' mod is for use with singlenode mapgen.

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

paramat wrote:The 'fun caves' mod is for use with singlenode mapgen.
1: it's the "original" fun caves. It is the lua version of the v6 cavegen
2: Duane added surface to the new fun caves

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

Ok, contact the mod author in the mod thread.

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

paramat wrote:Ok, contact the mod author in the mod thread.
I don't think it is a mod problem. Moretrees has the same problem and I think I saw them in vanilla minetest too, but very rarely

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

Ok, I forgot that the moretree bug is "a little bit" different oO

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

paramat wrote:Ok, contact the mod author in the mod thread.
I still think it is an engine problem similar to moretrees, probably caused by the same issue. Both mods work with v6, but have problems with v7 based mg's.

User avatar
StepDevelop
Member
Posts: 75
Joined: Mon May 02, 2016 21:11
GitHub: StepDevelop

Re: What can cause these shadows?

by StepDevelop » Post

Worldedit bugs ;) Me too returns this bug. it is the fault of deleted nodes, they remain invisible and you can select and generate shadows in the game. If not installed mods, Minetest works wonders! but without mods, are you doing a little :)

I hope I was helpful. The Worldedit bug I could not solve it.

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

I never used Worldedit.

Hm, generated and deleted nodes... The cavegen only generates air which should not cause shadows

User avatar
StepDevelop
Member
Posts: 75
Joined: Mon May 02, 2016 21:11
GitHub: StepDevelop

Re: What can cause these shadows?

by StepDevelop » Post

burli wrote:I never used Worldedit.

Hm, generated and deleted nodes... The cavegen only generates air which should not cause shadows

Hi burli. Can you tell me that mods do you use? I make "accurate testing" of Minetest. If you let me know the mods you use, I see to clarify your problem. Thank you :)

And an air block problem, which are selected (node selection appears), I found this bug using "worldedit" and the "more trees".

User avatar
burli
Member
Posts: 1641
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Post

As I said in the first post
burli wrote:I have disabled caves, dungeons and decorations and I use vanilla mc game 0.4.14 with valleys mapgen. The only installed mod is the lua version of v6 caves.
The mod is a rewrite of the v6 cavegen in Lua to make the v6 caves avalible for other mapgens. It was originally convertet by duane, but I made some bugfixes.

User avatar
qwertymine3
Member
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Post

This seems to be an engine issue, I can re-create these shadows with this code

Code: Select all

minetest.register_on_generated(function(minp,maxp,seed)
	vm,emin,emax = minetest.get_mapgen_object("voxelmanip")
	vm:set_lighting({day=0,night=0})
	vm:calc_lighting()
	vm:write_to_map()
end)
Also I can reproduce ~100% of times by loading a map in a specific way.
Hopefully not terrain dependent:
Look forward when loading terrain.
When all chunks loaded, look backwards.
When all chunks loaded, look left or right.
When all chunks loaded, look backwards.
+ Spoiler
Tested at (2381,50-60,3004)
Reloading was done by deleting map.sqlite
Lighting issues will appear in different places each load.


Issue seems to be with light updates in the extended emerge area where the chunks are already loaded, as I can see the light issues forming on already loaded chunks.
Avatar by :devnko-ennekappao:

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

> Both mods work with v6, but have problems with v7 based mg's.

The overgeneration used in non-mgv6 mapgens does cause lighting problems.
Last edited by paramat on Mon May 23, 2016 00:53, edited 1 time in total.

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

I've just realised, mgv6 cavegen can overgenerate by up to 16 nodes.
At https://github.com/duane-r/fun_caves/bl ... n.lua#L539 try:

vm:calc_lighting({x = minp.x - 16, y = minp.y - 16, z = minp.z - 16}, {x = maxp.x + 16, y = maxp.y + 16, z = maxp.z + 16})

or:

vm:calc_lighting({x = minp.x - 16, y = minp.y - 16, z = minp.z - 16}, {x = maxp.x + 16, y = maxp.y, z = maxp.z + 16})

These may not work though.

User avatar
qwertymine3
Member
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Post

paramat wrote:I've just realised, mgv6 cavegen can overgenerate by up to 16 nodes.
At https://github.com/duane-r/fun_caves/bl ... n.lua#L539 try:

vm:calc_lighting({x = minp.x - 16, y = minp.y - 16, z = minp.z - 16}, {x = maxp.x + 16, y = maxp.y + 16, z = maxp.z + 16})
I see that you have missed my post...

Also it doesn't over generate when above ground, the mod doesn't replace air/ignore nodes.
Also that code causes even worse light errors, shortly before crashing minetest.
Avatar by :devnko-ennekappao:

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

I saw your post.
Didn't think this would work.
Large caves do replace air, they have to when flooded with liquid.
My guess is overgenerating large caves spreading darkness.
Still not sure how core mgv6 avoids these lighting bugs.

User avatar
qwertymine3
Member
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Post

Over generating the caves does cause some lighting issues, however the ones which burli is talking about are not related.

burli, try changing the call to set_lighting to

Code: Select all

vm:set_lighting({day=0,night=0},minp,maxp)
EDIT: Fixes the shadows you are talking about, but cuts off mountain shadows @ mapchunk border...
Probably would also cause cave lighting issues...
Last edited by qwertymine3 on Mon May 23, 2016 02:25, edited 1 time in total.
Avatar by :devnko-ennekappao:

User avatar
paramat
Developer
Posts: 3679
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat
IRC: paramat
Location: UK

Re: What can cause these shadows?

by paramat » Post

https://github.com/duane-r/fun_caves/bl ... n.lua#L296

local p1 = vector.add(orpi, veci, this.of, this.rs / 2)

This can't add 4 values, this would cause the heightmap checks to fail, causing shadows. Try fixing that.
Here's now vector add works https://github.com/minetest/minetest/bl ... or.lua#L86

We had a similar problem in core mgv6, overgenerated large caves were being generated above ground and the dark air was causing lighting bugs:
https://github.com/minetest/minetest/issues/1190
https://github.com/minetest/minetest/pull/2410

User avatar
qwertymine3
Member
Posts: 202
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Post

burli, change set_lighting and calc_lighting to:

Code: Select all

	vm:set_lighting({day=0,night=0},{x=minp.x,y=emin.y,z=minp.z},maxp)
	vm:calc_lighting({x=minp.x,y=emin.y,z=minp.z},maxp)
Tested with fun caves, no issues seen in my test senario
Last edited by qwertymine3 on Mon May 23, 2016 03:19, edited 5 times in total.
Avatar by :devnko-ennekappao:

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest