[Interest] [QT3D] transparencies

Sean Harmer sh at theharmers.co.uk
Fri May 20 22:16:34 CEST 2016


Hi,

With the materials and framegraph you can do either traditional alpha 
blended geometry sorted back to front or you are free to implement 
whatever flavour of OIT you desire. The framegraph gives you complete 
control over render targets and passes. Nothing is hard wired in the Qt 
3D renderer.

We don't provide any OIT out of the box yet but we may do one day. There 
are a lot of different needs though. For e.g. to reduce memory usage, it 
can be better to use a linked list of fragments rather than a full 
screen buffer with capacity for 8 blended fragments at each pixel 
location. Qt 3D gives you the freedom to build what you need on top of it.

Cheers,

Sean


On 20/05/2016 20:44, Jérôme Godbout wrote:
> 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 
> <mailto: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 list
>>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>>     http://lists.qt-project.org/mailman/listinfo/interest
>
>
>     -- 
>     Dr Sean Harmer |sean.harmer at kdab.com <mailto:sean.harmer at kdab.com>  | Managing Director UK
>     KDAB (UK) Ltd, a KDAB Group company
>     Tel.+44 (0)1625 809908 <tel:%2B44%20%280%291625%20809908>; Sweden (HQ)+46-563-540090 <tel:%2B46-563-540090>
>     Mobile:+44 (0)7545 140604 <tel:%2B44%20%280%297545%20140604>
>     KDAB - Qt Experts
>
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org <mailto:Interest at qt-project.org>
>     http://lists.qt-project.org/mailman/listinfo/interest
>
>
>
>
> _______________________________________________
> 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/d876389f/attachment.html>


More information about the Interest mailing list