My game is very dark, and mostly lit by torchlight. Can I take advantage of this in some way and tell ue4 not to bother drawing or calculating anything beyond a certain distance?
I worry that I’m wasting lots of resources drawing tons of landscape which is pitch black. Or is ue4 smart enough to handle this already?
Every object has a max draw distance setting, which you can use to stop it from rendering beyond a certain distance. In addition you can use cull distance volumes to set this for everything within that volume.
Simplest thing that you could do is to loop over all actors per frame and calculate distance from that torch to bounding box/sphere edge. If distance is higher than torch range you can set object to be hidden. If your levels does not have crazy amounts(tens of thousands) objects this should work really well.
You can take advantage of your visibility range being low, and force more aggressive LOD transitions for landscape and static meshes, including significant simplifications of your materials for LODs, and up to completely stopping it from rendering. Manually calculating distances and stopping objects from rendering is basically duplicating the work culling already does for you. It is likely to be performance regression, rather than improvement. So in respect to meshes, engine is clever enough to do it for you, provided that your LOD settings are appropriate. Landscape is a bit different, but as I mentioned, you can take advantage and force more aggressive LOD transition on it.
If you manually make objects hided engine can skip all work for those objects. It’s does not cause any duplication and simple distance check is super fast. Engine can’t be clever enough for this kind of super content specific optimization. For example I manually cull most of the objects for planar reflections and gained significant performance gains.
I am not too worried about individual actors (I can easily add zones and hide actors in remote zones, thanks). I was more concerned about the landscape as a whole… I’ll only ever be seeing a small part of it. Using tiled landscape and world composition is on my To-Do list, haven’t quite gotten there yet, nor have I looked into LODDing much yet either.