PagedLOD texture loading #1373
-
Are PagedLODs with same texture loading its texture again or not? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It all depends on how the textures are stored. As you haven't said anything about how you PagedLOD based databases are created I can say anything specific about your usage case. The vsg::External class was written to enable scene subgraphs to pull in external files like texture, but it can be any object type. You set up the vsg::External class then assign it to the root of the subgraph as user data, and as long as the vsg::Options object used when reading shares the vsg::SharedObjects external objects that are common should be shared. Rather than just textures what you ideally want to share is the BindDescriptorSet/DescriptorImage objects as this would then share the same Vulkan state. However, far simpler than this, the other way to share state is put it at the top of the scene graph and inherit it down. This is how the vsg::tile/vsg::TileDatabase class functions, putting common state, including graphics pipeline and common uniforms on the root node. So... you have options, what suits you application best depends upon your needs, which... you haven't mentioned anything about so you'll need to tell us or just figure out what works yourself. |
Beta Was this translation helpful? Give feedback.
My recommendation would be to try and move the common state up to a root node, just like he vsg::tile ReaderWriter does for TileDatabase data. Putting textures into a texture array or texture atlas, uniform arrays etc. that you can assign to a StateGroup in the root subgraph.
Then underneath the root node you'd typically create a quad tree hierarchy, but for point clouds it might be an octree, or a linear world like around a railway perhaps even a binary tree. You can mix and match depending upon the neeeds of the region that you are breaking down into LOD's/PagedLODs.
Then for the PagedLOD you'd have a low res version of the data that is seen in the distance, and then a high res external…