Get Started

  • 2021.2
  • 03/26/2021
  • Public Content

Run a Sample with Intel® Open Volume Kernel Library (Intel® Open VKL)

This tutorial demonstrates how to use the Intel® Open Volume Kernel Library (Intel® Open VKL) with sample applications to visualize volumetric datasets.
To run the sample applications, do one of the following:

Run Pre-Built Samples

Run the vklTutorial Sample
The
vklTutorial
sample application demonstrates how to use the Intel Open VKL API to find samples, gradients, and t-values along sampling rays in a simple procedurally defined volume.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    with Intel Open VKL. By default, the toolkit is installed to
    C:\Program Files (x86)\Intel\oneAPI
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
  • Microsoft Visual C++* Runtime Redistributable x64. You can download it from https://visualstudio.microsoft.com/downloads/ separately or with Microsoft Visual Studio* 2019.
To run the
vklTutorial
application:
  1. From the Start menu, open a new command prompt.
  2. Set oneAPI environment variables:
    call "<install-dir>\setvars.bat"
    where
    <install-dir>
    is the directory where you installed the
    Intel® oneAPI Rendering Toolkit
    . By default, it is
    C:\Program Files (x86)\Intel\oneAPI\
    .
    For Render Kit programs, this will ensure programs and pre-compiled library
    .dll
    files are available for samples launched within the command shell session. You can also set up the
    Render Kit
    environment variables per component from a command prompt as follows:
    path <install-dir>\ospray\latest\bin;%PATH%
    path <install-dir>\ospray_studio\latest\bin;%PATH%
    path <install-dir>\embree\latest\bin;%PATH%
    path <install-dir>\tbb\latest\redist\intel64\vc_mt;%PATH%
    path <install-dir>\openvkl\latest\bin;%PATH%
    path <install-dir>\oidn\latest\bin;%PATH%
    path <install-dir>\rkcommon\latest\bin;%PATH%
  3. Run the sample application:
    vklTutorial.exe
  4. Review the application output printed to the
    command prompt
    .
The results display the following:
  • A bounding box for a grid.
  • The range of values, or samples, within the grid.
  • A sample taken at location 1.0, 1.0, 1.0 of the grid.
  • The computed gradient at the same 1.0, 1.0, 1.0 location.
  • Intervals of a ray that correlate with ranges of sought values. You can search these intervals further in user code.
Run the vklExamples Sample
The
vklExamples
sample application renders the Intel Open VKL API results to screen through a graphical interface.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    with Intel Open VKL. By default, the toolkit is installed to
    C:\Program Files (x86)\Intel\oneAPI
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
  • Microsoft Visual C++* Runtime Redistributable x64. You can download it from https://visualstudio.microsoft.com/downloads/ separately or with a Microsoft Visual Studio* 2019.
  • OpenGL*. It is typically provided with a graphics device driver for Windows* OS. If you do not have OpenGL pre-installed on your system, you can download it from https://www.mesa3d.org/.
Run the
vklExamples
application:
  1. From the Start menu, open a new command prompt.
  2. Set oneAPI environment variables:
    call "<install-dir>\setvars.bat"
    where
    <install-dir>
    is the directory where you installed the
    Intel® oneAPI Rendering Toolkit
    . By default, it is
    C:\Program Files (x86)\Intel\oneAPI\
    .
    For Render Kit programs, this will ensure programs and pre-compiled library
    .dll
    files are available for samples launched within the command shell session. You can also set up the
    Render Kit
    environment variables per component from a command prompt as follows:
    path <install-dir>\ospray\latest\bin;%PATH%
    path <install-dir>\ospray_studio\latest\bin;%PATH%
    path <install-dir>\embree\latest\bin;%PATH%
    path <install-dir>\tbb\latest\redist\intel64\vc_mt;%PATH%
    path <install-dir>\openvkl\latest\bin;%PATH%
    path <install-dir>\oidn\latest\bin;%PATH%
    path <install-dir>\rkcommon\latest\bin;%PATH%
  3. Run the sample application:
    vklExamples.exe
    A new window with the sample results will open.
The Intel Open VKL API path enabling Intel® Implicit SPMD Program Compiler (Intel® ISPC) might not be available. If the program shows a blank screen, choose the
C scalar
API from the
Open VKL API used
drop-down.
User interface elements may overlap. Drag and drop the blue control bar to see all controls.
You can select different transfer functions, Intel Open VKL API values, and rendering controls to visualize the volume:

Build and Run a Sample Application

This section explains how to build and run the
vklTutorial
sample application, which uses the Intel Open VKL API to find samples, gradients, and t-values along sampling rays in a simple procedurally defined volume.
Requirements:
  • Intel® oneAPI Rendering Toolkit
    with Intel Open VKL. By default, the toolkit is installed to
    C:\Program Files (x86)\Intel\oneAPI
    directory. Replace
    <install-dir>
    with the default or your custom installation path.
  • Microsoft Visual C++* Runtime Redistributable x64, which is included in the Microsoft Visual Studio* 2019
  • Git* 2.20 or higher
  • CMake* 3.12 or higher
    You can download it from https://cmake.org/ or use the one included in the Microsoft Visual Studio* 2019.
  • Intel® oneAPI Threading Building Blocks
    (
    oneTBB
    ).
    oneTBB
    version required to build the libraries is delivered with the
    Render Kit
    . You can also download it from the
    oneTBB
    GitHub* repository at https://github.com/oneapi-src/oneTBB/releases.
    This tutorial does not include instructions on linking the
    oneTBB
    library manually. For this information, refer to
    oneTBB
    documentation.
To build the
vklTutorial
sample application:
  1. From the Start Menu, launch an
    x64 Native Tools Command Prompt for VS 2019
    .
  2. Go to a writable directory. Create a directory to stage the build. For example, create the
    rk_gsg
    folder under the
    user directory
    %USERPROFILE%
    :
    cd %USERPROFILE%
    mkdir rk_gsg
    cd rk_gsg
  3. Check out sources for the sample application from the Intel Open VKL GitHub repository. Check out the version tag for your release of the Render Kit:
    git clone --no-checkout https://github.com/openvkl/openvkl openvkl
    cd openvkl
    git fetch --tags
    git checkout tags/v0.12.0
    See the latest Release Notes for version information
  4. Set up a build directory:
    cd examples\from_openvkl_install
    mkdir build
    cd build
  5. Create a Microsoft Visual Studio solution and build it:
    cmake -G"Visual Studio 16 2019" -A x64 -DCMAKE_PREFIX_PATH="<install-dir>\openvkl\latest\lib\cmake\openvkl-0.12.0;C:\Program Files (x86)\Intel\oneAPI\rkcommon\latest\lib\cmake\rkcommon-1.6.0" ..
    cmake --build . --config Release
    where
    <install-dir>
    is the directory where you installed the
    Intel® oneAPI Rendering Toolkit
    . By default, it is
    C:\Program Files (x86)\Intel\oneAPI\
    .
  6. Run the sample application:
    cd Release
    vklTutorial.exe
Review the application output printed to the command prompt. The results display the following:
  • A bounding box for a grid.
  • The range of values, or samples, within the grid.
  • A sample taken at location 1.0, 1.0, 1.0 of the grid.
  • The computed gradient at the same 1.0, 1.0, 1.0 location.
  • Intervals of a ray that correlate with ranges of sought values. You can search these intervals further in user code.
  • Ray t-values for desired sample values.

Next Steps

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.