I’m trying to figure out how to correctly setup a baked directional light which casts shadows and how it works.
Please correct me if I’m wrong:
- Shadowmap for baked lights is generated once after I call pc.Lightmapper.bake(). Resolution of the shadow map is equal to pc.LightComponent.shadowResolution (What happens if I have more lights with different shadowResolution. Does engine generate a shadow map for every light in the scene?)
- Shadows in shadow map are generated only for object in a particular distance which is somehow detemined by pc.LightCompoment.shadowDistance. According to API docs “shadowDistance” is the distance from the viewpoint beyond which shadows are no longer rendered. This is true for shadows casted by nonbaked lights, but it’s definitely not true for shadows generated by runtime lightmaps. According to my tests position of viewpoint (camera) doesn’t affect shadows casted by baked lights at all. So what exactly is “shadowDistance” for baked lights, from which point is this distance measured?
So, according to my understanding I can use baked lights in a scene with a fixed size, where I’m able to set correct values for “shadowResolution” and “shadowDistance” and the scene is rather small so shadows wouldn’t be so blurry. But if my scene is big or has an unlimited size, I won’t be able to use baked lights. How should I proceed if my scene is big, I want shadows but I can’t use dynamic shadows because they are slow on mobiles? Is there a solution for this problem?