On Chunk Data Regeneration (where meshes and Material ID Textures are generated), now I also generate a 3D texture in following format: RGB = RGB light components, A = Sunlight Level.
The shader looks up this texture, applies the RGB texels to lighten the world and sums it with clamping by the Sun color multiplied by Alpha channel. So, when the game is running, I can change the Sun color without regenerating the chunk data. However, placing a light or removing it forces recalculation of light contributions for affected chunks.
Sunlight is calculated by casting rays from the top of the map to first non-zero material ID. Light levels are stored into my voxel type, so every texel is lit.
Then, while I apply my low-pass filter, I also blur the sunlight value. I blur densities oncce, light values thrice per chunk.
But soon I will write radiosity simulation (on the CPU) which will calculate small distance light spread.
I'm still at research, but colored torches are a must
Just, LargeVolume seems to be slow as hell for direct access, so I very often clone data to temp RawVolumes where I perform heavy processing, calculate there and write back the changes.
I have to refactor the way I store and process chunks, so while sun-casting we work only with RawVolumes. Now I sufferr from many chunk sync problems and when to run the Relight pass for given chunk.
Point lights are with distance calculation and adding color values to otherws so we can mix colors from lights.
Spotlights are pure simulation and relight properly unlights then relights the voxel data.
However, no screen shots yes, because the performance is horrible.
I have to fix my threading, because the concurrent access to LargeVolume is only working if I read/write to different regions, so I am now allowing only one thread at a time to access the volume.
In the future when I light the game objects, corresponding 3D texture will be passed to their shaders, so each vertex is properly lit from this 3D texture's texels.
I am sure that I will have problems with chunk boundaries and game object lighting, but my objects will often be small enough so their light level is only based on the interpolated texel objects reside in.
In case this experiment fails I will be forced to use some classic form of lighting.