Get Started with the Intel® Rendering Toolkit for Windows*

ID 766442
Date 3/22/2024
Public

Run Intel® Embree Sample

This tutorial shows how to run an interactive Intel® Embree pre-compiled sample applications included in the Intel® 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.

Prerequisite: Configure your system.

To run the application:

  1. Open a command prompt.
  2. Set up environment variables:
    call "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
    NOTE:
    If you installed the Render Kit to a custom location, make sure to replace C:\Program Files (x86)\Intel\oneAPI\ 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 :
    cd %USERPROFILE%
    
    mkdir rk_gsg
    cd rk_gsg
  4. 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 Chapter 9 in the Intel Embree documentation.

NOTE:
The ispc version, embree_triangle_geometry_ispc, and other ispc labeled samples use Intel® Implicit SPMD Program Compiler for optimized CPU performance. There are also GPU optimized versions via SYCL* (Ex: embree_triangle_geometry_sycl).

Details

  • To move camera, click and drag the left mouse button or use W, A, S, D buttons or arrow keys.
  • There is also an optimized Intel® Implicit SPMD Program Compiler (Intel® ISPC) version for CPU (embree_triangle_geometry_ispc) and a GPU optimized version through SYCL* (embree_triangle_geometry_sycl)
  • 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 is used by 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 capabilities focus on 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