Welcome back to the oneAPI channel.
Computer-generated graphics in movies, video games or scientific applications are amazing,
But are also very compute-inten sive , Rendering one frame using ray tracing can
take many billions of operations And this is one frame..
One of the reasons it could be done today in real time is Embree, oneAPI ray tracing
kernel library Most users of Embree report 1.5 to 6 x performance
boost without compromising image fidelity, let me tell you all about it
In previous videos we have talked about the oneAPI components.
We mentioned the multi-device, multi-vendor and open spec libraries..
That can now work on multiple devices, CPU, GPU and others, what we call XPUs..
And are arranged into toolkits,
One of them is the oneAPI rendering toolkit,
Which includes Embree
the Ray Tracing Kernels library
Embree basically have a collection of kernels, I’ll show you a quick sample code in a minute
They are all highly optimized..
Both the latest algorithms and the accelerated, parallel optimized code using instructions
like AVX2
Embree API is fairly simple and can be integrated into rendering applications by just replacing
the ray tracing operations
Embree is feature rich, with features like multi-segment motion blur,
multi-level instancing, modern geometry types like curves and subdivision
surfaces.
And you can even extend Embree with your own custom geometry types
And..
The same code can work on your CPU or Intel GPU,
The code is open source and the spec is published.
What can be better than that?
These are some of the reason why Embree won a Scientific and Technical Achievement Award
at the 2021 Oscar’s A huge honor.
Let me show you how you can get started with Embree in minutes.
The easiest way to go, in my mind, is to use a remote machine on the intel dev cloud.
Google Intel devcloud For oneAPI
You’ll need to register And install some stuff, it’s really 5 minutes
I’ll open a Cygwin window Ssh devcloud
I want to really see the Embree results so I need a VNC session
There is a way to do it, Look for the instructions in this video description
Once you have the VNC working, open a terminal And that is all…
Nothing to download Nothing to configure
Everything installed and ready
Navigate to oneapi/Embree/bin And we have here all the demos ready to execute
I’ll run the triangle-geometry And you can see here a very simple scene
It is a cube, rendered in real time using Embree
I’m changing the point of view with my mouse
And it’s being rendered in 400 FPS, almost 200 Millions ray a second
And let’s run the path-tracer This is a little more complex scene
And I can play with the parameters and the point of view interactively
If you navigate to the Embree github page, Go to tutorials
You can find the source code for all the demos..
Here for example is the code for the triangle-geometry A great way to learn
Let’s go to Oneapi.com Spec elements
Advanced Ray tracing The components
Here is Embree Here is the introduction
What is a device, what is a scene, geometry and so on
Going to Embree.org Resources
API examples And that’s a great hello-world sample code
We define here the device The scene which will run on this device
And the geometries to be included in the scene Here it is just one triangle, of course, it
can be as complex as your scene is
Now we create 3 Vertices to construct the triangle, and we assign index buffers to copy
the geometry data to By the way Embree does not have to copy, it
can operate on data “in place” In Embree you prepare it all, and when all
the elements are ready, you commit
So the Geometry is ready, we commit it We attach the geometry to the scene and now
we can commit the scene And here we create one ray, it has an origin
and a direction and we intersect it with the triangle in our
scene And now we can call Embree's intersect function
and check if the ray intersects the triangle.
And these are step by step, really nice and simple explanations
And how to build the example and run it.
Last resource is the Embree github How to install, on Windows, linux mac..
And under tutorials you can find the source code of all the demos you can find in the
DevCloud
Ray tracing at real time performance using Embree Kernels library
Lots of resources online, here are few of them
Thnx you