🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DXR Geometry Description

Started by
2 comments, last by __MONTE2020 2 years, 11 months ago

When loading models, if possible, I make all model meshes share the same vertex buffer and index buffer and just use vertex offsets/index offsets when calling DrawIndexedInstanced/DrawInstanced. When reading about DXR, I've noticed that D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC doesn't have any offset parameters when specifying vertex and index buffers. Does that mean I should manually offset D3D12_GPU_VIRTUAL_ADDRESS of buffers or I cannot share vb/ib between meshes when ray tracing?

Advertisement

Yes that's exactly right: just compute the final GPU virtual address yourself by summing the byte offset with the base address of the buffer, and use that for the geometry desc. FYI you can do the exact same thing with D3D12_VERTEX_BUFFER_VIEW, it's the same concept.

@mjp Thanks for the confirmation. I actually stumbled on your DXR repository in the meantime where I found the exact same scenario as mine ?

This topic is closed to new replies.

Advertisement