[Interest] Qt3D Stencil example?
Jonathan Greig
redteam316 at gmail.com
Sat Nov 4 04:41:57 CET 2017
Jonathan P. Greig
aka redteam316
RIP 6/13/1984 - 2/7/2016
On Mon, Sep 25, 2017 at 3:25 PM, Gil H <qt at tastytech.ca> wrote:
> Thanks very much for the example, Sean. It’s much clearer now that I see
> RenderStates in use (for some reason I thought they only applied in Effect)…
>
> There is a pretty serious issue that is blocking me from using Qt3D for
> augmented reality, which is that QtMultimedia’s VideoOutput doesn’t work
> when the window surface uses CoreProfile (tested on Mac). This issue was
> given a low priority and is a year and a half old:
> https://bugreports.qt.io/browse/QTBUG-51064
> <https://u5810871.ct.sendgrid.net/wf/click?upn=RgE1ASyOg54bH5KXOAIcDCNgCWqccrQ-2FpQuIrXIrfIJMy2TtuL9LVEN2mNDqCmUOgEyuwohNEwt6hzEhA36JiQ-3D-3D_wBwg3POqus3ycpk-2F0rxnkTh6GGX9m8uP6qHpajPv1FEqh6WFzqVsUSHUCdA-2BOqQY-2FNCuZVv79ETVvii1V4bbxv4SmlrJUt-2F-2FdM6WNEpEe2Oh4y2k29Db7BHceI00Q7BiXLMjpeO6sfy6p60Gd8suzJAArtjpHrJx4jcPOEQ9Od4FR3O54CZDcjiXIvnPZ1By6Mvk8NMavR8K639TrZc3LraMz8wX9ziddpiBosWMLrM-3D>
>
> Cheers,
>
> Gil
>
> On 2017-09-23, 7:22 AM, “Sean Harmer” <sean.harmer on behalf of
> sean.harmer at kdab.com> wrote:
>
> Hi,
>
> On 20/09/2017 18:43, Gil H wrote:
> > Hi everyone, between StencilMask, StencilTest, and StencilOperation QML
> > items and their sparse documentation, I have been unable to achieve
> > something fairly straightforward with a custom framegraph.
>
> The render states work in exactly the same way as raw OpenGL states just
> in an object oriented fashion. A nice page with a stencil example is:
> https://open.gl/depthstencils
>
> > Specifically, I am trying to render one object (say, a torus) to the
> > stencil buffer, and then use that to mask out the rendering of the rest
> > of the scene in the second pass. Can anyone provide an example frame
> > graph that does this?
>
> I've created the small attached example that demonstrates this for you.
> It renders a torus shaped entity as a mask, followed by a simple cube as
> the actual scene content. Left clicking on the cube toggles whether the
> stencil buffers masks in or masks out the scene layer content. I've
> briefly documented the MaskedForwardRenderer.qml frame graph for you.
>
> To control which entities are rendered in each phase of the frame, we
> use a Layer and LayerFilter combination - don't forget to assign the
> scene layer to your lights too.
>
> To improve the stencil writing pass, you could use a trivial shader
> program that does the bare minimum of work rather than the phong
> material I've used here for convenience.
>
> Hope this helps,
>
> Sean
> --
> Dr Sean Harmer | sean.harmer at kdab.com | Managing Director UK
> KDAB (UK) Ltd, a KDAB Group company
> Tel. +44 (0)1625 809908 <+44%201625%20809908>; Sweden (HQ) +46-563-540090 <+46%20563%2054%2000%2090>
> Mobile: +44 (0)7545 140604 <+44%207545%20140604>
> 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/20171103/acae355f/attachment.html>
More information about the Interest
mailing list