Get Started with the Intel® oneAPI Rendering Toolkit for Linux*

ID 766438
Date 4/11/2022

A newer version of this document is available. Customers should click here to go to the newest version.

Run Intel® Embree Sample

This tutorial shows how to run an interactive Intel® Embree pre-compiled sample applications included in the Intel® oneAPI Rendering Toolkit (Render Kit). This sample demonstrates how to generate an image with basic geometry using Intel Embree.

The triangle_geometry sample application shown in the tutorial uses a graphical user interface to create a static cube and ground plane using triangle vertices.

GUI-based samples are not available in the terminal-only Intel® DevCloud. Intel Embree also includes several non-GUI samples that do not need a graphical used interface (GUI) to output results, such as minimal, bvh_builder, and bvh_access. If you want to run the non-GUI sample in the Intel® DevCloud, create a job script or a pipe-based submission. See Basic Job Submission for details.

Prerequisite: Configure your system.

To run the application:

  1. Open a terminal.
  2. If you did not set up oneAPI toolkit environment permanently: Set up environment variables:
    • For root or sudo users:
      source /opt/intel/oneapi/
    • For non-root users:
      source ~/intel/oneapi/

    See Set up Environment Variables for other options.

    If you installed the Render Kit to a custom location, make sure to replace /opt/intel/oneapi/ (for root or sudo users) or ~/intel/oneapi/ (for non-root users) with the custom installation path before running the command.
  3. Go to a writable directory and create a directory to store supporting files. For example, create the rk_gsg folder under the home directory:
    cd ~
    mkdir rk_gsg
    cd rk_gsg
  4. Run the triangle geometry sample:

A new window will open with a 3D cube. For details about triangle_geometry, see Chapter 9 in the Intel Embree documentation.

The ispc versions of the triangle_geometry and other samples use Intel® Implicit SPMD Program Compiler for a better performance.

Tips and Observations

  • To move camera, click and drag the left mouse button or use W, A, S, D buttons or arrow keys.
  • This sample demonstrates how to generate an image with basic geometry using Intel Embree.
  • triangle_geometry sample features:
    • A hard-coded array of simple float vertex data, consisting of location of the corners of the cube and the ground plane.
    • The definition of index lists to construct triangles from the vertices.
    • API-defined geometry data structures to create and commit vertex and index data into the scene.
    • A multi-threaded compute hierarchy for ray-tracing over the image frame.
      • Computing rays is divided into tiles of screen pixels. Tiles are split amongst threads.
      • Each tile performs ray intersect tests for each pixel in the tile.
      • In addition to basic ray intersect tests that determine the triangle colors, a shadow intersect (occlusion) test is performed at the intersection point for one hard-coded fixed light direction.
      • Final pixels have color data computed from the rays packed into RGB color triplets.
    • Scaffolding abstraction provides much of the glue code. This abstraction is used heavily in other Intel Embree sample applications. The samples abstraction includes:
      • Setup for call backs to initialization, rendering, and tear-down functions
      • Data structures for managing scene data
      • Keyboard and mouse input/output
      • API hooks into operating system window management code for visualization

See the application source in triangle_geometry_device.cpp in the Intel Embree GitHub* repository.

Intel Embree relationship with other Render Kit components

  • Intel® OSPRay, the open scalable portable ray-tracing engine, uses Intel Embree to generate images. Intel OSPRay 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 the 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 renderer within the Intel OSPRay API.
  • Intel Embree capability is centered around geometric ray-tracing. In contrast, Intel® Open Volume Kernel Library (Intel® Open VKL) provides volume visualization and sampling capability.
  • Images rendered with the Intel Embree can be denoised with Intel® Open Image Denoise. However, Intel OSPRay provisions extended frame buffer channel access to simplify managing data denoising. The result is denoised high-quality images at a reduced ray tracing compute cost.

Next Steps