I’d like all the actors in my game to have lighting channels 0 and 1 enabled as opposed to only channel 0 being enabled as it is by default.
I’ve noticed that all the actors/components where lighting channels can be changed are children of the engine’s Actor base class, so if I change the lighting channels in the base class, then that should be propagated to everything else in the game, however, I can’t find the lighting channels variable in the actor.cpp file.
Does anyone know where to find them or if there is a better way of doing this?
I’ve done some search and found that LightingChannels is in the UPrimitiveComponent class which is base class for StaticMeshComponent, SkeletalMeshComponent etc.
It makes sense because these components are the ones should be rendered or receive light.
So, you can specify lighting channel for any mesh you want.
Example:
I found the solution. If you want to change the default lighting channel settings so that channel 1 is always set to enabled on everything in the engine, for example, this is what you need to do:
Open the header file PrimitiveComponent.h which is located in: /Engine/Source/Runtime/Engine/Classes/Components/PrimitiveComponent.h
This is the file in which the FLightingChannels structure which contains the booleans for channels 0, 1, and 2 is declared and where we can set their default values.
I wanted channel 1 to always be on by default so I set bChannel1(true), if I wanted channel 2 to also be on by default I would set bChannel2(true), etc.