How to get Render target handle in Unreal (OpenGL)?

Hi,

I need some help.

(Windows 10, UE 4.22, OpenGL, Nvidia RTX A4000)
Is there any method let me to get the handle(pointer) of render texture?
I need to feed this handle to opencl to do some caculation.

In Unity, I could get texture handle easily like below:

RT = new RenderTexture(frameWidth, frameHeight, 24);
RT.format = RenderTextureFormat.DefaultHDR;
RT.Create();
handle = RT.GetNativeTexturePtr() <— I need this in unreal

Is there any solution?

Bumping this thread.

Did you ever get an answer or find a solution?

I’m guessing you could use MyRenderTexture->GetNativeResource()->GetNativeHandle()

Look through the engine source to get examples closest to what you want to achieve.
It’s a pretty unsafe operation though because the return value is unknown

Here is an example from GoogleARCoreApi.cpp

ArTrackable* TrackableHandle = reinterpret_cast<FGoogleARCoreTrackableResource*>(TrackedGeometry->GetNativeResource())->GetNativeHandle();

If you sift through the engine code you might find one directly for render to texture.