From f87b19bd58208cc741c141dab7a1951a1e78660b Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 2 Dec 2012 14:15:34 +0100 Subject: [PATCH 1/8] Fixed build error on VS2008 --- library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h index 5775c4ba..81ddb9e5 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h +++ b/library/PolyVoxCore/include/PolyVoxCore/DefaultIsQuadNeeded.h @@ -24,7 +24,7 @@ freely, subject to the following restrictions: #ifndef __PolyVox_DefaultIsQuadNeeded_H__ #define __PolyVox_DefaultIsQuadNeeded_H__ -#include +#include "PolyVoxCore/Impl/TypeDef.h" namespace PolyVox { From 9a30fa54a532bfdc34291a1dfcad61c484ff0156 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sun, 2 Dec 2012 14:17:41 +0100 Subject: [PATCH 2/8] Fixed bug with peek function checking in wrong direction. --- library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl index 758e578d..39f51f3e 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/RawVolumeSampler.inl @@ -238,7 +238,7 @@ namespace PolyVox template VoxelType RawVolume::Sampler::peekVoxel0px1ny1nz(void) const { - if( BORDER_LOWX(this->mYPosInVolume) && BORDER_LOWZ(this->mZPosInVolume) ) + if( BORDER_LOWY(this->mYPosInVolume) && BORDER_LOWZ(this->mZPosInVolume) ) { return *(mCurrentVoxel - this->mVolume->getWidth() - this->mVolume->getWidth() * this->mVolume->getHeight()); } From 3b46aaa5d3431c185eefc78dec912f9e19ebb63d Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Thu, 22 Nov 2012 22:23:07 +0000 Subject: [PATCH 3/8] Fix LowPassFilter test The implicit default kernel size for the non-SAT version was 3 but the SAT version was using an explicit kernel of 5 which caused a discrepancy. Now just use a kernel of 3. --- tests/TestLowPassFilter.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/tests/TestLowPassFilter.cpp b/tests/TestLowPassFilter.cpp index 4ace36eb..902c26d6 100644 --- a/tests/TestLowPassFilter.cpp +++ b/tests/TestLowPassFilter.cpp @@ -58,7 +58,7 @@ void TestLowPassFilter::testExecute() RawVolume resultVolume(reg); - LowPassFilter< RawVolume, RawVolume, Density16 > lowPassfilter(&volData, reg, &resultVolume, reg, 5); + LowPassFilter< RawVolume, RawVolume, Density16 > lowPassfilter(&volData, reg, &resultVolume, reg, 3); //Test the normal implementation QBENCHMARK { @@ -74,16 +74,17 @@ void TestLowPassFilter::testExecute() QCOMPARE(resultVolume.getVoxelAt(7,7,7), Density8(4)); //Test the SAT implmentation - //FIXME - Shouldn't the results be the same as the normal case? - lowPassfilter.executeSAT(); + QBENCHMARK { + lowPassfilter.executeSAT(); + } QCOMPARE(resultVolume.getVoxelAt(0,0,0), Density8(4)); - QCOMPARE(resultVolume.getVoxelAt(1,1,1), Density8(8)); - QCOMPARE(resultVolume.getVoxelAt(2,2,2), Density8(19)); - QCOMPARE(resultVolume.getVoxelAt(3,3,3), Density8(12)); - QCOMPARE(resultVolume.getVoxelAt(4,4,4), Density8(19)); - QCOMPARE(resultVolume.getVoxelAt(5,5,5), Density8(12)); - QCOMPARE(resultVolume.getVoxelAt(6,6,6), Density8(8)); - QCOMPARE(resultVolume.getVoxelAt(7,7,7), Density8(2)); + QCOMPARE(resultVolume.getVoxelAt(1,1,1), Density8(21)); + QCOMPARE(resultVolume.getVoxelAt(2,2,2), Density8(10)); + QCOMPARE(resultVolume.getVoxelAt(3,3,3), Density8(21)); + QCOMPARE(resultVolume.getVoxelAt(4,4,4), Density8(10)); + QCOMPARE(resultVolume.getVoxelAt(5,5,5), Density8(21)); + QCOMPARE(resultVolume.getVoxelAt(6,6,6), Density8(10)); + QCOMPARE(resultVolume.getVoxelAt(7,7,7), Density8(4)); } QTEST_MAIN(TestLowPassFilter) From da77fa8432f7a3b1e18e4dd396216b4541877ba2 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 4 Dec 2012 21:57:54 +0100 Subject: [PATCH 4/8] Updated readme with some real information for BitBucket. --- README.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 9081fcb5..6c88db24 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,5 @@ PolyVox - The voxel management and manipulation library ======================================================= +PolyVox is the core technology which lies behind our games. It is a fast, lightweight C++ library for the storage and processing of volumetric (voxel-based) environments. It has applications in both games and medical/scientific visualisation, and is released under the terms of the `zlib license `_. -For installation instructions, please see INSTALL.txt +PolyVox is a relatively low-level library, and you will need experience in C++ and computer graphics/shaders to use it effectively. It is designed to be easily integrated into existing applications and is independent of your chosen graphics API. For more details please see 'this page '_ on our website. \ No newline at end of file From 7f4be2929e773021d8e6db8de12683bc3d5865b9 Mon Sep 17 00:00:00 2001 From: David Williams Date: Tue, 4 Dec 2012 22:26:39 +0100 Subject: [PATCH 5/8] Changed type of single quotes used for link. I'm not sure if this makes a difference but it's for consistency. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 6c88db24..9bf85940 100644 --- a/README.rst +++ b/README.rst @@ -2,4 +2,4 @@ PolyVox - The voxel management and manipulation library ======================================================= PolyVox is the core technology which lies behind our games. It is a fast, lightweight C++ library for the storage and processing of volumetric (voxel-based) environments. It has applications in both games and medical/scientific visualisation, and is released under the terms of the `zlib license `_. -PolyVox is a relatively low-level library, and you will need experience in C++ and computer graphics/shaders to use it effectively. It is designed to be easily integrated into existing applications and is independent of your chosen graphics API. For more details please see 'this page '_ on our website. \ No newline at end of file +PolyVox is a relatively low-level library, and you will need experience in C++ and computer graphics/shaders to use it effectively. It is designed to be easily integrated into existing applications and is independent of your chosen graphics API. For more details please see `this page `_ on our website. \ No newline at end of file From c10e992bf2b408863483408e9be373c47d13c688 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 26 Dec 2012 23:24:09 +0000 Subject: [PATCH 6/8] Fixed bug with SimpleVolume and negative positions. See commit 3f87fc780f6b60f6bf574833921bfca6 --- .../include/PolyVoxCore/SimpleVolume.inl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl index 12cee40f..f811f456 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/SimpleVolume.inl @@ -197,18 +197,28 @@ namespace PolyVox throw std::invalid_argument("Block side length must be a power of two."); } - m_uBlockSideLength = uBlockSideLength; - m_uNoOfVoxelsPerBlock = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength; + //m_uBlockSideLength = uBlockSideLength; + //m_uNoOfVoxelsPerBlock = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength; m_pUncompressedBorderData = 0; this->m_regValidRegion = regValidRegion; - m_regValidRegionInBlocks.setLowerCorner(this->m_regValidRegion.getLowerCorner() / static_cast(uBlockSideLength)); - m_regValidRegionInBlocks.setUpperCorner(this->m_regValidRegion.getUpperCorner() / static_cast(uBlockSideLength)); + //m_regValidRegionInBlocks.setLowerCorner(this->m_regValidRegion.getLowerCorner() / static_cast(uBlockSideLength)); + //m_regValidRegionInBlocks.setUpperCorner(this->m_regValidRegion.getUpperCorner() / static_cast(uBlockSideLength)); //Compute the block side length m_uBlockSideLength = uBlockSideLength; m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); + m_uNoOfVoxelsPerBlock = m_uBlockSideLength * m_uBlockSideLength * m_uBlockSideLength; + + //m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setLowerCorner(Vector3DInt32(this->m_regValidRegion.getLowerCorner().getX() >> m_uBlockSideLengthPower, this->m_regValidRegion.getLowerCorner().getY() >> m_uBlockSideLengthPower, this->m_regValidRegion.getLowerCorner().getZ() >> m_uBlockSideLengthPower)); + //m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setUpperCorner(Vector3DInt32(this->m_regValidRegion.getUpperCorner().getX() >> m_uBlockSideLengthPower, this->m_regValidRegion.getUpperCorner().getY() >> m_uBlockSideLengthPower, this->m_regValidRegion.getUpperCorner().getZ() >> m_uBlockSideLengthPower)); //Compute the size of the volume in blocks (and note +1 at the end) m_uWidthInBlocks = m_regValidRegionInBlocks.getUpperCorner().getX() - m_regValidRegionInBlocks.getLowerCorner().getX() + 1; From f0e2924c42ea5260fd453eed93e25423cf0ef98b Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Wed, 26 Dec 2012 23:39:06 +0000 Subject: [PATCH 7/8] Fixed potential bug with negative voxel positions in large volume. See commit 1f9264a --- .../include/PolyVoxCore/LargeVolume.inl | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl index 4e679477..8a6634f7 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl +++ b/library/PolyVoxCore/include/PolyVoxCore/LargeVolume.inl @@ -422,18 +422,25 @@ namespace PolyVox this->m_regValidRegion = regValidRegion; - m_regValidRegionInBlocks.setLowerCorner(this->m_regValidRegion.getLowerCorner() / static_cast(uBlockSideLength)); - m_regValidRegionInBlocks.setUpperCorner(this->m_regValidRegion.getUpperCorner() / static_cast(uBlockSideLength)); + //m_regValidRegionInBlocks.setLowerCorner(this->m_regValidRegion.getLowerCorner() / static_cast(uBlockSideLength)); + //m_regValidRegionInBlocks.setUpperCorner(this->m_regValidRegion.getUpperCorner() / static_cast(uBlockSideLength)); + //Compute the block side length + m_uBlockSideLength = uBlockSideLength; + m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); + //m_regValidRegionInBlocks.setLowerX(this->m_regValidRegion.getLowerX() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setLowerY(this->m_regValidRegion.getLowerY() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setLowerZ(this->m_regValidRegion.getLowerZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setLowerCorner(Vector3DInt32(this->m_regValidRegion.getLowerCorner().getX() >> m_uBlockSideLengthPower, this->m_regValidRegion.getLowerCorner().getY() >> m_uBlockSideLengthPower, this->m_regValidRegion.getLowerCorner().getZ() >> m_uBlockSideLengthPower)); + //m_regValidRegionInBlocks.setUpperX(this->m_regValidRegion.getUpperX() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setUpperY(this->m_regValidRegion.getUpperY() >> m_uBlockSideLengthPower); + //m_regValidRegionInBlocks.setUpperZ(this->m_regValidRegion.getUpperZ() >> m_uBlockSideLengthPower); + m_regValidRegionInBlocks.setUpperCorner(Vector3DInt32(this->m_regValidRegion.getUpperCorner().getX() >> m_uBlockSideLengthPower, this->m_regValidRegion.getUpperCorner().getY() >> m_uBlockSideLengthPower, this->m_regValidRegion.getUpperCorner().getZ() >> m_uBlockSideLengthPower)); setMaxNumberOfUncompressedBlocks(m_uMaxNumberOfUncompressedBlocks); //Clear the previous data m_pBlocks.clear(); - //Compute the block side length - m_uBlockSideLength = uBlockSideLength; - m_uBlockSideLengthPower = logBase2(m_uBlockSideLength); - //Clear the previous data m_pBlocks.clear(); From 8747c05be9694ee27898d753de1453edd27d2695 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Thu, 27 Dec 2012 00:04:40 +0000 Subject: [PATCH 8/8] Bump version number to 0.2.1 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e8bbf35..1b587ab0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,7 @@ PROJECT(PolyVox) SET(POLYVOX_VERSION_MAJOR "0") SET(POLYVOX_VERSION_MINOR "2") -SET(POLYVOX_VERSION_PATCH "0") +SET(POLYVOX_VERSION_PATCH "1") SET(POLYVOX_VERSION "${POLYVOX_VERSION_MAJOR}.${POLYVOX_VERSION_MINOR}.${POLYVOX_VERSION_PATCH}" CACHE STRING "PolyVox version") MARK_AS_ADVANCED(FORCE POLYVOX_VERSION)