diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2014-10-13 15:55:32 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2014-10-14 08:56:31 +0300 |
commit | 4f70d3777e036f131cf8d39e1072b276132e32a1 (patch) | |
tree | 26b47c5af111f5b4f0c5cf9771a86659a3319e3a /tests | |
parent | 631d9bead3aac19bcc5bdbd79df54e7aa216ecff (diff) |
Fix gradient artifacts on some edge cases
When static optimization is in use with mesh objects and range
gradient, and the object Y-value resolves into a texture coordinate
that is exactly on the texel boundary, the rendered fragments
of the object are not all same colors on some graphics cards,
despite all vertices having the same UV value.
Fixed by adjusting the Y-value slightly if it is close to the
boundary.
Task-number: QTRD-3370
Change-Id: Ie028602cbd9a00bb0e17049eb8f40feb8b18a6bf
Reviewed-by: Tomi Korpipää <tomi.korpipaa@digia.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/scattertest/scatterchart.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/scattertest/scatterchart.cpp b/tests/scattertest/scatterchart.cpp index c7b93c32..e5a7acc3 100644 --- a/tests/scattertest/scatterchart.cpp +++ b/tests/scattertest/scatterchart.cpp @@ -723,8 +723,21 @@ void ScatterDataModifier::changeBunch() if (m_targetSeries->dataProxy()->array()->size()) { int amount = qMin(m_targetSeries->dataProxy()->array()->size(), 100); QScatterDataArray items(amount); - for (int i = 0; i < items.size(); i++) + for (int i = 0; i < items.size(); i++) { items[i].setPosition(randVector()); + // Change the Y-values of first few items to exact gradient boundaries + if (i == 0) + items[i].setY(0.65f); + else if (i == 1) + items[i].setY(0.1f); + else if (i == 2) + items[i].setY(-0.45f); + else if (i == 3) + items[i].setY(-1.0f); + else if (i == 4) + items[i].setY(1.2f); + } + m_targetSeries->dataProxy()->setItems(0, items); qDebug() << m_loopCounter << "Changed bunch, array size:" << m_targetSeries->dataProxy()->array()->size(); } |