Skip to content

Commit dcdd2e1

Browse files
committed
Merge branch 'release-1.0.x'
2 parents 5a7071d + d076e47 commit dcdd2e1

File tree

13 files changed

+392
-11
lines changed

13 files changed

+392
-11
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
Version History
22
---------------
33

4+
### Open VKL 1.0.1
5+
6+
- Fixed issue in `structuredRegular` and `vdb` interval iterators that could
7+
lead to erroneous initial intervals for certain ray inputs
8+
- Fixed handling of `intervalResolutionHint` interval iterator context
9+
parameter for `amr`, `particle`, and `unstructured` volumes with small
10+
numbers of cells / primitives
11+
412
### Open VKL 1.0.0
513

614
- The version 1.0 release marks long term API stability (until v2.0)

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)
1919

2020
## Establish project ##
2121

22-
project(openvkl VERSION 1.0.0 LANGUAGES C CXX)
22+
project(openvkl VERSION 1.0.1 LANGUAGES C CXX)
2323

2424
## Add openvkl specific macros ##
2525

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Intel® Open Volume Kernel Library
22

3-
This is release v1.0.0 of Intel® Open VKL. For changes and new features
3+
This is release v1.0.1 of Intel® Open VKL. For changes and new features
44
see the [changelog](CHANGELOG.md). Visit http://www.openvkl.org for more
55
information.
66

@@ -33,6 +33,14 @@ example renderers to demonstrate how to best use the Open VKL API.
3333

3434
## Version History
3535

36+
### Open VKL 1.0.1
37+
38+
- Fixed issue in `structuredRegular` and `vdb` interval iterators that
39+
could lead to erroneous initial intervals for certain ray inputs
40+
- Fixed handling of `intervalResolutionHint` interval iterator context
41+
parameter for `amr`, `particle`, and `unstructured` volumes with
42+
small numbers of cells / primitives
43+
3644
### Open VKL 1.0.0
3745

3846
- The version 1.0 release marks long term API stability (until v2.0)

examples/interactive/vklExamples.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,8 @@ void usage(const char *progname)
249249
"\t-motionBlur structured | unstructured (structuredRegular and vdb)\n"
250250
"\t-filter nearest | trilinear (structured and vdb) | tricubic "
251251
"(structured and vdb)\n"
252-
"\t-field wavelet | xyz | sphere | <vdb grid name>\n"
252+
"\t-field wavelet | xyz | sphere | torus (vdb float only) | <vdb grid "
253+
"name>\n"
253254
"\t-file <filename>\n"
254255
"\t-numParticles <N> (particle only)\n"
255256
"\t-disable-vsync\n"
@@ -912,6 +913,8 @@ void setupVolume(ViewerParams &params,
912913
params.filter,
913914
temporalConfig,
914915
numAttributes);
916+
} else if (params.field == "torus") {
917+
testingVolume = std::make_shared<TestingVdbTorusVolume>();
915918
} else {
916919
testingVolume =
917920
std::make_shared<WaveletVdbVolumeFloat>(getOpenVKLDevice(),

gitlab/.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
variables:
55
GIT_DEPTH: "15"
66
KW_PROJECT_NAME: openvkl
7-
OPENVKL_RELEASE_PACKAGE_VERSION: "1.0.0"
7+
OPENVKL_RELEASE_PACKAGE_VERSION: "1.0.1"
88
MACOSX_DEPLOYMENT_TARGET: "10.13"
99

1010
stages:

openvkl/devices/cpu/iterator/IteratorContext.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,17 @@ namespace openvkl {
7171
const float defaultRangeBegin = 0.45f;
7272
const float defaultRangeEnd = 0.55f;
7373

74-
for (int i = 0; i <= defaultDepth; i++) {
75-
float f = float(i) / float(defaultDepth) * defaultRangeBegin;
76-
hintToDepth.emplace_back(f, i);
74+
// mapping defined for intervalResolutionHint in [0, defaultRangeBegin]
75+
if (defaultDepth == 0) {
76+
hintToDepth.emplace_back(0.f, 0);
77+
} else {
78+
for (int i = 0; i <= defaultDepth; i++) {
79+
float f = float(i) / float(defaultDepth) * defaultRangeBegin;
80+
hintToDepth.emplace_back(f, i);
81+
}
7782
}
7883

84+
// mapping defined for intervalResolutionHint in [defaultRangeEnd, 1)
7985
for (int i = defaultDepth + 1; i <= bvhDepth - 1; i++) {
8086
float f = defaultRangeEnd + float(i - (defaultDepth + 1)) /
8187
float(bvhDepth - (defaultDepth + 1)) *
@@ -84,6 +90,7 @@ namespace openvkl {
8490
hintToDepth.emplace_back(f, i);
8591
}
8692

93+
// mapping defined for intervalResolutionHint == 1
8794
hintToDepth.emplace_back(1.f, bvhDepth);
8895
}
8996

openvkl/devices/cpu/math/math_utility.ih

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
inline uniform float divide_safe(uniform float f)
77
{
8-
return 1.f / ((abs(f) < 1e-8f) ? 1e-8f : f);
8+
return 1.f / ((abs(f) < 1e-8f) ? (f >= 0.f ? 1e-8f : -1e-8f) : f);
99
}
1010

1111
inline varying float divide_safe(varying float f)
1212
{
13-
return 1.f / ((abs(f) < 1e-8f) ? 1e-8f : f);
13+
return 1.f / ((abs(f) < 1e-8f) ? (f >= 0.f ? 1e-8f : -1e-8f) : f);
1414
}

testing/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
add_library(openvkl_testing STATIC
55
apps/AppInit.cpp
6+
volume/TestingVdbTorusVolume.cpp
67
)
78

89
target_link_libraries(openvkl_testing PUBLIC

testing/apps/tests/vdb_volume.cpp

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
using namespace openvkl;
1010

11+
using openvkl::testing::TestingVdbTorusVolume;
1112
using openvkl::testing::WaveletVdbVolumeFloat;
1213
using openvkl::testing::XYZVdbVolumeFloat;
1314

@@ -276,7 +277,8 @@ TEST_CASE("VDB volume sampling", "[volume_sampling]")
276277
vklCommit(vklSampler);
277278
const vec3i step(2);
278279

279-
// tricubic support span; ignore coordinates here since they will interpolate with background
280+
// tricubic support span; ignore coordinates here since they will
281+
// interpolate with background
280282
const int lowerSpan = 1;
281283
const int upperSpan = 2;
282284

@@ -399,7 +401,8 @@ TEST_CASE("VDB volume sampling", "[volume_sampling]")
399401
vklCommit(vklSampler);
400402
const vec3i step(2);
401403

402-
// tricubic support span; ignore coordinates here since they will interpolate with background
404+
// tricubic support span; ignore coordinates here since they will
405+
// interpolate with background
403406
const int lowerSpan = 1;
404407
const int upperSpan = 2;
405408

@@ -828,3 +831,79 @@ TEST_CASE("VDB volume strides", "[volume_strides]")
828831

829832
shutdownOpenVKL();
830833
}
834+
835+
TEST_CASE("VDB volume special cases", "[interval_iterators]")
836+
{
837+
initializeOpenVKL();
838+
839+
SECTION("torus interval iteration")
840+
{
841+
TestingVdbTorusVolume *volume = nullptr;
842+
REQUIRE_NOTHROW(volume = new TestingVdbTorusVolume());
843+
844+
VKLVolume vklVolume = volume->getVKLVolume(getOpenVKLDevice());
845+
846+
VKLSampler sampler = vklNewSampler(vklVolume);
847+
vklCommit(sampler);
848+
849+
VKLIntervalIteratorContext intervalContext =
850+
vklNewIntervalIteratorContext(sampler);
851+
vklCommit(intervalContext);
852+
853+
std::vector<char> buffer(vklGetIntervalIteratorSize(intervalContext));
854+
855+
// failure case found from OSPRay
856+
{
857+
// intbits() representation of ray
858+
const uint32_t rayOrigin[] = {1112900070, 1116163650, 1103628776};
859+
const uint32_t rayDirection[] = {1081551625, 1098411576, 2984533223};
860+
861+
const vkl_range1f rayTRange = {0.f, inf};
862+
const float time = 0.f;
863+
864+
VKLIntervalIterator intervalIterator =
865+
vklInitIntervalIterator(intervalContext,
866+
(vkl_vec3f *)&rayOrigin,
867+
(vkl_vec3f *)&rayDirection,
868+
&rayTRange,
869+
time,
870+
buffer.data());
871+
872+
int numIntervalsFound = 0;
873+
VKLInterval prevInterval;
874+
875+
while (true) {
876+
VKLInterval interval;
877+
int result = vklIterateInterval(intervalIterator, &interval);
878+
if (!result)
879+
break;
880+
881+
INFO("tRange = " << interval.tRange.lower << " "
882+
<< interval.tRange.upper
883+
<< "\nvalueRange = " << interval.valueRange.lower
884+
<< " " << interval.valueRange.upper
885+
<< "\nnominalDeltaT = " << interval.nominalDeltaT);
886+
887+
REQUIRE(interval.tRange.lower >= 0.f);
888+
REQUIRE(interval.tRange.upper >= 0.f);
889+
REQUIRE(interval.tRange.upper > interval.tRange.lower);
890+
891+
if (numIntervalsFound > 0) {
892+
REQUIRE(interval.tRange.lower == prevInterval.tRange.upper);
893+
}
894+
895+
numIntervalsFound++;
896+
prevInterval = interval;
897+
}
898+
899+
REQUIRE(numIntervalsFound > 0);
900+
}
901+
902+
vklRelease(intervalContext);
903+
vklRelease(sampler);
904+
905+
REQUIRE_NOTHROW(delete volume);
906+
}
907+
908+
shutdownOpenVKL();
909+
}

testing/openvkl_testing.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@
1717
#include "volume/RawHFileStructuredVolume.h"
1818
#include "volume/TestingStructuredVolumeMulti.h"
1919
#include "volume/TestingUnstructuredMixedSimple.h"
20+
#include "volume/TestingVdbTorusVolume.h"

0 commit comments

Comments
 (0)