Qt 5.13 | Qt 3D | QML Types | Scene3D QML Type

Qt 5.13.2 Reference Documentation

# Scene3D QML Type

The Scene3D type is used to integrate a Qt3D scene into a QtQuick 2 scene. More...

Import Statement: | import QtQuick.Scene3D 2.13

- List of all members, including inherited members

## Properties

- aspects : list<string>
- cameraAspectRatioMode : enumeration
- entity : Entity
- hoverEnabled : bool
- multisample : bool

## Methods

- void setItemAreaAndDevicePixelRatio(area, real devicePixelRatio)

## Detailed Description

The Scene3D type renders a Qt3D scene, provided by an Entity, into a multisampled Framebuffer object. This object is later blitted into a non-multisampled Framebuffer object, which is then rendered with premultiplied alpha. If multisampling is not required, it can be avoided by setting the multisample property to `false`. In this case Scene3D will render directly into the non-multisampled Framebuffer object.

If the scene to be rendered includes non-opaque materials, you may need to modify those materials with custom blend arguments in order for them to be rendered correctly. For example, if working with a PhongAlphaMaterial and a scene with an opaque clear color, you will likely want to add:

      sourceAlphaArg: BlendEquationArguments.Zero
      destinationAlphaArg: BlendEquationArguments.One

to that material.

## Property Documentation

aspects : list<string>

The list of aspects that should be registered for the 3D scene.

For example, if the scene makes use of FrameAction, the `"logic"` aspect should be included in the list.

The `"render"` aspect is hardwired and does not need to be explicitly listed.

cameraAspectRatioMode : enumeration

Constant | Description
--- | ---
`Scene3D.AutomaticAspectRatio` | Automatic aspect ratio.
`Scene3D.UserAspectRatio` | User defined aspect ratio.

[default] entity : Entity

The root entity of the 3D scene to be displayed.

hoverEnabled : bool

`true` if hover events are accepted.

multisample : bool

`true` if a multisample render buffer is requested.

By default multisampling is enabled. If the OpenGL implementation has no support for multisample renderbuffers or framebuffer blits, the request to use multisampling is ignored.

Note: Refrain from changing the value frequently as it involves expensive and potentially slow initialization of framebuffers and other OpenGL resources.

## Method Documentation

void setItemAreaAndDevicePixelRatio(area, real devicePixelRatio)