Graph Based Tree Rendering with Vulkan

~ 2 Minute Read.

When I talk about my many past projects I of­ten en­tire­ly for­get to men­tion the ones I did at the Uni­ver­si­ty of Kon­stanz. But in the six years I’ve been there up to now, there were some fun projects there, too, of course.

One of those was my bach­e­lor’s project, which was one of the many at­tempts of try­ing to com­bine pas­sion with Uni­ver­si­ty. To have an ex­cuse to work on Vukan sup­port in Mag­num, I got the op­por­tu­ni­ty to work on some graph based tree ren­der­ing and in­ves­ti­gate how Vulkan would im­pact the per­for­mance. “Graph based” mean­ing that I load­ed a set of nodes and edges from an XML for­mat us­ing pugixml (to re­place the QtXML based load­er they al­ready had), sent that graph da­ta to the GPU where the mesh for the leaves and the branch­es was gen­er­at­ed on the fly. Stor­ing the graph da­ta in­stead of the mesh can not on­ly be more ef­fi­cient in terms of stor­age, but is ad­van­ta­geous for sim­u­la­tion and dy­nam­ic LODs.

I ba­si­cal­ly reim­ple­ment­ed the ex­ist­ing al­go­rithm in Vulkan, mean­while wrap­ping parts I need­ed in a Mag­num style API 1. As the fi­nal re­sult was not amaz­ing, I al­so played around with oth­er op­ti­miza­tion tech­niques like pre-Z pass­es.

Fun­ni­ly enough, this project pret­ty much start­ed short­ly af­ter the re­lease of Vulkan and I did my fi­nal pre­sen­ta­tion of it on the day Vulkan turned 1. (Was a great anec­dote to start off the pre­sen­ta­tion with ;-) )

Some great Vulkan Re­sources I can rec­om­mend: the spec, the “Vulkan Pro­gram­ming Guide” 2 and the Sascha Willems Vulkan re­pos­i­to­ry on GitHub.

graph based tree rendering with vulkan

Writ­ten in 25 min­utes, ed­it­ed in 15 min­utes.

1
To­geth­er with an ac­com­pa­ny­ing ex­am­ple
2
“Vulkan Pro­gram­ming Guide” on Ama­zon