UTextureRenderTarget2D to PNG

RDaneelOlivaw
Thu, 30 Nov 2017 18:57:40 +0000
Rendering

Hi,
I’ve been trying to make this work for the past two days and I it seems to me that something is not right
I’m trying to retrieve camera images from UE4.17.2 and save them into a PNG.

I have added to my ActorBlueprint a SceneCaptureComponent2D that is linked to a TextureTargetthat I’ve also created. Is there a configuration that ahs to be done. Because the Little Icon of the TextureTarget Asset renders correctly and you can see what it should be seen

I’ve followed:

Unreal Engine Forums – 9 Dec 16

How to extract a Texture2D from a render target?

Hey, Through many attempts and hours I have been trying to convert a render target to a texture 2d. I believe the closest I have come is converting the render target to a slate brush and attempting to get it out with the "Get brush resource as...

Unreal Engine Forums – 12 Sep 16

Accessing camera images

Hello everybody, Does anyone know a way to programmatically access the images rendered by a camera ? I do not want to change the player's viewport or influence the environment in any kind. The only thing I need is an object (camera) to place...

Unreal Engine Forums – 26 May 17

Proper way to convert from UTextureRenderTarget2D into UTexture2D?

Hello, I want to convert a captured screen of game into UTexture2D. Here’s what has been done. I have inherited a custom class AScreenCapture2D from ASceneCapture2D, with member UPROPERTY() UTexture2D* m_photo; and added these functions. ...

But none of them seem to work. The images Appear either empty or totally black.
The FColour vectors generated are just totally black or white.

Could someone give a complete full example of how this should be accomplished because it seems that there is a lot of confusion on how this should be done and there is no full working example out there that I have found. Something like: create this blueprint actor with this and this, and create in its cutsom C++ class such and such functions that retrieves the This camera in this actor and saves it into a png.

It would help a lot to the UE4 comunity no doubt about it.

2 posts - 2 participants