[Interest] Split entities into groups and render them in custom order
Oleg Evseev
ev.mipt at gmail.com
Sun Jul 10 16:29:20 CEST 2016
2016-07-09 22:31 GMT+03:00 Sean Harmer <sean.harmer at kdab.com>:
> Hi,
>
> On 09/07/2016 14:27, Oleg Evseev wrote:
>
>> Hi,
>>
>> I'm trying to understand how can I split entities into groups and render
>> them in custom order.
>>
>> That is, for example, first render SkyBox - behind all entities, than a
>> Ground - plane mesh in front of SkyBox, but behind everything else. Then
>> render a group of many transparent entities in order of creation. After
>> that all other entities render "as usual" with ColorDepthBuffer.
>>
>
> Well, unless you're doing something very fancy, you would normally render
> the opaque objects first followed by the transparent objects in back to
> front order.
>
I see, but in my case those transparent entities - is the path behind
vehicle, so that it will always behind all "frontend" opaque entities
[image: Встроенное изображение 1]
>> For now I'm using one viewport and one camera.
>>
>> Do I understand right, that I can do such rendering with help of set of
>> LayerFilters (like in example Deferred Renderer
>> http://doc.qt.io/qt-5/qt3drender-framegraph.html) with different
>> parameters of ClearBuffers?
>>
>
> Using Layer components on your entities and LayerFilter nodes in the
> framegraph is indeed the way to go. You only need one ClearBuffers per
> render target node typically.
>
> Something schematically like this:
>
> * Viewport
> ** RenderSurfaceSelector
> *** CameraSelector
> **** ClearBuffers
> **** LayerFilter [layer = opaque]
> **** LayerFIlter [layer = environment]
> **** LayerFilter [layer = transparent]
> ***** SortPolicy [ front to back]
> ****** RenderStateSet [ disable depth writes ]
>
This is the typo with SortPolicy, right? Should be "back to front" order as
you mention before?
I do not understand how to do RenderStateSet [ disable depth writes ] leaf
QRenderStateSet *renderStateSet = new QRenderStateSet();
QRenderState *renderState = new QRenderState();
renderState->???;
renderStateSet->addRenderState(renderState);
How to make "disable depth writes" renderState?
And another question: according to
http://doc.qt.io/qt-5/qt3drender-qrenderstateset.html#details :
> States set on a QRenderStateSet are set *globally*
If so, why RenderStateSet is inside last LayerFilter [layer = transparent]?
Much appreciated for help!
---
Regards, Oleg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160710/05808ebd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 57232 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160710/05808ebd/attachment.png>
More information about the Interest
mailing list