Enable OpenGL, and disable Vulkan, in Unreal Engine 4.25

June 12, 2020

Can't support Vulkan?

Tired of typing -opengl4 every time you want to open UE4.25?

Don't want to edit -opengl4 into the generated desktop files so you can launch it without the terminal?

Want to be able to launch directly from the project?

You're in luck! There's a very simple way to enable OpenGL while disabling Vulkan.

Chances are, you're here becuase you're getting the error message;

text

1Trying to force OpenGL RHI but the project does not have it in TargetedRHIs list.

So how do I enable OpenGL?

You just need to uncomment one line in the BaseEngine.ini file located here:

text

1Engine/Config/BaseEngine.ini

Then search for, and uncomment the line

text

1+TargetedRHIs=GLSL_430

At the time of me writing this, this can be found on line 2191.

You'll now be able to launch Unreal by using the -opengl4 argument. But what if you don't want to include the argument? That's simple! You just comment this line above it:

text

1+TargetedRHIs=SF_VULKAN_SM5

As the comment directly above it states:

text

1When neither -vulkan nor -opengl4 are passed on the commandline, the engine will default to the first targeted RHI.

By default, the first targeted RHI is Vulkan.

After the edits, the Linux Target Settings in your BaseEngine.ini should look like this:

text

1[/Script/LinuxTargetPlatform.LinuxTargetSettings]
2; When neither -vulkan nor -opengl4 are passed on the commandline, the engine will default to the first targeted RHI.
3; +TargetedRHIs=SF_VULKAN_SM5
4
5; OpenGL4 is deprecated, you can comment this back in to add it to your targeted RHI list
6+TargetedRHIs=GLSL_430

Congrats! Unreal can now be launched without the -opengl4 argument.

You will be met with a new warning message every time you launch. Just click "Ok" and Unreal will continue launching. It may be worth getting a new computer soon though as I doubt UE5 will support OpenGL.

If you're reading this then you've probably already compiled the source for Unreal but if you haven't, you can do that here: Compiling Unreal Engine 4 from source on Windows and Linux.

If this helped you, please consider buying me a coffee on Ko-Fi at https://ko-fi.com/rhyce.

Did this post help you?

Consider buying me a slice of pizza!