Previously, Blender was using OpenGL selection when painting vertices. Although convenient for painting visible vertices, this technique has several problems.
- is unable to paint occluded vertices efficiently. Only vertices directly underneath the brush region can be selected.
- tests multiple selection rays against all vertices of a mesh. This is not only inefficient, it also fails at selecting vertices not caught by the ray.
- is unorganized. It is difficult to take advantage of vertex locality without searching through a large list of vertices.
The goal of this project was to rethink the way we handle vertex painting, and this commit does so by using Paint Bounding Volume Hierarchies (PBVH) and spherical based selection.
In addition to fixing the above OpenGL selection challenges, this commit adds the following features to both weight and vertex paint:
- Mirrored painting and radial symmetry, like in sculpt mode.
- Volume based splash prevention, which avoids painting vertices far away from the 3D brush location.
- Normal based splash prevention, which avoids painting vertices with normals opposite the normal at the 3D brush location.
- Blur mode now uses a nearest neighbor average.
- Average mode, which averages the color/weight of the vertices within the brush
- Smudge mode, which pulls the colors/weights along the direction of the brush
- RGB^2 color blending, which gives a more accurate blend between two colors
- multithreading support. (PBVH leaves are painted in parallel.)
- Foreground/background color picker in vertex paint
End User Documentation:
Working Branch Used for Development: