Hello, we are using the “Light Influences” advanced showflag debug display as a useful tool to debug our lights in complex scenes
[Image Removed]
We realized that only shadow casting lights OR non-shadow casting light with mobility set to “Static” are actually displaying the debug orange line, which we suspect might be a bug.
Here are my findings:
If a spotlight is not casting shadow, the light influence debug orange line will not show up.
[Image Removed]
If you set the spotlight “mobility” to static, the debug orange line will show up
[Image Removed]
If the light is shadow casting, the debug orange line will show up, no matter the mobility settings.
If this debug display is intended only for shadow casting light, maybe “Shadow casting light influence” would be a better name for that debug display?
Thank you
[Attachment Removed]
Steps to Reproduce
Activate “Light Influence” debug display (Advanced showflags)
Create Spotlight actor near another actor (cube)
Select the cube actor, notice that a debug orange line will draw from the center of the object to the spotlight
Back to the spotlight actor, set “Cast Shadows” to false
Select the cube again, notice that the debug orange line will not draw anymore
If you change the mobility of the spotlight component from “Movable” to “Static” notice that the debug orange line will draw again.
[Attachment Removed]
Hello,
Thank you for reaching out.
I’ve been assigned this issue, and we will be looking into the behavior of the ShowFlag LightInfluence for you.
[Attachment Removed]
Hello,
This showflag is showing which lights a primitive will make an FLightPrimitiveInteraction with, rather than which lights are shining on the primitive.
When you disable shadows on the light, and it is dynamic, the CPU does not need to keep track of which primitives the light is shining on. When you change the light’s mobility to Static, the CPU sees that it might need to bake the light’s influence, and thus needs to track the interaction again.
The condition used by this debug mode is “FLightSceneInfo::ShouldCreateLightPrimitiveInteraction(…)” from LightSceneInfo.cpp. The debug view mode gets the list of lights via “FScene::GetRelevantLights_RenderThread(…)” from RenderScene.cpp, and you can see it in use in the function “FSceneRenderer::PreVisibilityFrameSetup(…)” from SceneVisibility.cpp.
If this is not the information you are trying to visualize, can you please describe what you are looking for?
Please let us know if this helps.
[Attachment Removed]
Thanks for the detailed answer,
In our case, we have complex scenes that can have hundreds of lights with large radiuses, making the “light complexity” debug display quite tricky to use because its hard to pinpoint which are the lights that are “shining” on the selected primitive. For example, we were troubleshooting a light that had an extremely high draw distance (we knew there was a light using the light complexity mode) but it was very tricky to know “which light” the icon can be very small and hidden inside other actors etc.
The light influence is super useful because you have a clear line that shows “this light affects this actor” but it would make more sense for us to also include non-shadow casting lights in this debug display.
[Attachment Removed]
Hello,
In this case, it might be better to make a custom tool. This can be done with Blueprints, via an Editor Blueprint inheriting from Actor Action Utility. You can iterate the selected actors and compare them to the light components in the scene, and with a few distance and angle checks, draw lines using the debug drawing functionality. We will leave the implementation up to you.
Keep in mind performance of this tool will depend on the amount of iteration, so properly scoping and bounds checking will be helpful.
This documentation covers Actor Action Utilities and other Blueprint scriptable tools:
https://dev.epicgames.com/documentation/en\-us/unreal\-engine/scripted\-actions\-in\-unreal\-engine
Please let us know if this helps.
[Attachment Removed]