[Interest] Using QSGVertexColorMaterial transparency
Nuno Santos
nunosantos at imaginando.pt
Tue Nov 11 15:13:53 CET 2014
Hi,
That was my initial approach but it lacked performance.
I have a matrix of this cells. I was laying them out on listiview with a listview inside. In the computer it was OK, but on an iPad 2, it was not.
I have already implemented the matrix on scene graph. The performance is incomparable.
I now that now I don’t have the fine grain control over appearance without a considerable investment in time but I need need this.
Any suggestion?
Regards,
Nuno
> On 11/11/2014, at 12:11, Al-Khanji Louai <louai.al-khanji at theqtcompany.com> wrote:
>
> Why not do this directly in QML with Rectangle items?
>
> -- Louai
>
>
>> -----Original Message-----
>> From: interest-bounces+louai.al-khanji=theqtcompany.com at qt-project.org
>> [mailto:interest-bounces+louai.al-khanji=theqtcompany.com at qt-
>> project.org] On Behalf Of Nuno Santos
>> Sent: Tuesday, November 11, 2014 1:17 PM
>> To: Interests Qt
>> Subject: [Interest] Using QSGVertexColorMaterial transparency
>>
>> Hi,
>>
>> I want to give a flashing effect on a quad. My idea is to draw two quads. One
>> with the base color, and one above it with a white color but with
>> transparency oscillating. This will give the flashing effect.
>>
>> I'm not being able to do it with QSGVertexColorMaterial. There is no opacity
>> on quad there is placed above. I have found the following post answer but I
>> still can't understand it quite well.
>>
>> "The blend mode used by the scene graph is glBlendFunc(GL_ONE,
>> GL_ONE_MINUS_SRC_ALPHA) which gives you premultiplied blending. A
>> "valid" color in premultiplied mode must have r <= a (same for g and b of
>> course). If it doesn't, then that color channel will overflow, giving you
>> additive blending instead."
>>
>> Will it be possible to implement this with a QSGVertexColorMaterial?
>>
>> // quad below
>>
>> v[0].set(_rect.left(), _rect.bottom(), r, g, b, a);
>> v[1].set(_rect.left(), _rect.top(), r, g, b, a);
>> v[2].set(_rect.right(), _rect.top(), r, g, b, a);
>>
>> v[3].set(_rect.left(), _rect.bottom(), r, g, b, a);
>> v[4].set(_rect.right(), _rect.top(), r, g, b, a);
>> v[5].set(_rect.right(), _rect.bottom(), r, g, b, a);
>>
>> // flashing quad above
>>
>> a=128+128*qSin(phase),r=0xff,g=0xff,b=0xff;
>>
>> v[6].set(_rect.left(), _rect.bottom(), r, g, b, a);
>> v[7].set(_rect.left(), _rect.top(), r, g, b, a);
>> v[8].set(_rect.right(), _rect.top(), r, g, b, a);
>>
>> v[9].set(_rect.left(), _rect.bottom(), r, g, b, a);
>> v[10].set(_rect.right(), _rect.top(), r, g, b, a);
>> v[11].set(_rect.right(), _rect.bottom(), r, g, b, a);
>>
>> 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