From 3ffbef1bd65d3db07f2db4b2d16bb91095f09da4 Mon Sep 17 00:00:00 2001 From: Samuel Fadel Date: Tue, 12 Jan 2016 11:21:27 +0100 Subject: VoronoiSplat: sites' vertices are uploaded as 'GL_DYNAMIC_DRAW'. --- voronoisplat.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'voronoisplat.cpp') 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 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); -- cgit v1.2.3