Skip to content

Commit 5da393e

Browse files
committed
Merge branch 'release-1.2.x'
2 parents b2cfd8a + 44579dd commit 5da393e

Some content is hidden

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

51 files changed

+1891
-314
lines changed

CHANGELOG.md

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

4+
### Open VKL 1.2.0
5+
6+
- Added `vklSetParam()` API function which can set parameters of any supported
7+
type
8+
- Structured regular volumes:
9+
- Added support for cell-centered data via the `cellCentered` parameter;
10+
vertex-centered remains the default
11+
- Added support for more general transformations via the `indexToObject`
12+
parameter
13+
- Added `indexOrigin` parameter which applies an index-space vec3i
14+
translation
15+
- VDB volumes:
16+
- Added `indexClippingBounds` parameter, which can restrict the active
17+
voxel bounding box
18+
- The `indexToObject` parameter can now be provided as a `VKL_AFFINE3F`
19+
- Corrected bounding box computations in `InnerNode` observer
20+
- Particle volumes:
21+
- Now ignoring particles with zero radius
22+
- VDB utility library: added `commit` flag (default true) to volume creation
23+
methods, allowing apps to set additional parameters before first commit
24+
- Examples:
25+
- Added new set of minimal examples, which step through creation of basic
26+
volume and isosurface renderers
27+
- Exposing `intervalResolutionHint` parameter in `vklExamples` application
28+
- Superbuild updates to latest versions of dependencies
29+
430
### Open VKL 1.1.0
531

632
- vklExamples improvements: asynchronous rendering, multiple viewports,

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.1.0 LANGUAGES C CXX)
22+
project(openvkl VERSION 1.2.0 LANGUAGES C CXX)
2323

2424
## Add openvkl specific macros ##
2525

README.md

Lines changed: 95 additions & 42 deletions
Large diffs are not rendered by default.

cmake/openvkl_macros.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Copyright 2019-2021 Intel Corporation
1+
## Copyright 2019-2022 Intel Corporation
22
## SPDX-License-Identifier: Apache-2.0
33

44
macro(openvkl_add_library_ispc name type)
@@ -51,7 +51,8 @@ endmacro()
5151
macro(openvkl_configure_global_build_flags)
5252
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR
5353
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
54-
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
54+
CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
55+
CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
5556

5657
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
5758

@@ -96,7 +97,8 @@ function(openvkl_get_compile_options_for_width WIDTH FLAGS)
9697

9798
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR
9899
CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR
99-
CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
100+
CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
101+
CMAKE_CXX_COMPILER_ID STREQUAL "IntelLLVM")
100102

101103
message(STATUS "detected Clang or GNU compiler")
102104

doc/api.md

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ counting for lifetime determination. Objects are created with particular type's
230230

231231
In general, modifiable parameters to objects are modified using `vklSet...`
232232
functions based on the type of the parameter being set. The parameter name is
233-
passed as a string. Below are all variants of `vklSet...`.
233+
passed as a string. Below are variants of `vklSet...`.
234234

235235
void vklSetBool(VKLObject object, const char *name, int b);
236236
void vklSetFloat(VKLObject object, const char *name, float x);
@@ -241,6 +241,19 @@ passed as a string. Below are all variants of `vklSet...`.
241241
void vklSetString(VKLObject object, const char *name, const char *s);
242242
void vklSetVoidPtr(VKLObject object, const char *name, void *v);
243243

244+
A more generic parameter setter is also available, which allows setting
245+
parameters beyond the explicit types above:
246+
247+
void vklSetParam(VKLObject object,
248+
const char *name,
249+
VKLDataType dataType,
250+
const void *mem);
251+
252+
Note that `mem` must always be a pointer _to_ the object, otherwise accidental
253+
type casting can occur. This is especially true for pointer types
254+
(`VKL_VOID_PTR` and `VKLObject` handles), as they will implicitly cast to `void\
255+
*`, but be incorrectly interpreted.
256+
244257
After parameters have been set, `vklCommit` must be called on the object to make
245258
them take effect.
246259

@@ -427,11 +440,12 @@ Finally, the value range of the volume for a given attribute can be queried:
427440
### Structured Volumes
428441

429442
Structured volumes only need to store the values of the samples, because their
430-
addresses in memory can be easily computed from a 3D position. The dimensions
431-
for all structured volume types are in units of vertices, not cells. For
432-
example, a volume with dimensions $(x, y, z)$ will have $(x-1, y-1, z-1)$ cells
433-
in each dimension. Voxel data provided is assumed vertex-centered, so $x*y*z$
434-
values must be provided.
443+
addresses in memory can be easily computed from a 3D position. Data can be
444+
provided either per cell or per vertex (the default), selectable via the
445+
`cellCentered` parameter. This parameter also affects the interpretation of
446+
the volume's dimensions, which will be in units of cells or vertices,
447+
respectively. A volume with $(x, y, z)$ vertices will have $(x-1, y-1, z-1)$
448+
cells.
435449

436450
#### Structured Regular Volumes
437451

@@ -443,10 +457,10 @@ table below.
443457
--------- -------------------------------- ----------------------------- ---------------------------------------
444458
Type Name Default Description
445459
--------- -------------------------------- ----------------------------- ---------------------------------------
446-
vec3i dimensions number of voxels in each
460+
vec3i dimensions number of values in each
447461
dimension $(x, y, z)$
448462

449-
VKLData data VKLData object(s) of voxel data,
463+
VKLData data VKLData object(s) of volume data,
450464
VKLData[] supported types are:
451465

452466
`VKL_UCHAR`
@@ -465,10 +479,27 @@ table below.
465479
through passing an array of VKLData
466480
objects.
467481

482+
bool cellCentered false indicates if data is provided per cell
483+
(true) or per vertex (false)
484+
468485
vec3f gridOrigin $(0, 0, 0)$ origin of the grid in object space
469486

470487
vec3f gridSpacing $(1, 1, 1)$ size of the grid cells in object space
471488

489+
affine3f indexToObject 1, 0, 0, Defines the transformation from index
490+
0, 1, 0, space to object space. In index space,
491+
0, 0, 1, the grid is an axis-aligned regular
492+
0, 0, 0 grid, and grid cells have size (1,1,1).
493+
This parameter takes precedence over
494+
`gridOrigin` and `gridSpacing`, if
495+
provided.
496+
497+
vec3i indexOrigin $(0, 0, 0)$ Defines the index space origin of the
498+
volume. This translation is applied
499+
before any (`gridOrigin`,
500+
`gridSpacing`) or `indexToObject`
501+
transformation.
502+
472503
uint32 temporalFormat `VKL_TEMPORAL_FORMAT_CONSTANT` The temporal format for this volume.
473504
Use `VKLTemporalFormat` for named
474505
constants.
@@ -537,7 +568,8 @@ Structured spherical volumes are also supported, which are created by passing a
537568
type string of `"structuredSpherical"` to `vklNewVolume`. The grid dimensions
538569
and parameters are defined in terms of radial distance ($r$), inclination angle
539570
($\theta$), and azimuthal angle ($\phi$), conforming with the ISO convention for
540-
spherical coordinate systems. The coordinate system and parameters understood by
571+
spherical coordinate systems. Structured spherical volumes currently only
572+
support vertex-centered data. The coordinate system and parameters understood by
541573
structured spherical volumes are summarized below.
542574

543575
![Structured spherical volume coordinate system: radial distance ($r$), inclination angle ($\theta$), and azimuthal angle ($\phi$).][imgStructuredSphericalCoords]
@@ -807,9 +839,9 @@ VDB leaf nodes are implicit in Open VKL: they are stored as pointers to user-pro
807839

808840
![Structure of `"vdb"` volumes in the default configuration][imgVdbStructure]
809841

810-
VDB volumes interpret input data as constant cells (which are then potentially filtered).
811-
This is in contrast to `structuredRegular` volumes, which have a vertex-centered
812-
interpretation.
842+
VDB volumes interpret input data as constant cells (which are then potentially
843+
filtered). This is in contrast to `structuredRegular` volumes, which can have
844+
either a vertex-centered or cell-centered interpretation.
813845

814846
The VDB implementation in Open VKL follows the following goals:
815847

@@ -826,15 +858,16 @@ following parameters:
826858
------------ ------------------------------------- ------------------------------ ---------------------------------------
827859
Type Name Default Description
828860
------------ ------------------------------------- ------------------------------ ---------------------------------------
829-
float[] indexToObject 1, 0, 0, An array of 12 values of type `float`
830-
0, 1, 0, that define the transformation from
831-
0, 0, 1, index space to object space.
832-
0, 0, 0 In index space, the grid is an
833-
axis-aligned regular grid, and leaf
834-
voxels have size (1,1,1).
835-
The first 9 values are interpreted
836-
as a row-major linear transformation
837-
matrix. The last 3 values are the
861+
affine3f indexToObject 1, 0, 0, Defines the transformation from index
862+
float[] 0, 1, 0, space to object space. In index space,
863+
0, 0, 1, the grid is an axis-aligned regular
864+
0, 0, 0 grid, and leaf voxels have size (1,1,1).
865+
A `vkl_affine3f` can be provided;
866+
alternatively an array of 12 values of
867+
type `float` can be used, where the
868+
first 9 values are interpreted as a
869+
row-major linear transformation matrix,
870+
and the last 3 values are the
838871
translation of the grid origin.
839872

840873
uint32[] node.format For each input node, the data format.
@@ -898,6 +931,14 @@ following parameters:
898931
float[] background `VKL_BACKGROUND_UNDEFINED` For each attribute, the value that is
899932
returned when sampling an undefined
900933
region outside the volume domain.
934+
935+
box3i indexClippingBounds Clips the volume to the specified
936+
index-space bounding box. This is
937+
useful for volumes with dimensions that
938+
are not even multiples of the leaf node
939+
dimensions, or .vdb files with
940+
restrictive active voxel bounding
941+
boxes.
901942
------------ ------------------------------------- ------------------------------ ---------------------------------------
902943
: Configuration parameters for VDB (`"vdb"`) volumes.
903944

@@ -1033,6 +1074,9 @@ radial basis function phi, for each particle that overlaps it. Gradients are
10331074
similarly computed, based on the summed analytical contributions of each
10341075
contributing particle.
10351076

1077+
Particles with a radius less than or equal to zero are ignored. At least one
1078+
valid particle (radius greater than zero) must be provided.
1079+
10361080
The Open VKL implementation is similar to direct evaluation of samples in Reda
10371081
et al.[2]. It uses an Embree-built BVH with a custom traversal, similar to the
10381082
method in [1].

examples/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Copyright 2019-2020 Intel Corporation
1+
## Copyright 2019-2022 Intel Corporation
22
## SPDX-License-Identifier: Apache-2.0
33

44
## "Hello world" VKL tutorials ##
@@ -14,3 +14,7 @@ add_subdirectory(ispc)
1414
## Interacive Examples ##
1515

1616
add_subdirectory(interactive)
17+
18+
## Minimal Console-based Examples ##
19+
20+
add_subdirectory(minimal)

examples/interactive/ParameterGui.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Intel Corporation
1+
// Copyright 2021-2022 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include "ParameterGui.h"
@@ -265,6 +265,8 @@ namespace openvkl {
265265

266266
ImGui::PushID(id.c_str());
267267

268+
changed |= ImGui::SliderFloat(
269+
"intervalResolutionHint", &p.intervalResolutionHint, 0.f, 1.f);
268270
changed |=
269271
ImGui::SliderFloat("Sampling rate", &p.samplingRate, 0.01f, 4.f);
270272

@@ -310,6 +312,8 @@ namespace openvkl {
310312

311313
ImGui::PushID(id.c_str());
312314

315+
changed |= ImGui::SliderFloat(
316+
"intervalResolutionHint", &p.intervalResolutionHint, 0.f, 1.f);
313317
changed |=
314318
ImGui::SliderFloat("Color scale", &p.intervalColorScale, 1.f, 32.f);
315319
changed |=

examples/interactive/renderer/IntervalIteratorDebug.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Intel Corporation
1+
// Copyright 2021-2022 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include "IntervalIteratorDebug.h"
@@ -28,6 +28,10 @@ namespace openvkl {
2828
vklSetInt(
2929
intervalContext, "attributeIndex", rendererParams->attributeIndex);
3030

31+
vklSetFloat(intervalContext,
32+
"intervalResolutionHint",
33+
params->intervalResolutionHint);
34+
3135
// set interval context value ranges based on transfer function positive
3236
// opacity intervals, if we have any
3337
VKLData valueRangesData = nullptr;

examples/interactive/renderer/IntervalIteratorDebug.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Intel Corporation
1+
// Copyright 2021-2022 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

44
#pragma once
@@ -10,6 +10,7 @@ namespace openvkl {
1010

1111
struct IntervalIteratorDebugParams
1212
{
13+
float intervalResolutionHint{0.5f};
1314
float intervalColorScale{4.f};
1415
float intervalOpacity{0.25f};
1516
bool firstIntervalOnly{false};

examples/interactive/renderer/RayMarchIteratorRenderer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 Intel Corporation
1+
// Copyright 2021-2022 Intel Corporation
22
// SPDX-License-Identifier: Apache-2.0
33

44
#include "RayMarchIteratorRenderer.h"
@@ -30,6 +30,10 @@ namespace openvkl {
3030
vklSetInt(
3131
intervalContext, "attributeIndex", rendererParams->attributeIndex);
3232

33+
vklSetFloat(intervalContext,
34+
"intervalResolutionHint",
35+
params->intervalResolutionHint);
36+
3337
// set interval context value ranges based on transfer function positive
3438
// opacity intervals, if we have any
3539
VKLData valueRangesData = nullptr;

0 commit comments

Comments
 (0)