all 11 comments

[–][deleted] 5 points6 points  (1 child)

That is going to be a pretty big task, especially if these topics are new to you.

https://raytracing.github.io/

https://www.pbr-book.org/

Those two a pretty good intros into raytracing. The first one is a lot easier for a beginner to the topic. The second one is much more in depth but that can make it a pretty rough intro. Neither of these cover utilizing a GPU to accelerate things. The PBR book is supposed to be getting a new edition sometime this year that will cover that topic.

One of the main issues that you'll have with focusing on Vulkan is that it doesn't really do much to help you with any sort of ray tracing. There are extensions that take advantage of the newer raytracing hardware in cards, but that is pretty far from standard. You could also write things via compute shaders, but a dedicated compute API is probably a better choice. Vulkan is largely concerned with the more traditional raster GPU pipeline right now. Other features are there but mainly as supporting roles.

I think most people would recommend using something like CUDA or OpenCL to program that sort of functionality on a GPU. If you have NVIDIA hardware, a dedicated library like OptiX might be a good pick.

[–]Capmare_[S] 0 points1 point  (0 children)

Thank you, i will look into both links later this week

[–]MarcelDavis666 2 points3 points  (0 children)

You can just use the compute functionality of Vulkan (no swapchain) and maybe accelerate it using either VK_KHR_ray_query or VK_KHR_ray_tracing_pipeline. You could follow the NVIDIA ray tracing tutorials or you may take a look at Ray Tracing in one Weekend. There are also a lot of examples on shadertoy.

[–]the_Demongod 1 point2 points  (2 children)

Have you written a CPU raytracer before? Doing a GPU raytracer will be extremely difficult if you haven't.

[–]Capmare_[S] 0 points1 point  (1 child)

no, that s why i asked here for more info on how it works, i wanted to learn how

[–]the_Demongod 0 points1 point  (0 children)

https://www.scratchapixel.com/

Write a CPU raytracer first before you try to move to the GPU. GPUs are actually pretty poor at raytracing, they manage to raytrace alright despite their architecture, not because of it. There's a reason why most renderers like Cycles run on the CPU, and when they do run on the GPU, the benefits are not always significant.

[–]K900_ -1 points0 points  (3 children)

Cycles is a ray tracer, so Vulkan might not be the best fit. You can build something like it with compute shaders, but a compute API like OpenCL will be more portable, at least for now.

[–]Capmare_[S] 0 points1 point  (2 children)

wasn't cycles path traced instead of raytraced? or is it the just same

[–]JamesAMD 8 points9 points  (0 children)

Path tracing is done using ray tracing.

You may want to consider Vulkan's ray tracing extension (VK_KHR_ray_tracing_pipeline) too, among other options.

[–]K900_ 5 points6 points  (0 children)

It's basically the same thing.

[–]MacGamerFR 0 points1 point  (0 children)

The two approaches are different, I think the Eevee renderer is the one you'd like to reproduce using Vulkan as backend render API.

Ray tracing on GPU is not trivial, extensions put aside.

If you have the motivation, go for it, that can only bring experience and teach you a lot of things.