[Interest] QSGGeometryNode painting with two different colours

Gunnar Sletta gunnar at sletta.org
Tue Oct 21 11:12:38 CEST 2014


There is no text/glyph node, sadly.

I've wanted to add one for a while now, but never got around to it. That means that your options right now are to either use Text {} labels which you create through QML or to use a QPainter on a QImage and show the texture. Neither option is ideal, I know :/

cheers,
Gunnar

On 21 Oct 2014, at 10:52, Nuno Santos <nunosantos at imaginando.pt> wrote:

> Got it.
> 
> One last question. What is the best way to include text rendering on a custom QQuickItem? Is there any class that renders text that can be appended as a node?
> 
> Thanks
> 
> Regards,
> 
> Nuno
> 
> On 21 Oct 2014, at 09:38, Gunnar Sletta <gunnar at sletta.org> wrote:
> 
>> 
>> On 21 Oct 2014, at 10:25, Nuno Santos <nunosantos at imaginando.pt> wrote:
>> 
>>> Hi Gunnar,
>>> 
>>> Thanks for your reply.
>>> 
>>> I understand and in this case I can use a ColoredPoint2D and QSGVertexColorMaterial.
>>> 
>>> However, I’m always limited to one material per node, right? Suppose i’m using a triangle fan as drawing mode for the node. If I need to draw quads, I will need to use another node, right?
>> 
>> Correct, however you are better of just using triangles and triangle strips as these are batchable in the renderer. A fan is not. It is also possible to put 700 fans into the same geometry using triangles or a triangle strip with collapsed triangles between each fan.
>> 
>>> 
>>> Thanks,
>>> 
>>> Regards,
>>> 
>>> Nuno
>>> 
>>> On 21 Oct 2014, at 03:54, Gunnar Sletta <gunnar at sletta.org> wrote:
>>> 
>>>> 
>>>> On 20 Oct 2014, at 23:16, Nuno Santos <nunosantos at imaginando.pt> wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> I’m using scene graph to render to make a sequencing matrix.
>>>>> 
>>>>> I have extended QQuickItem for the main class and i’m making several nodes for the various parts that compose the matrix.
>>>>> 
>>>>> One of the parts, that I was intending to put on a single node is the keyboard keys which are black and white.
>>>>> 
>>>>> The question is: can I use two different colours on the same node? The other nodes are being used with the supposition that only one color is allowed per node. IS this supposition right?
>>>> 
>>>> Geometry nodes can be whatever you desire :)  
>>>> 
>>>> It all depends on what data you put into your geometry and what kind of material it is using. If you want to have multiple colors in the same geometry, you can for instance use GL_TRIANGLE and QSGGeometry::defaultAttributes_ColoredPoint2D() and a QSGVertexColorMaterial. 
>>>> 
>>>> cheers,
>>>> Gunnar
>>>> 
>>>>> 
>>>>> Thanks,
>>>>> 
>>>>> Regards,
>>>>> 
>>>>> Nuno
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Interest mailing list
>>>>> Interest at qt-project.org
>>>>> http://lists.qt-project.org/mailman/listinfo/interest
>>>> 
>>> 
>> 
> 




More information about the Interest mailing list