summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-25 03:01:56 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-12-25 03:01:56 +0100
commit59c18801b129ee81487ebd842641cecd0ce18508 (patch)
treed21482daf90ad75897b1957090de35b92bd41976 /src
parentcc4c126d29e43c51e16a1c3fdcc0c7987e84ee42 (diff)
parent080f9d0b99b0d2e7e179a41d901096e595000448 (diff)
Merge remote-tracking branch 'origin/5.12' into dev
Diffstat (limited to 'src')
-rw-r--r--src/core/transforms/qskeletonloader.cpp1
-rw-r--r--src/quick3d/imports/scene3d/importsscene3d.pro1
-rw-r--r--src/quick3d/imports/scene3d/scene3ditem.cpp14
-rw-r--r--src/render/lights/qenvironmentlight.cpp50
-rw-r--r--src/render/lights/qenvironmentlight.h2
-rw-r--r--src/render/lights/qenvironmentlight_p.h3
-rw-r--r--src/render/texture/qtexture.cpp8
-rw-r--r--src/render/texture/qtexturedata.cpp2
-rw-r--r--src/render/texture/qtextureimagedata.cpp2
-rw-r--r--src/render/texture/texture_p.h2
-rw-r--r--src/src.pro1
11 files changed, 75 insertions, 11 deletions
diff --git a/src/core/transforms/qskeletonloader.cpp b/src/core/transforms/qskeletonloader.cpp
index a917252d9..d5296ecc9 100644
--- a/src/core/transforms/qskeletonloader.cpp
+++ b/src/core/transforms/qskeletonloader.cpp
@@ -124,6 +124,7 @@ void QSkeletonLoaderPrivate::setStatus(QSkeletonLoader::Status status)
\property Qt3DCore::QSkeletonLoader::createJointsEnabled
\brief A boolean to indicate whether createJoints is enabled or not.
+*/
/*!
Constructs a new QSkeletonLoader with \a parent.
*/
diff --git a/src/quick3d/imports/scene3d/importsscene3d.pro b/src/quick3d/imports/scene3d/importsscene3d.pro
index cf8d7cacf..a8ad8f417 100644
--- a/src/quick3d/imports/scene3d/importsscene3d.pro
+++ b/src/quick3d/imports/scene3d/importsscene3d.pro
@@ -7,6 +7,7 @@ QT += qml quick 3dcore 3drender 3drender-private
qtConfig(qt3d-input): QT += 3dinput
qtConfig(qt3d-logic): QT += 3dlogic
+qtConfig(qt3d-animation): QT += 3danimation
# Qt3D is free of Q_FOREACH - make sure it stays that way:
DEFINES += QT_NO_FOREACH
diff --git a/src/quick3d/imports/scene3d/scene3ditem.cpp b/src/quick3d/imports/scene3d/scene3ditem.cpp
index ddb25777c..ffb1d9112 100644
--- a/src/quick3d/imports/scene3d/scene3ditem.cpp
+++ b/src/quick3d/imports/scene3d/scene3ditem.cpp
@@ -52,6 +52,10 @@
#include <Qt3DLogic/qlogicaspect.h>
#endif
+#if QT_CONFIG(qt3d_animation)
+#include <Qt3DAnimation/qanimationaspect.h>
+#endif
+
#include <Qt3DRender/QRenderAspect>
#include <Qt3DRender/qcamera.h>
#include <Qt3DRender/qrendersurfaceselector.h>
@@ -169,7 +173,15 @@ void Scene3DItem::setAspects(const QStringList &aspects)
m_aspectEngine->registerAspect(new Qt3DLogic::QLogicAspect);
continue;
#else
- qFatal("Scene3D requested the Qt 3D input aspect but Qt 3D wasn't configured to build the Qt 3D Input aspect");
+ qFatal("Scene3D requested the Qt 3D logic aspect but Qt 3D wasn't configured to build the Qt 3D Logic aspect");
+#endif
+ }
+ if (aspect == QLatin1String("animation")) {
+#if QT_CONFIG(qt3d_animation)
+ m_aspectEngine->registerAspect(new Qt3DAnimation::QAnimationAspect);
+ continue;
+#else
+ qFatal("Scene3D requested the Qt 3D animation aspect but Qt 3D wasn't configured to build the Qt 3D Animation aspect");
#endif
}
m_aspectEngine->registerAspect(aspect);
diff --git a/src/render/lights/qenvironmentlight.cpp b/src/render/lights/qenvironmentlight.cpp
index a094af7b2..866905fb6 100644
--- a/src/render/lights/qenvironmentlight.cpp
+++ b/src/render/lights/qenvironmentlight.cpp
@@ -40,6 +40,7 @@
#include "qenvironmentlight.h"
#include "qenvironmentlight_p.h"
#include "qabstracttexture.h"
+#include <QVector3D>
QT_BEGIN_NAMESPACE
@@ -65,6 +66,23 @@ QEnvironmentLightPrivate::~QEnvironmentLightPrivate()
{
}
+void QEnvironmentLightPrivate::_q_updateEnvMapsSize()
+{
+ QVector3D irradianceSize;
+ if (m_irradiance != nullptr)
+ irradianceSize = QVector3D(m_irradiance->width(),
+ m_irradiance->height(),
+ m_irradiance->depth());
+ m_shaderData->setProperty("irradianceSize", QVariant::fromValue(irradianceSize));
+
+ QVector3D specularSize;
+ if (m_specular != nullptr)
+ specularSize = QVector3D(m_specular->width(),
+ m_specular->height(),
+ m_specular->depth());
+ m_shaderData->setProperty("specularSize", QVariant::fromValue(specularSize));
+}
+
Qt3DCore::QNodeCreatedChangeBasePtr QEnvironmentLight::createNodeCreationChange() const
{
auto creationChange = Qt3DCore::QNodeCreatedChangePtr<QEnvironmentLightData>::create(this);
@@ -148,17 +166,26 @@ void QEnvironmentLight::setIrradiance(QAbstractTexture *i)
if (irradiance() == i)
return;
- if (irradiance())
- d->unregisterDestructionHelper(irradiance());
+ if (irradiance()) {
+ d->unregisterDestructionHelper(d->m_irradiance);
+ QObject::disconnect(d->m_irradiance, SIGNAL(widthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::disconnect(d->m_irradiance, SIGNAL(heightChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::disconnect(d->m_irradiance, SIGNAL(depthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ }
if (i && !i->parent())
i->setParent(this);
d->m_irradiance = i;
d->m_shaderData->setProperty("irradiance", QVariant::fromValue(i));
+ d->_q_updateEnvMapsSize();
- if (i)
+ if (i) {
d->registerDestructionHelper(i, &QEnvironmentLight::setIrradiance, i);
+ QObject::connect(d->m_irradiance, SIGNAL(widthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::connect(d->m_irradiance, SIGNAL(heightChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::connect(d->m_irradiance, SIGNAL(depthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ }
emit irradianceChanged(i);
}
@@ -169,17 +196,26 @@ void QEnvironmentLight::setSpecular(QAbstractTexture *s)
if (specular() == s)
return;
- if (irradiance())
- d->unregisterDestructionHelper(specular());
+ if (specular()) {
+ d->unregisterDestructionHelper(d->m_specular);
+ QObject::disconnect(d->m_specular, SIGNAL(widthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::disconnect(d->m_specular, SIGNAL(heightChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::disconnect(d->m_specular, SIGNAL(depthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ }
if (s && !s->parent())
s->setParent(this);
d->m_specular = s;
d->m_shaderData->setProperty("specular", QVariant::fromValue(s));
+ d->_q_updateEnvMapsSize();
- if (s)
+ if (s) {
d->registerDestructionHelper(s, &QEnvironmentLight::setSpecular, s);
+ QObject::connect(d->m_specular, SIGNAL(widthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::connect(d->m_specular, SIGNAL(heightChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ QObject::connect(d->m_specular, SIGNAL(depthChanged(int)), this, SLOT(_q_updateEnvMapsSize()));
+ }
emit specularChanged(s);
}
@@ -187,3 +223,5 @@ void QEnvironmentLight::setSpecular(QAbstractTexture *s)
} // namespace Qt3DRender
QT_END_NAMESPACE
+
+#include "moc_qenvironmentlight.cpp"
diff --git a/src/render/lights/qenvironmentlight.h b/src/render/lights/qenvironmentlight.h
index c3d180233..995768d3c 100644
--- a/src/render/lights/qenvironmentlight.h
+++ b/src/render/lights/qenvironmentlight.h
@@ -77,6 +77,8 @@ Q_SIGNALS:
private:
Q_DECLARE_PRIVATE(QEnvironmentLight)
Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const override;
+
+ Q_PRIVATE_SLOT(d_func(), void _q_updateEnvMapsSize())
};
} // namespace Qt3DRender
diff --git a/src/render/lights/qenvironmentlight_p.h b/src/render/lights/qenvironmentlight_p.h
index 02358dafc..f4fa97b5a 100644
--- a/src/render/lights/qenvironmentlight_p.h
+++ b/src/render/lights/qenvironmentlight_p.h
@@ -72,6 +72,9 @@ public:
QShaderData *m_shaderData;
QAbstractTexture *m_irradiance;
QAbstractTexture *m_specular;
+
+private:
+ void _q_updateEnvMapsSize();
};
struct QEnvironmentLightData
diff --git a/src/render/texture/qtexture.cpp b/src/render/texture/qtexture.cpp
index 110df30e3..cf93f872f 100644
--- a/src/render/texture/qtexture.cpp
+++ b/src/render/texture/qtexture.cpp
@@ -317,6 +317,12 @@ const struct FourCCFormat
{ DdsFourCC<'D','X','T','5'>::value, { QOpenGLTexture::NoSourceFormat, QOpenGLTexture::RGBA_DXT5, QOpenGLTexture::NoPixelType, 16, true } },
{ DdsFourCC<'A','T','I','1'>::value, { QOpenGLTexture::NoSourceFormat, QOpenGLTexture::R_ATI1N_UNorm, QOpenGLTexture::NoPixelType, 8, true } },
{ DdsFourCC<'A','T','I','2'>::value, { QOpenGLTexture::NoSourceFormat, QOpenGLTexture::RG_ATI2N_UNorm, QOpenGLTexture::NoPixelType, 16, true } },
+{ /* DXGI_FORMAT_R16_FLOAT */ 111, { QOpenGLTexture::Red, QOpenGLTexture::R16F, QOpenGLTexture::Float16, 2, false } },
+{ /* DXGI_FORMAT_R16_FLOAT */ 112, { QOpenGLTexture::RG, QOpenGLTexture::RG16F, QOpenGLTexture::Float16, 4, false } },
+{ /* DXGI_FORMAT_R16G16B16A16_FLOAT */113, { QOpenGLTexture::RGBA, QOpenGLTexture::RGBA16F, QOpenGLTexture::Float16, 8, false } },
+{ /* DXGI_FORMAT_R32_FLOAT */ 114, { QOpenGLTexture::Red, QOpenGLTexture::R32F, QOpenGLTexture::Float32, 4, false } },
+{ /* DXGI_FORMAT_R32G32_FLOAT */ 115, { QOpenGLTexture::RG, QOpenGLTexture::RG32F, QOpenGLTexture::Float32, 8, false } },
+{ /* DXGI_FORMAT_R32G32B32A32_FLOAT */116, { QOpenGLTexture::RGBA, QOpenGLTexture::RGBA32F, QOpenGLTexture::Float32, 16, false } }
};
const struct DX10Format
@@ -1413,7 +1419,7 @@ QTextureFromSourceGenerator::QTextureFromSourceGenerator(QTextureLoader *texture
, m_mirrored()
, m_texture(textureId)
, m_engine(engine)
- , m_format(QAbstractTexture::RGBA8_UNorm)
+ , m_format(QAbstractTexture::NoFormat)
{
Q_ASSERT(textureLoader);
diff --git a/src/render/texture/qtexturedata.cpp b/src/render/texture/qtexturedata.cpp
index b7bb75242..ac4ca80c0 100644
--- a/src/render/texture/qtexturedata.cpp
+++ b/src/render/texture/qtexturedata.cpp
@@ -57,7 +57,7 @@ class QTextureDataPrivate
{
public:
QAbstractTexture::Target m_target;
- QAbstractTexture::TextureFormat m_format;
+ QAbstractTexture::TextureFormat m_format = QAbstractTexture::NoFormat;
int m_width = 0;
int m_height = 0;
int m_depth = 0;
diff --git a/src/render/texture/qtextureimagedata.cpp b/src/render/texture/qtextureimagedata.cpp
index c31f272a8..bf43a6e16 100644
--- a/src/render/texture/qtextureimagedata.cpp
+++ b/src/render/texture/qtextureimagedata.cpp
@@ -55,7 +55,7 @@ QTextureImageDataPrivate::QTextureImageDataPrivate()
, m_mipLevels(-1)
, m_blockSize(-1)
, m_target(QOpenGLTexture::Target2D)
- , m_format(QOpenGLTexture::RGBA8_UNorm)
+ , m_format(QOpenGLTexture::NoFormat)
, m_pixelFormat(QOpenGLTexture::RGBA)
, m_pixelType(QOpenGLTexture::UInt8)
, m_isCompressed(false)
diff --git a/src/render/texture/texture_p.h b/src/render/texture/texture_p.h
index 705d86e68..c60e90181 100644
--- a/src/render/texture/texture_p.h
+++ b/src/render/texture/texture_p.h
@@ -84,7 +84,7 @@ struct TextureProperties
int mipLevels = 1;
int samples = 1;
QAbstractTexture::Target target = QAbstractTexture::Target2D;
- QAbstractTexture::TextureFormat format = QAbstractTexture::RGBA8_UNorm;
+ QAbstractTexture::TextureFormat format = QAbstractTexture::NoFormat;
bool generateMipMaps = false;
QAbstractTexture::Status status = QAbstractTexture::None;
diff --git a/src/src.pro b/src/src.pro
index c3c8d6291..853ae8fb5 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -147,6 +147,7 @@ qtHaveModule(quick) {
src_quick3d_imports_scene2d
}
qtConfig(qt3d-logic): src_quick3d_imports_scene3d.depends += src_logic
+ qtConfig(qt3d-animation): src_quick3d_imports_scene3d.depends += src_animation
}
qtConfig(qt3d-animation) {
SUBDIRS += \