What can cause these shadows?

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

What can cause these shadows?

by burli » Sat May 21, 2016 14:34

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
screenshot_20160521_160837.jpg (318.6 KiB) Viewed 2118 times
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: What can cause these shadows?

by Krock » Sat May 21, 2016 15:00

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

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
vm:set_lighting({day=0, night=0})
vm:calc_lighting()
vm:write_to_map(data)
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: What can cause these shadows?

by burli » Sat May 21, 2016 15:23

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: 278
Joined: Thu Jun 11, 2015 23:19
In-game: Knatt or Rudilyn

Re: What can cause these shadows?

by KCoombes » Sat May 21, 2016 20:08

 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: What can cause these shadows?

by Krock » Sat May 21, 2016 20:15

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.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

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

Re: What can cause these shadows?

by burli » Sat May 21, 2016 21:14

KCoombes wrote:https://forum.minetest.net/viewtopic.php?f=9&t=10662&p=201614&hilit=map+fixer#p201614

This will fix it.

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
screenshot_20160521_225422.jpg (113.36 KiB) Viewed 2118 times
screenshot_20160521_223303.jpg
screenshot_20160521_223303.jpg (44.42 KiB) Viewed 2118 times
screenshot_20160521_222701.jpg
screenshot_20160521_222701.jpg (80.71 KiB) Viewed 2118 times
 

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

Re: What can cause these shadows?

by kaadmy » Sat May 21, 2016 22:19

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

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Sun May 22, 2016 03:38

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

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

Re: What can cause these shadows?

by burli » Sun May 22, 2016 04:02

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
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Sun May 22, 2016 04:23

Ok, contact the mod author in the mod thread.
 

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

Re: What can cause these shadows?

by burli » Sun May 22, 2016 05:18

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: 1313
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Sun May 22, 2016 05:51

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

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

Re: What can cause these shadows?

by burli » Sun May 22, 2016 11:01

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 » Sun May 22, 2016 16:40

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: 1313
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Sun May 22, 2016 16:56

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 » Sun May 22, 2016 20:33

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: 1313
Joined: Fri Apr 10, 2015 13:18

Re: What can cause these shadows?

by burli » Sun May 22, 2016 20:38

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: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Sun May 22, 2016 21:25

This seems to be an engine issue, I can re-create these shadows with this code
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.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.
+ MyTestWorldSettings(map_meta.txt)
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:
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Mon May 23, 2016 00:29

> 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.
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Mon May 23, 2016 00:48

I've just realised, mgv6 cavegen can overgenerate by up to 16 nodes.
At https://github.com/duane-r/fun_caves/blob/v6/mapgen.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: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Mon May 23, 2016 01:14

paramat wrote:I've just realised, mgv6 cavegen can overgenerate by up to 16 nodes.
At https://github.com/duane-r/fun_caves/blob/v6/mapgen.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:
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Mon May 23, 2016 01:35

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: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Mon May 23, 2016 02:12

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
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
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:
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Mon May 23, 2016 02:16

https://github.com/duane-r/fun_caves/blob/v6/mapgen.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/blob/master/builtin/common/vector.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: 194
Joined: Wed Jun 03, 2015 14:33
GitHub: Qwertymine
In-game: qwertymine3

Re: What can cause these shadows?

by qwertymine3 » Mon May 23, 2016 03:06

burli, change set_lighting and calc_lighting to:

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
   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:
 

paramat
Member
 
Posts: 2662
Joined: Sun Oct 28, 2012 00:05
GitHub: paramat

Re: What can cause these shadows?

by paramat » Mon May 23, 2016 03:07

burli what changes have you made to the v6 branch?

This may be worth trying in non-mgv6 mapgens:

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

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

Re: What can cause these shadows?

by qwertymine3 » Mon May 23, 2016 03:26

paramat wrote:burli what changes have you made to the v6 branch?

This may be worth trying in non-mgv6 mapgens:

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


You need to change set_lighting too - as is setting lighting in the emerge area, which is not being re-calculated
Avatar by :devnko-ennekappao:
 

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

Re: What can cause these shadows?

by burli » Mon May 23, 2016 04:39

Slow down guys, I just get out of bed :-D

I already fixed the bug with vector.add(). There were large caves in the sky. I fixed this and banned them to -100 and below. I also fixed some other bugs. But nothing removed the shadows

I made the caves visible by replacing cobble and wood instead of air. See this screenshots
viewtopic.php?f=9&t=14494&start=25#p217803

I will try your suggestions later
 

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

Re: What can cause these shadows?

by burli » Mon May 23, 2016 06:01

qwertymine3 wrote:burli, change set_lighting and calc_lighting to:

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
   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


That's it. Great job. No more shadows here too. Thank you guys
 

User avatar
duane
Member
 
Posts: 776
Joined: Wed Aug 19, 2015 19:11
GitHub: duane-r

Re: What can cause these shadows?

by duane » Mon May 23, 2016 10:59

That's interesting. Burli, what happens if you just remove the set_lighting call altogether? I did that with fun_caves/master since it didn't seem to be necessary anyway, and (perhaps coincidentally) haven't seen any shadows afterward. set_lighting seems to be a waste of cpu time unless you're actually changing ground level.
 

Next

Return to Minetest Problems

Who is online

Users browsing this forum: No registered users and 6 guests

cron