Skip to content

Commit aaf2d4f

Browse files
committed
Merge branch 'release-0.11.x'
2 parents 1f8724d + 75df6cd commit aaf2d4f

File tree

187 files changed

+9326
-3643
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+9326
-3643
lines changed

CHANGELOG.md

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

4+
### Open VKL 0.11.0
5+
6+
- Introduced API support for multi-attribute volumes, including APIs for
7+
sampling multiple attributes simultaneously
8+
- Initially only `structuredRegular` and `structuredSpherical` volume
9+
types support multi-attribute data
10+
- Iterator APIs now work on sampler objects rather than volumes, supporting
11+
finer-grained configurability
12+
- Observers can now be created for both volume and sampler objects
13+
- `LeafNodeAccess` observers must now be created on sampler objects
14+
- Log and error callbacks now support a user pointer
15+
- `vdb` volume interval iterators:
16+
- Added support for elementary cell iteration when `maxIteratorDepth` is
17+
set to `VKL_VDB_NUM_LEVELS`-1
18+
- Up to 2x faster iteration
19+
- `unstructured` and `particle` volume interval iterators:
20+
- Improved interior empty space skipping behavior
21+
- Added support for configurable iterator depth via the `maxIteratorDepth`
22+
parameter
23+
- Added support for filter modes in `structuredRegular` and
24+
`structuredSpherical` volumes
25+
- `amr` volumes now support `method` parameter on sampler objects
26+
- Added new `interval_iterator_debug` renderer in `vklExamples` to visualize
27+
interval iteration behavior
28+
- Hit iterator accuracy improvements for `unstructured` volumes
29+
- Fixed bugs in `amr` and `vdb` volume bounding box computations
30+
- Fixed bug in `unstructured` volume gradient computations near empty regions
31+
- Minimum ISPC version is now v1.14.1
32+
433
### Open VKL 0.10.0 (alpha)
534

635
- Added new `particle` volume type supporting Gaussian radial basis functions

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 0.10.0 LANGUAGES C CXX)
22+
project(openvkl VERSION 0.11.0 LANGUAGES C CXX)
2323

2424
## Add openvkl specific macros ##
2525

README.md

Lines changed: 547 additions & 136 deletions
Large diffs are not rendered by default.

cmake/openvkl_ispc.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
option(OPENVKL_ISPC_FAST_MATH "enable ISPC fast-math optimizations" OFF)
55

66
# ISPC versions to look for, in decending order (newest first)
7-
set(ISPC_VERSION_WORKING "1.10.0")
7+
set(ISPC_VERSION_WORKING "1.14.1")
88
list(GET ISPC_VERSION_WORKING -1 ISPC_VERSION_REQUIRED)
99

1010
if (NOT ISPC_EXECUTABLE)

cmake/openvkl_macros.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,16 @@ function(openvkl_vdb_generate_topology)
249249
)
250250
endforeach()
251251

252+
configure_file(
253+
${PROJECT_SOURCE_DIR}/${PROJECT_NAME}/drivers/ispc/volume/vdb/VdbQueryVoxel.ih.in
254+
include/${PROJECT_NAME}_vdb/VdbQueryVoxel_${VKL_VDB_LEVEL}.ih
255+
)
256+
257+
configure_file(
258+
${PROJECT_SOURCE_DIR}/${PROJECT_NAME}/drivers/ispc/volume/vdb/HDDA.ih.in
259+
include/${PROJECT_NAME}_vdb/HDDA_${VKL_VDB_LEVEL}.ih
260+
)
261+
252262
endforeach(I)
253263

254264
endfunction()

doc/api.md

Lines changed: 363 additions & 101 deletions
Large diffs are not rendered by default.

doc/compilation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ you can build Open VKL you need the following prerequisites:
2121
have some version of OpenGL.
2222

2323
- Additionally you require a copy of the [Intel® SPMD Program Compiler
24-
(ISPC)](http://ispc.github.io), version 1.12.0 or later. Please obtain a
24+
(ISPC)](http://ispc.github.io), version 1.14.1 or later. Please obtain a
2525
release of ISPC from the [ISPC downloads
2626
page](https://ispc.github.io/downloads.html).
2727

doc/examples.md

Lines changed: 146 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ For quick reference, the contents of `vklTutorial.c` are shown below.
2020
#include <stdio.h>
2121

2222
#if defined(_MSC_VER)
23-
#include <malloc.h> // _malloca
23+
#include <malloc.h> // _malloca
24+
#include <windows.h> // Sleep
2425
#endif
2526

2627
void demoScalarAPI(VKLVolume volume)
@@ -36,18 +37,36 @@ void demoScalarAPI(VKLVolume volume)
3637
printf("\t\tlower = %f %f %f\n", bbox.lower.x, bbox.lower.y, bbox.lower.z);
3738
printf("\t\tupper = %f %f %f\n\n", bbox.upper.x, bbox.upper.y, bbox.upper.z);
3839

39-
// value range
40-
vkl_range1f valueRange = vklGetValueRange(volume);
41-
printf("\tvalue range = (%f %f)\n\n", valueRange.lower, valueRange.upper);
40+
// number of attributes
41+
unsigned int numAttributes = vklGetNumAttributes(volume);
42+
printf("\tnum attributes = %d\n\n", numAttributes);
4243

43-
// sample, gradient
44-
vkl_vec3f coord = {1.f, 1.f, 1.f};
45-
float sample = vklComputeSample(sampler, &coord);
46-
vkl_vec3f grad = vklComputeGradient(sampler, &coord);
47-
printf("\tcoord = %f %f %f\n", coord.x, coord.y, coord.z);
44+
// value range (first attribute)
45+
vkl_range1f valueRange = vklGetValueRange(volume);
46+
printf("\tvalue range (first attribute) = (%f %f)\n\n",
47+
valueRange.lower,
48+
valueRange.upper);
49+
50+
// coordinate for sampling / gradients
51+
vkl_vec3f coord = {1.f, 2.f, 3.f};
52+
printf("\tcoord = %f %f %f\n\n", coord.x, coord.y, coord.z);
53+
54+
// sample, gradient (first attribute)
55+
unsigned int attributeIndex = 0;
56+
float sample = vklComputeSample(sampler, &coord, attributeIndex);
57+
vkl_vec3f grad = vklComputeGradient(sampler, &coord, attributeIndex);
58+
printf("\tsampling and gradient computation (first attribute)\n");
4859
printf("\t\tsample = %f\n", sample);
4960
printf("\t\tgrad = %f %f %f\n\n", grad.x, grad.y, grad.z);
5061

62+
// sample (multiple attributes)
63+
unsigned int M = 3;
64+
unsigned int attributeIndices[] = {0, 1, 2};
65+
float samples[3];
66+
vklComputeSampleM(sampler, &coord, samples, M, attributeIndices);
67+
printf("\tsampling (multiple attributes)\n");
68+
printf("\t\tsamples = %f %f %f\n\n", samples[0], samples[1], samples[2]);
69+
5170
// value selector setup (note the commit at the end)
5271
vkl_range1f ranges[2] = {{10, 20}, {50, 75}};
5372
int num_ranges = 2;
@@ -75,12 +94,12 @@ void demoScalarAPI(VKLVolume volume)
7594
#if defined(_MSC_VER)
7695
// MSVC does not support variable length arrays, but provides a
7796
// safer version of alloca.
78-
char *buffer = _malloca(vklGetIntervalIteratorSize(volume));
97+
char *buffer = _malloca(vklGetIntervalIteratorSize(sampler));
7998
#else
80-
char buffer[vklGetIntervalIteratorSize(volume)];
99+
char buffer[vklGetIntervalIteratorSize(sampler)];
81100
#endif
82101
VKLIntervalIterator intervalIterator = vklInitIntervalIterator(
83-
volume, &rayOrigin, &rayDirection, &rayTRange, selector, buffer);
102+
sampler, &rayOrigin, &rayDirection, &rayTRange, selector, buffer);
84103

85104
printf("\n\tinterval iterator for value ranges {%f %f} {%f %f}\n",
86105
ranges[0].lower,
@@ -109,12 +128,12 @@ void demoScalarAPI(VKLVolume volume)
109128
#if defined(_MSC_VER)
110129
// MSVC does not support variable length arrays, but provides a
111130
// safer version of alloca.
112-
char *buffer = _malloca(vklGetHitIteratorSize(volume));
131+
char *buffer = _malloca(vklGetHitIteratorSize(sampler));
113132
#else
114-
char buffer[vklGetHitIteratorSize(volume)];
133+
char buffer[vklGetHitIteratorSize(sampler)];
115134
#endif
116135
VKLHitIterator hitIterator = vklInitHitIterator(
117-
volume, &rayOrigin, &rayDirection, &rayTRange, selector, buffer);
136+
sampler, &rayOrigin, &rayDirection, &rayTRange, selector, buffer);
118137

119138
printf("\thit iterator for values %f %f\n", values[0], values[1]);
120139

@@ -141,26 +160,57 @@ void demoVectorAPI(VKLVolume volume)
141160
VKLSampler sampler = vklNewSampler(volume);
142161
vklCommit(sampler);
143162

144-
vkl_vvec3f4 coord4; // structure-of-array layout
163+
// structure-of-array layout
164+
vkl_vvec3f4 coord4;
145165
int valid[4];
146166
for (int i = 0; i < 4; i++) {
147-
coord4.x[i] = coord4.y[i] = coord4.z[i] = i;
148-
valid[i] = -1; // valid mask: 0 = not valid, -1 = valid
167+
coord4.x[i] = i * 3 + 0;
168+
coord4.y[i] = i * 3 + 1;
169+
coord4.z[i] = i * 3 + 2;
170+
valid[i] = -1; // valid mask: 0 = not valid, -1 = valid
149171
}
150172

173+
for (int i = 0; i < 4; i++) {
174+
printf(
175+
"\tcoord[%d] = %f %f %f\n", i, coord4.x[i], coord4.y[i], coord4.z[i]);
176+
}
177+
178+
// sample, gradient (first attribute)
179+
unsigned int attributeIndex = 0;
151180
float sample4[4];
152181
vkl_vvec3f4 grad4;
153-
vklComputeSample4(valid, sampler, &coord4, sample4);
154-
vklComputeGradient4(valid, sampler, &coord4, &grad4);
182+
vklComputeSample4(valid, sampler, &coord4, sample4, attributeIndex);
183+
vklComputeGradient4(valid, sampler, &coord4, &grad4, attributeIndex);
184+
185+
printf("\n\tsampling and gradient computation (first attribute)\n");
155186

156187
for (int i = 0; i < 4; i++) {
157-
printf(
158-
"\tcoord[%d] = %f %f %f\n", i, coord4.x[i], coord4.y[i], coord4.z[i]);
159188
printf("\t\tsample[%d] = %f\n", i, sample4[i]);
160189
printf(
161190
"\t\tgrad[%d] = %f %f %f\n", i, grad4.x[i], grad4.y[i], grad4.z[i]);
162191
}
163192

193+
// sample (multiple attributes)
194+
unsigned int M = 3;
195+
unsigned int attributeIndices[] = {0, 1, 2};
196+
float samples[3 * 4];
197+
vklComputeSampleM4(valid, sampler, &coord4, samples, M, attributeIndices);
198+
199+
printf("\n\tsampling (multiple attributes)\n");
200+
201+
printf("\t\tsamples = ");
202+
203+
for (unsigned int j = 0; j < M; j++) {
204+
printf("%f %f %f %f\n",
205+
samples[j * 4 + 0],
206+
samples[j * 4 + 1],
207+
samples[j * 4 + 2],
208+
samples[j * 4 + 3]);
209+
printf("\t\t ");
210+
}
211+
212+
printf("\n");
213+
164214
vklRelease(sampler);
165215
}
166216

@@ -175,20 +225,47 @@ void demoStreamAPI(VKLVolume volume)
175225
vkl_vec3f coord[5];
176226

177227
for (int i = 0; i < 5; i++) {
178-
coord[i].x = coord[i].y = coord[i].z = i;
228+
coord[i].x = i * 3 + 0;
229+
coord[i].y = i * 3 + 1;
230+
coord[i].z = i * 3 + 2;
179231
}
180232

233+
for (int i = 0; i < 5; i++) {
234+
printf("\tcoord[%d] = %f %f %f\n", i, coord[i].x, coord[i].y, coord[i].z);
235+
}
236+
237+
// sample, gradient (first attribute)
238+
printf("\n\tsampling and gradient computation (first attribute)\n");
239+
unsigned int attributeIndex = 0;
181240
float sample[5];
182241
vkl_vec3f grad[5];
183-
vklComputeSampleN(sampler, 5, coord, sample);
184-
vklComputeGradientN(sampler, 5, coord, grad);
242+
vklComputeSampleN(sampler, 5, coord, sample, attributeIndex);
243+
vklComputeGradientN(sampler, 5, coord, grad, attributeIndex);
185244

186245
for (int i = 0; i < 5; i++) {
187-
printf("\tcoord[%d] = %f %f %f\n", i, coord[i].x, coord[i].y, coord[i].z);
188246
printf("\t\tsample[%d] = %f\n", i, sample[i]);
189247
printf("\t\tgrad[%d] = %f %f %f\n", i, grad[i].x, grad[i].y, grad[i].z);
190248
}
191249

250+
// sample (multiple attributes)
251+
unsigned int M = 3;
252+
unsigned int attributeIndices[] = {0, 1, 2};
253+
float samples[3 * 5];
254+
vklComputeSampleMN(sampler, 5, coord, samples, M, attributeIndices);
255+
256+
printf("\n\tsampling (multiple attributes)\n");
257+
258+
printf("\t\tsamples = ");
259+
260+
for (int i = 0; i < 5; i++) {
261+
for (unsigned int j = 0; j < M; j++) {
262+
printf("%f ", samples[i * M + j]);
263+
}
264+
printf("\n\t\t ");
265+
}
266+
267+
printf("\n");
268+
192269
vklRelease(sampler);
193270
}
194271

@@ -200,10 +277,12 @@ int main()
200277
vklCommitDriver(driver);
201278
vklSetCurrentDriver(driver);
202279

203-
int dimensions[] = {128, 128, 128};
280+
const int dimensions[] = {128, 128, 128};
204281

205282
const int numVoxels = dimensions[0] * dimensions[1] * dimensions[2];
206283

284+
const int numAttributes = 3;
285+
207286
VKLVolume volume = vklNewVolume("structuredRegular");
208287
vklSetVec3i(
209288
volume, "dimensions", dimensions[0], dimensions[1], dimensions[2]);
@@ -217,16 +296,44 @@ int main()
217296
return 1;
218297
}
219298

220-
// x-grad sample volume
299+
// volume attribute 0: x-grad
221300
for (int k = 0; k < dimensions[2]; k++)
222301
for (int j = 0; j < dimensions[1]; j++)
223302
for (int i = 0; i < dimensions[0]; i++)
224303
voxels[k * dimensions[0] * dimensions[1] + j * dimensions[2] + i] =
225304
(float)i;
226305

227-
VKLData data = vklNewData(numVoxels, VKL_FLOAT, voxels, VKL_DATA_DEFAULT, 0);
228-
vklSetData(volume, "data", data);
229-
vklRelease(data);
306+
VKLData data0 = vklNewData(numVoxels, VKL_FLOAT, voxels, VKL_DATA_DEFAULT, 0);
307+
308+
// volume attribute 1: y-grad
309+
for (int k = 0; k < dimensions[2]; k++)
310+
for (int j = 0; j < dimensions[1]; j++)
311+
for (int i = 0; i < dimensions[0]; i++)
312+
voxels[k * dimensions[0] * dimensions[1] + j * dimensions[2] + i] =
313+
(float)j;
314+
315+
VKLData data1 = vklNewData(numVoxels, VKL_FLOAT, voxels, VKL_DATA_DEFAULT, 0);
316+
317+
// volume attribute 2: z-grad
318+
for (int k = 0; k < dimensions[2]; k++)
319+
for (int j = 0; j < dimensions[1]; j++)
320+
for (int i = 0; i < dimensions[0]; i++)
321+
voxels[k * dimensions[0] * dimensions[1] + j * dimensions[2] + i] =
322+
(float)k;
323+
324+
VKLData data2 = vklNewData(numVoxels, VKL_FLOAT, voxels, VKL_DATA_DEFAULT, 0);
325+
326+
VKLData attributes[] = {data0, data1, data2};
327+
328+
VKLData attributesData =
329+
vklNewData(numAttributes, VKL_DATA, attributes, VKL_DATA_DEFAULT, 0);
330+
331+
vklRelease(data0);
332+
vklRelease(data1);
333+
vklRelease(data2);
334+
335+
vklSetData(volume, "data", attributesData);
336+
vklRelease(attributesData);
230337

231338
vklCommit(volume);
232339

@@ -240,6 +347,14 @@ int main()
240347

241348
free(voxels);
242349

350+
printf("complete.\n");
351+
352+
#if defined(_MSC_VER)
353+
// On Windows, sleep for a few seconds so the terminal window doesn't close
354+
// immediately.
355+
Sleep(3000);
356+
#endif
357+
243358
return 0;
244359
}
245360
```

doc/teaser.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
<div class="carousel-inner">
1717

1818
<div class="carousel-item active">
19-
<img src="images/hacc.jpg">
19+
<img src="images/siggraph20_cloudscape.jpg">
2020
<div class="carousel-caption">
2121
<h3>
22-
Particle Volume Support
22+
SIGGRAPH 2020 demo: Interactive Volumetric Path Traced Cloudscape
2323
</h3>
2424
<p>
25-
Open VKL based volumetric path tracing of a 5.9 million particle subset of the HACC DarkSky simulation. Data courtesy of Salman Habib and Katrin Heitmann at Argonne National Laboratory.
25+
Interactive rendering of a large-scale volumetric cloudscape of VDB volumes, using Intel® Open Volume Kernel Library, Intel® OSPRay, and Intel® OSPRay Studio. <a href="https://www.youtube.com/watch?v=cpRMNuyiTig">Video</a>
2626
</p>
2727
</div>
2828
</div>
@@ -73,7 +73,7 @@ <h3>
7373
<div class="carousel-caption">
7474
<h3>Interactive Data Exploration</h3>
7575
<p>
76-
Loading leaf data from the Disney Moana cloud dataset while the user manipulates the viewport.
76+
Loading leaf data from the Disney Moana cloud dataset while the user manipulates the viewport. White regions indicate inner nodes, while blue regions indicate fully-loaded leaf data.
7777
</p>
7878
</div>
7979
</div>

examples/interactive/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ openvkl_add_library_ispc(vkl_example_renderers STATIC
2626
renderers/DensityPathTracer.ispc
2727
renderers/HitIterator.cpp
2828
renderers/HitIterator.ispc
29+
renderers/IntervalIteratorDebug.cpp
30+
renderers/IntervalIteratorDebug.ispc
2931
renderers/RayMarchIterator.cpp
3032
renderers/RayMarchIterator.ispc
3133
)

0 commit comments

Comments
 (0)