[Interest] Qt3D face culling

Øyvind Bakken oyviba at gmail.com
Thu Feb 25 10:38:17 CET 2016


Hi,

we are developing a desktop application with 3D graphics using Qt3D. We
have run into some issues when using the Qt3DRender.CullFace settings in
the Qt3DRender.StateSet module.

Basically we have an open surface which was correctly rendering the front,
but not the back face. We then added the Qt3DRender.CullFace settings like
this (QML):


Scene3D { ..... ..... // Top-level entity entity: Qt3DCore.Entity { .....
..... // Simple framegraph that just renders the scene from the camera
components: [ Qt3DRender.FrameGraph { activeFrameGraph: Qt3DRender.Viewport
{ rect: Qt.rect(0, 0, 1, 1) // From Top Left clearColor: "transparent"
Qt3DRender.CameraSelector { camera: camera Qt3DRender.ClearBuffer { buffers
: Qt3DRender.ClearBuffer.ColorDepthBuffer Qt3DRender.StateSet {
Qt3DRender.CullFace { //mode: Qt3DRender.CullFace.FrontAndBack } } } } } }
] } //Top-level entity } //Scene3D

The obvious first strange thing here is that we don't even have to add the
mode setting of the CullFace to make it work - even though the line is
commented out, both the front and back face is rendered correctly.

The other issue is that when rotating the camera, the depth mode seems to
be broken - we have two objects in the scene, and now one of them is always
in the front of the other when rotating 360 degrees.

It seems to us that we are either not using the correct way of changing
culling settings, or that when adding the Qt3DRender.StateSet part this
overwrites other settings as well, related to depth etc.

Any ideas? Thanks in advance:)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160225/b1ca5564/attachment.html>


More information about the Interest mailing list