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.
Prerequisite: Configure your system.
To run the application:
- Open a terminal.
- If you did not set up oneAPI toolkit environment permanently: Set up environment variables:
- For root or sudo users:
- For non-root users:
See Set up Environment Variables for other options.NOTE: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.
- For root or sudo users:
- Go to a writable directory and create a directory to store supporting files. For example, create the rk_gsg folder under the home directory:
- 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.
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.