#Setting up rendering for complex scene

2 messages · Page 1 of 1 (latest)

gusty sable
#

I successfully build a render to display one static mesh (8 mb of data) and implement carefully the synchronization (fences and semaphore) with the help of discord users.

Right now I'm using vkDrawIndexed to display the mesh.

Now, I would like to move in the direction to display many multiple objects with their respective model matrices.

I read different resources but I don't understand what direction to pick yet.

  1. Should the model matrices be allocated in a storage buffer or uniform buffer (I think it's more appropriate into a storage buffer)?
  2. How can I access the right objects' model matrix since I would like to batch the geometry together?
  3. I red many resources using vkDrawIndexedIndirect which allow to read/write and perform usefull technique like culling in gpu. However, any indirect command will result in a draw call, therefor "removing" the benefit of batching together different meshes?

There are a lot of stuff to consider as a beginner moving to intermediate.

Can you clarify me what direction to pick?

warped meadow
#

It’s hard to give exact answers what would be the best for you. But something to consider.

1 is easy use storage buffers, uniform buffers can be max 64k. You could eventually need more, but depends on you end goal

A possible first step could be to group you scene by mesh and then by instance. You can crate a single save containing all the matrices. Then for the each mesh count the number of instances you want to draw and offset it in the matrices storage buffers.

3 GPU culling can be complex so perhaps first get multiple meshes and instances working. And define the next challenge you then find important to tackle.

And most important learn and have fun along the way