-
Hi I'm part of the Blender project's sculpt and painting module. I'm redoing the indexed drawing mode for sculpt mode. This is a bit complicated as we now support custom face corner attributes in our dynamic topology mode, which means splitting UV islands. I'm investigating if meshoptimizer would be a good fit for us. Blender's sculpt tools use a special coarse BVH tree we call PBVH. We store drawing buffers in the leaves, and also index buffers. The idea is to dynamically generate new index buffers when the topology inside a given leaf node changes. This means splitting by UV islands (of which their may be more then one) and vertex normal "smooth groups." Right now the code just falls back on unindexed drawing if it detects UV islands. Any advice would be appreciated, thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Yeah unindexed rendering is pretty inefficient for modern GPUs. If the adjustment is not very frequent (that is, if you don't need to rebuild these buffers every frame), meshopt could be used to make these more efficient to render by using it as a postprocess. For example, a reasonable and cheap sequence of steps would be:
These steps come in decreased importance for vertex-heavy workloads, so if perf. requirements for rebuild are very strict you could skip step 3 and/or 2 (although I suspect running at least step 2 is worthwhile). To run these you'd need to first prepare an unindexed vertex buffer with all relevant data in the vertex struct; if it's more convenient to use multiple streams (you'd still need one index buffer), you will need to slightly change steps 1 & 3, see https://github.com/zeux/meshoptimizer#deinterleaved-geometry. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the answer. We're using a packed vertex buffer, so that's not an issue. I was going to ask about that though, is it more efficient to use separate streams? I want to avoid uploading vertex attribute data that hasn't changed, especially since the number of attributes is likely to go up significantly in the near future. |
Beta Was this translation helpful? Give feedback.
Yeah unindexed rendering is pretty inefficient for modern GPUs. If the adjustment is not very frequent (that is, if you don't need to rebuild these buffers every frame), meshopt could be used to make these more efficient to render by using it as a postprocess.
For example, a reasonable and cheap sequence of steps would be:
These steps come in decreased impor…