Is it possible to integrate OpenGL code as a plugin for Unreal?

Suppose I have a graphics application written in C++/OpenGL/GLFW/GLEW/GLSL/GLM, is it possible to load the OpenGL application as an external script/plugin? or do I have to throw away the OpenGL code and recreate everything from scratch using Unreal?

The motivation is I want to hand over the work to another developer that is familiar with Unreal (but not OpenGL) so he can add UIs, create and animate CG objects etc on top of the graphics application written by OpenGL.

If it was sperete view port or somehow render on top of UE4 window then i think that might be possible, C++ in UE4 is still normal C++ so you can technically do anything there but not everything will cooperate with engine APIs, also specific use of OpenGL will reduce portabbility capabilities, maybe not on PC and Mac but on consoles yes.

UE4 use rendering interface called RHI which you send rendering commands to it and RHI will translate it to library that it’s curretly using, DX, OpenGL, any library that consoles platfrom uses. Slate alone give you rendering options to, you can paint custom (sadly only 2D) vertieces data:

Or even inject RHI commands in to rendering system

I think those 2 above can help you out, i personally testing them out right now :slight_smile:

1 Like

Thanks a lot for the answer. I would like to somehow place the Unreal rendering on top of the OpenGL rendering. To narrow down the problem, is it possible to draw two triangles in the same viewport and one with a glDrawElements call and one with a UE4 RHI call?

Another question is is it possible to draw two triangles in the same viewport and one with a glDrawElements call and one with UE4 blueprint?

you can’t use UE4 viewport, you would need to render on top of UE4 viewport… if thats even possible to begin with