Implementation of a GPU-based ray tracer using SYCL and Embree using both megakernel and wavefront approaches.
sudo apt update
sudo apt install -y gpg-agent wget
wget -qO - https://repositories.intel.com/gpu/intel-graphics.key | sudo gpg --dearmor --output /usr/share/keyrings/intel-graphics.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/intel-graphics.gpg] https://repositories.intel.com/gpu/ubuntu jammy/production/2328 unified" | sudo tee /etc/apt/sources.list.d/intel-gpu-jammy.list
sudo apt update
sudo apt install -y linux-headers-$(uname -r) flex bison xpu-smi
sudo apt install -y \
intel-opencl-icd intel-level-zero-gpu level-zero \
intel-media-va-driver-non-free libmfx1 libmfxgen1 libvpl2 \
libegl-mesa0 libegl1-mesa libegl1-mesa-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri \
libglapi-mesa libgles2-mesa-dev libglx-mesa0 libigdgmm12 libxatracker2 mesa-va-drivers \
mesa-vdpau-drivers mesa-vulkan-drivers va-driver-all vainfo hwinfo clinfo
sudo apt install -y \
libigc-dev intel-igc-cm libigdfcl-dev libigfxcmrt-dev level-zero-dev
sudo gpasswd -a ${USER} render
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt update
sudo apt install intel-basekit
sudo apt install intel-renderkit
sudo apt install intel-oneapi-runtime-libs
Export the scene as GLTF.
Add a custom property to the scene called sky_color
with the type float array with 3 elements.
In the Principled BSDF node, set the IOR to something other than the default (1.5) and the transmission weight to a non-zero value.
Used if the metallic property in the Principled BSDF node is non-zero.
The metallic value is not actually used in lighting calculations, it just identifies that the material type should be metallic. The roughness value is used for shading, though.
Used if no other criteria matches.
Generate build files.
rm -rf build
cmake -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx .
Generate build files.
rm -rf build
cmake -Bbuild -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=icx \
-DCMAKE_CXX_COMPILER=icpx .
Build project.
ninja -C build
Build project.
watchexec --no-vcs-ignore -e cpp,hpp,h,glb,gltf,txt "ninja -C build && ./build/raytracer"