This is the situation: there is a tank roaming around, and a nice sun is high in the sky.
Then, I switch camera, and the new camera is inside the cockpit.
The sun does not light the cockpit at all.
There is a small light, inside the cockpit, that creates a nice atmosphere.
And this light has to light ONLY THE COCKPIT.
How to do this if I can only exclude 4 layers from the rendering list of a light???
Depending on your layer setup this can be easy or not. From your description it sound like you’d only need two lighting layers. One for outside and one for inside. Now the HUGE problem with the out of the box layer design in Unity is that you can set only on layer per object and that this layer is used for lighting, logic, cameras etc. all at the same time.
So if you’re already using some layers for asset picking or whatnot, you’re basically screwed and have to find a workaround, like not picking the actual object but some invisible stand-in.
ATM I’m NOT using layers at all (I’m at the beginning of the development) so I thought I’d start to use them for this… and… I can’t.
Well, what are you doing exactly?
Basically you would do something like putting the objects inside the tank on layer X and cull/exclude this layer from the sun.
Vice versa you cull the default layer (which still has all of the outside objects on it ) from your cockpit light.
What you shouldn’t do is cull all of the layers except for your layer X, just the ones that matter.
Yes, this is of course exactly what I’m doing.
And this looks like it’s the bad news… it means there is no other way and I have, from now on, to manage layers for ALL the objects.
So uncool (just to use a neologism).
I’m trying another solution.
I will just trick it all by placeing carefully limited lights that will only be able to hit the hull of the tank and nothing else.
If in game this will work, then that’s ok for me