Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
QQuick3DSceneEnvironment Class Reference

#include <qquick3dsceneenvironment_p.h>

Inheritance diagram for QQuick3DSceneEnvironment:
Collaboration diagram for QQuick3DSceneEnvironment:

Public Types

enum  QQuick3DEnvironmentAAModeValues { NoAA = 0 , SSAA , MSAA , ProgressiveAA }
enum  QQuick3DEnvironmentAAQualityValues { Medium = 2 , High = 4 , VeryHigh = 8 }
enum  QQuick3DEnvironmentBackgroundTypes {
  Transparent = 0 , Unspecified , Color , SkyBox ,
  SkyBoxCubeMap
}
enum  QQuick3DEnvironmentTonemapModes {
  TonemapModeNone = 0 , TonemapModeLinear , TonemapModeAces , TonemapModeHejlDawson ,
  TonemapModeFilmic
}
enum  QQuick3DEnvironmentOITMethod { OITNone = 0 , OITWeightedBlended }

Public Slots

void setAntialiasingMode (QQuick3DSceneEnvironment::QQuick3DEnvironmentAAModeValues antialiasingMode)
void setAntialiasingQuality (QQuick3DSceneEnvironment::QQuick3DEnvironmentAAQualityValues antialiasingQuality)
void setTemporalAAEnabled (bool temporalAAEnabled)
void setTemporalAAStrength (float strength)
void setBackgroundMode (QQuick3DSceneEnvironment::QQuick3DEnvironmentBackgroundTypes backgroundMode)
void setClearColor (const QColor &clearColor)
void setAoStrength (float aoStrength)
void setAoDistance (float aoDistance)
void setAoSoftness (float aoSoftness)
void setAoDither (bool aoDither)
void setAoSampleRate (int aoSampleRate)
void setAoBias (float aoBias)
void setLightProbe (QQuick3DTexture *lightProbe)
void setProbeExposure (float probeExposure)
void setProbeHorizon (float probeHorizon)
void setProbeOrientation (const QVector3D &orientation)
void setDepthTestEnabled (bool depthTestEnabled)
void setDepthPrePassEnabled (bool depthPrePassEnabled)
void setTonemapMode (QQuick3DSceneEnvironment::QQuick3DEnvironmentTonemapModes tonemapMode)
 Q_REVISION (6, 4) void setSkyboxBlurAmount(float new SkyboxBlurAmount)
 Q_REVISION (6, 4) void setSpecularAAEnabled(bool enabled)
 Q_REVISION (6, 4) void setSkyBoxCubeMap(QQuick3DCubeMapTexture *newSkyBoxCubeMap)
 Q_REVISION (6, 4) void setLightmapper(QQuick3DLightmapper *lightmapper)
 Q_REVISION (6, 5) void setDebugSettings(QQuick3DDebugSettings *newDebugSettings)
 Q_REVISION (6, 5) void setScissorRect(QRect scissorRect)
 Q_REVISION (6, 5) void setFog(QQuick3DFog *fog)
Public Slots inherited from QQuick3DObject
void update ()
void setParentItem (QQuick3DObject *parentItem)
Public Slots inherited from QObject
void deleteLater ()
 \threadsafe

Signals

void antialiasingModeChanged ()
void antialiasingQualityChanged ()
void temporalAAEnabledChanged ()
void temporalAAStrengthChanged ()
void backgroundModeChanged ()
void clearColorChanged ()
void aoStrengthChanged ()
void aoDistanceChanged ()
void aoSoftnessChanged ()
void aoDitherChanged ()
void aoSampleRateChanged ()
void aoBiasChanged ()
 Q_REVISION (6, 5) void aoEnabledChanged()
void lightProbeChanged ()
void probeExposureChanged ()
void probeHorizonChanged ()
void probeOrientationChanged ()
void depthTestEnabledChanged ()
void depthPrePassEnabledChanged ()
void tonemapModeChanged ()
 Q_REVISION (6, 4) void skyboxBlurAmountChanged()
 Q_REVISION (6, 4) void specularAAEnabledChanged()
 Q_REVISION (6, 4) void lightmapperChanged()
 Q_REVISION (6, 4) void skyBoxCubeMapChanged()
 Q_REVISION (6, 5) void debugSettingsChanged()
 Q_REVISION (6, 5) void scissorRectChanged()
 Q_REVISION (6, 5) void fogChanged()
 Q_REVISION (6, 9) void oitMethodChanged()
Signals inherited from QQuick3DObject
void parentChanged ()
void childrenChanged ()
void stateChanged ()
Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.

Public Member Functions

 QQuick3DSceneEnvironment (QQuick3DObject *parent=nullptr)
 \qmltype SceneEnvironment \inherits Object3D \inqmlmodule QtQuick3D
 ~QQuick3DSceneEnvironment () override
QQuick3DEnvironmentAAModeValues antialiasingMode () const
 \qmlproperty enumeration QtQuick3D::SceneEnvironment::antialiasingMode
QQuick3DEnvironmentAAQualityValues antialiasingQuality () const
 \qmlproperty enumeration QtQuick3D::SceneEnvironment::antialiasingQuality
bool temporalAAEnabled () const
 \qmlproperty bool QtQuick3D::SceneEnvironment::temporalAAEnabled
float temporalAAStrength () const
 \qmlproperty real QtQuick3D::SceneEnvironment::temporalAAStrength
QQuick3DEnvironmentBackgroundTypes backgroundMode () const
 \qmlproperty enumeration QtQuick3D::SceneEnvironment::backgroundMode
QColor clearColor () const
 \qmlproperty color QtQuick3D::SceneEnvironment::clearColor
float aoStrength () const
 \qmlproperty real QtQuick3D::SceneEnvironment::aoStrength
float aoDistance () const
 \qmlproperty real QtQuick3D::SceneEnvironment::aoDistance
float aoSoftness () const
 \qmlproperty real QtQuick3D::SceneEnvironment::aoSoftness
bool aoDither () const
 \qmlproperty bool QtQuick3D::SceneEnvironment::aoDither
int aoSampleRate () const
 \qmlproperty int QtQuick3D::SceneEnvironment::aoSampleRate
float aoBias () const
 \qmlproperty real QtQuick3D::SceneEnvironment::aoBias
 Q_REVISION (6, 5) bool aoEnabled() const
 Q_REVISION (6, 5) void setAoEnabled(bool new AoEnabled)
QQuick3DTexturelightProbe () const
 \qmlproperty QtQuick3D::Texture QtQuick3D::SceneEnvironment::lightProbe
float probeExposure () const
 \qmlproperty real QtQuick3D::SceneEnvironment::probeExposure
float probeHorizon () const
 \qmlproperty real QtQuick3D::SceneEnvironment::probeHorizon
QVector3D probeOrientation () const
 \qmlproperty vector3d QtQuick3D::SceneEnvironment::probeOrientation
bool depthTestEnabled () const
 \qmlproperty bool QtQuick3D::SceneEnvironment::depthTestEnabled
bool depthPrePassEnabled () const
 \qmlproperty bool QtQuick3D::SceneEnvironment::depthPrePassEnabled
QQuick3DEnvironmentTonemapModes tonemapMode () const
 \qmlproperty enumeration QtQuick3D::SceneEnvironment::tonemapMode
QQmlListProperty< QQuick3DEffecteffects ()
 Q_REVISION (6, 4) float skyboxBlurAmount() const
 Q_REVISION (6, 4) bool specularAAEnabled() const
 Q_REVISION (6, 4) QQuick3DLightmapper *lightmapper() const
 Q_REVISION (6, 4) QQuick3DCubeMapTexture *skyBoxCubeMap() const
 Q_REVISION (6, 5) QQuick3DDebugSettings *debugSettings() const
 Q_REVISION (6, 5) QRect scissorRect() const
 Q_REVISION (6, 5) QQuick3DFog *fog() const
QQuick3DEnvironmentOITMethod Q_REVISION (6, 9) oitMethod() const
bool gridEnabled () const
void setGridEnabled (bool newGridEnabled)
float gridScale () const
void setGridScale (float newGridScale)
uint gridFlags () const
void setGridFlags (uint newGridFlags)
Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
QString objectName () const
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
QBindable< QStringbindableObjectName ()
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
bool isQmlObjectType () const
 Returns whether the object has been created by the QML engine or ownership has been explicitly set via QJSEngine::setObjectOwnership().
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
QThreadthread () const
 Returns the thread in which the object lives.
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
void killTimer (int id)
 Kills the timer with timer identifier, id.
void killTimer (Qt::TimerId id)
template<typename T>
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
template<typename T>
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
template<typename T>
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
template<typename T>
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const QObjectListchildren () const
 Returns a list of child objects.
void setParent (QObject *parent)
 Makes the object a child of parent.
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
bool disconnect (const QObject *receiver, const char *member=nullptr) const
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
bool setProperty (const char *name, QVariant &&value)
QVariant property (const char *name) const
 Returns the value of the object's name property.
QList< QByteArraydynamicPropertyNames () const
QBindingStoragebindingStorage ()
const QBindingStoragebindingStorage () const
QObjectparent () const
 Returns a pointer to the parent object.
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
Public Member Functions inherited from QQmlParserStatus
 QQmlParserStatus ()
virtual ~QQmlParserStatus ()

Protected Member Functions

QSSGRenderGraphObjectupdateSpatialNode (QSSGRenderGraphObject *node) override
void itemChange (ItemChange, const ItemChangeData &) override
virtual const QVector< QQuick3DEffect * > & effectList () const
virtual bool useBuiltinTonemapper () const
Protected Member Functions inherited from QQuick3DObject
virtual void markAllDirty ()
 QQuick3DObject (QQuick3DObjectPrivate &dd, QQuick3DObject *parent=nullptr)
void classBegin () override
 Invoked after class creation, but before any properties have been set.
void componentComplete () override
 Invoked after the root component that caused this instantiation has completed construction.
bool isComponentComplete () const
virtual void preSync ()
Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
int senderSignalIndex () const
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
bool isSignalConnected (const QMetaMethod &signal) const
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
virtual void connectNotify (const QMetaMethod &signal)
virtual void disconnectNotify (const QMetaMethod &signal)
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)

Properties

QQuick3DEnvironmentAAModeValues antialiasingMode
QQuick3DEnvironmentAAQualityValues antialiasingQuality
bool temporalAAEnabled
float temporalAAStrength
QQuick3DEnvironmentBackgroundTypes backgroundMode
QColor clearColor
bool depthTestEnabled
bool depthPrePassEnabled
float aoStrength
float aoDistance
float aoSoftness
bool aoDither
int aoSampleRate
float aoBias
bool aoEnabled
 \qmlproperty bool SceneEnvironment::aoEnabled
QQuick3DTexturelightProbe
float probeExposure
float probeHorizon
QVector3D probeOrientation
QQuick3DCubeMapTextureskyBoxCubeMap
 \qmlproperty QtQuick3D::CubeMapTexture QtQuick3D::SceneEnvironment::skyBoxCubeMap
QQuick3DEnvironmentTonemapModes tonemapMode
QQmlListProperty< QQuick3DEffecteffects
 \qmlproperty List<QtQuick3D::Effect> QtQuick3D::SceneEnvironment::effects
float skyboxBlurAmount
 \qmlproperty real QtQuick3D::SceneEnvironment::skyboxBlurAmount
bool specularAAEnabled
 \qmlproperty bool QtQuick3D::SceneEnvironment::specularAAEnabled
QQuick3DLightmapperlightmapper
 \qmlproperty Lightmapper QtQuick3D::SceneEnvironment::lightmapper
QQuick3DDebugSettingsdebugSettings
 \qmlproperty QtQuick3D::DebugSettings QtQuick3D::SceneEnvironment::debugSettings
QRect scissorRect
 \qmlproperty rect QtQuick3D::SceneEnvironment::scissorRect
QQuick3DFogfog
 \qmlproperty QtQuick3D::Fog QtQuick3D::SceneEnvironment::fog
QQuick3DEnvironmentOITMethod oitMethod
 \qmlproperty enumeration QtQuick3D::SceneEnvironment::oitMethod
Properties inherited from QQuick3DObject
QQuick3DObjectparent
 \qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a 3D scene.
Properties inherited from QObject
QString objectName
 the name of this object

Friends

class QQuick3DSceneRenderer

Additional Inherited Members

Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
template<typename Func1, typename Func2>
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
template<typename Func1, typename Func2>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
template<typename Func1>
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr

Detailed Description

Definition at line 36 of file qquick3dsceneenvironment_p.h.

Member Enumeration Documentation

◆ QQuick3DEnvironmentAAModeValues

Enumerator
NoAA 
SSAA 
MSAA 
ProgressiveAA 

Definition at line 84 of file qquick3dsceneenvironment_p.h.

◆ QQuick3DEnvironmentAAQualityValues

Enumerator
Medium 
High 
VeryHigh 

Definition at line 92 of file qquick3dsceneenvironment_p.h.

◆ QQuick3DEnvironmentBackgroundTypes

Enumerator
Transparent 
Unspecified 
Color 
SkyBox 
SkyBoxCubeMap 

Definition at line 99 of file qquick3dsceneenvironment_p.h.

◆ QQuick3DEnvironmentOITMethod

Enumerator
OITNone 
OITWeightedBlended 

Definition at line 117 of file qquick3dsceneenvironment_p.h.

◆ QQuick3DEnvironmentTonemapModes

Enumerator
TonemapModeNone 
TonemapModeLinear 
TonemapModeAces 
TonemapModeHejlDawson 
TonemapModeFilmic 

Definition at line 108 of file qquick3dsceneenvironment_p.h.

Constructor & Destructor Documentation

◆ QQuick3DSceneEnvironment()

QT_BEGIN_NAMESPACE QQuick3DSceneEnvironment::QQuick3DSceneEnvironment ( QQuick3DObject * parent = nullptr)
explicit

\qmltype SceneEnvironment \inherits Object3D \inqmlmodule QtQuick3D

Lets you configure how a scene is rendered.

SceneEnvironment defines a set of global properties for how a scene should be rendered.

Note
The QtQuick3D.Helpers module offers an \l ExtendedSceneEnvironment type which inherits from SceneEnvironment and adds a number of built-in effects on top.

To use SceneEnvironment or \l ExtendedSceneEnvironment, associate the \l{View3D::environment}{environment property} of a View3D with an instance of these types. The object can be declared inline, for example like this:

\qml View3D { environment: SceneEnvironment { antialiasingMode: SceneEnvironment.MSAA tonemapMode: SceneEnvironment.TonemapModeFilmic backgroundMode: SceneEnvironment.SkyBox lightProbe: Texture { source: "panoramic_hdri_background.hdr" } } } \endqml

Alternatively, the environment object can be defined separately. It can then be referenced by one or more View3D objects. An example code snippet, using \l ExtendedSceneEnvironment this time:

\qml ExtendedSceneEnvironment { id: myEnv vignetteEnabled: true }

View3D { width: parent.width / 2 environment: myEnv }

View3D { width: parent.width / 2 x: parent.width / 2 environment: myEnv } \endqml

Definition at line 124 of file qquick3dsceneenvironment.cpp.

◆ ~QQuick3DSceneEnvironment()

QQuick3DSceneEnvironment::~QQuick3DSceneEnvironment ( )
override

Definition at line 139 of file qquick3dsceneenvironment.cpp.

Member Function Documentation

◆ antialiasingMode()

QQuick3DSceneEnvironment::QQuick3DEnvironmentAAModeValues QQuick3DSceneEnvironment::antialiasingMode ( ) const

\qmlproperty enumeration QtQuick3D::SceneEnvironment::antialiasingMode

Since
5.15

This property controls the antialiasing mode that is applied when rendering the scene.

Possible values are: \value SceneEnvironment.NoAA No antialiasing is applied. \value SceneEnvironment.SSAA Supersample antialiasing is applied. \value SceneEnvironment.MSAA Multisample antialiasing is applied. \value SceneEnvironment.ProgressiveAA Progressive antialiasing is applied.

The default value is SceneEnvironment.NoAA.

Supersampling

The scene is rendered in a higher resolution, and then scaled down to actual resolution.

Pros: High quality. Antialiases all scene content and not just geometry silhouettes.

Cons: Usually more expensive than MSAA. Increases video memory usage. Supported with View3D items with all renderMode except Inline, but since the technique implies rendering to a texture first, enabling SSAA with a renderMode of Underlay or Overlay will result in using an intermediate texture and render pass that would normally not be needed, meaning the performance costs may be more noticeable. It is recommended to use SSAA only when the renderMode is the default Offscreen.

Multisampling

The edges of geometry are super-sampled, resulting in smoother silhouettes. This technique has no effect on the materials inside geometry, however.

Pros: Works with any View3D item regardless of the renderMode. Good results on geometry silhouettes, where aliasing is often most noticeable; works with fast animation without issues. Performance depends purely on the system's (GPU) capabilities.

Cons: Does not help with texture or reflection issues. Increases video memory usage. Can be expensive to use on less powerful graphics hardware. Can be controlled on a per-window basis or for individual View3D items depending on the renderMode. When using Underlay/Overlay with an effect applied or Offscreen, MSAA can be controlled for each View3D item. On the other hand, using Underlay/Overlay without any effect or Inline will make MSAA controlled per-window.

Note
For View3D items with a \l{QtQuick3D::View3D::renderMode}{renderMode} other than Underlay/Overlay with effects or Offscreen, multisampling can only be enabled via the \l{QSurfaceFormat::setSamples()}{QSurfaceFormat} of the QQuickWindow or QQuickView. This will then affect all content, both 2D and 3D, in that window.

{Progressive antialiasing}

This property enables and sets the level of progressive antialiasing applied to the scene.

When all content of the scene has stopped moving, the camera is jiggled very slightly between frames, and the result of each new frame is blended with the previous frames. The more frames you accumulate, the better looking the result.

Pros: Provides great results when all content in the scene is standing still.

Cons: Does not take effect if any visual changes are occurring. Expensive due to having to accumulate and blend. Increases video memory usage.

Note
Progressing antialiasing is not currently supported with multiview rendering, and should not be used in VR/AR applications.

See \l{Anti-Aliasing Best Practices} for further discussion on anti-aliasing methods.

Definition at line 220 of file qquick3dsceneenvironment.cpp.

◆ antialiasingModeChanged

void QQuick3DSceneEnvironment::antialiasingModeChanged ( )
signal

◆ antialiasingQuality()

QQuick3DSceneEnvironment::QQuick3DEnvironmentAAQualityValues QQuick3DSceneEnvironment::antialiasingQuality ( ) const

\qmlproperty enumeration QtQuick3D::SceneEnvironment::antialiasingQuality

Since
5.15

This property sets the level of antialiasing applied to the scene. Behavior depends on used antialiasingMode. With antialiasingMode property set to NoAA this property doesn't have an effect.

Possible values are: \value SceneEnvironment.Medium SSAA: Antialiasing uses 1.2x supersampling resolution.\br MSAA: Antialiasing uses 2 samples per pixel.\br ProgressiveAA: Antialiasing uses 2 frames for final image. \value SceneEnvironment.High SSAA: Antialiasing uses 1.5x supersampling resolution.\br MSAA: Antialiasing uses 4 samples per pixel.\br ProgressiveAA: Antialiasing uses 4 frames for final image. \value SceneEnvironment.VeryHigh SSAA: Antialiasing uses 2.0x supersampling resolution.\br MSAA: Antialiasing uses 8 samples per pixel.\br ProgressiveAA: Antialiasing uses 8 frames for final image.

The default value is SceneEnvironment.High

Definition at line 250 of file qquick3dsceneenvironment.cpp.

◆ antialiasingQualityChanged

void QQuick3DSceneEnvironment::antialiasingQualityChanged ( )
signal

◆ aoBias()

float QQuick3DSceneEnvironment::aoBias ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::aoBias

This property defines a cutoff distance preventing objects from exhibiting ambient occlusion at close distances. Higher values increase the distance required between objects before ambient occlusion is seen.

Note
If you see ambient occlusion shadowing on objects where there should be no shadowing, increase the value slightly to clip away close results.

The default value is 0.0.

Definition at line 537 of file qquick3dsceneenvironment.cpp.

◆ aoBiasChanged

void QQuick3DSceneEnvironment::aoBiasChanged ( )
signal

◆ aoDistance()

float QQuick3DSceneEnvironment::aoDistance ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::aoDistance

This property defines roughly how far ambient occlusion shadows spread away from objects. Greater distances cause increasing impact to performance.

The default value is 5.0.

Pictured here with the default aoSoftness and the maximum aoStrength:

\table \header

  • aoDistance of 5
  • aoDistance of 1 \row
  • \endtable
Note
Getting visually good-looking screen space ambient occlusion is dependent on carefully tuning a number of related parameters, such as \l aoStrength, \l aoSoftness, \l aoDistance, \l aoDither, \l aoBias, and \l aoSampleRate.
See also
aoStrength, aoSoftness

Definition at line 454 of file qquick3dsceneenvironment.cpp.

◆ aoDistanceChanged

void QQuick3DSceneEnvironment::aoDistanceChanged ( )
signal

◆ aoDither()

bool QQuick3DSceneEnvironment::aoDither ( ) const

\qmlproperty bool QtQuick3D::SceneEnvironment::aoDither

When this property is enabled it scatters the edges of the ambient occlusion shadow bands to improve smoothness (at the risk of sometimes producing obvious patterned artifacts).

Note
Very large distances between the clipping planes of your camera may cause problems with ambient occlusion. If you are seeing odd banding in your ambient occlusion, try adjusting the \l {PerspectiveCamera::}{clipFar} property of your camera to be closer to your content.

The default value is false.

See also
{QtQuick3D::PerspectiveCamera::clipFar}{PerspectiveCamera.clipFar}, {QtQuick3D::OrthographicCamera::clipFar}{OrthographicCamera.clipFar}

Definition at line 507 of file qquick3dsceneenvironment.cpp.

◆ aoDitherChanged

void QQuick3DSceneEnvironment::aoDitherChanged ( )
signal

◆ aoSampleRate()

int QQuick3DSceneEnvironment::aoSampleRate ( ) const

\qmlproperty int QtQuick3D::SceneEnvironment::aoSampleRate

This property defines ambient occlusion quality (more shades of gray) at the expense of performance.

The value must be 2, 3, or 4. The default value is 2.

Definition at line 520 of file qquick3dsceneenvironment.cpp.

◆ aoSampleRateChanged

void QQuick3DSceneEnvironment::aoSampleRateChanged ( )
signal

◆ aoSoftness()

float QQuick3DSceneEnvironment::aoSoftness ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::aoSoftness

This property defines how smooth the edges of the ambient occlusion shading are.

The value must be between 0.0 and 50.0. The default value is 50.0.

Pictured here with the default aoDistance and the maximum aoStrength:

\table \header

  • aoSoftness of 50
  • aoSoftness of 25 \row
  • \endtable
Note
Getting visually good-looking screen space ambient occlusion is dependent on carefully tuning a number of related parameters, such as \l aoStrength, \l aoSoftness, \l aoDistance, \l aoDither, \l aoBias, and \l aoSampleRate.
See also
aoStrength, aoDistance

Definition at line 485 of file qquick3dsceneenvironment.cpp.

◆ aoSoftnessChanged

void QQuick3DSceneEnvironment::aoSoftnessChanged ( )
signal

◆ aoStrength()

float QQuick3DSceneEnvironment::aoStrength ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::aoStrength

This property defines the amount of ambient occulusion applied. Ambient occulusion is a form of approximated global illumination which causes non-directional self-shadowing where objects are close together. A value of 100 causes full darkness shadows; lower values cause the shadowing to appear lighter. A value of 0 disables ambient occlusion entirely, improving performance at a cost to the visual realism of 3D objects rendered in the scene.

All values other than 0 have the same impact to the performance.

The default value is 0.0. The maximum value is 100.0.

A value of 0 is equivalent to setting \l aoEnabled to false.

Pictured here with the default aoSoftness and aoDistance:

\table \header

  • aoStrength of 0 (AO disabled)
  • aoStrength of 100
  • aoStrength of 50 \row
  • \endtable
Note
Getting visually good-looking screen space ambient occlusion is dependent on carefully tuning a number of related parameters, such as \l aoStrength, \l aoSoftness, \l aoDistance, \l aoDither, \l aoBias, and \l aoSampleRate.
See also
aoEnabled, aoDistance, aoSoftness

Definition at line 423 of file qquick3dsceneenvironment.cpp.

◆ aoStrengthChanged

void QQuick3DSceneEnvironment::aoStrengthChanged ( )
signal

◆ backgroundMode()

QQuick3DSceneEnvironment::QQuick3DEnvironmentBackgroundTypes QQuick3DSceneEnvironment::backgroundMode ( ) const

\qmlproperty enumeration QtQuick3D::SceneEnvironment::backgroundMode

This property controls if and how the background of the scene should be cleared.

Note
The clearing of the color buffer backing the View 3D does not always happen: depending on the \l{QtQuick3D::View3D::renderMode}{renderMode} property the View3D may not perform any clearing on its own, in which case {SceneEnvironment.Transparent} and {SceneEnvironment.Color} have no effect. Only the default Offscreen \l{View3D::renderMode}{render mode} (rendering into a texture) supports all clearing modes. With the Underlay mode, use \l{QQuickWindow::setColor()} or \l[QtQuick]{Window::color}{Window.color} to control the clear color for the Qt Quick scene. SkyBox is handled differently, as it implies drawing actual geometry, so that works identically across all render modes.

\value SceneEnvironment.Transparent The scene is cleared to be transparent. This is useful to render 3D content on top of another item. This mode has no effect when the View3D is using a renderMode of Underlay or Overlay without any post processing enabled. \value SceneEnvironment.Color The scene is cleared with the color specified by the clearColor property. This mode has no effect when the View3D is using a renderMode of Underlay or Overlay without any post processing enabled. \value SceneEnvironment.SkyBox The scene will not be cleared, but instead a SkyBox or Skydome will be rendered. The SkyBox is defined using the HDRI map defined in the lightProbe property. \value SceneEnvironment.SkyBoxCubeMap The scene will not be cleared, but instead a SkyBox or Skydome will be rendered. The SkyBox is defined using the cubemap defined in the skyBoxCubeMap property.

The default value is SceneEnvironment.Transparent

Take the following example. The Suzanne model is expected to be pre-processed with the balsam tool and is sourced from the \l{https://github.com/KhronosGroup/glTF-Sample-Models}{glTF Sample Models} repository.

\qml import QtQuick import QtQuick3D import QtQuick3D.Helpers

Item { width: 1280 height: 720

View3D { id: v3d anchors.fill: parent

environment: ExtendedSceneEnvironment { backgroundMode: SceneEnvironment.SkyBox lightProbe: Texture { source: "00455_OpenfootageNET_field_low.hdr" }

glowEnabled: true glowStrength: 1.25 glowBloom: 0.25 glowBlendMode: ExtendedSceneEnvironment.GlowBlendMode.Additive }

DirectionalLight { }

Suzanne { scale: Qt.vector3d(50, 50, 50) z: -500 }

PerspectiveCamera { id: camera }

WasdController { controlledObject: camera } } } \endqml

Using image-based lighting in additional to the DirectionalLight and also using the light probe texture as the skybox gives us the following:

What happens if there is no light probe?

\qml backgroundMode: SceneEnvironment.Transparent \endqml

Here the background is provided not by the View3D but by the QQuickWindow or QQuickView hosting the 2D and 3D scene. Lighting is based on the DirectionalLight only.

Using a fixed clear color:

\qml backgroundMode: SceneEnvironment.Color clearColor: "green" \endqml

See also
lightProbe, QQuickWindow::setColor(), Window::color, View3D

Definition at line 365 of file qquick3dsceneenvironment.cpp.

◆ backgroundModeChanged

void QQuick3DSceneEnvironment::backgroundModeChanged ( )
signal

◆ clearColor()

QColor QQuick3DSceneEnvironment::clearColor ( ) const

\qmlproperty color QtQuick3D::SceneEnvironment::clearColor

This property defines which color will be used to clear the viewport when using SceneEnvironment.Color for the backgroundMode property.

The default value is Qt::black

See also
backgroundMode

Definition at line 381 of file qquick3dsceneenvironment.cpp.

◆ clearColorChanged

void QQuick3DSceneEnvironment::clearColorChanged ( )
signal

◆ depthPrePassEnabled()

bool QQuick3DSceneEnvironment::depthPrePassEnabled ( ) const

\qmlproperty bool QtQuick3D::SceneEnvironment::depthPrePassEnabled

When enabled, the renderer performs a Z-prepass for opaque objects, meaning it renders them with a simple shader and color write disabled in order to get the depth buffer pre-filled before issuing draw calls for the main rendering passes.

This can improve performance depending on the scene contents. It is typically scenes with lots of overlapping objects and expensive fragment shading that benefit from this. At the same time, it is worth noting that the renderer performs front to back sorting for opaque objects, which in itself helps reducing unnecessary fragment shading, and therefore the Z-prepass does not always bring significant improvements.

On GPUs that use a tiled rendering architecture, which is common in mobile and embedded systems, it is recommended to set this to false.

The default value is false.

Note
This property has no effect when depth testing is disabled.

Definition at line 907 of file qquick3dsceneenvironment.cpp.

◆ depthPrePassEnabledChanged

void QQuick3DSceneEnvironment::depthPrePassEnabledChanged ( )
signal

◆ depthTestEnabled()

bool QQuick3DSceneEnvironment::depthTestEnabled ( ) const

\qmlproperty bool QtQuick3D::SceneEnvironment::depthTestEnabled

The default value is true. By default the renderer classifies the objects in the scene either as opaque or as semi-transparent. The objects (sub-meshes with the associated material) in the opaque list are rendered first, with depth testing and depth write enabled, providing optimal Z-culling for typical 3D objects that have no semi-transparent regions. The objects in the semi-transparent list are rendered with depth write disabled, although still with depth testing enabled (to test against the opaque objects), in back to front order (sorted based on their center point's distance from the camera). This allows correct blending ("see through") for 3D objects that involve semi-transparent regions on their surface, either due to the \l{Node::opacity}{node opacity} or due to some color or texture map in the material.

When this property is set to {false}, the Z-buffer is not written and tested against, the depth test is skipped, and all objects, including fully opaque ones, are rendered in one go, sorted back to front.

Setting this property to false should be rarely needed. It can be useful in scenes where it is known that there is little benefit in the two-round approach because either there are very few opaque objects, or they are transformed in a way that a single back to front sorted pass performs better.

Note
Setting this property to false may cause rendering errors in certain scenes. In addition, some features, such as shadows, ambient occlusion, SCREEN_TEXTURE and DEPTH_TEXTURE in custom materials and effects, will not behave correctly without enabling depth buffer usage.
This flag has no control over the presence of a depth or depth-stencil buffer. Such buffers may still be allocated even when this is set to false.

Definition at line 881 of file qquick3dsceneenvironment.cpp.

◆ depthTestEnabledChanged

void QQuick3DSceneEnvironment::depthTestEnabledChanged ( )
signal

◆ effectList()

const QVector< QQuick3DEffect * > & QQuick3DSceneEnvironment::effectList ( ) const
protectedvirtual

Reimplemented in SceneEffectEnvironment.

Definition at line 1237 of file qquick3dsceneenvironment.cpp.

◆ effects()

QQmlListProperty< QQuick3DEffect > QQuick3DSceneEnvironment::effects ( )

◆ gridEnabled()

bool QQuick3DSceneEnvironment::gridEnabled ( ) const

Definition at line 1437 of file qquick3dsceneenvironment.cpp.

◆ gridFlags()

uint QQuick3DSceneEnvironment::gridFlags ( ) const

Definition at line 1463 of file qquick3dsceneenvironment.cpp.

◆ gridScale()

float QQuick3DSceneEnvironment::gridScale ( ) const

Definition at line 1450 of file qquick3dsceneenvironment.cpp.

◆ itemChange()

void QQuick3DSceneEnvironment::itemChange ( ItemChange ,
const ItemChangeData &  )
overrideprotectedvirtual

Reimplemented from QQuick3DObject.

Definition at line 1231 of file qquick3dsceneenvironment.cpp.

◆ lightProbe()

QQuick3DTexture * QQuick3DSceneEnvironment::lightProbe ( ) const

\qmlproperty QtQuick3D::Texture QtQuick3D::SceneEnvironment::lightProbe

This property defines an image used to light the scene, either instead of, or in addition to standard lights.

The image is preferably a high-dynamic range image or a \l{Pre-generating IBL cubemap}{pre-generated cubemap}. Pre-baking provides significant performance improvements at run time, because no time is spent on filtering and mipmap generation. If the source is a .hdr or other image, the GPU-based pre-processing happens at run time after loading the image file, and that can be potentially time consuming, in particular on embedded and mobile hardware. Therefore, it is strongly recommended that applications pre-process .hdr images at latest at build time, as described \l{Pre-generating IBL cubemap}{here}.

Note
Using a Texture with \l{Texture::sourceItem}{sourceItem} is not supported in combination with this property. Pre-filtering of all mip levels for dynamic Qt Quick content is typically not reasonable in practice due to performance implications.

For more information on image-based lighting, see \l{Using Image-Based Lighting}.

Note
The light probe texture, when the property is set to a valid Texture, is used for lighting regardless of the \l backgroundMode. However, when \l backgroundMode is set to {SceneEnvironment.SkyBox}, the texture is also used to render the scene background as a skybox.

The examples below were generated with varying the \l backgroundMode in the environment of the following scene. The scene has no DirectionLight, PointLight, or SpotLight. All lighting is based on the panoramic HDRI image.

\qml import QtQuick import QtQuick3D import QtQuick3D.Helpers

Item { width: 1280 height: 720

View3D { id: v3d anchors.fill: parent

environment: ExtendedSceneEnvironment { backgroundMode: SceneEnvironment.SkyBox lightProbe: Texture { source: "00455_OpenfootageNET_field_low.hdr" }

tonemapMode: SceneEnvironment.TonemapModeFilmic sharpnessAmount: 0.4

glowEnabled: true glowStrength: 1.25 glowBloom: 0.25 glowBlendMode: ExtendedSceneEnvironment.GlowBlendMode.Additive }

Node { scale: Qt.vector3d(100, 100, 100)

Sponza { }

Suzanne { y: 1 scale: Qt.vector3d(0.5, 0.5, 0.5) eulerRotation.y: -90 } }

PerspectiveCamera { id: camera y: 100 }

WasdController { controlledObject: camera } } } \endqml

Results with the above environment:

Switching the backgroundMode to {SceneEnvironment.Transparent} would give us:

Here the lighting of the 3D scene is the same as before, meaning the materials use the light probe in the lighting calculations the same way as before, but there is no skybox rendered. The background is white since that is the default clear color of the QQuickWindow hosting the 2D and 3D scene.

It is valid to set the lightProbe property value back to the default null. This unassigns the previously associated texture. For example, let's use the Delete key to dynamically toggle between image-based lighting with a skybox, and no image-based lighting with a fixed clear color for the background:

\qml environment: ExtendedSceneEnvironment { id: env

backgroundMode: SceneEnvironment.SkyBox lightProbe: iblTex

tonemapMode: SceneEnvironment.TonemapModeFilmic sharpnessAmount: 0.4

glowEnabled: true glowStrength: 1.25 glowBloom: 0.25 glowBlendMode: ExtendedSceneEnvironment.GlowBlendMode.Additive }

Texture { id: iblTex source: "00455_OpenfootageNET_field_low.hdr" }

focus: true Keys.onDeletePressed: { if (env.backgroundMode == SceneEnvironment.SkyBox) { env.backgroundMode = SceneEnvironment.Color; env.clearColor = "green"; env.lightProbe = null; } else { env.backgroundMode = SceneEnvironment.SkyBox; env.lightProbe = iblTex; } } \endqml

Pressing Delete gives the following result. Remember that the scene used here has no lights so all 3D models appear completely black.

While lightProbe is commonly used in combination with Texture instances that source their data from an image file (typically .hdr or .ktx), it can also makes sense to associate with a Texture that uses in-memory, \l{Texture::textureData}{procedurally generated image data}. A prime example of this is a Texture where the image data is generated by \l ProceduralSkyTextureData from the QtQuick3D.Helpers module:

\qml backgroundMode: SceneEnvironment.SkyBox lightProbe: Texture { textureData: ProceduralSkyTextureData { } } \endqml

This gives us a procedurally generated HDR skybox texture that is now used both as the skybox and for image-based lighting:

See also
backgroundMode, {Using Image-Based Lighting}, {Pre-generating IBL cubemap}, probeExposure, probeHorizon, probeOrientation, ProceduralSkyTextureData

Definition at line 710 of file qquick3dsceneenvironment.cpp.

◆ lightProbeChanged

void QQuick3DSceneEnvironment::lightProbeChanged ( )
signal

◆ probeExposure()

float QQuick3DSceneEnvironment::probeExposure ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::probeExposure

This property modifies the amount of light emitted by the light probe. Part of the tonemapping is exposure mapping, and this property adjusts how the light values in the light probes get tonemaped.

By default exposure is set to is 1.0

Note
This property does not have an effect when \l tonemapMode is set to SceneEnvironment.TonemapModeNone.
See also
lightProbe, probeHorizon, probeOrientation

Definition at line 729 of file qquick3dsceneenvironment.cpp.

◆ probeExposureChanged

void QQuick3DSceneEnvironment::probeExposureChanged ( )
signal

◆ probeHorizon()

float QQuick3DSceneEnvironment::probeHorizon ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::probeHorizon

This property when defined with increasing values adds darkness (black) to the bottom half of the environment, forcing the lighting to come predominantly from the top of the image (and removing specific reflections from the lower half). This property is useful for accounting for a ground plane that would have the effect of obscuring the reflection of the light probe from the ground. This is necessary because light probe contributions come directily from the image without consideration for the content of the scene.

The expected value range for the probeHorizon property is between 0.0 and 1.0. Any value outside of this range will be clamped to the expected range.

By default probeHorizon is set to 0.0 which means the whole light probe is used without adjustment.

Note
The probeHorizon property only affects materials lighting, and has no effect on the rendering of the sky box.
See also
lightProbe, probeExposure, probeOrientation

Definition at line 758 of file qquick3dsceneenvironment.cpp.

◆ probeHorizonChanged

void QQuick3DSceneEnvironment::probeHorizonChanged ( )
signal

◆ probeOrientation()

QVector3D QQuick3DSceneEnvironment::probeOrientation ( ) const

\qmlproperty vector3d QtQuick3D::SceneEnvironment::probeOrientation

This property when defines the orientation of the light probe. Orientation is defined in terms of euler angles in degrees over the x, y, and z axes.

Note
This value augments how the lightProbe Texture is sampled in combination with any texture rotations and offsets set on the lightProbe texture.
See also
lightProbe, probeHorizon, probeExposure

Definition at line 774 of file qquick3dsceneenvironment.cpp.

◆ probeOrientationChanged

void QQuick3DSceneEnvironment::probeOrientationChanged ( )
signal

◆ Q_REVISION() [1/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  ) const

◆ Q_REVISION() [2/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  ) const

◆ Q_REVISION() [3/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  ) const

◆ Q_REVISION() [4/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  ) const

◆ Q_REVISION [5/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
signal

◆ Q_REVISION [6/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
slot

◆ Q_REVISION [7/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
newslot

◆ Q_REVISION [8/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
slot

◆ Q_REVISION [9/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
slot

◆ Q_REVISION [10/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
signal

◆ Q_REVISION [11/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
signal

◆ Q_REVISION [12/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
4  )
signal

◆ Q_REVISION() [13/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [14/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [15/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION() [16/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  ) const

◆ Q_REVISION [17/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION [18/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION [19/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION [20/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
signal

◆ Q_REVISION() [21/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
new

◆ Q_REVISION [22/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
slot

◆ Q_REVISION [23/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
slot

◆ Q_REVISION [24/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
5  )
slot

◆ Q_REVISION() [25/26]

QQuick3DEnvironmentOITMethod QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
9  ) const

◆ Q_REVISION [26/26]

QQuick3DSceneEnvironment::Q_REVISION ( 6 ,
9  )
signal

◆ setAntialiasingMode

void QQuick3DSceneEnvironment::setAntialiasingMode ( QQuick3DSceneEnvironment::QQuick3DEnvironmentAAModeValues antialiasingMode)
slot

Definition at line 1037 of file qquick3dsceneenvironment.cpp.

◆ setAntialiasingQuality

void QQuick3DSceneEnvironment::setAntialiasingQuality ( QQuick3DSceneEnvironment::QQuick3DEnvironmentAAQualityValues antialiasingQuality)
slot

Definition at line 1047 of file qquick3dsceneenvironment.cpp.

◆ setAoBias

void QQuick3DSceneEnvironment::setAoBias ( float aoBias)
slot

Definition at line 1135 of file qquick3dsceneenvironment.cpp.

◆ setAoDistance

void QQuick3DSceneEnvironment::setAoDistance ( float aoDistance)
slot

Definition at line 1091 of file qquick3dsceneenvironment.cpp.

◆ setAoDither

void QQuick3DSceneEnvironment::setAoDither ( bool aoDither)
slot

Definition at line 1115 of file qquick3dsceneenvironment.cpp.

◆ setAoSampleRate

void QQuick3DSceneEnvironment::setAoSampleRate ( int aoSampleRate)
slot

Definition at line 1125 of file qquick3dsceneenvironment.cpp.

◆ setAoSoftness

void QQuick3DSceneEnvironment::setAoSoftness ( float aoSoftness)
slot

Definition at line 1105 of file qquick3dsceneenvironment.cpp.

◆ setAoStrength

void QQuick3DSceneEnvironment::setAoStrength ( float aoStrength)
slot

Definition at line 1077 of file qquick3dsceneenvironment.cpp.

◆ setBackgroundMode

void QQuick3DSceneEnvironment::setBackgroundMode ( QQuick3DSceneEnvironment::QQuick3DEnvironmentBackgroundTypes backgroundMode)
slot

Definition at line 1057 of file qquick3dsceneenvironment.cpp.

◆ setClearColor

void QQuick3DSceneEnvironment::setClearColor ( const QColor & clearColor)
slot

Definition at line 1067 of file qquick3dsceneenvironment.cpp.

◆ setDepthPrePassEnabled

void QQuick3DSceneEnvironment::setDepthPrePassEnabled ( bool depthPrePassEnabled)
slot

Definition at line 1200 of file qquick3dsceneenvironment.cpp.

◆ setDepthTestEnabled

void QQuick3DSceneEnvironment::setDepthTestEnabled ( bool depthTestEnabled)
slot

Definition at line 1190 of file qquick3dsceneenvironment.cpp.

◆ setGridEnabled()

void QQuick3DSceneEnvironment::setGridEnabled ( bool newGridEnabled)

Definition at line 1442 of file qquick3dsceneenvironment.cpp.

◆ setGridFlags()

void QQuick3DSceneEnvironment::setGridFlags ( uint newGridFlags)

Definition at line 1468 of file qquick3dsceneenvironment.cpp.

◆ setGridScale()

void QQuick3DSceneEnvironment::setGridScale ( float newGridScale)

Definition at line 1455 of file qquick3dsceneenvironment.cpp.

◆ setLightProbe

void QQuick3DSceneEnvironment::setLightProbe ( QQuick3DTexture * lightProbe)
slot

Definition at line 1145 of file qquick3dsceneenvironment.cpp.

◆ setProbeExposure

void QQuick3DSceneEnvironment::setProbeExposure ( float probeExposure)
slot

Definition at line 1157 of file qquick3dsceneenvironment.cpp.

◆ setProbeHorizon

void QQuick3DSceneEnvironment::setProbeHorizon ( float probeHorizon)
slot

Definition at line 1167 of file qquick3dsceneenvironment.cpp.

◆ setProbeOrientation

void QQuick3DSceneEnvironment::setProbeOrientation ( const QVector3D & orientation)
slot

Definition at line 1180 of file qquick3dsceneenvironment.cpp.

◆ setTemporalAAEnabled

void QQuick3DSceneEnvironment::setTemporalAAEnabled ( bool temporalAAEnabled)
slot

Definition at line 1253 of file qquick3dsceneenvironment.cpp.

◆ setTemporalAAStrength

void QQuick3DSceneEnvironment::setTemporalAAStrength ( float strength)
slot

Definition at line 1263 of file qquick3dsceneenvironment.cpp.

◆ setTonemapMode

void QQuick3DSceneEnvironment::setTonemapMode ( QQuick3DSceneEnvironment::QQuick3DEnvironmentTonemapModes tonemapMode)
slot

Definition at line 1210 of file qquick3dsceneenvironment.cpp.

◆ temporalAAEnabled()

bool QQuick3DSceneEnvironment::temporalAAEnabled ( ) const

\qmlproperty bool QtQuick3D::SceneEnvironment::temporalAAEnabled

When this property is enabled temporal antialiasing will be used.

The camera is jiggled very slightly between frames, and the result of each new frame is blended with the previous frame.

Note
Temporal antialiasing doesn't have an effect when antialiasingMode is MSAA.
When combined with ProgressiveAA antialiasingMode, temporalAA is used when scene animates while ProgressiveAA is used once animations stop.

Pros: Due to the jiggling camera it finds real details that were otherwise lost; low impact on performance.

Cons: Fast-moving objects cause one-frame ghosting.

\default false

Note
Temporal antialiasing is not currently supported with multiview rendering, and should not be used in VR/AR applications.

Definition at line 801 of file qquick3dsceneenvironment.cpp.

◆ temporalAAEnabledChanged

void QQuick3DSceneEnvironment::temporalAAEnabledChanged ( )
signal

◆ temporalAAStrength()

float QQuick3DSceneEnvironment::temporalAAStrength ( ) const

\qmlproperty real QtQuick3D::SceneEnvironment::temporalAAStrength

Since
5.15

This property modifies the amount of temporal movement (antialiasing). This has an effect only when temporalAAEnabled property is true.

\default 0.3

See also
temporalAAEnabled

Definition at line 817 of file qquick3dsceneenvironment.cpp.

◆ temporalAAStrengthChanged

void QQuick3DSceneEnvironment::temporalAAStrengthChanged ( )
signal

◆ tonemapMode()

QQuick3DSceneEnvironment::QQuick3DEnvironmentTonemapModes QQuick3DSceneEnvironment::tonemapMode ( ) const

\qmlproperty enumeration QtQuick3D::SceneEnvironment::tonemapMode

Since
6.0

This property defines how colors are tonemapped before rendering. All rendering in Qt Quick 3D is performed in linear color space and can in many cases lead to generating color values that are not displayable. The tonemapMode determines the technique that is used to remap colors into a displayable range.

The default value is SceneEnvironment.TonemapModeLinear

\value SceneEnvironment.TonemapModeNone All Tonemapping is bypassed. This mode is useful when performing post processing effects. \value SceneEnvironment.TonemapModeLinear Linear tonemapping is applied. Colors are gamma corrected and returned in sRGB color space. \value SceneEnvironment.TonemapModeAces Academy Color Encoding System tonemapping is applied. \value SceneEnvironment.TonemapModeHejlDawson Hejl-Dawson tonemapping is applied. \value SceneEnvironment.TonemapModeFilmic Filmic tonemapping is applied.

See \l{ExtendedSceneEnvironment::tonemapMode}{ExtendedSceneEnvironment} for an example of these different modes.

Note
When using post-processing effects, most effects expect untonemapped linear color data. With application-provided, custom effects implemented via the \l Effect type, it is important to know that starting with Qt 6.5 effects can safely assume that they work with linear color data, and tonemapping is performed automatically on the output of the last effect in the chain. If there is a need to customize tonemapping completely, consider setting the SceneEnvironment.TonemapModeNone value to disable the built-in tonemapper, and perform the appropriate adjustments on the color value in the last effect in the chain instead. This does not apply to the built-in effects of \l ExtendedSceneEnvironment, because those automatically take care of proper tonemapping regardless of what combination of built-in effects are enabled in the environment.

Definition at line 974 of file qquick3dsceneenvironment.cpp.

◆ tonemapModeChanged

void QQuick3DSceneEnvironment::tonemapModeChanged ( )
signal

◆ updateSpatialNode()

QSSGRenderGraphObject * QQuick3DSceneEnvironment::updateSpatialNode ( QSSGRenderGraphObject * node)
overrideprotectedvirtual

Reimplemented from QQuick3DObject.

Reimplemented in SceneEffectEnvironment.

Definition at line 1225 of file qquick3dsceneenvironment.cpp.

◆ useBuiltinTonemapper()

bool QQuick3DSceneEnvironment::useBuiltinTonemapper ( ) const
protectedvirtual

Reimplemented in SceneEffectEnvironment.

Definition at line 1220 of file qquick3dsceneenvironment.cpp.

◆ QQuick3DSceneRenderer

friend class QQuick3DSceneRenderer
friend

Definition at line 262 of file qquick3dsceneenvironment_p.h.

Property Documentation

◆ antialiasingMode

QQuick3DEnvironmentAAModeValues QQuick3DSceneEnvironment::antialiasingMode
readwrite

Definition at line 39 of file qquick3dsceneenvironment_p.h.

◆ antialiasingQuality

QQuick3DEnvironmentAAQualityValues QQuick3DSceneEnvironment::antialiasingQuality
readwrite

Definition at line 40 of file qquick3dsceneenvironment_p.h.

◆ aoBias

float QQuick3DSceneEnvironment::aoBias
readwrite

Definition at line 54 of file qquick3dsceneenvironment_p.h.

◆ aoDistance

float QQuick3DSceneEnvironment::aoDistance
readwrite

Definition at line 50 of file qquick3dsceneenvironment_p.h.

◆ aoDither

bool QQuick3DSceneEnvironment::aoDither
readwrite

Definition at line 52 of file qquick3dsceneenvironment_p.h.

◆ aoEnabled

bool QQuick3DSceneEnvironment::aoEnabled
readwrite

\qmlproperty bool SceneEnvironment::aoEnabled

Since
6.5

Enable or disable ambient occlusion.

The default value is false, which means ambient occlusion is disabled.

Note
If \l aoStrength or \ aoDistance is 0, then setting this property to true will also set those values appropriately to make the ambient occlusion effective.
Getting visually good-looking screen space ambient occlusion is dependent on carefully tuning a number of related parameters, such as \l aoStrength, \l aoSoftness, \l aoDistance, \l aoDither, \l aoBias, and \l aoSampleRate.
See also
aoStrength, aoDistance

Definition at line 55 of file qquick3dsceneenvironment_p.h.

◆ aoSampleRate

int QQuick3DSceneEnvironment::aoSampleRate
readwrite

Definition at line 53 of file qquick3dsceneenvironment_p.h.

◆ aoSoftness

float QQuick3DSceneEnvironment::aoSoftness
readwrite

Definition at line 51 of file qquick3dsceneenvironment_p.h.

◆ aoStrength

float QQuick3DSceneEnvironment::aoStrength
readwrite

Definition at line 49 of file qquick3dsceneenvironment_p.h.

◆ backgroundMode

QQuick3DEnvironmentBackgroundTypes QQuick3DSceneEnvironment::backgroundMode
readwrite

Definition at line 44 of file qquick3dsceneenvironment_p.h.

◆ clearColor

QColor QQuick3DSceneEnvironment::clearColor
readwrite

Definition at line 45 of file qquick3dsceneenvironment_p.h.

◆ debugSettings

QQuick3DDebugSettings * QQuick3DSceneEnvironment::debugSettings
readwrite

\qmlproperty QtQuick3D::DebugSettings QtQuick3D::SceneEnvironment::debugSettings

Since
6.5

This property specifies a DebugSettings object which is used to configure the debugging tools of the renderer. During construction the SceneEnvironment automatically creates a DebugSettings object associated with itself, and therefore setting a custom DebugSettings is usually not required.

An example of rendering the scene with wireframe mode enabled: Visualizing the normal vectors of the meshes: Visualizing the specular lighting contribution:

See also
DebugSettings

Definition at line 73 of file qquick3dsceneenvironment_p.h.

◆ depthPrePassEnabled

bool QQuick3DSceneEnvironment::depthPrePassEnabled
readwrite

Definition at line 47 of file qquick3dsceneenvironment_p.h.

◆ depthTestEnabled

bool QQuick3DSceneEnvironment::depthTestEnabled
readwrite

Definition at line 46 of file qquick3dsceneenvironment_p.h.

◆ effects

QQmlListProperty< QQuick3DEffect > QQuick3DSceneEnvironment::effects
read

\qmlproperty List<QtQuick3D::Effect> QtQuick3D::SceneEnvironment::effects

Since
5.15

This property contains a list of post-processing effects that will be applied to the entire viewport. The result of each effect is fed to the next so the order is significant.

Note
For technical reasons, adding the same \l{QtQuick3D::Effect}{Effect} node several times to the list is unsupported and will give unexpected results.

Definition at line 66 of file qquick3dsceneenvironment_p.h.

◆ fog

QQuick3DFog * QQuick3DSceneEnvironment::fog
readwrite

\qmlproperty QtQuick3D::Fog QtQuick3D::SceneEnvironment::fog

Since
6.5

When this property is set to a valid \l {QtQuick3D::Fog}{Fog} object, it is used to configure the renderer's built-in fog support.

The default value is null, which means no fog. This is equivalent to setting a Fog object with \l{Fog::enabled}{enabled} set to false.

See also
{QtQuick3D::Fog}{Fog}

Definition at line 76 of file qquick3dsceneenvironment_p.h.

◆ lightmapper

QQuick3DLightmapper * QQuick3DSceneEnvironment::lightmapper
readwrite

\qmlproperty Lightmapper QtQuick3D::SceneEnvironment::lightmapper

When this property is set to a valid Lightmapper object, the settings specified by the object will be taken into account when baking lightmaps.

The default value is null, which means using default values for all the baking-related settings.

For more information on how to bake lightmaps, see the \l Lightmapper documentation.

When lightmaps are not relevant to an application and baked lighting is never generated, the property and the associated object serve no purpose in practice.

See also
Model::usedInBakedLighting, Model::bakedLightmap, Light::bakeMode, Lightmapper

Definition at line 71 of file qquick3dsceneenvironment_p.h.

◆ lightProbe

QQuick3DTexture * QQuick3DSceneEnvironment::lightProbe
readwrite

Definition at line 57 of file qquick3dsceneenvironment_p.h.

◆ oitMethod

QQuick3DSceneEnvironment::QQuick3DEnvironmentOITMethod QQuick3DSceneEnvironment::oitMethod
readwrite

\qmlproperty enumeration QtQuick3D::SceneEnvironment::oitMethod

Since
6.9

This property holds the Order Independent Transparency method. Setting this property to a valid OIT method causes the renderer to render transparent pixels in the correct depth order.

Possible values are: \value SceneEnvironment.OITNone OIT is turned off. \value SceneEnvironment.OITWeightedBlended Approximates order independent transparency.

The default is None and order independent transparency is turned off.

Weighted Blended

This is an approximation of order independent transparency. The transparent fragments are rendered to an offscreen buffer while weighting is applied to each fragment based on its distance to the camera. This buffer is then blended to the backbuffer after de-weighting each pixel. This method doesn't follow the source-over composition rule for all fragments and the result is different from the correct result, however this method works also on older hardware and is faster than the other more rigorous methods.

Note
OIT might not work with MSAA on devices with GLES 3.1 or lower. It is recommended not to use MSAA if oit is wanted on such devices.
Order independent transparenty is only applicaple to source-over blend mode. If scene contains objects with other blending modes, OIT is disabled.

Definition at line 78 of file qquick3dsceneenvironment_p.h.

◆ probeExposure

float QQuick3DSceneEnvironment::probeExposure
readwrite

Definition at line 58 of file qquick3dsceneenvironment_p.h.

◆ probeHorizon

float QQuick3DSceneEnvironment::probeHorizon
readwrite

Definition at line 59 of file qquick3dsceneenvironment_p.h.

◆ probeOrientation

QVector3D QQuick3DSceneEnvironment::probeOrientation
readwrite

Definition at line 60 of file qquick3dsceneenvironment_p.h.

◆ scissorRect

QRect QQuick3DSceneEnvironment::scissorRect
readwrite

\qmlproperty rect QtQuick3D::SceneEnvironment::scissorRect

Since
6.5

This property defines a scissor rectangle in view coordinates, with the top-left corner at [0, 0]

Definition at line 74 of file qquick3dsceneenvironment_p.h.

◆ skyboxBlurAmount

float QQuick3DSceneEnvironment::skyboxBlurAmount
readwrite

\qmlproperty real QtQuick3D::SceneEnvironment::skyboxBlurAmount

Since
6.4

This property determines how much much the skybox should be blurred when using SceneEnvironment.SkyBox for the \l backgroundMode property. The default value is 0.0 which means there is no blurring.

Acceptable values range between 0.0 and 1.0, all other values will be clamped to this range.

Definition at line 68 of file qquick3dsceneenvironment_p.h.

◆ skyBoxCubeMap

QQuick3DCubeMapTexture * QQuick3DSceneEnvironment::skyBoxCubeMap
readwrite

\qmlproperty QtQuick3D::CubeMapTexture QtQuick3D::SceneEnvironment::skyBoxCubeMap

This property defines a cubemap to be used as a skybox when the background mode is SkyBoxCubeMap.

Since
6.4

Definition at line 62 of file qquick3dsceneenvironment_p.h.

◆ specularAAEnabled

bool QQuick3DSceneEnvironment::specularAAEnabled
readwrite

\qmlproperty bool QtQuick3D::SceneEnvironment::specularAAEnabled

Since
6.4

When this property is enabled, specular aliasing will be mitigated. Specular aliasing is often visible in form of bright dots, possibly flickering when moving the camera around.

The default value is false.

\table \header

  • Specular AA disabled
  • Specular AA enabled \row
  • \endtable

Definition at line 69 of file qquick3dsceneenvironment_p.h.

◆ temporalAAEnabled

bool QQuick3DSceneEnvironment::temporalAAEnabled
readwrite

Definition at line 42 of file qquick3dsceneenvironment_p.h.

◆ temporalAAStrength

float QQuick3DSceneEnvironment::temporalAAStrength
readwrite

Definition at line 43 of file qquick3dsceneenvironment_p.h.

◆ tonemapMode

QQuick3DEnvironmentTonemapModes QQuick3DSceneEnvironment::tonemapMode
readwrite

Definition at line 64 of file qquick3dsceneenvironment_p.h.


The documentation for this class was generated from the following files: