Hi. I am looking for a way to optimize my scene. I have a city with a lot of street lamps. Street lamps look very cool when they cast shadow, but there is a lot of them. Is it possible to disable casting shadows at certain distance? I am using only dynamic lights.
I have 3 ideas, but all of them are not perfect.
- Creating two lights instead of one, both placed in the same spot. One (much weaker) will not cast any shadow, and will have very large draw distance, and the second (stronger) will cast shadow, but will have very small draw distance. From what I have noticed, lights are pretty cheap when they are not casting shadow. The huge advantage to this metod is the “depth” of shadow. The issue with this method is that the light gets darker when stronger light fades away.
- Adding a sphere trigger to the lamp, and enable shadow casting when player is near it. The problem with that is that there will be a lot of those triggers, and they seem unnecessary.
- Adding a trigger to the player, and enable/disable shadows when they are close. I think it is the weakest method, because moving trigger that is that large could cause performance issues when coliding with other things.
I like the first method the most, but I wanted to ask here, because maybe there is another, simpler way to do that that I don’t know about.
Thank you!