Recently I’ve been committing some improvements to the sculpt PBVH drawing code. None of these changes affect the fancier drawing modes — GLSL and all that is still not accelerated by the PBVH when sculpting. However, there are still some performance and feature improvements.
The most noticeable change is pictured at right: materials and shading mode (smooth/flat faces) are now drawn correctly in sculpt mode. Previously, the material and shading mode were set once for each PBVHNode (each of which typically contains thousands of polygons.) This is still the case, but now PBVHNodes are split until all the faces they contain (whether mesh or multires faces) all share the same material and shading mode.
Another recent change involves building VBOs for multires meshes. This is done by mapping a vertex buffer as write-only and copying multires grids (containing coordinate and normal data) into the buffer. There was a small bug in this code though: when sculpting on a flat-shaded model, the normals in the buffer were updated in a way that read from the buffer before writing to it. This is an invalid operation for a write-only buffer, and while most drivers won’t crash if you do it, I found that on my particular drivers (Gallium/Radeon) it makes a huge difference in performance. (This was on the order of seconds for dense meshes.)
Finally, improvements have been made to use better normals for flat shading. The results should in general look quite close to non-sculpt normals, with the exception of non-multires with VBO.