Is There a Better Way to do This or is This Sufficient?

I noticed things are different when it comes to characters and lighting. I don’t know if it has to do with the fact a character is composed of many faces or what, but here’s the issue…

I found out that eight lights max (maybe) can be on any object at a time. The thing is, a character will move through the environment receiving light from all sources, and that can easily total above eight.

Even if you have a character’s Shader value set to off, you’ll still get that console error message saying the CG program for your shaders are too complex.

The only solution I can think of at the moment is to turn lights on and off the character in groups, depending on where the character moves to. For example, I have four lights on a building and inside the building, which is another level separate from the outer, will have six to seven more. The inner of the building is not attached to render while the character is on the out side, and all the inner lights are attached to the inner level, so the inner lights are not in the scene while the inner is not in the scene.

Even if the lights are not in the scene, but the lights are set on for your character, this will still raise the CG exception in the console window!

So, what I’ve done to counter this is turn the outer building lights off of the character before the inner level loads into render with its lights, and once the outer lights are off, I turn on the inner lights.

Sure, this keeps the CG too complex exception from raising, but at the price of a small “hickup.” The Shaders have to recalculate when you turn a light on or off for an object, that’s why you get the “hickup.”

It’s not too bad because once my inner levels load in, that one “hickup” at the beginning is all the player will see. I don’t like the fact you can see the effect of the outer lights going off the character and the inner lights taking effect on the character…in other words, you can see that abrupt shading change.

Is there a better way to avoid that CG error (crash) and lose the “hickup” and abrupt shading change on a character? I’ve played too many games where a million lights where in a level and not once did I see the shaders recalculate from area to area, so there has to be a way.

I’ve found a solution that works. I altered what triggers control the on and off of lights. This switch takes place just as the camera changes position and angle, so the “hickup” and shader regeneration is not seen. Even if the player opens a door and the inner level is attached to render, the inner lights will not get set on the player until the player steps into the inner level, and the outer detach along with its lights getting set to off.

All of this happens in that quick instance the camera changes angle (from outer to inner cam viewing), creating a clean transaction. This is probably the best way to do it…

So it seems anyway.