summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/qt3d/planets-qml/PlanetShadowEffectD.qml2
-rw-r--r--examples/qt3d/shadow-map-qml/AdsEffect.qml4
-rw-r--r--src/plugins/sceneparsers/gltf/gltfparser.cpp2
-rw-r--r--src/render/renderstates/qpolygonoffset.cpp18
-rw-r--r--src/render/renderstates/qpolygonoffset.h8
-rw-r--r--src/render/renderstates/renderstateset.cpp2
6 files changed, 18 insertions, 18 deletions
diff --git a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
index d1b0c6994..d4ec48090 100644
--- a/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
+++ b/examples/qt3d/planets-qml/PlanetShadowEffectD.qml
@@ -86,7 +86,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
diff --git a/examples/qt3d/shadow-map-qml/AdsEffect.qml b/examples/qt3d/shadow-map-qml/AdsEffect.qml
index 537035cdc..4f6910f63 100644
--- a/examples/qt3d/shadow-map-qml/AdsEffect.qml
+++ b/examples/qt3d/shadow-map-qml/AdsEffect.qml
@@ -92,7 +92,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
@@ -137,7 +137,7 @@ Effect {
}
renderStates: [
- PolygonOffset { scaleFactor: 4; units: 4 },
+ PolygonOffset { scaleFactor: 4; depthSteps: 4 },
DepthTest { depthFunction: DepthTest.Less }
]
},
diff --git a/src/plugins/sceneparsers/gltf/gltfparser.cpp b/src/plugins/sceneparsers/gltf/gltfparser.cpp
index 3deafa796..61d3d4d9a 100644
--- a/src/plugins/sceneparsers/gltf/gltfparser.cpp
+++ b/src/plugins/sceneparsers/gltf/gltfparser.cpp
@@ -1538,7 +1538,7 @@ QRenderState* GLTFParser::buildState(const QString& functionName, const QJsonVal
type = GL_POLYGON_OFFSET_FILL;
QPolygonOffset *polygonOffset = new QPolygonOffset;
polygonOffset->setScaleFactor((float)values.at(0).toDouble(0.0f));
- polygonOffset->setUnits((float)values.at(1).toDouble(0.0f));
+ polygonOffset->setDepthSteps((float)values.at(1).toDouble(0.0f));
return polygonOffset;
}
diff --git a/src/render/renderstates/qpolygonoffset.cpp b/src/render/renderstates/qpolygonoffset.cpp
index 73ca8f4fa..f677bd285 100644
--- a/src/render/renderstates/qpolygonoffset.cpp
+++ b/src/render/renderstates/qpolygonoffset.cpp
@@ -50,12 +50,12 @@ public:
QPolygonOffsetPrivate()
: QRenderStatePrivate(QRenderState::PolygonOffset)
, m_scaleFactor(0)
- , m_units(0)
+ , m_depthSteps(0)
{
}
float m_scaleFactor;
- float m_units;
+ float m_depthSteps;
Q_DECLARE_PUBLIC(QPolygonOffset)
};
@@ -85,18 +85,18 @@ void QPolygonOffset::setScaleFactor(float scaleFactor)
}
}
-float QPolygonOffset::units() const
+float QPolygonOffset::depthSteps() const
{
Q_D(const QPolygonOffset);
- return d->m_units;
+ return d->m_depthSteps;
}
-void QPolygonOffset::setUnits(float units)
+void QPolygonOffset::setDepthSteps(float depthSteps)
{
Q_D(QPolygonOffset);
- if (d->m_units != units) {
- d->m_units = units;
- emit unitsChanged(d->m_units);
+ if (d->m_depthSteps != depthSteps) {
+ d->m_depthSteps = depthSteps;
+ emit depthStepsChanged(d->m_depthSteps);
}
}
@@ -105,7 +105,7 @@ void QPolygonOffset::copy(const QNode *ref)
QRenderState::copy(ref);
const QPolygonOffset *refState = static_cast<const QPolygonOffset *>(ref);
d_func()->m_scaleFactor = refState->d_func()->m_scaleFactor;
- d_func()->m_units = refState->d_func()->m_units;
+ d_func()->m_depthSteps = refState->d_func()->m_depthSteps;
}
} // namespace Qt3DRender
diff --git a/src/render/renderstates/qpolygonoffset.h b/src/render/renderstates/qpolygonoffset.h
index 5c147ec8d..dbba09d88 100644
--- a/src/render/renderstates/qpolygonoffset.h
+++ b/src/render/renderstates/qpolygonoffset.h
@@ -53,21 +53,21 @@ class QT3DRENDERSHARED_EXPORT QPolygonOffset : public QRenderState
Q_OBJECT
Q_PROPERTY(float scaleFactor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged)
- Q_PROPERTY(float units READ units WRITE setUnits NOTIFY unitsChanged)
+ Q_PROPERTY(float depthSteps READ depthSteps WRITE setDepthSteps NOTIFY depthStepsChanged)
public:
explicit QPolygonOffset(Qt3DCore::QNode *parent = Q_NULLPTR);
~QPolygonOffset();
float scaleFactor() const;
- float units() const;
+ float depthSteps() const;
public Q_SLOTS:
void setScaleFactor(float scaleFactor);
- void setUnits(float units);
+ void setDepthSteps(float depthSteps);
Q_SIGNALS:
void scaleFactorChanged(float scaleFactor);
- void unitsChanged(float units);
+ void depthStepsChanged(float depthSteps);
protected:
void copy(const Qt3DCore::QNode *ref) Q_DECL_OVERRIDE;
diff --git a/src/render/renderstates/renderstateset.cpp b/src/render/renderstates/renderstateset.cpp
index 0d324b55b..fee781bd6 100644
--- a/src/render/renderstates/renderstateset.cpp
+++ b/src/render/renderstates/renderstateset.cpp
@@ -325,7 +325,7 @@ RenderStateImpl* RenderStateImpl::getOrCreateState(QRenderState *renderState)
case QRenderState::PolygonOffset: {
QPolygonOffset *polygonOffset = static_cast<QPolygonOffset *>(renderState);
return getOrCreateRenderStateImpl<PolygonOffset>(polygonOffset->scaleFactor(),
- polygonOffset->units());
+ polygonOffset->depthSteps());
}
case QRenderState::ColorMask: {
QColorMask *colorMask = static_cast<QColorMask *>(renderState);