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
- From theStartmenu, typecmd.exeand pressEnterto open a new Command Prompt window.
- Go to a writable directory and create a directory to save the sample application results to.For example, create the:rk_gsgfoldercd %USERPROFILE%mkdir rk_gsgcd rk_gsg
- Set environment variables:call "<install-dir>\setvars.bat"where<install-dir>is the directory where you installed theIntel® oneAPI Rendering Toolkit. By default, it isC:\Program Files (x86)\Intel\oneAPI\.For Render Kit programs, this will ensure programs and pre-compiled library.dllfiles are available for samples launched within the command shell session. You can set up theRender Kitenvironment 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%
- Run the minimal sample:minimal.exeThis 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.
- Run the triangle geometry sample:triangle_geometry.exeA new window opens with a 3D ray-traced cube. To move camera, click and drag the left mouse button or useW,A,S,Dor arrow keys. For details about the sample output, see Intel® Embree tutorials.
Try any of the other sample programs of interest in
. Review the
Intel® Embree tutorials page for more information about the samples.
<install-dir>
\embree\latest\bin Build a Sample Application
- Open ax64 Native Tools Command Prompt for VS 2019from the start menu.
- Go to a writable directory and create a directory to save the sample application results to.For example, create the:rk_gsgfoldercd %USERPROFILE%mkdir rk_gsgcd rk_gsg
- Set environment variables:call "<install-dir>\setvars.bat"where<install-dir>is the directory where you installed theIntel® oneAPI Rendering Toolkit. By default, it isC:\Program Files (x86)\Intel\oneAPI\.For Render Kit programs, this will ensure programs and pre-compiled library.dllfiles are available for samples launched within the command shell session. You can set up theRender Kitenvironment 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%
- Clone the Intel Embree GitHub* project:git clone --no-checkout https://github.com/embree/embree.git embreecd embree
- Fetch the version tags:git fetch --tags
- Check out the tutorial sources for the Intel Embree version in your deployment of the Intel oneAPI Rendering Toolkit:git checkout tags/v3.12.2
- Navigate to theminimaldirectory:cd tutorials\minimal
- Build the minimal sample:cl /I"<install-dir>\embree\latest\include" minimal.cpp /Fe:minimal /link /LIBPATH:"<install-dir>\embree\latest\lib" embree3.libwhere<install-dir>is the directory where you installed theIntel® oneAPI Rendering Toolkit. By default, it isC:\Program Files (x86)\Intel\oneAPI\.
- Run the minimal sample:minimal.exeThis 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 source code of the tutorials and Intel Embree API 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 theIntel® oneAPI Rendering ToolkitWindows* 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 otherIntel® oneAPI Rendering Toolkitcomponents 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 theIntel® 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.