Get Started

  • 2021.3
  • 07/20/2021
  • Public Content

Run a Sample with Intel® Embree

This tutorial shows how to run Intel® Embree pre-compiled sample applications included in the
Intel® oneAPI Rendering Toolkit
(Render Kit) for Windows* OS. It also explains how to build sample applications with Intel® Embree.

Run a Pre-Compiled Sample Application

  1. From the
    Start
    menu, type
    cmd.exe
    and press
    Enter
    to open a new Command Prompt window.
  2. Go to a writable directory and create a directory to save the sample application results to.
    For example, create the
    rk_gsg
    folder
    :
    cd %USERPROFILE%
    mkdir rk_gsg
    cd rk_gsg
  3. Set 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 makes sure programs and pre-compiled library
    .dll
    files are available for samples launched within the command shell session. Alternatively, you can 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%
  4. Run the minimal sample:
    minimal.exe
    This sample application output results in a terminal window. It is a basic check that the Intel Embree library is accessible for a very basic program.
  5. Run the triangle geometry sample:
    triangle_geometry.exe
    A new window opens with a 3D ray-traced cube. To move camera, click and drag the left mouse button or use
    W
    ,
    A
    ,
    S
    ,
    D
    or arrow keys. For details about the sample, see Intel® Embree API Example.
Try any of the other sample programs of interest in
<install-dir>
\embree\latest\bin
.

Build a Sample Application

  1. Open a
    x64 Native Tools Command Prompt for VS 2019
    from the start menu.
  2. Go to a writable directory and create a directory to save the sample application results to.
    For example, create the
    rk_gsg
    folder
    :
    cd %USERPROFILE%
    mkdir rk_gsg
    cd rk_gsg
  3. Set 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 makes sure programs and pre-compiled library
    .dll
    files are available for samples launched within the command shell session. You can 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%
  4. Clone the Intel Embree GitHub* project:
    git clone --no-checkout https://github.com/embree/embree.git embree
    cd embree
  5. Fetch the version tags:
    git fetch --tags
  6. Check out the tutorial sources for the Intel Embree version in your deployment of the Intel oneAPI Rendering Toolkit:
    git checkout tags/v3.13.0
  7. Navigate to the
    minimal
    directory:
    cd tutorials\minimal
  8. Build the minimal sample:
    cl /I"<install-dir>\embree\latest\include" minimal.cpp /Fe:minimal /link /LIBPATH:"<install-dir>\embree\latest\lib" embree3.lib
    where
    <install-dir>
    is the directory where you installed the
    Intel® oneAPI Rendering Toolkit
    . By default, it is
    C:\Program Files (x86)\Intel\oneAPI\
    .
  9. Run the minimal sample:
    minimal.exe
    This sample application output results in a terminal window. It is a basic check that the Intel Embree library is accessible for a basic program.
You can build your own Intel Embree-based applications on Windows* OS using the Intel Embree library. In the
<install-dir>\embree\latest
folder, you should find a CMake* file that you can use with the
find_package(…)
function of CMake in your own projects.
Typical production applications use additional libraries with accelerated ray tracing kernel functionality available in Intel Embree. Consider building Render Kit libraries with samples from source to review, edit, and explore GUI samples. These samples use an extended set of libraries.

Next Steps

  • Review the Intel Embree API Example to understand its functionality using a simple example application.
  • Review the tutorial source code in the Intel Embree GitHub repository to understand their functionality.
  • To try your own edits to the GUI tutorial sources, you are recommended to build Intel® Embree and the tutorials from scratch. See the
    Intel® oneAPI Rendering Toolkit
    Windows* OS build guide
    for more information. For details about the API, refer to the documentation on the official website or in the Git* repository.
  • Review other
    Intel® oneAPI Rendering Toolkit
    components in connection with the Intel Embree:
    • Intel® OSPRay, the Open Scalable Portable Ray tracing engine, uses Intel Embree to generate renders. It also provisions objects and functionality typical to 3D scenes.
      • Intel OSPRay provisions include volume and geometry objects, materials, textures, lights, camera, frame buffers, MPI-based distributed computing, and others.
      • For developers with OpenGL*-like background, Intel OSPRay may be a better way to start exploration of the toolkit than Intel Embree.
      • Intel Embree pathtracer example program provides a minimal and logical introduction to a pathtracer. Access a full professional visualization implementation of a pathtracer within the Intel OSPRay API.
    • If you are interested in volumetric rendering, review Intel® Open Volume Kernel Library (Intel® Open VKL) from the
      Intel® oneAPI Rendering Toolkit
      .
    • If you are interested in denoising, pass Intel Embree renders to Intel® Open Image Denoise. However, the Intel OSPRay frame buffer channel access makes sending framebuffer output color data, albedo, and normal data to Intel Open Image Denoise more manageable. The result is higher quality denoised images at a reduced ray tracing compute cost.

Product and Performance Information

1

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