[Interest] [QT3D] transparencies

Jérôme Godbout jerome at bodycad.com
Fri May 20 21:44:04 CEST 2016


Transparency is always a bit tricky, having transparent object leave the
blending to add background color to current fragment. The easy not so good
is to render back object to the front.  But since the order in which you
render affect the final results you end up with transparency that may look
ugly and event bad if object can be at the same time partially behind and
in front of each other.

I haven't play with Qt 3D yet, but to do this properly you need an OIT,
https://en.wikipedia.org/wiki/Order-independent_transparency

After that the right OIT depends on your needs. But a multi pass depth list
for up to 8 object transparent is good enough for most use case, may not be
the fastest but work without too much trouble, but you need some hands on
into the rendering pass, because you need to keep the depth buffer and some
custom buffer between each rendering pass.

One easy optimization is to render all opact object first, then render into
multi pass only transparent object with occlusion by depth buffer, the
first pass collecting each fragment depth and color into list, second pass
is to accumulate the transparency color from back to front.

Not sure how much Qt allow you to play with the rendering pass and keep
buffer between pass, but that's what is require to have a good transparent
rendering.

Jerome


On Fri, May 20, 2016 at 2:52 PM, Sean Harmer <sean.harmer at kdab.com> wrote:

> Hi,
>
> works already since 5.6 I think. There is a transparent phong material.
> You may need to customise a framegraph a little though. See
> http://code.qt.io/cgit/qt/qt3d.git/tree/tests/manual/transparency-qml?h=5.7
>
> Cheers,
>
> Sean
>
> On 20/05/2016 19:17, Pierre Chicoine wrote:
>
> Is there an update on when transparencies will be supported by default? I
> am still on Qt 5.6. Maybe 5.7 or 5.8? Or should I plan on setting up my own
> shader?
>
> Pierre Chicoine
>
>
> _______________________________________________
> Interest mailing listInterest at qt-project.orghttp://lists.qt-project.org/mailman/listinfo/interest
>
>
>
> --
> Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
> KDAB (UK) Ltd, a KDAB Group company
> Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090
> Mobile: +44 (0)7545 140604
> KDAB - Qt Experts
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160520/20b11281/attachment.html>


More information about the Interest mailing list