jeudi 4 juin 2020

How to access SceneDepthTexture in UE4

I want to get the depth buffer from the UE4 rendering thread to the game thread, and then do some calculations, how should I do this?

I tried to get the SceneDepthTexture in the Render(), but I still don’t know how to pass it to the game thread, for example, I can use the depth cache in the tick function of the Actor class.

// 在Render里获取Depth Texture
FTexture2DRHIRef DTexture = SceneContext.GetSceneDepthTexture();

I also used another method, that is, I want to save the acquired depth texture as a local file, and then I use another function to read it. But i still failed.

Can someone help me ?

Aucun commentaire:

Enregistrer un commentaire