Hi all,
So I have a question about lighting in UDK. I was wondering on how you determine how many lights that need to be in your level/scene? I know some light sources are going to come from the sun if it's during the day, or even during a sunset, and some are going to come from light bulbs, lanterns, etc. However I don't know how many lights you need to use for the environment in general.
Any feedback about this is greatly appreciated. Thank you!
Also if you were wondering which version of Unreal I am using, I'm not using Unreal Engine 4, I'm using UDK 2013 I believe.
Replies
https://udn.epicgames.com/Three/LightingArtistHome.html
IIRC you'll bake most lights into lightmaps/shadowmaps using Lightmass, and use a few dynamic lights (Dominant Lights) for objects that move around, like characters and vehicles.
I can't remember when they added Light Environments, but that's a cool way to light moving objects.
Lightmaps costs video memory, and realtime lighting/shadows use the GPU, so both has their positive and negative sides.
Real time lighting is good in openworld games, where you have day-night cycle, changing lighting, and lightmapping couldn't really work here.
But if you don't want to have this (changing lighting) , then probably lightmaps are what you need.
Real time lighting:
+ Fully dynamic lighting and shadows
+ Can be fast if you don't have too much light sources, and they don't cast shadows (or just one of them, such as a sun)
+ Fast to setup, and parameter it
+ Doesn't cost video memory
- No global illumination (at least in unreal engine)
- It can go expensive easily
- done with GPU
Lightmaps:
+ Global illumination with multiple bounces
+ Ambient occlusion
+ Doesn't use GPU (as I know)
+ No limit of the amount of lights
+ Every light can cast shadows
- Can't be used in a scene where the lighting is changing (day-night cycle for example)
- Costs video memory
- Second UV channels are needed
- Sharp shadows can be acchieved only with using very high lightmap resolution , which would cost a lot of video memory, especially in a big scene.
Sometimes you get your total lighting value above 1, because of intersecting light attenuations (or just because you wanted this because of an artistic purpose), and then you need HDR lightmaps to store this correctly, which costs a lot more video memory than a non hdr texture. Theoretically it is possible to clamp the result to be between 0-1 (0-255), but then a shader trick is needed to push it back to the desired level. I don't exactly know how udk deals with this though.
Light environment is a good invention, it totally works, if you have just a few moving objects (characters/openable doors for example). Then the rest of the scene can use lightmaps, and the moving objects can use this light environment thing. However, its noticeably not so accurate...
It is possible to fake the GI with some fill lights/environment color, or a sort of image based lighting, so lightmaps are not must needed if you want to get bouce light look, but again, everything has its positive and negative sides, and the good approach depends on the case.