calculate lighting only one time

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

calculate lighting only one time

by Hybrid Dog » Mon Aug 17, 2015 19:07

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.
 

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

Re: calculate lighting only one time

by paramat » Tue Aug 18, 2015 17:07

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.
 

Hybrid Dog
Member
 
Posts: 2460
Joined: Thu Nov 01, 2012 12:46

Re: calculate lighting only one time

by Hybrid Dog » Thu Aug 20, 2015 10:41

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?
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 20 guests

cron