Hi there,
I'm writing a BRG renderer for GameObjects. I'm using a bucket based approach where each bucket holds 64 instances and has its own batchID and metadata that point to a reserved range of memory inside a big graphics buffer. Reserving memory, calculating metadata offsets and writing the actual data like matrices and SH coefficients works. How ever I seem to be too dumb to actually understand what the instance arrays in connection to the DrawCommands are and how to set them up for my buckets. I'm looking at the manual, this branch of the graphics repo https://github.com/Unity-Technologies/Graphics/blob/graphics/gpudriven/com.unity.render-pipelines.core/Runtime/BatchRenderer/RenderBRG.cs, as well as this test project https://github.com/Unity-Technologies/Graphics/blob/master/Tests/SRPTests/Packages/com.unity.testing.brg/Scripts/RenderBRG.cs. Right now my bucket holds a NativeList for both DrawRanges and the BatchDraw(holds mesh and material id). My bucket also stores a NativeArray of AABB that I calculate from the gameObject when it is added to a bucket. This will be needed for the culling job., but I cant seem to grasp how to handle the rest of the needed data and what output from the frustum culling job should go into the draw command output job. My plan is to in the end have a ParallelFor job that uses my bucket list and issues draw commands for each bucket. I've even already talked to a wonderful unity employee about this and still fail to understand. I can provide any code that is needed to further clarify my problem.
Thanks in advance.