I’m working on a game that takes place entirely underground. Besides some small caves, there will also be very large caves that even contain towns (1 level == one big cave).
My initial idea was to create only a landscape and build the cave outlines using high rock meshes, then use a light source that only reaches a defined height (fading out into darkness). This would save me from having to create a cave ceiling over the entire landscape.
Problem: A DirectionalLight reveals the upper ends of the rock walls, making it obvious that there is no ceiling.
I then tried using PointLights (static, no shadows), which allow me to restrict the light perfectly. However, this severely increases light complexity and hurts performance. To avoid dark spots, there would be a lot of overlapping.
What’s the best way to light large caves without destroying performance? Are there any settings or techniques I might be missing? Or is this approach fundamentally flawed, meaning I really do need to create a cave ceiling?
I would say, trying to fake the ceiling and making your lights behave accordingly to the lack of said ceiling, will get you more headaches than just making a roof for your setup. Also, UE has great options to create complete cave systems, either with splines or landscapes. I would suggest checking the following guides below:
You could make your landscape blend mode a mask and use the visibility sculpting option in landscape mode to remove parts of the landscape, then add meshes around the hole, that’s what I’ve done in my project so I have a facility under the landscape.
@brs-sebascova I will definitely have a look at those tutorials! At first glance, the caves shown there seem to be much smaller than what I’m planning to build, but maybe they can still be helpful in some way.
@WrATHZer0 If I understand you correctly, you mean using a landscape as a ceiling, cutting holes into it, and letting sunlight (DirectionalLight) shine through those openings? That approach wouldn’t really fit my setting, though, since my cave world is located far below the surface and is completely unknown to the upper world.
No, the hole in the landscape is your cave entrace, as for performance, you don’t need to worry about it, that’s what mega lights is for and you can have many lights anyway, just use them wisely don’t have a large overlapping attenuation radius. You could hide the cave entrance with meshes or foliage.
So, in case there is no entrance at all in my (very large) cave for directional light from outside, I can create the basic lighting using point lights as long as they are static? Because when I tried this, the light complexity view reached maximum very quickly. However, some overlapping is necessary to achieve even lighting without dark spots.
Well, the lighting complexity view isn’t the all and end all of telling you about performance, it’s just telling you it’s complex or not, whether that be because your light is too bright or has a large radius, it’s about the material roughness as well, you shouldn’t worry about it as it’s just one point off optimising of your lighting.