I am trying to use scene capture to record how many pixels of each static mesh are visible from a camera view. Here is the result of a SceneCapture in ‘BaseColor RGB’:
If I assign each static mesh a unique BaseColor (i.e. like in the image above), then I could simply count the pixels of each color in the resulting image, which would represent how much of each static mesh is visible to the camera, for example:
Green = 3,845 pixels
Blue = 2,714 pixels
Red = 3,109 pixels
If I keep a record of which static mesh has been assigned which color, I can then map the color counts back to the static mesh, which I can then use for further processing. This is all good and well…
HOWEVER…
This is not how I would like these objects to appear to the player. I would like any ‘assigned’ colors to be for the purpose of the scene capture analysis only, and not affect the appearance to the player.
Is there a spare/redundant channel in any of the below data types, which I could use to record a ‘unique ID’ for each static mesh without affecting visibility to the player and without restricting basic material editing functionality?
Ideally it would be great if was possible to capture a custom source, for example:
SCS_Custom UMETA(DisplayName = “Custom RGB dta defined by user, for SceneCapture purposes only”),
If this is not possible, would a practical workaround be to create two identical static meshes, one with a unique RGB BaseColor (which is hidden from the player but viewable to the SceneCapture), and another with the final material (which is viewable to the player but hidden from the SceneCapture).
I understand this method is essentially doubling the number of static meshes just to extract some basic scene info, which seems incredibly wasteful and doesn’t feel like the most elegant solution. However I’m wondering if it might work? However before I jump in and create a second copy of absolutely everything, are there any important considerations of this method I should consider beforehand? For example will this affect rendering speed, collisions etc?