TL;DR first: I’m trying to replicate the gimbal at the bottom center of the screen in Kerbal Space Program (reference image).
I have an actor blueprint, placed arbitrarily in the level, that contains a StaticMeshComponent sphere as the gimbal and a SceneCaptureComponent2D that looks at it. This capture component has a RenderTarget asset attached. I have a simple unlit material that uses this render target as emissive color. Finally, in the WidgetBlueprint that is my HUD, I use an image widget to display this material. (The image widget doesn’t seem to accept a render target, hence the intermediate material use.) So far, this works fine in the sense that I see the sphere rendered on my HUD. (I also see everything in its background, but I can work around that by playing with the capture component cull distance or placing the blueprint such that it faces the void.)
Now this is where I bump into: The gimbal sphere receives light from the sky light in my level. If I place a directional light, it also affects the gimbal. Similarly in reverse, if I place a directional light to illuminate the gimbal, it affects the whole level. This all seems like the natural behavior to me, too. The thing is, I’d like to separate the gimbal’s lighting from the rest of the level. Think of it like this: The gimbal is, along with other instruments perhaps, inside the spacecraft, which has no windows. I’m trying to reach a solution where I don’t have to remove the sky/directional light(s) or static lighting.
I’m working with engine version 4.7.6. So far I’ve tried messing around with lighting and shadow options, placing the gimbal blueprint in a streamed level, and enclosing it inside a hollow BSP cube made up of either a single BSP brush with the hollow option or six separate BSP walls.
What is the best way to accomplish this, if it is possible at all?
Thanks in advance.
Original, badly worded question:
I have a level with directional lighting in it. I want to render a scene, with lighting independent from the level, to a texture and use it on my HUD. I did the render target and draw-on-HUD part, but the directional light in the level affects the HUD scene, and vice versa. Level streaming didn’t solve this. Is this somehow possible to do?