The Scene Capture 2d component has the ability to Hide or Only Show certain actors and components. Is it possible for a camera to do this? I know it would require some code. I’m just trying to gauge how feasible it would be to add that functionality to a camera. If it is possible, I’d appreciate any help on how to go about adding that functionality.
Simple way to do it:
- give all your base game actors some type of enum like “CameraChannel::1, 2, 3”
- whenever you switch cameras, iterate through all base game actors and show/hide them based on their enum value
I don’t want to use to the visibility setting every actor already has. If I hide a skyphere using the visibility or Hidden In Game setting, then it’s light stops affecting the world. I want the ability to only render certain objects that are still affected by any hidden objects. For example lets say I have a box in the level, it should still be affected by a skyphere that isn’t being rendered in viewport. The Scene Capture 2d Components already has this functionality built in with the Hide/Only Show certain actors. I’m just asking whether it is possible to add this functionality to cameras and how I would go about doing it.
Here is a side by side comparison of what I’m talking about. The left circle render was taken using the Scene Capture Component using the Only Show feature. The right circle is rendered with a regular camera actor with everything hidden in the game except for the circle and a few lights. I want to get the same result as the Scene Capture Component with a camera.
Sorry for reviving this thread, but i’ve been looking into the same issue, and have just confirmed this is do-able via modifying UE4. For future references, here is my train of thought:
Core Idea:
- PlayerCamaerManager: add method to extract current active camera component
- AActor: add method to grab active camera component
- GameViewportClient: line 1450, during view construction, get LocalPlayer’s playerCameraManager
- CameraComponent: mimic SceneCaptureComponent2D, add ignore actors and its interfacing functions
- GameViewportClient: grab the active camera from camManager, get its list of ignore actors, and mimic SceneCaptureRendering’s Hidden actor logic, adding to HiddenPrimitives for the newly created view.
You can see my implementation of just that at: https://github.com/EpicGames/UnrealEngine/pull/8896
Any chance you have a plugin version of this for UE5? If not, mat I have permission to make one? I feel like this could be really useful.