[Interest] use custom fragment shader for Quick2 Image item
Ola Røer Thorsen
ola at silentwings.no
Tue Oct 22 22:04:02 CEST 2013
Hi Sean, thanks for the reply! Yes I think I'll have to go for the second
option there, writing my own CustomImage based on the original Image source
I'll post a feature request on the bug tracker, let's see what happens.
By the way, I browsed a bit through the Qt source tree for glsl shaders
(version 5.1.1). Seems like nearly every shader is only using the "highp"
precision setting for uniforms etc. In my experience on these low-end
mobile GPUs, highp is very slow. Texture coordinates can mostly be mediump,
and color calculations can be lowp most times (sometimes with extra care of
the order of multiplications etc, to stay within [-2,2]. Maybe this is
something that can be looked into for future performance optimizations.
2013/10/22 Sean Harmer <sh at theharmers.co.uk>
> The shader code is hard-wired into the relevant material in the
> qtdeclarative module and there is no way to replace it at present (that I
> know of) apart from altering the source and building a customised version.
> Maybe Gunnar knows of way?
> Another option would be to write yourself a custom material using the SG
> API and assigning that to a specialised CustomImage item.
> I agree that in some cases such a feature would indeed be useful to avoid
> having to do this.
> On 22/10/2013 14:20, Ola Røer Thorsen wrote:
> Hi all,
> I want to use a custom fragment shader when rendering a Image item. Is
> it possible to set the shader to use directly somehow? That is, I want to
> use a custom shader instead of the "passthrough" fragment shader used in
> the Image element.
> I have tried using the QtGraphicalEffects (GammaAdjust), but the
> performance is not good enough on my target platform (Omap 3530).
> ShaderEffect elements work, but they also seem to render via another
> render-texture, again with a performance loss.
> Best regards,
> Interest mailing listInterest at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
> Interest mailing list
> Interest at qt-project.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest