Little discussion on some of the practical aspects of getting started with ray-tracing (and path-tracing) using the Vulkan ray-tracing extension. The article shifts primarily towards moving beyond triangles towards ray-tracing with implict shapes (procedural stuff).
I often think that ray-tracing without implict shapes is a loss! You can generate fractals and volumetric shapes - all sorts of juicy things - but most of all - it's fun and easy with ray-tracers.
Ray-tracing vs path-tracing - just to note - path-tracing is just another form of ray-tracing - but the journey of the ray through the scene uses probablity - usually over multiple frames and lots and lots of rays. When we say 'ray-tracing' all the discussion and concepts here work with both ray-tracing and path-tracing.
Path-Tracer example output from the Vulkan Ray-Tracing Extension (intersection shader).
Ray|Path-Tracing (Ray-Marching)
Working with the Vulkan API (Ray-Tracing Extension)
1. Working with Triangle Meshes
2. Working with Procecural Geometry
Triangle Geomtry
Load the triangle mesh into the acceleration buffers (top and bottom) - and most of the work is done for you - you get the interection point and the triangle corners (vertices) - and you have everything you need.
The procedural ray-tracing/path-tracing is a little less documented and requires a bit more work - so we'll delve into that more.
Focus on the 'Procedural' Geometry Part
You'll use the 'aabb' geometry - and the 'intersect' shader.
Adding the intersect shader is a bit tricky - as it's not one of the required shaders - so you it takes more work to add it into the pipeline compared to the required (rmiss/rhit/rgen).
Word to the wiser - while developing your Top/Bottom acceleration structure - the flags can be a bit tricky - as the wrong flags/grouping can cause a bit of pain - often it won't crash - but your output won't work.
So it's worth switching on the 'layer' feature for the errors/warning.
Let me give you one example - this is one error I got while trying to mix both procedural and triangle geometries:
Visitor:
Copyright (c) 2002-2025 xbdev.net - All rights reserved.
Designated articles, tutorials and software are the property of their respective owners.