Cailen
Cailen

Reputation: 690

Unity3D Point lights in large scene

I'm currently building a large scene in Unity that has a lot of point lights. Each room in the scene (~40 rooms) has 2 point lights and I am using deferred rendering (to enabled shadows so that light doesn't leak out of the room).

When using forward rendering my game runs at 60 fps, but when switching to deferred lighting it runs around 25-30 fps (because its calculating the soft shadows for the point lights I'm assuming).

How can I solve this problem while still preventing lights from leaking through walls?

Thanks!

Upvotes: 3

Views: 1024

Answers (1)

Shotgun Ninja
Shotgun Ninja

Reputation: 2540

One method, while complex, is to dynamically load and unload rooms separately, so that only the lights, polygons, and other information is present when those rooms are visible to the player. If you have a way to segment the scene to better minimize the amount of data to process, then you can get away with this as a hack. That's my only recommendation that's simple enough to explain in a small amount of time, and obviously, it's pretty dependent on the type of game you're making.

Upvotes: 4

Related Questions