Vulkan Real-Time Ray Tracing

Share

This article introduces the process of implementing real-time ray tracing with Vulkan.

Vulkan is a low-overhead, cross-platform API for 2D, 3D graphics, and compute. Compared with OpenGL, it is lower level. Being lower level means there are more places where performance can be optimized, and it can provide better performance.

Ray tracing is a rendering algorithm in 3D computer graphics. It traces the path of light from the light source to objects, and then the reflected paths from those objects. Since computing all paths completely is very expensive, current ray-tracing techniques usually compute only the light paths that are visible to the eye.

Real-time ray tracing is not fundamentally different from ray tracing. It uses hardware acceleration, fewer samples, and shorter marching steps to reduce computation, eventually reaching real-time performance, meaning multiple frames per second. For details, see High-Quality Real-Time Rendering: Real-Time Ray Tracing.

Figure 1 compares real-time ray-traced reflections in Wolfenstein: Youngblood.

2020-Real-time-ray-traced-reflections-in-Wolfenstein-01
Figure 1: reflections disabled on the left, ray-traced reflections enabled on the right

Technical Route

  1. Learn Vulkan.

Process: learn basic Vulkan concepts through https://vulkan-tutorial.com/ and https://vkguide.dev/.

https://github.com/yufeiran/LearnVulkan

  1. Build a small framework that can render multiple objects.

https://github.com/yufeiran/miniVulkanRender

Vulkan: drawing multiple objects with dynamic uniforms

  1. Start learning ray tracing.

I plan to study tutorials such as NVIDIA Vulkan Ray Tracing Tutorials, then implement a small ray-tracing framework myself.

At the same time, I am learning the glTF format: https://github.khronos.org/glTF-Tutorials/gltfTutorial/

Hardware-Accelerated Ray Tracing Principles

I am interested in how GPUs implement hardware-accelerated ray tracing, so I looked up some materials and organized them into a PPT:

File: Hardware acceleration ray tracing principles design and applications Download
File: Hardware acceleration ray tracing principles design and applications Download

CSIG Competition Materials

Competition link:

File: AwardMaterials Download
File: RayTracingReport Download

Demo Video

Document

File: RaytracingDocument Download

Renderer Implementation

After completing the competition, I also implemented my own renderer:

https://github.com/yufeiran/miniVulkanRenderer2

Reference Links

Principles

High-Quality Real-Time Rendering: Real-Time Ray Tracing

Deep Dive into GPU Hardware Architecture and Execution Mechanisms

Tutorials

RayTracingInVulkan

NVIDIA Vulkan Ray Tracing Tutorials

AMD Hardware-Accelerated Ray Tracing Principles

https://zhuanlan.zhihu.com/p/337151778

Read more

可多路视频播放的VisionOS 媒体查看器开发

可多路视频播放的VisionOS 媒体查看器开发

开发一款能够同时播放多个视频的vision pro媒体查看器。 0:00 /0:40 1× 缘起 Vision Pro 发布时我就特别想买,毕业工作后终于有资金购入并加入Apple开发者计划,从今年五月到现在也用了快小半年,用起来确实挺爽。 但是有些痛点还是很难受,其中一个痛点就是无法同时播放多个视频音频(实际上VisionOS提供了同时播放音频的API,但是似乎我用的APP都是不遵守🤣 导致都在抢占),因此为了满足我自己的这个痛点,也学习一下Vision OS 的应用开发,甚至完成度足够的话考虑上架App Store,便有了这个目标是多视频同时播放的媒体查看器项目。 现有工作 我购买了4XVR、Infuse、Moon Player、ES 文件助手(这款只有iPad OS版,不是专供Vision OS的),这几个月体验下来,全都存在我提到的和其他APP抢占音频通道,无法同时播放的问题,其他的我的主观的体验如下: 4XVR:使用最多,用起来最舒服,格式支持很全,VR视频也能看,号称全v

By Feiran Yu