Computer Graphics II - Term Project - Vulpix
Hi everyone! In this blog post, I will talk about my term project in CENG469 course, which is Vulkan based Ray Tracer, Vulpix. Inspired by the captivating Fire-type Pokemon of the same name. Vulpix combines the power of Vulkan and the art of ray tracing to bring you stunningly lifelike graphics.
Firstly, I will give you brief information about the ray tracing pipeline, the acceleration structure, and the shader binding table. After that, I will show basic features of Vulpix shortly. Then, I will talk about the problems I faced and how I solved them.
Vulkan Ray Tracing Pipeline and Acceleration Structure
At the heart of my Vulkan-based ray tracer lies the VK_KHR_ray_tracing_pipeline extension. This powerful feature harnesses the GPU's capabilities to accelerate ray tracing, enabling us to achieve realistic visual effects. The ray tracing pipeline encompasses key stages, including ray generation, intersection testing, and shading. To optimize the ray tracing process, an acceleration structure, a bottom-level and top-level acceleration structure, is employed. These structures effectively organize scene geometry and allow for efficient ray-object intersection calculations.
Shader Binding Table:
To bind shaders to the ray tracing pipeline, I utilized the shader binding table. This table maps shaders to specific ray tracing operations, facilitating efficient shader invocation during the rendering process. By carefully organizing shader bindings, I achieved optimal performance and reduced unnecessary computations, enhancing the overall efficiency of the ray tracer.
Some of Vulpix features as follows:
Issues
Building a ray tracer comes with its fair share of challenges. During my project, I encountered several issues, such as managing memory for large scenes, handling complex shader logic, and ensuring efficient ray-object intersection tests. To tackle these obstacles, I adopted various strategies, including memory optimization techniques, debugging and profiling tools (Nsight).
And also, I had a hard time to get used to compile shader after I edit them. Unlikely, in OpenGL, we don't need to compile our shaders before running our program. I wasted most of my time to figure out where the problem is. Since I changed the shader code, I always kept asking myself why didn't have effect on the screen :) Because I forgot to compile my shaders :| Thus, through diligent research, experimentation, I was able to overcome these challenges and continue progressing towards my goal.
My Scenes
Scene1: My custom scene with a ground plane, and lovely reflective teapot, and refractive bunny and Erato models
Scene1: Up View
Scene1: Close look
Scene2: This my custom Cryteck Sponza Scene, including reflective teapot and refractive Erato models
In my test system with AMD Ryzen 5800X CPU, Nvidia RTX 3070 GPU and 64GB RAM and MAX BOUNCE COUNT= 10, I get approximately 1100FPS in Scene1. However, If I get close to the objects, the FPS dropped ~400 FPS because of the path tracing. Similarly, Scene2, If I get close to the objects, the FPS dropped. Initially, I get 400FPS, when I close the object it dropped ~250FPS. However, there is no significant problem visually, Vulpix runs smoothly.
Conclusion:
References:
- https://vulkan-tutorial.com/, Vulkan Tutorial , I used this tutorial for learning the basics of the vulkan.
- https://nvpro-samples.github.io/vk_raytracing_tutorial_KHR/, NVIDIA Vulkan Ray Tracing Tutorial, I used this tutorial for learning the basics of the ray tracing, and also get inspired from the project structure.
- https://iorange.github.io/, Vulkan Raytracing Tutorial, I used this tutorial for learning the basics of the ray tracing, and also get inspired from the project structure.
- https://casual-effects.com/data/, I get the models from there.
Comments
Post a Comment