When we use Heap to store all the textures of all the models rendered in a scene, creating the heap only once and load it to the GPU for rendering, what should we do if we want to add another model to the scene later? It doesn’t sound like an efficient approach to destroy the heap and create a new one from all textures needed. What is a recommended way of managing textures using heaps?
Maybe it is not an ideal practice to store textures of all model in one heap, but should create one heap for each model, so that it will be easier when we add/remove models in the scene?
Any thoughts that might be helpful is appreciated.
I don’t know the standard way of doing it yet. I would have thought that partitioning the scene and having a heap per partition would be the way to go. It would depend on your usage though.
That’s a good idea. Is it correct to say that once the heap is created, adding one more texture later to it is impossible and we will have to destroy the old one and create a new heap?
I can’t recommend the WWDC 2019 video on Modern Rendering that Caroline posted highly enough – especially if you’re interested in indirect commands and using heaps. The code also has some extremely interesting stuff on how to do texture streaming, which is along the lines of what I think you’re trying to do. You can checkout the Texture Manager class in the sample code that goes along with the talk for ideas.