We use forward lighting and Unreal 4.22.3.
We created a moveable spot light with only lighting channel 1 enabled. Then we created a couple of objects derived from UWidgetComponent to represent pages in our notebook. We made these UWidgetComponent objects movable and enabled both 0 and 1 lighting channels in them.
We didn’t see any light from channel 1 on our UWidgetComponent objects.
For some reason Unreal Editor doesn’t show the LightingChannels variable in the UWidgetComponent details view, though it is declared in UPrimitiveComponent, which is a base class for UWidgetComponent. So we did set the value of this variable in our C++ code and traced it all the way to LightingChannelMask == 3 in FPrimitiveSceneProxy and finally it was set in the primitive shader parameters in
Data.W = *(const float*)&PrimitiveUniformShaderParameters.LightingChannelMask;
Still, we didn’t see any light from channel 1 on our UWidgetComponent object.
The only way to get this light was to replace
uint LightingChannelMask = GetPrimitiveData(PrimitiveId).LightingChannelMask;
uint LightingChannelMask = 3;
directly in ForwardLightingCommon.ush.
This makes us think that LightingChannelMask in is not being set correctly by Unreal Engine on widgets.
Our current fix is to create a new material shader model, which allows us to modify shader code for widget materials and set the LightingChannelMask in the shader code directly.
Could You suggest a more elegant solution?