Need ideas for creating SkyLight shadows

My project’s world is procedurally generated, and as such all lighting must be computed at runtime.

The inside of caves and buildings are too bright, as they receive skylight, when they should not.

Does anyone have any ideas on how I could put shadows into the skylight/ambient light?

I dont mind using c++, but I want to avoid modifying the engine, or atleast keep engine modification to a minimum.

Hey there @somawheels! So generally the Skylight does cast shadows, usually by default.

So depending on your rendering type, most of the lighting that comes from the skylight is bounce lighting, so if your cave is sealed there shouldn’t be too much of it visible. If you’re getting

You can increase the occlusion max distance and get a bit more darkness for your cave outright. Many non-multiplayer games tend to disable skylighting when the player goes under ground/in a cave so they don’t have to do much with it.

1 Like

Thanks for the suggestion, one detail I did not mention however Is I cannot use distance field lighting. This is because my static meshes are generated at runtime, and I so I cannot generate distance fields for them.

Ahhh that does pose a bit of a problem, is there any way you can just stop the entirety of the skylight while you’re underground? Early ARK used to do this. Which is why all the cave entrances were tight corridor → true entrance while the lighting effects changed out.

There is one major flaw with this technique for me: windows. If I turn the skylight off, the outside/inside of the buildings will look different when you look through the window.

Ahh yeah that is a bit of a predicament. My usual fix comes with that DFAO, and since we can’t create them at runtime. Going to take a bit of time to see what other options would be available there barring that occlusion. Otherwise the Skylight will “bleed” through everything to an extent.