I have a few rotating elements in my game. Everytime anything is spinning the edges are drawn not very nicely. I already tried to enable msaa, by adding QSG_ANTIALIASING_METHOD = msaa to the build environment variables in QtCreator. But nothing changed.
Are there any suggestions what to do?
Thanks
This topic was modified 7 years, 10 months ago by Terry86.
From the Qt Docu: http://doc.qt.io/qt-5/qml-qtquick-item.html#antialiasing-prop
antialiasing : bool
Used by visual elements to decide if the item should use antialiasing or not. In some cases items with antialiasing require more memory and are potentially slower to render (see Antialiasing for more details).
The default is false, but may be overridden by derived elements.
This reply was modified 7 years, 10 months ago by pklaffert.
pklaffert had the right idea, but the problem are the internals of the MultiResolutionImage component. It is an Item with an Image as child, so setting the antialiasing property doesn’t affect the Image. As a workaround you can access the antialiasing property of the internal image by adding image.antialiasing: true to the MultiResolutionImage. (you can ignore the warning of QtCreator that imagehas no members, this is just an autocompletion issue of the editor)
We will change the internal image to inherit the antialiasing property of it’s internal Item parent with the next update.
Cheers,
Alex
This reply was modified 7 years, 10 months ago by Alex.
Ok, maybe it was obvious but now I’ve found the solution to turn on msaa (multisampling) which brings you a slightly better result than the default vertex antialiasing.
QQmlApplicationEngine engine; // something like this should already be in your code
vplay.initialize(&engine); // something like this should already be in your code
vplay.setMainQmlFileName(QStringLiteral("qml/Main.qml")); // something like this should already be in your code
engine.load(QUrl(vplay.mainQmlFileName())); // something like this should already be in your code
QQuickWindow* window = (QQuickWindow*) m_engine.rootObjects().first();
QSurfaceFormat format;
format.setSamples(16);
window->setFormat(format);
Maybe you also have to add QSG_ANTIALIASING_METHOD to the variables of the build environment in QtCreator and assign it the value msaa. By default the value should not be in the list and therefore the value vertex will be assigned, if I’m right.
This reply was modified 7 years, 10 months ago by Terry86.
This reply was modified 7 years, 10 months ago by Terry86.
Is the “image.antialiasing: true”-issues solved in the new version (2.6) ? I.e. do you changed the internal image to inherit the antialiasing property of it’s internal Item parent?
By signing up, you consent to Felgo processing your data & contacting you to fulfill your request. For more information on how we are committed to protecting & respecting your privacy, please review our privacy policy.
Want to find out if Felgo is a good fit for your company?
As part of the free Business evaluation, we offer a free welcome call for companies, to talk about your requirements, and how the Felgo SDK & Services can help you. Just sign up and schedule your call.
Sign up now to start your free Business evaluation: