aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-01-12 11:21:27 +0100
committerSamuel Fadel <samuelfadel@gmail.com>2016-01-12 11:21:27 +0100
commit3ffbef1bd65d3db07f2db4b2d16bb91095f09da4 (patch)
treede492cc41c99b35b459e17fc9abd8278cf83dcb2
parentdf657b8e4ba24c561b96e8ce48811a408474960c (diff)
VoronoiSplat: sites' vertices are uploaded as 'GL_DYNAMIC_DRAW'.
-rw-r--r--voronoisplat.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/voronoisplat.cpp b/voronoisplat.cpp
index adf144f..b6b480d 100644
--- a/voronoisplat.cpp
+++ b/voronoisplat.cpp
@@ -300,7 +300,7 @@ void VoronoiSplatTexture::updateSites()
// Update VBO with the new data
gl.glBindBuffer(GL_ARRAY_BUFFER, m_VBOs[0]);
gl.glBufferData(GL_ARRAY_BUFFER, m_sites.size() * sizeof(float),
- m_sites.data(), GL_STATIC_DRAW);
+ m_sites.data(), GL_DYNAMIC_DRAW);
// Compute DT values for the new positions
computeDT();
@@ -331,13 +331,13 @@ void VoronoiSplatTexture::computeDT()
{
int w = m_size.width(), h = m_size.height();
+ // Compute FT of the sites
std::vector<float> buf(w*h, 0.0f);
for (unsigned i = 0; i < m_sites.size(); i += 2) {
buf[int(m_sites[i + 1])*h + int(m_sites[i])] = (float) i/2 + 1;
}
-
- // Compute FT of the sites
skelft2DFT(0, buf.data(), 0, 0, w, h, w);
+
// Compute DT of the sites (from the resident FT)
skelft2DDT(buf.data(), 0, 0, w, h);