Optimizing a dynamic Scene
We are coming to the end of the chapter, but we can’t end without recalling the benefits of optimizing the scene. This scene is not very different from the one we designed in Chapter 4, Preparing Our Home Sweet Home: Part 2. It has static elements too. The only difference is that the Prefabs are added at runtime.
It is important that you apply the same optimization techniques that we saw in Chapter 4, Preparing Our Home Sweet Home: Part 2. We have programmed these dynamic elements to be instantiated statically, so we are already applying optimization in terms of lights.
Although these buildings are added later, when the scene is run, the Camera Occlusion Culling optimization will remove and display them depending on whether or not they are in the viewing area.
This type of scene may result in less FPS due to not having baked shadows on the dynamic buildings, but it is not a concern. I recommend that you analyze the FPS as your scene grows...