Download

Best way to light a scene with many physics actors in it?

Greetings everyone.

I’m currently working on prototyping a new game that features firing cannons at castles. The castles will be comprised of individual bricks with physics turned on which will react to the cannonballs hitting them. Obviously having a large number of physics actors in a scene can be a huge performance drain, so I’m trying to come up with some possible work arounds.

I intend to create a volume around the cannonball that will be used to turn on and off the physics of the bricks near it in order to prevent the engine from having to calculate physics for all of the bricks at once, but that still leaves me the problem of lighting them. Even with their physics turned off, the bricks will still be moving and will still require a dynamic light source for casting shadows. (the castles are going to be a sort of flying fortress which the player will be able to fly around).

Any advice for how to set up the lighting would be appreciated.

You kind of demanding too much from engine. Wait about 10 years with this idea, else you are for some serious pain.

Or optimize/cut everything possible.
Forget dynamic shadows from thousands of physic actors. I think you also should forget dynamic lighting for them, instead make unlit material with fake global light vector, and some static cubemap reflection for shiny spots.

Or you need some very clever C++ code that updates static mesh of wall/tower makes bricky hole where it should make and spawn few bricks. Then you can do some better lighting. You could do this by keeping 3d voxel shape of castle in array, then update mesh from it. But for that forget blueprints.

So either you do hard work or players gpu does.