Simple example for multiple UBO and VBO

Greetings,

can someone point me to a simple c++/linux vulkan example where multiple objects are rendered and each object is represented by a UBO / VBO pair (with only the UBO getting updated every frame) and other parameters are the same for all objects? Would you have to recreate the command buffer for every object or can you reuse it save for the VBO change? I’m looking for the most efficient method. Should be flexible enough so that adding functionality for occasional object removal / addition is trivial.

Regards

Hi,
seeing the name and reading your post “I can kind feel your desperation” BUT my experience with Vulkan ( and other graphics libs ) you really have to take it “in small steps”.

If I suppose you have “some basics” because you surely worked with other graphics libs, I really recommend ( yes I know sometime it feels like going back to school ) to read well this website : https://vulkan-tutorial.com/

While “conceptually” what you asking for here is “standard stuff usually done” with Vulkan really “the devil is in the details” you are asking for a SIMPLE example the answer with Vulkan could really be “there are NO SIMPLE EXAMPLES” :slight_smile:

A quick answer is “depending all and how you do it” but yes you can reuse the command buffer but I dare to say “before you get worried about the most efficient method” you should be able “to answer this question by yourself” I mean have a good read around because “if you miss the basics” you are never going to understand Vulkan, especially stuff like descriptors and such are a bit of a headache the first time you see them.

The other problem is that “there’s quite a bit of stuff to set up to get a Vulkan app going” that almost “all code samples” I’ve seen around have their own “framework” built around that from a “learning” point of view often “is not super helpful” because “they call functions that behind the scenes do fundamental stuff and have lots of line of code you don’t see”.

So you may see a bit of code calling a thing like “GetVBO()” … and already here “we could discuss for days” about “how to get that VBO” I am sure and “what is the best method ?” again “depends on what you do and how you do it”, there’s no unique answer.

But if you hold on studying/reading various tutorials around “you’ll get the idea” … … after about a couple of months or so :slight_smile:

Don’t despair :slight_smile:

Cheers.