I'm trying to download a WebGL project (exported from Unity 2018.3.14f1) in Qt WebEngineView (Qt 5.12.0)
For an example, WebGL project was created in Unity 2018 - an empty scene without objects (camera only) - Screenshot: Unity project
and exported to the WebGL Assembly (applied .gzip compression, build size 2.3 MB) - Screenshot: Unity build settings
The Qt project was take from Qt's library of examples ("WebEngine Widgets Minimal Example").
#include <QApplication>
#include <QWebEngineView>
QUrl commandLineUrlArgument()
{
const QStringList args = QCoreApplication::arguments();
for (const QString &arg : args.mid(1)) {
if (!arg.startsWith(QLatin1Char('-')))
return QUrl::fromUserInput(arg);
}
return QUrl(QStringLiteral("file:///F:/qt/test4Exp/index.html"));
}
int main(int argc, char *argv[])
{
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
QWebEngineView view;
view.setUrl(commandLineUrlArgument());
view.resize(1024, 750);
view.show();
return app.exec();
}
When you open a WebGL project in Chrome, everything loads very quickly (instantly) - Screenshot: WebGL project opened in Chrome
When you open WebGL in WebEngineView, the project takes a very long time to load (about 5-6 minutes) - Screenshot: WebGL project loading in WebEngineView
... but then it opens - Screenshot: WebGL project loaded in WebEngineView
The WebGL project is opened from a local drive. I have tried various options for Unity export parameters (brodil compression, code optimization, etc.). Tell me, what could be the problem? Can be applied to any option in the Assembly or in QCoreApplication::setAttribute ?
Below attached the project WebGL and Qt project