Overv / VulkanTutorial

Tutorial for the Vulkan graphics and compute API
https://vulkan-tutorial.com
Creative Commons Attribution Share Alike 4.0 International
3.21k stars 527 forks source link

Best Practices For Dynamic Scenes #153

Open kklouzal opened 5 years ago

kklouzal commented 5 years ago

Your tutorials seem to be focused on building one single static scene and doesn't elaborate on how to draw objects after everything is setup and running.

A chapter on 'Best Practices For Dynamic Scenes' might be a good starting point for people after they have mastered the current set of chapters.

I can only assume after mastering your tutorials is that we need a way to submit commands to our command buffers after-the-fact, but what is a good approach to take when doing this? Do we need to completely flush a command buffer and resubmit all commands for every object in the scene? Should buffers be split up into groups depending on how likely we are to add/remove objects from the buffer?

A chapter exploring these ideas would be extremely valuable to newcomers to Vulkan, especially since your tutorials are the best around.

lewa-j commented 5 years ago

Additionally, it would be useful to describe the implementation of culling.

kklouzal commented 5 years ago

From what I can gather, a typical approach is to give each 'game object' their own sub command buffer (level 3), which would be sub command buffers of 'similar game objects' (level 2), which are ultimately grouped by a megalithic main command buffer (level 1).

Culling mechanisms can be put in place to determine if these buffers get used or not but we have to walk before we run here and culling is a pretty advanced feature from where i'm standing.