[Interest] Antialiasing possible on QSGGeometry?
markg85 at gmail.com
Fri Jun 7 21:32:01 CEST 2013
That's an interesting solution!
But how do i get a QQuickView from within a custom component that
inherits from QQuickItem?
My component is meant to be a QML Plugin, not a standalone QML application.
On Fri, Jun 7, 2013 at 8:12 AM, Sletta Gunnar <Gunnar.Sletta at digia.com> wrote:
> You need to set the surface format of your QQuickView.
> QQuickView view;
> QSurfaceFormat format = view.format();
> If your graphics hardware supports multisample antialiasing, you will now have antialiased geometry.
> As the scene graph might require depth/stencil buffer for its renderer, it is a bit important that you inherit the original surface format from the view instead of creating a new one from scratch.
> qmlscene supports this out of the box by passing --multisample as a command line option.
> On Jun 7, 2013, at 12:12 AM, Mark <markg85 at gmail.com> wrote:
>> Another day, another question :)
>> Don't worry, i plan on making a big blog about everything. This
>> information won't get lost.
>> So today i'm trying to draw a custom shape by setting vertices. More
>> specifically a GL_QUAD_STRIP.
>> It looks like this (obviously just testing data)
>> QSGGeometry *geometry = new
>> QSGGeometry(QSGGeometry::defaultAttributes_Point2D(), 8);
>> geometry->vertexDataAsPoint2D().set(0, 100);
>> geometry->vertexDataAsPoint2D().set(0, height());
>> geometry->vertexDataAsPoint2D().set(width() / 4, 80);
>> geometry->vertexDataAsPoint2D().set(width() / 4, height());
>> geometry->vertexDataAsPoint2D().set(width() / 2, 110);
>> geometry->vertexDataAsPoint2D().set(width() / 2, height());
>> geometry->vertexDataAsPoint2D().set(width(), 150);
>> geometry->vertexDataAsPoint2D().set(width(), height());
>> QSGFlatColorMaterial *material = new QSGFlatColorMaterial;
>> material->setColor(QColor(255, 0, 0, 128));
>> QSGGeometryNode *n = new QSGGeometryNode;
>> So roughly the same as the example  only with a quad strip.
>> However, this ends up looking a bit aliased.. So the question is: How
>> do i get this anti-aliased?
>> I did read something about multisampling and setting the number of
>> samples, but i can't find such a function in any of the used classes..
>> Kind regards,
>>  http://qt-project.org/doc/qt-5.0/qtquick/qsggeometrynode.html
>> Interest mailing list
>> Interest at qt-project.org
More information about the Interest