Are 200 PointLight too much?
For a good computer, using deferred rendering, they are probably ok.
For an average computer, using forward rendering, they are far too many.
On a general way, they are too many, you should try to optimize better the lighting in your scene.
I have had over 50 in a somewhat small area and although it did run on our development computers, I did bake with beast because other PCs aren’t as powerful. So yes, optimize, bake cos yours is not the only machine (unless it is the only demo machine).
In unity it’s bad even in deferred as it’s kinda weird kind of deferred. Even though normal deferred rendering can handle many lights unity deferred has problems with that.
If I use 200 points in a vast scenario, and the camera does not always view all these points is too much too?
Thank you guys, I had reduced 'em.
In deferred mode, the cost of a light generally scales with how big that light is on screen. Point lights are drawn as rough spheres into the scene, clipping against the scene geometry like any other model. So having a lot of small lights or lights obscured by other objects will not cost you too much. What you want to avoid is having a bunch of large radius point lights overlapping, as you can end up doing multiple full-screen-covering render passes.
You will have to write a light manager script, custom tailored to your needs.
How large is a large radius? I have up to nine vehicles with point lights and a range of 210. If the vehicles have their lights on, Unity now crashes, even with only three of them on screen and moving. If I leave the lights off, it doesn’t look as good. I’ve been playing around with different ranges but haven’t found one that works yet. If I leave the lights disabled or the ranges 0, then Unity doesn’t crash, so I assume it’s a problem with rendering the additional moving lights.
Also, my lights have a Shadow Type (No Shadows), Render Mode (Auto), Culling Mask (Everything), and Lightmapping (Auto). I assume culling everything is easier on the GPU as is no shadows. Is there a better Render Mode (could be Important or Not Important instead of Auto) and Lightmapping (Could be Realtime Only or Baked Only instead of Auto)? The documentation doesn’t even mention those options for Render Mode or Lightmapping. I assume Not Important is the latest name for what the documentation calls ForceVertex, Important ForcePixel, but I have no idea what my light’s Lightmapping options do.
It’s not about the radius as much as it’s about the number of objects in range (assuming Forward rendering). Every object ‘touched’ by a light has to be drawn an extra time to add in that light’s contribution, and that’s what makes the light expensive.
“Culling Mask” set to “Everything” does not mean “cull everything” - it actually means “apply light to everything.” If you only want the light to apply to your terrain and your vehicles, but not to characters, buildings, props, etc, then you’d set the Culling Mask to only include the layers with your terrain and vehicles on.
Your Lightmapping should presumably be Realtime Only as these lights are wholly dynamic (it would never make sense to bake them into a lightmap).
I don’t remember offhand whether the RenderMode’s Important/NotImportant corresponds directly to “ForcePixel” and “ForceVertex” - I think it’s more about where it tries to place them. If there are no more pixel light slots available (as determined by your quality settings) then an Important light will still render as a vertex light, and if you have slots left over then I believe a NotImportant light will render as a pixel light.
What kind of crash do you get? Does Unity hang, or do you get a crash dialog/crashdump?
Just use light probes, if the lighting doesn’t need to be super-duper-accurate.
Light probes are only for static lights. I’m assuming that his lights are attached to his vehicles and therefore dynamic…