Page 1 of 1

calculate lighting only one time

PostPosted: Mon Aug 17, 2015 19:07
by Hybrid Dog
If you use the vmanip mapgen object in an on_generated function, you can run set_lighting and calc_lighting functions to e.g. add shadows to floating islands in singlenode mapgen.
l think instead of making calc_lighting directly calculate the light it could remember that the mapchunk needs light calculation and then the light becomes calculated only one time after the on_generateds are executed.

Re: calculate lighting only one time

PostPosted: Tue Aug 18, 2015 17:07
by paramat
This can already be done with 'mg_flags = nolight', then lighting is not calculated after core mapgen but is done only once after 'on generated' by a mod's LVM 'calc_lighting' call.

Re: calculate lighting only one time

PostPosted: Thu Aug 20, 2015 10:41
by Hybrid Dog
paramat wrote:This can already be done with 'mg_flags = nolight', then lighting is not calculated after core mapgen but is done only once after 'on generated' by a mod's LVM 'calc_lighting' call.

What would happen if two mods register 'on generated' and both do a 'calc_lighting' call?