summaryrefslogtreecommitdiffstats
path: root/src/extras/defaults
diff options
context:
space:
mode:
authorKevin Ottens <kevin.ottens@kdab.com>2017-02-16 11:15:54 +0100
committerKevin Ottens <kevin.ottens@kdab.com>2017-02-16 14:31:08 +0000
commitb5f76df191c10dfcd0688fc79bd3af12dbe74bbb (patch)
treecec18299bf21791a204866426aa838749b67117a /src/extras/defaults
parent0b9f985454da517b0da01cb7df09cbe1d86e04ff (diff)
Metal/Rough materials: metallic -> metalness
Rename decided during API review in order to match with roughness. Change-Id: I4b1a13e6028ba410fb31a80e6c64f9539581f8c4 Task-Id: QTBUG-58894 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/extras/defaults')
-rw-r--r--src/extras/defaults/qmetalroughmaterial.cpp20
-rw-r--r--src/extras/defaults/qmetalroughmaterial.h8
-rw-r--r--src/extras/defaults/qmetalroughmaterial_p.h2
-rw-r--r--src/extras/defaults/qtexturedmetalroughmaterial.cpp34
-rw-r--r--src/extras/defaults/qtexturedmetalroughmaterial.h8
-rw-r--r--src/extras/defaults/qtexturedmetalroughmaterial_p.h4
6 files changed, 38 insertions, 38 deletions
diff --git a/src/extras/defaults/qmetalroughmaterial.cpp b/src/extras/defaults/qmetalroughmaterial.cpp
index ee43993c9..b988e11ce 100644
--- a/src/extras/defaults/qmetalroughmaterial.cpp
+++ b/src/extras/defaults/qmetalroughmaterial.cpp
@@ -63,7 +63,7 @@ QMetalRoughMaterialPrivate::QMetalRoughMaterialPrivate()
, m_environmentIrradianceTexture(new QTexture2D())
, m_environmentSpecularTexture(new QTexture2D())
, m_baseColorParameter(new QParameter(QStringLiteral("baseColor"), QColor("grey")))
- , m_metallicParameter(new QParameter(QStringLiteral("metallic"), 0.0f))
+ , m_metalnessParameter(new QParameter(QStringLiteral("metalness"), 0.0f))
, m_roughnessParameter(new QParameter(QStringLiteral("roughness"), 0.0f))
, m_environmentIrradianceParameter(new QParameter(QStringLiteral("skyIrradiance"), m_environmentIrradianceTexture))
, m_environmentSpecularParameter(new QParameter(QStringLiteral("skySpecular"), m_environmentSpecularTexture))
@@ -90,7 +90,7 @@ void QMetalRoughMaterialPrivate::init()
{
connect(m_baseColorParameter, &Qt3DRender::QParameter::valueChanged,
this, &QMetalRoughMaterialPrivate::handleBaseColorChanged);
- connect(m_metallicParameter, &Qt3DRender::QParameter::valueChanged,
+ connect(m_metalnessParameter, &Qt3DRender::QParameter::valueChanged,
this, &QMetalRoughMaterialPrivate::handleMetallicChanged);
connect(m_roughnessParameter, &Qt3DRender::QParameter::valueChanged,
this, &QMetalRoughMaterialPrivate::handleRoughnessChanged);
@@ -118,7 +118,7 @@ void QMetalRoughMaterialPrivate::init()
m_metalRoughEffect->addTechnique(m_metalRoughGL3Technique);
m_metalRoughEffect->addParameter(m_baseColorParameter);
- m_metalRoughEffect->addParameter(m_metallicParameter);
+ m_metalRoughEffect->addParameter(m_metalnessParameter);
m_metalRoughEffect->addParameter(m_roughnessParameter);
m_metalRoughEffect->addParameter(m_environmentIrradianceParameter);
m_metalRoughEffect->addParameter(m_environmentSpecularParameter);
@@ -135,7 +135,7 @@ void QMetalRoughMaterialPrivate::handleBaseColorChanged(const QVariant &var)
void QMetalRoughMaterialPrivate::handleMetallicChanged(const QVariant &var)
{
Q_Q(QMetalRoughMaterial);
- emit q->metallicChanged(var.toFloat());
+ emit q->metalnessChanged(var.toFloat());
}
void QMetalRoughMaterialPrivate::handleRoughnessChanged(const QVariant &var)
{
@@ -204,15 +204,15 @@ QColor QMetalRoughMaterial::baseColor() const
}
/*!
- \property QMetalRoughMaterial::metallic
+ \property QMetalRoughMaterial::metalness
- Holds the current metallic level of the material, since is a value between 0 (purely dielectric, the default)
+ Holds the current metalness level of the material, since is a value between 0 (purely dielectric, the default)
and 1 (purely metallic).
*/
-float QMetalRoughMaterial::metallic() const
+float QMetalRoughMaterial::metalness() const
{
Q_D(const QMetalRoughMaterial);
- return d->m_metallicParameter->value().toFloat();
+ return d->m_metalnessParameter->value().toFloat();
}
/*!
@@ -272,10 +272,10 @@ void QMetalRoughMaterial::setBaseColor(const QColor &baseColor)
d->m_baseColorParameter->setValue(QVariant::fromValue(baseColor));
}
-void QMetalRoughMaterial::setMetallic(float metallic)
+void QMetalRoughMaterial::setMetalness(float metalness)
{
Q_D(QMetalRoughMaterial);
- d->m_metallicParameter->setValue(QVariant::fromValue(metallic));
+ d->m_metalnessParameter->setValue(QVariant::fromValue(metalness));
}
void QMetalRoughMaterial::setRoughness(float roughness)
diff --git a/src/extras/defaults/qmetalroughmaterial.h b/src/extras/defaults/qmetalroughmaterial.h
index a7fbfba59..e13d6c1e9 100644
--- a/src/extras/defaults/qmetalroughmaterial.h
+++ b/src/extras/defaults/qmetalroughmaterial.h
@@ -58,7 +58,7 @@ class QT3DEXTRASSHARED_EXPORT QMetalRoughMaterial : public Qt3DRender::QMaterial
{
Q_OBJECT
Q_PROPERTY(QColor baseColor READ baseColor WRITE setBaseColor NOTIFY baseColorChanged)
- Q_PROPERTY(float metallic READ metallic WRITE setMetallic NOTIFY metallicChanged)
+ Q_PROPERTY(float metalness READ metalness WRITE setMetalness NOTIFY metalnessChanged)
Q_PROPERTY(float roughness READ roughness WRITE setRoughness NOTIFY roughnessChanged)
Q_PROPERTY(Qt3DRender::QAbstractTexture *environmentIrradiance READ environmentIrradiance WRITE setEnvironmentIrradiance NOTIFY environmentIrradianceChanged)
Q_PROPERTY(Qt3DRender::QAbstractTexture *environmentSpecular READ environmentSpecular WRITE setEnvironmentSpecular NOTIFY environmentSpecularChanged)
@@ -68,21 +68,21 @@ public:
~QMetalRoughMaterial();
QColor baseColor() const;
- float metallic() const;
+ float metalness() const;
float roughness() const;
Qt3DRender::QAbstractTexture *environmentIrradiance() const;
Qt3DRender::QAbstractTexture *environmentSpecular() const;
public Q_SLOTS:
void setBaseColor(const QColor &baseColor);
- void setMetallic(float metallic);
+ void setMetalness(float metalness);
void setRoughness(float roughness);
void setEnvironmentIrradiance(Qt3DRender::QAbstractTexture *environmentIrradiance);
void setEnvironmentSpecular(Qt3DRender::QAbstractTexture *environmentSpecular);
Q_SIGNALS:
void baseColorChanged(const QColor &baseColor);
- void metallicChanged(float metallic);
+ void metalnessChanged(float metalness);
void roughnessChanged(float roughness);
void environmentIrradianceChanged(Qt3DRender::QAbstractTexture *environmentIrradiance);
void environmentSpecularChanged(Qt3DRender::QAbstractTexture *environmentSpecular);
diff --git a/src/extras/defaults/qmetalroughmaterial_p.h b/src/extras/defaults/qmetalroughmaterial_p.h
index e501867e1..b406df996 100644
--- a/src/extras/defaults/qmetalroughmaterial_p.h
+++ b/src/extras/defaults/qmetalroughmaterial_p.h
@@ -87,7 +87,7 @@ public:
Qt3DRender::QAbstractTexture *m_environmentIrradianceTexture;
Qt3DRender::QAbstractTexture *m_environmentSpecularTexture;
Qt3DRender::QParameter *m_baseColorParameter;
- Qt3DRender::QParameter *m_metallicParameter;
+ Qt3DRender::QParameter *m_metalnessParameter;
Qt3DRender::QParameter *m_roughnessParameter;
Qt3DRender::QParameter *m_environmentIrradianceParameter;
Qt3DRender::QParameter *m_environmentSpecularParameter;
diff --git a/src/extras/defaults/qtexturedmetalroughmaterial.cpp b/src/extras/defaults/qtexturedmetalroughmaterial.cpp
index f50bc8ab8..ea7c7b9d7 100644
--- a/src/extras/defaults/qtexturedmetalroughmaterial.cpp
+++ b/src/extras/defaults/qtexturedmetalroughmaterial.cpp
@@ -61,14 +61,14 @@ namespace Qt3DExtras {
QTexturedMetalRoughMaterialPrivate::QTexturedMetalRoughMaterialPrivate()
: QMaterialPrivate()
, m_baseColorTexture(new QTexture2D())
- , m_metallicTexture(new QTexture2D())
+ , m_metalnessTexture(new QTexture2D())
, m_roughnessTexture(new QTexture2D())
, m_ambientOcclusionTexture(new QTexture2D())
, m_normalTexture(new QTexture2D())
, m_environmentIrradianceTexture(new QTexture2D())
, m_environmentSpecularTexture(new QTexture2D())
, m_baseColorParameter(new QParameter(QStringLiteral("baseColorMap"), m_baseColorTexture))
- , m_metallicParameter(new QParameter(QStringLiteral("metallicMap"), m_metallicTexture))
+ , m_metalnessParameter(new QParameter(QStringLiteral("metalnessMap"), m_metalnessTexture))
, m_roughnessParameter(new QParameter(QStringLiteral("roughnessMap"), m_roughnessTexture))
, m_ambientOcclusionParameter(new QParameter(QStringLiteral("ambientOcclusionMap"), m_ambientOcclusionTexture))
, m_normalParameter(new QParameter(QStringLiteral("normalMap"), m_normalTexture))
@@ -86,11 +86,11 @@ QTexturedMetalRoughMaterialPrivate::QTexturedMetalRoughMaterialPrivate()
m_baseColorTexture->setGenerateMipMaps(true);
m_baseColorTexture->setMaximumAnisotropy(16.0f);
- m_metallicTexture->setMagnificationFilter(QAbstractTexture::Linear);
- m_metallicTexture->setMinificationFilter(QAbstractTexture::LinearMipMapLinear);
- m_metallicTexture->setWrapMode(QTextureWrapMode(QTextureWrapMode::Repeat));
- m_metallicTexture->setGenerateMipMaps(true);
- m_metallicTexture->setMaximumAnisotropy(16.0f);
+ m_metalnessTexture->setMagnificationFilter(QAbstractTexture::Linear);
+ m_metalnessTexture->setMinificationFilter(QAbstractTexture::LinearMipMapLinear);
+ m_metalnessTexture->setWrapMode(QTextureWrapMode(QTextureWrapMode::Repeat));
+ m_metalnessTexture->setGenerateMipMaps(true);
+ m_metalnessTexture->setMaximumAnisotropy(16.0f);
m_roughnessTexture->setMagnificationFilter(QAbstractTexture::Linear);
m_roughnessTexture->setMinificationFilter(QAbstractTexture::LinearMipMapLinear);
@@ -127,7 +127,7 @@ void QTexturedMetalRoughMaterialPrivate::init()
{
connect(m_baseColorParameter, &Qt3DRender::QParameter::valueChanged,
this, &QTexturedMetalRoughMaterialPrivate::handleBaseColorChanged);
- connect(m_metallicParameter, &Qt3DRender::QParameter::valueChanged,
+ connect(m_metalnessParameter, &Qt3DRender::QParameter::valueChanged,
this, &QTexturedMetalRoughMaterialPrivate::handleMetallicChanged);
connect(m_roughnessParameter, &Qt3DRender::QParameter::valueChanged,
this, &QTexturedMetalRoughMaterialPrivate::handleRoughnessChanged);
@@ -159,7 +159,7 @@ void QTexturedMetalRoughMaterialPrivate::init()
m_metalRoughEffect->addTechnique(m_metalRoughGL3Technique);
m_metalRoughEffect->addParameter(m_baseColorParameter);
- m_metalRoughEffect->addParameter(m_metallicParameter);
+ m_metalRoughEffect->addParameter(m_metalnessParameter);
m_metalRoughEffect->addParameter(m_roughnessParameter);
m_metalRoughEffect->addParameter(m_ambientOcclusionParameter);
m_metalRoughEffect->addParameter(m_normalParameter);
@@ -178,7 +178,7 @@ void QTexturedMetalRoughMaterialPrivate::handleBaseColorChanged(const QVariant &
void QTexturedMetalRoughMaterialPrivate::handleMetallicChanged(const QVariant &var)
{
Q_Q(QTexturedMetalRoughMaterial);
- emit q->metallicChanged(var.value<QAbstractTexture *>());
+ emit q->metalnessChanged(var.value<QAbstractTexture *>());
}
void QTexturedMetalRoughMaterialPrivate::handleRoughnessChanged(const QVariant &var)
{
@@ -268,11 +268,11 @@ QAbstractTexture *QTexturedMetalRoughMaterial::baseColor() const
}
/*!
- \property QTexturedMetalRoughMaterial::metallic
+ \property QTexturedMetalRoughMaterial::metalness
- Holds the current metallic map texture.
+ Holds the current metalness map texture.
- By default, the metallic texture has the following properties:
+ By default, the metalness texture has the following properties:
\list
\li Linear minification and magnification filters
@@ -281,10 +281,10 @@ QAbstractTexture *QTexturedMetalRoughMaterial::baseColor() const
\li Maximum anisotropy of 16.0
\endlist
*/
-QAbstractTexture *QTexturedMetalRoughMaterial::metallic() const
+QAbstractTexture *QTexturedMetalRoughMaterial::metalness() const
{
Q_D(const QTexturedMetalRoughMaterial);
- return d->m_metallicParameter->value().value<QAbstractTexture *>();
+ return d->m_metalnessParameter->value().value<QAbstractTexture *>();
}
/*!
@@ -392,10 +392,10 @@ void QTexturedMetalRoughMaterial::setBaseColor(QAbstractTexture *baseColor)
d->m_baseColorParameter->setValue(QVariant::fromValue(baseColor));
}
-void QTexturedMetalRoughMaterial::setMetallic(QAbstractTexture *metallic)
+void QTexturedMetalRoughMaterial::setMetalness(QAbstractTexture *metalness)
{
Q_D(QTexturedMetalRoughMaterial);
- d->m_metallicParameter->setValue(QVariant::fromValue(metallic));
+ d->m_metalnessParameter->setValue(QVariant::fromValue(metalness));
}
void QTexturedMetalRoughMaterial::setRoughness(QAbstractTexture *roughness)
diff --git a/src/extras/defaults/qtexturedmetalroughmaterial.h b/src/extras/defaults/qtexturedmetalroughmaterial.h
index 2a667aea8..c5c3fce33 100644
--- a/src/extras/defaults/qtexturedmetalroughmaterial.h
+++ b/src/extras/defaults/qtexturedmetalroughmaterial.h
@@ -53,7 +53,7 @@ class QT3DEXTRASSHARED_EXPORT QTexturedMetalRoughMaterial : public Qt3DRender::Q
{
Q_OBJECT
Q_PROPERTY(Qt3DRender::QAbstractTexture *baseColor READ baseColor WRITE setBaseColor NOTIFY baseColorChanged)
- Q_PROPERTY(Qt3DRender::QAbstractTexture *metallic READ metallic WRITE setMetallic NOTIFY metallicChanged)
+ Q_PROPERTY(Qt3DRender::QAbstractTexture *metalness READ metalness WRITE setMetalness NOTIFY metalnessChanged)
Q_PROPERTY(Qt3DRender::QAbstractTexture *roughness READ roughness WRITE setRoughness NOTIFY roughnessChanged)
Q_PROPERTY(Qt3DRender::QAbstractTexture *ambientOcclusion READ ambientOcclusion WRITE setAmbientOcclusion NOTIFY ambientOcclusionChanged)
Q_PROPERTY(Qt3DRender::QAbstractTexture *normal READ normal WRITE setNormal NOTIFY normalChanged)
@@ -65,7 +65,7 @@ public:
~QTexturedMetalRoughMaterial();
Qt3DRender::QAbstractTexture *baseColor() const;
- Qt3DRender::QAbstractTexture *metallic() const;
+ Qt3DRender::QAbstractTexture *metalness() const;
Qt3DRender::QAbstractTexture *roughness() const;
Qt3DRender::QAbstractTexture *ambientOcclusion() const;
Qt3DRender::QAbstractTexture *normal() const;
@@ -74,7 +74,7 @@ public:
public Q_SLOTS:
void setBaseColor(Qt3DRender::QAbstractTexture *baseColor);
- void setMetallic(Qt3DRender::QAbstractTexture *metallic);
+ void setMetalness(Qt3DRender::QAbstractTexture *metalness);
void setRoughness(Qt3DRender::QAbstractTexture *roughness);
void setAmbientOcclusion(Qt3DRender::QAbstractTexture *ambientOcclusion);
void setNormal(Qt3DRender::QAbstractTexture *normal);
@@ -83,7 +83,7 @@ public Q_SLOTS:
Q_SIGNALS:
void baseColorChanged(Qt3DRender::QAbstractTexture *baseColor);
- void metallicChanged(Qt3DRender::QAbstractTexture *metallic);
+ void metalnessChanged(Qt3DRender::QAbstractTexture *metalness);
void roughnessChanged(Qt3DRender::QAbstractTexture *roughness);
void ambientOcclusionChanged(Qt3DRender::QAbstractTexture *ambientOcclusion);
void normalChanged(Qt3DRender::QAbstractTexture *normal);
diff --git a/src/extras/defaults/qtexturedmetalroughmaterial_p.h b/src/extras/defaults/qtexturedmetalroughmaterial_p.h
index 54fdb73b2..084824304 100644
--- a/src/extras/defaults/qtexturedmetalroughmaterial_p.h
+++ b/src/extras/defaults/qtexturedmetalroughmaterial_p.h
@@ -87,14 +87,14 @@ public:
void handleEnvironmentSpecularChanged(const QVariant &var);
Qt3DRender::QAbstractTexture *m_baseColorTexture;
- Qt3DRender::QAbstractTexture *m_metallicTexture;
+ Qt3DRender::QAbstractTexture *m_metalnessTexture;
Qt3DRender::QAbstractTexture *m_roughnessTexture;
Qt3DRender::QAbstractTexture *m_ambientOcclusionTexture;
Qt3DRender::QAbstractTexture *m_normalTexture;
Qt3DRender::QAbstractTexture *m_environmentIrradianceTexture;
Qt3DRender::QAbstractTexture *m_environmentSpecularTexture;
Qt3DRender::QParameter *m_baseColorParameter;
- Qt3DRender::QParameter *m_metallicParameter;
+ Qt3DRender::QParameter *m_metalnessParameter;
Qt3DRender::QParameter *m_roughnessParameter;
Qt3DRender::QParameter *m_ambientOcclusionParameter;
Qt3DRender::QParameter *m_normalParameter;