I’m trying to export SceneDepth in R images (using a blueprint) for a machine learning application. I know that the render target has to be set to RTF R32f and that the image cannot be viewed directly. To get around this, I’ve made a material which uses the render target as a texture sample and normalizes the output values, so that it makes sense in gray scale (see here: What does DeviceDepth option under SceneCaptureComponent2D capture? - UE4 AnswerHub).
The problem is that this new correctly normalized data cannot be exported to a png or bmp image, I’ve tried both drawing the material to a new render target and exporting that as well as making a texture from the material and exporting that, neither of which work. The image exports but is either solid black (for render target exports) or unreadable (for texture exports), no matter what render target format is selected. In the UE4 editor everything looks correct and the various render targets, materials and textures all update correctly, it is only the export which isn’t working.
If I export the texture manually from the content browser it works fine but I can’t do that for every image.