天天看点

解决UE4加载网页帧率不足60fps的问题问题产生原因

问题产生原因

UE4.24到4.26中引擎默认启用WebGL,这会导致在使用WebUI插件等其它方法打开网页时实际帧率达不到60fps,

解决方法

修改/ Engine / Source / Runtime / WebBrowser / Private / CEF目录里的CEFBrowserApp.cpp文件。

找到FCEFBrowserApp::OnBeforeCommandLineProcessing:

void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
	CommandLine->AppendSwitch("enable-gpu");
	CommandLine->AppendSwitch("enable-gpu-compositing");
	CommandLine->AppendSwitch("enable-begin-frame-scheduling");
}
           

修改为:

void FCEFBrowserApp::OnBeforeCommandLineProcessing(const CefString& ProcessType, CefRefPtr< CefCommandLine > CommandLine)
{
	CommandLine->AppendSwitch("disable-gpu");
	CommandLine->AppendSwitch("disable-gpu-compositing");
	CommandLine->AppendSwitch("enable-begin-frame-scheduling");
}
           

编译成功后即可解决问题。

UE4.26.2版本编译后的.dll文件

下载地址:https://gitee.com/ProgrammerLuo/temporary-warehouse/blob/master/WebBrowser/UE4Editor-WebBrowser.dll

参考:https://github.com/tracerinteractive/UnrealEngine/tree/4.26