I am trying to use layer filtering as shown in this answer. For this I wrote a simple test (see below). This is a continuation of the question.
At a certain position
You can fix that by adding a QNoDraw
node as a child of clearBuffers
, as shown in this answer. The "artifact" is not caused by the layer filters, it is a problem of QClearBuffers
itself.
Making clearBuffers
a child of cameraSelector
may seem to work on the surface, but what's actually happening is that everything is being rendered twice, so the transparent sphere will appear darker. You can verify this by commenting out either one of the filters: the objects in the corresponding layer will get rendered anyway.
By leaving clearBuffers
as a child of renderSurfaceSelector
and adding the QNoDraw
, you don't get undesired stuff drawn on top of your viewport, and the filters behave as expected.