diff options
Diffstat (limited to 'src/extras/defaults')
27 files changed, 275 insertions, 211 deletions
diff --git a/src/extras/defaults/defaults.pri b/src/extras/defaults/defaults.pri deleted file mode 100644 index cbd3bb8fe..000000000 --- a/src/extras/defaults/defaults.pri +++ /dev/null @@ -1,74 +0,0 @@ -INCLUDEPATH += $$PWD - -HEADERS += \ - $$PWD/qdiffusespecularmaterial.h \ - $$PWD/qdiffusespecularmaterial_p.h \ - $$PWD/qphongmaterial.h \ - $$PWD/qphongmaterial_p.h \ - $$PWD/qdiffusemapmaterial_p.h \ - $$PWD/qdiffusemapmaterial.h \ - $$PWD/qnormaldiffusespecularmapmaterial.h \ - $$PWD/qnormaldiffusespecularmapmaterial_p.h \ - $$PWD/qnormaldiffusemapmaterial.h \ - $$PWD/qnormaldiffusemapmaterial_p.h \ - $$PWD/qnormaldiffusemapalphamaterial.h \ - $$PWD/qnormaldiffusemapalphamaterial_p.h \ - $$PWD/qdiffusespecularmapmaterial.h \ - $$PWD/qdiffusespecularmapmaterial_p.h \ - $$PWD/qforwardrenderer.h \ - $$PWD/qforwardrenderer_p.h \ - $$PWD/qpervertexcolormaterial.h \ - $$PWD/qpervertexcolormaterial_p.h \ - $$PWD/qskyboxentity.h \ - $$PWD/qskyboxentity_p.h \ - $$PWD/qgoochmaterial.h \ - $$PWD/qgoochmaterial_p.h \ - $$PWD/qphongalphamaterial.h \ - $$PWD/qphongalphamaterial_p.h \ - $$PWD/qt3dwindow.h \ - $$PWD/qt3dwindow_p.h \ - $$PWD/qabstractcameracontroller.h \ - $$PWD/qabstractcameracontroller_p.h \ - $$PWD/qfirstpersoncameracontroller.h \ - $$PWD/qorbitcameracontroller.h \ - $$PWD/qorbitcameracontroller_p.h \ - $$PWD/qabstractspritesheet.h \ - $$PWD/qabstractspritesheet_p.h \ - $$PWD/qspritegrid.h \ - $$PWD/qspritegrid_p.h \ - $$PWD/qspritesheet.h \ - $$PWD/qspritesheet_p.h \ - $$PWD/qspritesheetitem.h \ - $$PWD/qspritesheetitem_p.h \ - $$PWD/qtexturematerial.h \ - $$PWD/qtexturematerial_p.h \ - $$PWD/qmetalroughmaterial.h \ - $$PWD/qmetalroughmaterial_p.h \ - $$PWD/qmorphphongmaterial.h \ - $$PWD/qmorphphongmaterial_p.h - -SOURCES += \ - $$PWD/qdiffusespecularmaterial.cpp \ - $$PWD/qphongmaterial.cpp \ - $$PWD/qdiffusemapmaterial.cpp \ - $$PWD/qnormaldiffusespecularmapmaterial.cpp \ - $$PWD/qnormaldiffusemapmaterial.cpp \ - $$PWD/qnormaldiffusemapalphamaterial.cpp \ - $$PWD/qdiffusespecularmapmaterial.cpp \ - $$PWD/qforwardrenderer.cpp \ - $$PWD/qpervertexcolormaterial.cpp \ - $$PWD/qskyboxentity.cpp \ - $$PWD/qgoochmaterial.cpp \ - $$PWD/qphongalphamaterial.cpp \ - $$PWD/qt3dwindow.cpp \ - $$PWD/qabstractcameracontroller.cpp \ - $$PWD/qfirstpersoncameracontroller.cpp \ - $$PWD/qorbitcameracontroller.cpp \ - $$PWD/qabstractspritesheet.cpp \ - $$PWD/qspritegrid.cpp \ - $$PWD/qspritesheet.cpp \ - $$PWD/qspritesheetitem.cpp \ - $$PWD/qtexturematerial.cpp \ - $$PWD/qmetalroughmaterial.cpp \ - $$PWD/qmorphphongmaterial.cpp - diff --git a/src/extras/defaults/qabstractcameracontroller.cpp b/src/extras/defaults/qabstractcameracontroller.cpp index f3eb03f00..fdf81aac1 100644 --- a/src/extras/defaults/qabstractcameracontroller.cpp +++ b/src/extras/defaults/qabstractcameracontroller.cpp @@ -223,9 +223,6 @@ void QAbstractCameraControllerPrivate::applyInputAccelerations() mouse, and other devices. QAbstractCameraController is an abstract class and cannot itself be instantiated. It provides a standard interface for camera controllers. - - Derived classes need only implement the frameActionTriggered() - method to move the camera. */ /*! diff --git a/src/extras/defaults/qabstractspritesheet.cpp b/src/extras/defaults/qabstractspritesheet.cpp index 88498d5f2..ad7de0491 100644 --- a/src/extras/defaults/qabstractspritesheet.cpp +++ b/src/extras/defaults/qabstractspritesheet.cpp @@ -8,10 +8,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QAbstractSpriteSheetPrivate::QAbstractSpriteSheetPrivate() : QNodePrivate() , m_texture(nullptr) diff --git a/src/extras/defaults/qdiffusemapmaterial.cpp b/src/extras/defaults/qdiffusemapmaterial.cpp index 6fbdc0469..cfdcc9c56 100644 --- a/src/extras/defaults/qdiffusemapmaterial.cpp +++ b/src/extras/defaults/qdiffusemapmaterial.cpp @@ -20,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseMapMaterialPrivate::QDiffuseMapMaterialPrivate() : QMaterialPrivate() , m_diffuseMapEffect(new QEffect()) @@ -221,7 +221,7 @@ QDiffuseMapMaterial::~QDiffuseMapMaterial() } /*! - \property QDiffuseMapMaterial::ambient + \property Qt3DExtras::QDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -233,7 +233,7 @@ QColor QDiffuseMapMaterial::ambient() const } /*! - \property QDiffuseMapMaterial::specular + \property Qt3DExtras::QDiffuseMapMaterial::specular Holds the current specular color. */ @@ -244,7 +244,7 @@ QColor QDiffuseMapMaterial::specular() const } /*! - \property QDiffuseMapMaterial::shininess + \property Qt3DExtras::QDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -255,7 +255,7 @@ float QDiffuseMapMaterial::shininess() const } /*! - \property QDiffuseMapMaterial::diffuse + \property Qt3DExtras::QDiffuseMapMaterial::diffuse Holds the current texture used as the diffuse map. @@ -275,7 +275,7 @@ QAbstractTexture *QDiffuseMapMaterial::diffuse() const } /*! - \property QDiffuseMapMaterial::textureScale + \property Qt3DExtras::QDiffuseMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. diff --git a/src/extras/defaults/qdiffusespecularmapmaterial.cpp b/src/extras/defaults/qdiffusespecularmapmaterial.cpp index de343e1e7..c791d02a8 100644 --- a/src/extras/defaults/qdiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmapmaterial.cpp @@ -20,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseSpecularMapMaterialPrivate::QDiffuseSpecularMapMaterialPrivate() : QMaterialPrivate() , m_diffuseSpecularMapEffect(new QEffect()) @@ -228,7 +228,7 @@ QDiffuseSpecularMapMaterial::~QDiffuseSpecularMapMaterial() } /*! - \property QDiffuseSpecularMapMaterial::ambient + \property Qt3DExtras::QDiffuseSpecularMapMaterial::ambient Holds the current ambient color that is emitted by an object without any other light source. @@ -240,7 +240,7 @@ QColor QDiffuseSpecularMapMaterial::ambient() const } /*! - \property QDiffuseSpecularMapMaterial::diffuse + \property Qt3DExtras::QDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -260,7 +260,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::diffuse() const } /*! - \property QDiffuseSpecularMapMaterial::specular + \property Qt3DExtras::QDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -280,7 +280,7 @@ QAbstractTexture *QDiffuseSpecularMapMaterial::specular() const } /*! - \property QDiffuseSpecularMapMaterial::shininess + \property Qt3DExtras::QDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. Higher values of shininess result in a smaller and brighter highlight. @@ -294,7 +294,7 @@ float QDiffuseSpecularMapMaterial::shininess() const } /*! - \property QDiffuseSpecularMapMaterial::textureScale + \property Qt3DExtras::QDiffuseSpecularMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. diff --git a/src/extras/defaults/qdiffusespecularmaterial.cpp b/src/extras/defaults/qdiffusespecularmaterial.cpp index e8f60cd73..7dd5fbbf9 100644 --- a/src/extras/defaults/qdiffusespecularmaterial.cpp +++ b/src/extras/defaults/qdiffusespecularmaterial.cpp @@ -24,10 +24,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QDiffuseSpecularMaterialPrivate::QDiffuseSpecularMaterialPrivate() : QMaterialPrivate() , m_effect(new QEffect()) @@ -271,7 +271,7 @@ QDiffuseSpecularMaterial::~QDiffuseSpecularMaterial() } /*! - \property QDiffuseSpecularMaterial::ambient + \property Qt3DExtras::QDiffuseSpecularMaterial::ambient Holds the ambient color that is emitted by an object without any other light source. @@ -289,7 +289,7 @@ QColor QDiffuseSpecularMaterial::ambient() const } /*! - \property QDiffuseSpecularMaterial::diffuse + \property Qt3DExtras::QDiffuseSpecularMaterial::diffuse Holds the diffuse color of the material that is emitted for rough surface reflections with the lights. This can be either a plain color value or a @@ -309,7 +309,7 @@ QVariant QDiffuseSpecularMaterial::diffuse() const } /*! - \property QDiffuseSpecularMaterial::specular + \property Qt3DExtras::QDiffuseSpecularMaterial::specular Holds the specular color of the material that is emitted for shiny surface reflections with the lights. This can be either a plain color value or a @@ -329,7 +329,7 @@ QVariant QDiffuseSpecularMaterial::specular() const } /*! - \property QDiffuseSpecularMaterial::shininess + \property Qt3DExtras::QDiffuseSpecularMaterial::shininess Holds the shininess exponent. Higher values of shininess result in a smaller and brighter highlight. @@ -351,7 +351,7 @@ float QDiffuseSpecularMaterial::shininess() const } /*! - \property QDiffuseSpecularMaterial::normal + \property Qt3DExtras::QDiffuseSpecularMaterial::normal Holds the current normal map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -369,7 +369,7 @@ QVariant QDiffuseSpecularMaterial::normal() const } /*! - \property QDiffuseSpecularMaterial::textureScale + \property Qt3DExtras::QDiffuseSpecularMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. @@ -395,7 +395,7 @@ float QDiffuseSpecularMaterial::textureScale() const } /*! - \property QDiffuseSpecularMaterial::alphaBlending + \property Qt3DExtras::QDiffuseSpecularMaterial::alphaBlending Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false. diff --git a/src/extras/defaults/qforwardrenderer.cpp b/src/extras/defaults/qforwardrenderer.cpp index f1594c135..e6a407f56 100644 --- a/src/extras/defaults/qforwardrenderer.cpp +++ b/src/extras/defaults/qforwardrenderer.cpp @@ -22,10 +22,10 @@ static void initResources() QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QForwardRendererPrivate::QForwardRendererPrivate() : QTechniqueFilterPrivate() , m_surfaceSelector(new QRenderSurfaceSelector) @@ -182,7 +182,7 @@ void QForwardRenderer::setShowDebugOverlay(bool showDebugOverlay) Holds the current normalized viewport rectangle. */ /*! - \property QForwardRenderer::viewportRect + \property Qt3DExtras::QForwardRenderer::viewportRect Holds the current normalized viewport rectangle. */ @@ -199,7 +199,7 @@ QRectF QForwardRenderer::viewportRect() const before rendering. */ /*! - \property QForwardRenderer::clearColor + \property Qt3DExtras::QForwardRenderer::clearColor Holds the current clear color of the scene. The frame buffer is initialized to the clear color before rendering. @@ -217,7 +217,7 @@ QColor QForwardRenderer::clearColor() const \since 5.14 */ /*! - \property QForwardRenderer::buffersToClear + \property Qt3DExtras::QForwardRenderer::buffersToClear Holds the current buffers to be cleared. Default value is ColorDepthBuffer \since 5.14 @@ -236,7 +236,7 @@ QClearBuffers::BufferType QForwardRenderer::buffersToClear() const \note A camera is an Entity that has a CameraLens as one of its components. */ /*! - \property QForwardRenderer::camera + \property Qt3DExtras::QForwardRenderer::camera Holds the current camera entity used to render the scene. @@ -256,7 +256,7 @@ Qt3DCore::QEntity *QForwardRenderer::camera() const \deprecated */ /*! - \property QForwardRenderer::window + \property Qt3DExtras::QForwardRenderer::window Holds the current render surface. @@ -269,7 +269,7 @@ Qt3DCore::QEntity *QForwardRenderer::camera() const Holds the current render surface. */ /*! - \property QForwardRenderer::surface + \property Qt3DExtras::QForwardRenderer::surface Holds the current render surface. */ @@ -287,7 +287,7 @@ QObject *QForwardRenderer::surface() const surface (as set in \l {surface}). */ /*! - \property QForwardRenderer::externalRenderTargetSize + \property Qt3DExtras::QForwardRenderer::externalRenderTargetSize Contains the size of the external render target. External render targets are relevant when rendering does not target a window @@ -305,7 +305,7 @@ QSize QForwardRenderer::externalRenderTargetSize() const Indicates if the renderer applies frustum culling to the scene. */ /*! - \property QForwardRenderer::frustumCulling + \property Qt3DExtras::QForwardRenderer::frustumCulling Indicates if the renderer applies frustum culling to the scene. */ @@ -321,7 +321,7 @@ bool QForwardRenderer::isFrustumCullingEnabled() const Holds the gamma value the renderer applies to the scene. */ /*! - \property QForwardRenderer::gamma + \property Qt3DExtras::QForwardRenderer::gamma Holds the gamma value the renderer applies to the scene. */ @@ -341,7 +341,7 @@ float QForwardRenderer::gamma() const \since 5.15 */ /*! - \property QForwardRenderer::showDebugOverlay + \property Qt3DExtras::QForwardRenderer::showDebugOverlay If true, a debug overlay will be rendered over the scene. It will show detailed information about the runtime rendering state, let the user diff --git a/src/extras/defaults/qgoochmaterial.cpp b/src/extras/defaults/qgoochmaterial.cpp index e9be354c4..f652fda2e 100644 --- a/src/extras/defaults/qgoochmaterial.cpp +++ b/src/extras/defaults/qgoochmaterial.cpp @@ -217,7 +217,7 @@ QGoochMaterial::QGoochMaterial(QGoochMaterialPrivate &dd, QNode *parent) } /*! - \property QGoochMaterial::diffuse + \property Qt3DExtras::QGoochMaterial::diffuse Holds the current diffuse color. */ @@ -228,7 +228,7 @@ QColor QGoochMaterial::diffuse() const } /*! - \property QGoochMaterial::specular + \property Qt3DExtras::QGoochMaterial::specular Holds the current specular color. */ @@ -239,7 +239,7 @@ QColor QGoochMaterial::specular() const } /*! - \property QGoochMaterial::cool + \property Qt3DExtras::QGoochMaterial::cool Holds the current cool color. */ @@ -250,7 +250,7 @@ QColor QGoochMaterial::cool() const } /*! - \property QGoochMaterial::warm + \property Qt3DExtras::QGoochMaterial::warm Holds the current warm color. */ @@ -261,7 +261,7 @@ QColor QGoochMaterial::warm() const } /*! - \property QGoochMaterial::alpha + \property Qt3DExtras::QGoochMaterial::alpha Holds the current alpha value. The start point of the color ramp used by the Gooch shader is calculated as {c = cool + alpha * diffuse}. @@ -273,7 +273,7 @@ float QGoochMaterial::alpha() const } /*! - \property QGoochMaterial::beta + \property Qt3DExtras::QGoochMaterial::beta Holds the current beta value. The start point of the color ramp used by the Gooch shader is calculated as {c = warm + beta * diffuse}. @@ -285,7 +285,7 @@ float QGoochMaterial::beta() const } /*! - \property QGoochMaterial::shininess + \property Qt3DExtras::QGoochMaterial::shininess Holds the current shininess value. Higher values of shininess result in a smaller and brighter highlight. diff --git a/src/extras/defaults/qmetalroughmaterial.cpp b/src/extras/defaults/qmetalroughmaterial.cpp index 86752a32c..edbef486f 100644 --- a/src/extras/defaults/qmetalroughmaterial.cpp +++ b/src/extras/defaults/qmetalroughmaterial.cpp @@ -19,10 +19,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QMetalRoughMaterialPrivate::QMetalRoughMaterialPrivate() : QMaterialPrivate() , m_baseColorParameter(new QParameter(QStringLiteral("baseColor"), QColor::fromString("grey"))) @@ -232,7 +232,7 @@ QMetalRoughMaterial::~QMetalRoughMaterial() } /*! - \property QMetalRoughMaterial::baseColor + \property Qt3DExtras::QMetalRoughMaterial::baseColor Holds the current base color of the material. This can be either a plain color value or a texture. By default the value of this property is "grey". @@ -250,7 +250,7 @@ QVariant QMetalRoughMaterial::baseColor() const } /*! - \property QMetalRoughMaterial::metalness + \property Qt3DExtras::QMetalRoughMaterial::metalness Holds the current metalness level of the material, as a value between 0 (purely dielectric, the default) and 1 (purely metallic). This can be @@ -272,7 +272,7 @@ QVariant QMetalRoughMaterial::metalness() const } /*! - \property QMetalRoughMaterial::roughness + \property Qt3DExtras::QMetalRoughMaterial::roughness Holds the current roughness level of the material. This can be either a plain uniform value or a texture. By default the value of this property is @@ -292,7 +292,7 @@ QVariant QMetalRoughMaterial::roughness() const } /*! - \property QMetalRoughMaterial::ambientOcclusion + \property Qt3DExtras::QMetalRoughMaterial::ambientOcclusion Holds the current ambient occlusion map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -310,7 +310,7 @@ QVariant QMetalRoughMaterial::ambientOcclusion() const } /*! - \property QMetalRoughMaterial::normal + \property Qt3DExtras::QMetalRoughMaterial::normal Holds the current normal map texture of the material. This can only be a texture, otherwise it is ignored. By default this map is not set. @@ -328,7 +328,7 @@ QVariant QMetalRoughMaterial::normal() const } /*! - \property QMetalRoughMaterial::textureScale + \property Qt3DExtras::QMetalRoughMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. diff --git a/src/extras/defaults/qmorphphongmaterial.cpp b/src/extras/defaults/qmorphphongmaterial.cpp index ad2b17dc8..712df2209 100644 --- a/src/extras/defaults/qmorphphongmaterial.cpp +++ b/src/extras/defaults/qmorphphongmaterial.cpp @@ -18,10 +18,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QMorphPhongMaterialPrivate::QMorphPhongMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) @@ -210,7 +210,7 @@ QMorphPhongMaterial::~QMorphPhongMaterial() } /*! - \property QMorphPhongMaterial::ambient + \property Qt3DExtras::QMorphPhongMaterial::ambient Holds the ambient color. */ @@ -221,7 +221,7 @@ QColor QMorphPhongMaterial::ambient() const } /*! - \property QMorphPhongMaterial::diffuse + \property Qt3DExtras::QMorphPhongMaterial::diffuse Holds the diffuse color. */ @@ -232,7 +232,7 @@ QColor QMorphPhongMaterial::diffuse() const } /*! - \property QMorphPhongMaterial::specular + \property Qt3DExtras::QMorphPhongMaterial::specular Holds the specular color. */ @@ -243,7 +243,7 @@ QColor QMorphPhongMaterial::specular() const } /*! - \property QMorphPhongMaterial::shininess + \property Qt3DExtras::QMorphPhongMaterial::shininess Holds the shininess exponent. */ @@ -254,7 +254,7 @@ float QMorphPhongMaterial::shininess() const } /*! - \property QMorphPhongMaterial::interpolator + \property Qt3DExtras::QMorphPhongMaterial::interpolator Contains the interpolation method of the Phong lighting effect. */ diff --git a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp index 62ce86b62..19be3cfa9 100644 --- a/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapalphamaterial.cpp @@ -20,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseMapAlphaMaterialPrivate::QNormalDiffuseMapAlphaMaterialPrivate() : QNormalDiffuseMapMaterialPrivate() diff --git a/src/extras/defaults/qnormaldiffusemapmaterial.cpp b/src/extras/defaults/qnormaldiffusemapmaterial.cpp index c77f954d9..6eb0d38a7 100644 --- a/src/extras/defaults/qnormaldiffusemapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusemapmaterial.cpp @@ -19,10 +19,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseMapMaterialPrivate::QNormalDiffuseMapMaterialPrivate() : QMaterialPrivate() , m_normalDiffuseEffect(new QEffect()) @@ -246,7 +246,7 @@ QNormalDiffuseMapMaterial::~QNormalDiffuseMapMaterial() } /*! - \property QNormalDiffuseMapMaterial::ambient + \property Qt3DExtras::QNormalDiffuseMapMaterial::ambient Holds the current ambient color. */ @@ -257,7 +257,7 @@ QColor QNormalDiffuseMapMaterial::ambient() const } /*! - \property QNormalDiffuseMapMaterial::specular + \property Qt3DExtras::QNormalDiffuseMapMaterial::specular Holds the current specular color. */ @@ -268,7 +268,7 @@ QColor QNormalDiffuseMapMaterial::specular() const } /*! - \property QNormalDiffuseMapMaterial::diffuse + \property Qt3DExtras::QNormalDiffuseMapMaterial::diffuse Holds the current diffuse map texture. @@ -288,7 +288,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::diffuse() const } /*! - \property QNormalDiffuseMapMaterial::normal + \property Qt3DExtras::QNormalDiffuseMapMaterial::normal Holds the current normal map texture. @@ -307,7 +307,7 @@ QAbstractTexture *QNormalDiffuseMapMaterial::normal() const } /*! - \property QNormalDiffuseMapMaterial::shininess + \property Qt3DExtras::QNormalDiffuseMapMaterial::shininess Holds the current shininess as a float value. */ @@ -318,7 +318,7 @@ float QNormalDiffuseMapMaterial::shininess() const } /*! - \property QNormalDiffuseMapMaterial::textureScale + \property Qt3DExtras::QNormalDiffuseMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. diff --git a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp index 22713da40..098b6b799 100644 --- a/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp +++ b/src/extras/defaults/qnormaldiffusespecularmapmaterial.cpp @@ -20,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QNormalDiffuseSpecularMapMaterialPrivate::QNormalDiffuseSpecularMapMaterialPrivate() : QMaterialPrivate() , m_normalDiffuseSpecularEffect(new QEffect()) @@ -254,7 +254,7 @@ QNormalDiffuseSpecularMapMaterial::~QNormalDiffuseSpecularMapMaterial() } /*! - \property QNormalDiffuseSpecularMapMaterial::ambient + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::ambient Holds the current ambient color. */ @@ -265,7 +265,7 @@ QColor QNormalDiffuseSpecularMapMaterial::ambient() const } /*! - \property QNormalDiffuseSpecularMapMaterial::diffuse + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::diffuse Holds the current diffuse map texture. @@ -285,7 +285,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::diffuse() const } /*! - \property QNormalDiffuseSpecularMapMaterial::normal + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::normal Holds the current normal map texture. @@ -304,7 +304,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::normal() const } /*! - \property QNormalDiffuseSpecularMapMaterial::specular + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::specular Holds the current specular map texture. @@ -324,7 +324,7 @@ QAbstractTexture *QNormalDiffuseSpecularMapMaterial::specular() const } /*! - \property QNormalDiffuseSpecularMapMaterial::shininess + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::shininess Holds the current shininess as a float value. */ @@ -335,7 +335,7 @@ float QNormalDiffuseSpecularMapMaterial::shininess() const } /*! - \property QNormalDiffuseSpecularMapMaterial::textureScale + \property Qt3DExtras::QNormalDiffuseSpecularMapMaterial::textureScale Holds the current texture scale. It is applied as a multiplier to texture coordinates at render time. Defaults to 1.0. diff --git a/src/extras/defaults/qorbitcameracontroller.cpp b/src/extras/defaults/qorbitcameracontroller.cpp index 92b59e46c..390a986f3 100644 --- a/src/extras/defaults/qorbitcameracontroller.cpp +++ b/src/extras/defaults/qorbitcameracontroller.cpp @@ -12,6 +12,12 @@ namespace Qt3DExtras { QOrbitCameraControllerPrivate::QOrbitCameraControllerPrivate() : m_zoomInLimit(2.0f) + , m_upVector(0.0f, 1.0f, 0.0f) + , m_inverseXTranslate(false) + , m_inverseYTranslate(false) + , m_inversePan(false) + , m_inverseTilt(false) + , m_zoomTranslateViewCenter(true) {} /*! @@ -80,7 +86,7 @@ QOrbitCameraController::~QOrbitCameraController() } /*! - \property QOrbitCameraController::zoomInLimit + \property Qt3DExtras::QOrbitCameraController::zoomInLimit Holds the current zoom-in limit. The zoom-in limit determines how close to the view center the camera can be zoomed. @@ -100,6 +106,95 @@ void QOrbitCameraController::setZoomInLimit(float zoomInLimit) } } +QVector3D QOrbitCameraController::upVector() const { + Q_D(const QOrbitCameraController); + return d->m_upVector; +} + +void QOrbitCameraController::setUpVector(const QVector3D& upVector) +{ + Q_D(QOrbitCameraController); + if (d->m_upVector != upVector) { + d->m_upVector = upVector; + emit upVectorChanged(d->m_upVector); + } +} + +bool QOrbitCameraController::inverseXTranslate() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseXTranslate; +} + +void QOrbitCameraController::setInverseXTranslate(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseXTranslate != isInverse) { + d->m_inverseXTranslate = isInverse; + emit inverseXTranslateChanged(d->m_inverseXTranslate); + } +} + +bool QOrbitCameraController::inverseYTranslate() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseYTranslate; +} + +void QOrbitCameraController::setInverseYTranslate(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseYTranslate != isInverse) { + d->m_inverseYTranslate = isInverse; + emit inverseYTranslateChanged(d->m_inverseYTranslate); + } +} + +bool QOrbitCameraController::inversePan() const +{ + Q_D(const QOrbitCameraController); + return d->m_inversePan; +} + +void QOrbitCameraController::setInversePan(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inversePan != isInverse) { + d->m_inversePan = isInverse; + emit inversePanChanged(d->m_inversePan); + } +} + +bool QOrbitCameraController::inverseTilt() const +{ + Q_D(const QOrbitCameraController); + return d->m_inverseTilt; +} + +void QOrbitCameraController::setInverseTilt(bool isInverse) +{ + Q_D(QOrbitCameraController); + if (d->m_inverseTilt != isInverse) { + d->m_inverseTilt = isInverse; + emit inverseTiltChanged(d->m_inverseTilt); + } +} + +bool QOrbitCameraController::zoomTranslateViewCenter() const +{ + Q_D(const QOrbitCameraController); + return d->m_zoomTranslateViewCenter; +} + +void QOrbitCameraController::setZoomTranslateViewCenter(bool isTranslate) +{ + Q_D(QOrbitCameraController); + if (d->m_zoomTranslateViewCenter != isTranslate) { + d->m_zoomTranslateViewCenter = isTranslate; + emit zoomTranslateViewCenterChanged(d->m_zoomTranslateViewCenter); + } +} + inline float clampInputs(float input1, float input2) { float axisValue = input1 + input2; @@ -120,8 +215,6 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt if (theCamera == nullptr) return; - const QVector3D upVector(0.0f, 1.0f, 0.0f); - // Mouse input if (state.leftMouseButtonActive) { if (state.rightMouseButtonActive) { @@ -133,22 +226,22 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt } } else { // Translate - theCamera->translate(QVector3D(clampInputs(state.rxAxisValue, state.txAxisValue) * linearSpeed(), - clampInputs(state.ryAxisValue, state.tyAxisValue) * linearSpeed(), - 0) * dt); + theCamera->translate(QVector3D((d->m_inverseXTranslate ? -1.0f : 1.0f) * clampInputs(state.rxAxisValue, state.txAxisValue) * linearSpeed(), + (d->m_inverseYTranslate ? -1.0f : 1.0f) * clampInputs(state.ryAxisValue, state.tyAxisValue) * linearSpeed(), + 0) * dt); } return; } else if (state.rightMouseButtonActive) { // Orbit - theCamera->panAboutViewCenter((state.rxAxisValue * lookSpeed()) * dt, upVector); - theCamera->tiltAboutViewCenter((state.ryAxisValue * lookSpeed()) * dt); + theCamera->panAboutViewCenter((d->m_inversePan ? -1.0f : 1.0f) * (state.rxAxisValue * lookSpeed()) * dt, d->m_upVector); + theCamera->tiltAboutViewCenter((d->m_inverseTilt ? -1.0f : 1.0f) * (state.ryAxisValue * lookSpeed()) * dt); } // Keyboard Input if (state.altKeyActive) { // Orbit - theCamera->panAboutViewCenter((state.txAxisValue * lookSpeed()) * dt, upVector); + theCamera->panAboutViewCenter((state.txAxisValue * lookSpeed()) * dt, d->m_upVector); theCamera->tiltAboutViewCenter((state.tyAxisValue * lookSpeed()) * dt); } else if (state.shiftKeyActive) { if (zoomDistance(camera()->position(), theCamera->viewCenter()) > d->m_zoomInLimit * d->m_zoomInLimit) { @@ -161,7 +254,8 @@ void QOrbitCameraController::moveCamera(const QAbstractCameraController::InputSt // Translate theCamera->translate(QVector3D(clampInputs(state.leftMouseButtonActive ? state.rxAxisValue : 0, state.txAxisValue) * linearSpeed(), clampInputs(state.leftMouseButtonActive ? state.ryAxisValue : 0, state.tyAxisValue) * linearSpeed(), - state.tzAxisValue * linearSpeed()) * dt); + state.tzAxisValue * linearSpeed()) * dt, + d->m_zoomTranslateViewCenter ? theCamera->TranslateViewCenter : theCamera->DontTranslateViewCenter); } } diff --git a/src/extras/defaults/qorbitcameracontroller.h b/src/extras/defaults/qorbitcameracontroller.h index 09731c8d9..07b8b3522 100644 --- a/src/extras/defaults/qorbitcameracontroller.h +++ b/src/extras/defaults/qorbitcameracontroller.h @@ -16,17 +16,42 @@ class Q_3DEXTRASSHARED_EXPORT QOrbitCameraController : public QAbstractCameraCon { Q_OBJECT Q_PROPERTY(float zoomInLimit READ zoomInLimit WRITE setZoomInLimit NOTIFY zoomInLimitChanged) + Q_PROPERTY(QVector3D upVector READ upVector WRITE setUpVector NOTIFY upVectorChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseXTranslate READ inverseXTranslate WRITE setInverseXTranslate NOTIFY inverseXTranslateChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseYTranslate READ inverseYTranslate WRITE setInverseYTranslate NOTIFY inverseYTranslateChanged REVISION(6, 7)) + Q_PROPERTY(bool inversePan READ inversePan WRITE setInversePan NOTIFY inversePanChanged REVISION(6, 7)) + Q_PROPERTY(bool inverseTilt READ inverseTilt WRITE setInverseTilt NOTIFY inverseTiltChanged REVISION(6, 7)) + Q_PROPERTY(bool zoomTranslateViewCenter READ zoomTranslateViewCenter WRITE setZoomTranslateViewCenter NOTIFY zoomTranslateViewCenterChanged REVISION(6, 7)) public: explicit QOrbitCameraController(Qt3DCore::QNode *parent = nullptr); ~QOrbitCameraController(); float zoomInLimit() const; - + QVector3D upVector() const; + bool inverseXTranslate() const; + bool inverseYTranslate() const; + bool inversePan() const; + bool inverseTilt() const; + bool zoomTranslateViewCenter() const; + +public Q_SLOTS: void setZoomInLimit(float zoomInLimit); + void setUpVector(const QVector3D& upVector); + void setInverseXTranslate(bool isInverse); + void setInverseYTranslate(bool isInverse); + void setInversePan(bool isInverse); + void setInverseTilt(bool isInverse); + void setZoomTranslateViewCenter(bool isTranslate); Q_SIGNALS: void zoomInLimitChanged(); + void upVectorChanged(const QVector3D &upVector); + void inverseXTranslateChanged(bool isInverse); + void inverseYTranslateChanged(bool isInverse); + void inversePanChanged(bool isInverse); + void inverseTiltChanged(bool isInverse); + void zoomTranslateViewCenterChanged(bool isTranslate); protected: QOrbitCameraController(QOrbitCameraControllerPrivate &dd, Qt3DCore::QNode *parent = nullptr); @@ -43,3 +68,4 @@ private: QT_END_NAMESPACE #endif // QT3DEXTRAS_QORBITCAMERACONTROLLER_H + diff --git a/src/extras/defaults/qorbitcameracontroller_p.h b/src/extras/defaults/qorbitcameracontroller_p.h index 602fad90f..720ed90b6 100644 --- a/src/extras/defaults/qorbitcameracontroller_p.h +++ b/src/extras/defaults/qorbitcameracontroller_p.h @@ -31,6 +31,10 @@ public: void init(); float m_zoomInLimit; + QVector3D m_upVector; + bool m_inverseXTranslate, m_inverseYTranslate; + bool m_inversePan, m_inverseTilt; + bool m_zoomTranslateViewCenter; private: QOrbitCameraController *q_ptr; diff --git a/src/extras/defaults/qpervertexcolormaterial.cpp b/src/extras/defaults/qpervertexcolormaterial.cpp index 89e0ccbbf..ef4b26ad7 100644 --- a/src/extras/defaults/qpervertexcolormaterial.cpp +++ b/src/extras/defaults/qpervertexcolormaterial.cpp @@ -18,10 +18,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPerVertexColorMaterialPrivate::QPerVertexColorMaterialPrivate() : QMaterialPrivate() , m_vertexEffect(new QEffect()) diff --git a/src/extras/defaults/qphongalphamaterial.cpp b/src/extras/defaults/qphongalphamaterial.cpp index 716451619..1e0ced28c 100644 --- a/src/extras/defaults/qphongalphamaterial.cpp +++ b/src/extras/defaults/qphongalphamaterial.cpp @@ -22,10 +22,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPhongAlphaMaterialPrivate::QPhongAlphaMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) @@ -245,7 +245,7 @@ QPhongAlphaMaterial::~QPhongAlphaMaterial() } /*! - \property QPhongAlphaMaterial::ambient + \property Qt3DExtras::QPhongAlphaMaterial::ambient Holds the ambient color. */ @@ -256,7 +256,7 @@ QColor QPhongAlphaMaterial::ambient() const } /*! - \property QPhongAlphaMaterial::diffuse + \property Qt3DExtras::QPhongAlphaMaterial::diffuse Holds the diffuse color. */ @@ -267,7 +267,7 @@ QColor QPhongAlphaMaterial::diffuse() const } /*! - \property QPhongAlphaMaterial::specular + \property Qt3DExtras::QPhongAlphaMaterial::specular Holds the specular color. */ @@ -278,7 +278,7 @@ QColor QPhongAlphaMaterial::specular() const } /*! - \property QPhongAlphaMaterial::shininess + \property Qt3DExtras::QPhongAlphaMaterial::shininess Holds the shininess exponent. */ @@ -289,7 +289,7 @@ float QPhongAlphaMaterial::shininess() const } /*! - \property QPhongAlphaMaterial::alpha + \property Qt3DExtras::QPhongAlphaMaterial::alpha Holds the alpha component of the object which varies between 0 and 1. @@ -302,7 +302,7 @@ float QPhongAlphaMaterial::alpha() const } /*! - \property QPhongAlphaMaterial::sourceRgbArg + \property Qt3DExtras::QPhongAlphaMaterial::sourceRgbArg Holds the blend equation source RGB blending argument. @@ -315,7 +315,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceRgbArg() const } /*! - \property QPhongAlphaMaterial::destinationRgbArg + \property Qt3DExtras::QPhongAlphaMaterial::destinationRgbArg Holds the blend equation destination RGB blending argument. @@ -328,7 +328,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationRgbArg() const } /*! - \property QPhongAlphaMaterial::sourceAlphaArg + \property Qt3DExtras::QPhongAlphaMaterial::sourceAlphaArg Holds the blend equation source alpha blending argument. @@ -341,7 +341,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::sourceAlphaArg() const } /*! - \property QPhongAlphaMaterial::destinationAlphaArg + \property Qt3DExtras::QPhongAlphaMaterial::destinationAlphaArg Holds the blend equation destination alpha blending argument. @@ -354,7 +354,7 @@ QBlendEquationArguments::Blending QPhongAlphaMaterial::destinationAlphaArg() con } /*! - \property QPhongAlphaMaterial::blendFunctionArg + \property Qt3DExtras::QPhongAlphaMaterial::blendFunctionArg Holds the blend equation function argument. diff --git a/src/extras/defaults/qphongmaterial.cpp b/src/extras/defaults/qphongmaterial.cpp index cb6c1f32d..5d543e005 100644 --- a/src/extras/defaults/qphongmaterial.cpp +++ b/src/extras/defaults/qphongmaterial.cpp @@ -20,10 +20,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QPhongMaterialPrivate::QPhongMaterialPrivate() : QMaterialPrivate() , m_phongEffect(new QEffect()) @@ -204,7 +204,7 @@ QPhongMaterial::~QPhongMaterial() } /*! - \property QPhongMaterial::ambient + \property Qt3DExtras::QPhongMaterial::ambient Holds the ambient color. */ @@ -215,7 +215,7 @@ QColor QPhongMaterial::ambient() const } /*! - \property QPhongMaterial::diffuse + \property Qt3DExtras::QPhongMaterial::diffuse Holds the diffuse color. */ @@ -226,7 +226,7 @@ QColor QPhongMaterial::diffuse() const } /*! - \property QPhongMaterial::specular + \property Qt3DExtras::QPhongMaterial::specular Holds the specular color. */ @@ -237,7 +237,7 @@ QColor QPhongMaterial::specular() const } /*! - \property QPhongMaterial::shininess + \property Qt3DExtras::QPhongMaterial::shininess Holds the shininess exponent. */ diff --git a/src/extras/defaults/qskyboxentity.cpp b/src/extras/defaults/qskyboxentity.cpp index 8f9718465..273c5724d 100644 --- a/src/extras/defaults/qskyboxentity.cpp +++ b/src/extras/defaults/qskyboxentity.cpp @@ -22,11 +22,12 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; -using namespace Qt3DRender; namespace Qt3DExtras { +using namespace Qt3DCore; +using namespace Qt3DRender; + QSkyboxEntityPrivate::QSkyboxEntityPrivate() : QEntityPrivate() , m_effect(new QEffect()) @@ -35,13 +36,16 @@ QSkyboxEntityPrivate::QSkyboxEntityPrivate() , m_loadedTexture(new QTextureLoader()) , m_gl3Shader(new QShaderProgram()) , m_gl2es2Shader(new QShaderProgram()) + , m_rhiShader(new QShaderProgram()) , m_gl2Technique(new QTechnique()) , m_es2Technique(new QTechnique()) , m_gl3Technique(new QTechnique()) + , m_rhiTechnique(new QTechnique()) , m_filterKey(new QFilterKey) , m_gl2RenderPass(new QRenderPass()) , m_es2RenderPass(new QRenderPass()) , m_gl3RenderPass(new QRenderPass()) + , m_rhiRenderPass(new QRenderPass()) , m_mesh(new QCuboidMesh()) , m_gammaStrengthParameter(new QParameter(QStringLiteral("gammaStrength"), 0.0f)) , m_textureParameter(new QParameter(QStringLiteral("skyboxTexture"), m_skyboxTexture)) @@ -66,6 +70,8 @@ void QSkyboxEntityPrivate::init() m_gl3Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/gl3/skybox.frag")))); m_gl2es2Shader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.vert")))); m_gl2es2Shader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/es2/skybox.frag")))); + m_rhiShader->setVertexShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/rhi/skybox.vert")))); + m_rhiShader->setFragmentShaderCode(QShaderProgram::loadSource(QUrl(QStringLiteral("qrc:/shaders/rhi/skybox.frag")))); m_gl3Technique->graphicsApiFilter()->setApi(QGraphicsApiFilter::OpenGL); m_gl3Technique->graphicsApiFilter()->setMajorVersion(3); @@ -82,6 +88,10 @@ void QSkyboxEntityPrivate::init() m_es2Technique->graphicsApiFilter()->setMinorVersion(0); m_es2Technique->graphicsApiFilter()->setProfile(QGraphicsApiFilter::NoProfile); + m_rhiTechnique->graphicsApiFilter()->setApi(QGraphicsApiFilter::RHI); + m_rhiTechnique->graphicsApiFilter()->setMajorVersion(1); + m_rhiTechnique->graphicsApiFilter()->setMinorVersion(0); + m_filterKey->setParent(m_effect); m_filterKey->setName(QStringLiteral("renderingStyle")); m_filterKey->setValue(QStringLiteral("forward")); @@ -89,10 +99,12 @@ void QSkyboxEntityPrivate::init() m_gl3Technique->addFilterKey(m_filterKey); m_gl2Technique->addFilterKey(m_filterKey); m_es2Technique->addFilterKey(m_filterKey); + m_rhiTechnique->addFilterKey(m_filterKey); m_gl3RenderPass->setShaderProgram(m_gl3Shader); m_gl2RenderPass->setShaderProgram(m_gl2es2Shader); m_es2RenderPass->setShaderProgram(m_gl2es2Shader); + m_rhiRenderPass->setShaderProgram(m_rhiShader); QCullFace *cullFront = new QCullFace(); cullFront->setMode(QCullFace::Front); @@ -107,14 +119,18 @@ void QSkyboxEntityPrivate::init() m_gl2RenderPass->addRenderState(depthTest); m_es2RenderPass->addRenderState(cullFront); m_es2RenderPass->addRenderState(depthTest); + m_rhiRenderPass->addRenderState(cullFront); + m_rhiRenderPass->addRenderState(depthTest); m_gl3Technique->addRenderPass(m_gl3RenderPass); m_gl2Technique->addRenderPass(m_gl2RenderPass); m_es2Technique->addRenderPass(m_es2RenderPass); + m_rhiTechnique->addRenderPass(m_rhiRenderPass); m_effect->addTechnique(m_gl3Technique); m_effect->addTechnique(m_gl2Technique); m_effect->addTechnique(m_es2Technique); + m_effect->addTechnique(m_rhiTechnique); m_material->setEffect(m_effect); m_material->addParameter(m_gammaStrengthParameter); @@ -253,7 +269,7 @@ void QSkyboxEntity::setBaseName(const QString &baseName) } } /*! - \property QSkyboxEntity::baseName + \property Qt3DExtras::QSkyboxEntity::baseName Contains the base name of the Skybox. */ @@ -285,7 +301,7 @@ void QSkyboxEntity::setExtension(const QString &extension) } /*! - \property QSkyboxEntity::extension + \property Qt3DExtras::QSkyboxEntity::extension Contains the extension of the filename for the skybox image, including the leading '.'. @@ -336,7 +352,7 @@ bool QSkyboxEntity::isGammaCorrectEnabled() const } // namespace Qt3DExtras /*! - \property QSkyboxEntity::gammaCorrect + \property Qt3DExtras::QSkyboxEntity::gammaCorrect A boolean indicating whether gamma correction is enabled. \since 5.9 diff --git a/src/extras/defaults/qskyboxentity_p.h b/src/extras/defaults/qskyboxentity_p.h index 70222b4dc..a335d472e 100644 --- a/src/extras/defaults/qskyboxentity_p.h +++ b/src/extras/defaults/qskyboxentity_p.h @@ -56,13 +56,16 @@ class QSkyboxEntityPrivate : public Qt3DCore::QEntityPrivate Qt3DRender::QTextureLoader *m_loadedTexture; Qt3DRender::QShaderProgram *m_gl3Shader; Qt3DRender::QShaderProgram *m_gl2es2Shader; + Qt3DRender::QShaderProgram *m_rhiShader; Qt3DRender::QTechnique *m_gl2Technique; Qt3DRender::QTechnique *m_es2Technique; Qt3DRender::QTechnique *m_gl3Technique; + Qt3DRender::QTechnique *m_rhiTechnique; Qt3DRender::QFilterKey *m_filterKey; Qt3DRender::QRenderPass *m_gl2RenderPass; Qt3DRender::QRenderPass *m_es2RenderPass; Qt3DRender::QRenderPass *m_gl3RenderPass; + Qt3DRender::QRenderPass *m_rhiRenderPass; QCuboidMesh *m_mesh; Qt3DRender::QParameter *m_gammaStrengthParameter; Qt3DRender::QParameter *m_textureParameter; diff --git a/src/extras/defaults/qspritegrid.cpp b/src/extras/defaults/qspritegrid.cpp index f916c31a2..f0f09f1b2 100644 --- a/src/extras/defaults/qspritegrid.cpp +++ b/src/extras/defaults/qspritegrid.cpp @@ -8,10 +8,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteGridPrivate::QSpriteGridPrivate() : QAbstractSpriteSheetPrivate() , m_numColumns(1) diff --git a/src/extras/defaults/qspritesheet.cpp b/src/extras/defaults/qspritesheet.cpp index 89f54687f..ed20fda1e 100644 --- a/src/extras/defaults/qspritesheet.cpp +++ b/src/extras/defaults/qspritesheet.cpp @@ -9,10 +9,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteSheetPrivate::QSpriteSheetPrivate() : QAbstractSpriteSheetPrivate() { diff --git a/src/extras/defaults/qspritesheetitem.cpp b/src/extras/defaults/qspritesheetitem.cpp index 04df89dfc..85733a84d 100644 --- a/src/extras/defaults/qspritesheetitem.cpp +++ b/src/extras/defaults/qspritesheetitem.cpp @@ -6,10 +6,11 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DCore; namespace Qt3DExtras { +using namespace Qt3DCore; + QSpriteSheetItemPrivate::QSpriteSheetItemPrivate() : QNodePrivate() , m_x(0) diff --git a/src/extras/defaults/qspritesheetitem_p.h b/src/extras/defaults/qspritesheetitem_p.h index 0f9070d2e..a885f48ed 100644 --- a/src/extras/defaults/qspritesheetitem_p.h +++ b/src/extras/defaults/qspritesheetitem_p.h @@ -1,8 +1,8 @@ // Copyright (C) 2017 Klaralvdalens Datakonsult AB (KDAB). // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only -#ifndef QT3DEXTRAS_QSPRITESHEET_P_H -#define QT3DEXTRAS_QSPRITESHEET_P_H +#ifndef QT3DEXTRAS_QSPRITESHEETITEM_P_H +#define QT3DEXTRAS_QSPRITESHEETITEM_P_H // // W A R N I N G @@ -39,5 +39,5 @@ class QSpriteSheetItemPrivate: public Qt3DCore::QNodePrivate QT_END_NAMESPACE -#endif // QT3DEXTRAS_QSPRITESHEET_P_H +#endif // QT3DEXTRAS_QSPRITESHEETITEM_P_H diff --git a/src/extras/defaults/qt3dwindow.cpp b/src/extras/defaults/qt3dwindow.cpp index 19186978e..689a0e37e 100644 --- a/src/extras/defaults/qt3dwindow.cpp +++ b/src/extras/defaults/qt3dwindow.cpp @@ -222,11 +222,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept } else if (userRequestedApi == QByteArrayLiteral("null")) { api = Qt3DRender::API::Null; } else if (userRequestedApi == QByteArrayLiteral("auto")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) api = Qt3DRender::API::RHI; -#else - api = Qt3DRender::API::OpenGL; -#endif } } @@ -235,7 +231,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept // backend is in use will get a valid value. bool useRhi = false; if (qEnvironmentVariableIsEmpty("QT3D_RENDERER")) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) && QT_CONFIG(qt3d_rhi_renderer) +#if QT_CONFIG(qt3d_rhi_renderer) qputenv("QT3D_RENDERER", "rhi"); #else qputenv("QT3D_RENDERER", "opengl"); @@ -268,7 +264,7 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept break; case Qt3DRender::API::DirectX: qputenv("QSG_RHI_BACKEND", "d3d11"); - window->setSurfaceType(QSurface::OpenGLSurface); + window->setSurfaceType(QSurface::Direct3DSurface); break; case Qt3DRender::API::Null: qputenv("QSG_RHI_BACKEND", "null"); @@ -304,13 +300,11 @@ void setupWindowSurface(QWindow *window, Qt3DRender::API api) noexcept format.setProfile(QSurfaceFormat::CoreProfile); } #endif - } else { - // This is used for RHI - format.setVersion(1, 0); } format.setDepthBufferSize(24); - format.setSamples(4); + if (!QSurfaceFormat::defaultFormat().stereo()) + format.setSamples(4); format.setStencilBufferSize(8); window->setFormat(format); QSurfaceFormat::setDefaultFormat(format); diff --git a/src/extras/defaults/qtexturematerial.cpp b/src/extras/defaults/qtexturematerial.cpp index 1fd5a525f..d81aab5f9 100644 --- a/src/extras/defaults/qtexturematerial.cpp +++ b/src/extras/defaults/qtexturematerial.cpp @@ -19,10 +19,10 @@ QT_BEGIN_NAMESPACE -using namespace Qt3DRender; - namespace Qt3DExtras { +using namespace Qt3DRender; + QTextureMaterialPrivate::QTextureMaterialPrivate() : QMaterialPrivate() , m_textureEffect(new QEffect) @@ -178,7 +178,7 @@ QTextureMaterial::~QTextureMaterial() } /*! - \property QTextureMaterial::texture + \property Qt3DExtras::QTextureMaterial::texture Holds the current texture used by the material. */ @@ -189,7 +189,7 @@ QAbstractTexture *QTextureMaterial::texture() const } /*! - \property QTextureMaterial::textureOffset + \property Qt3DExtras::QTextureMaterial::textureOffset This is a utility property. It sets the translation component of the general texture transform matrix @@ -204,7 +204,7 @@ QVector2D QTextureMaterial::textureOffset() const /*! - \property QTextureMaterial::textureTransform + \property Qt3DExtras::QTextureMaterial::textureTransform Holds the current texture transform. It is applied to texture coordinates at render time. Defaults to identity matrix. @@ -238,7 +238,7 @@ void QTextureMaterial::setTextureTransform(const QMatrix3x3 &matrix) } /*! - \property QTextureMaterial::alphaBlending + \property Qt3DExtras::QTextureMaterial::alphaBlending Indicates if the alpha information coming from the diffuse property will be taken into account during rendering. Defaults to false. |