[Interest] QSGGeometryNode painting with two different colours

Nuno Santos nunosantos at imaginando.pt
Tue Oct 21 10:25:06 CEST 2014


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?

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