How do I access vertex buffers corresponding to different (bottom level) acceleration structures?

Trending 2 months ago

I want to render scenes for illustration they are utilized successful mitsuba aliases pbrt (see https://benedikt-bitterli.me/resources/ for illustration segment explanation files).

That is, I person a database of obj-files. Each Obj record contains a mesh. And to each obj record a different BSDF is related. What I'm presently doing is creating a abstracted vertex and scale buffer per obj file. Moreover, I'm creating a abstracted bottommost level acceleration building (BLAS) per obj file. I'm assing an InstanceID of one to nan $i$th obj record truthful that I tin fig retired which 1 was deed utilizing nan InstanceID() intrinsic successful my closesthit shader.

Now, that's fine. However, I wonderment really I'm capable to entree nan vertex buffer successful my shaders. When I only person a azygous obj record (and hence a azygous BLAS), I tin simply upload nan corresponding vertex and scale buffers. So, successful that lawsuit I person thing for illustration this successful my code:

RaytracingAccelerationStructure accelerationStructure : register(t0); StructuredBuffer<Vertex> vertices : register(t1); StructuredBuffer<uint> indices : register(t2);

But what americium I doing if I person aggregate BLASs pinch different vertex/index buffers? Do I request to concatenate them together? But really do I separate them successful nan codification then? For example, if nan $i$th mesh was hit, really do I skip complete nan vertices corresponding to nan first $i-1$ meshes?

This is specified a communal problem that location must beryllium wide proposal connected this. Looking into nan existing tutorials is not of overmuch help, since they are either measurement to elemental aliases measurement excessively analyzable ...

More
close