Answered Scene Lighting FPS usage

ClubJulze

Well-known member
Featured Contributor
Messages
205
Reactions
587
Points
93
Patreon
clubjulze
I've know that lighting has a big impact on FPS. Having multiple light sources that interact with multiple objects can drive your FPS down quite a lot.

I've noticed when you turn down the intensity and range on a light source to 0, they are essentially off and have no impact on FPS. However, changing the scene lighting settings (Global illum master intensity, Diffuse Intensity, Specular Intensity, Cam Exposure) to 0 doesn't do anything FPS wise.

Is this something that can't be helped? Is the scene lighting something that has to be on for all the lights to work and therefore can't be shut off or something?

Just curious, cause it would be great to be able to turn it off so I can just use added lights instead.
 
Last edited:
You can turn scene lighting off if you want. It is only really pixel lights that you need to be concerned with. Even then VAM by default will only use 2 of them so you can add a bunch and the others with revert back to vertex which seems to be almost free lighting FPS wise. The only problem being VAM has to decide which lights are most important at any given moment and will switch them out causing weird lighting pops.

The way I do it is use just 2 pixel lights, either directional, spot or point and use point lights forced to vertex mode to fill the rest of the lighting in the scene. This means I get to control where is lit and VAM doesn't have to decide which lights to use so it never glitches.
 
Upvote 0
How do you turn the scene lighting off? All I know how to do is turning down it's intensity. Oh, and thanks for the tips, I'll try them out.
 
Upvote 0
Usually you just need to turn Global Illumination down to 0 and Custom Unity color to black and there will be no scene lighting. You might have a unity asset which has baked lighting though, in which case you're stuck with whatever lighting that has.
 
Upvote 0
Yeah, I explained in the OP that I already do that. I was talking about turning it off like you would an atomic light source, where there is a checkbox for Light On.
 
Upvote 0
An important setting is the "pixel count", by default it is set to two which allows you to have only 2 light sources on a single object. so if there are three lights vam will turn one off.
I advise you to set "pixel count" it to at least 3 but more is better, because it is on average the number of lights used in the scene ;)
 
Upvote 0
I always set my pixel count to 6. But I'm a spoiled brat with my 2080ti. EDIT: hard working spoiled brat
 
Upvote 0
If you intend to share a scene with 6 pixel lights the problem is the vast majority of people either can't or won't change the setting for it, so you don't know how your scene will look for them.
 
Upvote 0
If you intend to share a scene with 6 pixel lights the problem is the vast majority of people either can't or won't change the setting for it, so you don't know how your scene will look for them.
What I'm saying is I set my Pixel Light Count to 6 in settings. So that's for me viewing other's scenes. Has nothing to do with scenes I create.
 
Upvote 0
I wrote something about that months ago. It is the way you're lighting your scene that is going to draw on your FPS, not really how much lights you got. If you have a concentraded area with 6 lights on a high detailed area, you can draw a big chunk of your framerate. If your lights are well thought and scattered throughout your scene, you won't have any problem.

This is the problem when you're starting to use tools / engine like VaM. You have options that some user are going to think about the same way as they do with their über option menu in the next Doom : "the more I push up the more beautiful it is".

That's not wrong in a way (for the rendering part) but that's not the good way to think about that (for the creating part). If you have 6 pixel lights enabled all the time, as a creator, you WILL at some point, forget the priority of a light or two. Meaning that, when almost 99.5% of the community can handle 2 or 3 at most. Your scene suddenly has a 4 or 5 lights on a surface and this specific area will look ugly for most of them. There are a handful of scenes from creators that are "light-glitchy" because of that.

What you could do to optimize (if you have big scenes with a ton of lights), you could build your scene in unity, bake the light in the main scenery. And put a few pixel light here and there where it is important.

There are not a ton of ways to optimize the scenes... there is no control on the streaming nor the culling. If you don't careful light the scene, you will loose in perfs. At least, until 2.x hits :)
 
Upvote 0
@hazmhox thanks for that explination I'll give your article a read later. I've been reading more about lighting lately and my issue is that I like using lighting for effects (strobes, spinning, etc). So having to be limited in what I can do with light is annoying. Just means I have to start innovating, which is probably a good thing. I've recently learned that the ForcedVertex setting has a minor impact on FPS and will probably start using those for general lights, while sticking to spots for focus lighting.
 
Upvote 0
In 1.X, global illumination is very low cost in the shader, so I did not make an option to turn it off because the FPS difference would be negligible. Global illumination and all vertex lighting (up to 4 lights, based on Unity determining which are most important for that object) are all done in single pass. Then for each additional pixel light (up to number of pixel lights that effect the given object or up to the maximum pixel light preference setting), an additional shader pass has to occur. This is why each additional pixel light causes a performance hit.

All of this will change in 2.X due to move to HDRP. The shader itself will be much more configurable and scalable through user preferences or possibly selecting specific shader features per material.
 
Upvote 0
How do you turn the scene lighting off? All I know how to do is turning down it's intensity. Oh, and thanks for the tips, I'll try them out.
I might be wrong, but the way I understand it: The "Scene Lighting" is not an actual light in the technical sense. Not like the atom lights that have a position and direction. The Scene Lighting is just fake light from a skybox / HDRI. Technically it just picks the colors from the spherical sky map according to the 360° direction and overlays it on the material according to the 360° normals. There is no vector calculation about the light direction and falloff and so on, that's why it's so cheap.
So yes, turn down the intensity and it is "off". The effect will be gone. It works more like a post process.

In most of the material settings there is also a slider for Global Illumination Filter/Factor which can be used to boost/reduce the effect from Scene Lighting just for this material.
 
Upvote 0
Back
Top Bottom