Light Issues
For some reason, light is traveling through the blocks. Is there anyway to fix this without implemeneting a really complex lighting system? This also Happens with SpotLight, PointLights, Directional, Hemispheric etc.
Sorry source I couldn't help earlier I have 2 kids and it's Christmas vacation , they kicked me out of the PC lol. I f you lower the ambient light and ground light and you add one huge light it will create a shadow darker and darker ,I saw it with my own eyes , but didn't have time to experiment , but today I had an idea if the light Wich is technically the sun , follows the player , the the shadow effect will follow the player also , please test it if you can thanks
Ok, I'll test it
I know this sounds dumb, but Im trying to use SpotLight.range = x to change the size of the light but it's not working. Any ideas??
Made a Question on the BBJS Fourm. https://forum.babylonjs.com/t/spotlight-range-is-not-working/16784 I think it might be a bug.
Hi, so I could be misunderstanding the question, but in general I think light will always go through blocks unless you set up Babylon's options for handling shadows. Doing "real" shadows (where each light does tests against actual mesh geometries) is AFAIK not feasible for something like a big dynamic voxel world, so things like minecraft have a separate lighting system where the game engine tracks light levels for each voxel, and basically applies a tint to terrain graphics based on that, separate from the rendering engine.
OTOH if you're finding that lights aren't affecting meshes, I think there's also a limit on how many lights in a BJS scene can affect a given mesh. I think it's 4 by default, so the 5th light added to a scene won't affect anything unless various settings are changed. But I'm not sure of the details.
Any Ideas on how I could handle shadows? I've tried using shadowBuilder and that doesnt seem to work. The light does diffuse with a spotlight however only on the x,z axis. Not on the Y axis.
Hi, sorry I thought I replied to this. Basically handling shadows at the "meshes and lights" level is a Babylon question, and I don't know very much about it. My suspicion is that it couldn't perform well, due to how many terrain meshes would need (or potentially need) to cast shadows on each other. But I haven't tried anything similar.
(All that is separate from the question of handling lighting at the "voxel engine meshing" level, which isn't currently planned for noa.)
It definitely is a problem with Babylon. I don't know how well shadows would work with this performance-wise, but in other environments one can have shadows and 3D lighting while keeping a smooth performance.
It's been over a year. Recently I was making my own voxel stuff for fun when I remembered Noa engine. Apparently, shadows don't have much of a performance hit. I've since tested them on some pretty wild and large terrain. I scrappily implemented BabylonJS shadows into Noa. Here is a picture:

I'm using a frustum size constraint, not for performance, but just to keep the pixelation of the shadows down (currently using 2048px shadows, although performance didn't change much with 4096px). The main problem with shadows right now is that BabylonJS self-shadowing isn't the best.
Here's a GIF demonstrating it:

Wow, this looks really impressive. Was the code straightforward? I'd like to check out how it scales to larger draw distances!