Advertisement

Bullet physics debug draw using Vulkan?

Started by May 05, 2019 07:08 AM
2 comments, last by Owen1520 5 years, 4 months ago

Hey, I recently started moving my engine over to Vulkan. Everything's going smoothly, but I'm having some trouble figuring out how to get debug drawing for Bullet to work. Would I have to call


vkCmdDraw()

every time the


drawLine()

function in Bullet's debug class is called? That seems like it wouldn't be very good for performance. Any tips? Thanks!

It's common to write an "immediate mode" style rendering API on top of your actual graphics API, for use by debug drawing systems, UI, etc... Every time you want to draw something small, like a line, you can write a few vertices into a large, dynamic vertex buffer. When all the line drawing commands have been submitted, you've got a buffer full of many lines, which you can then draw with a single vk/gl/d3d draw call.

Advertisement

So basically I would allocate a vertex buffer with a large size, and update it with new vertex data each time the drawLine function is called?

This topic is closed to new replies.

Advertisement