This task will describe the engineering parts of vertex painting in sculpt mode.
My first impression was that the current patch is bloating and IMO that was not necessary. After discussing this, my second thought was that the scope that I had in mind for this patch was different.
The goal of this patch is to come to a clear design/scope/phasing, so it is clear what the changes entails. This is useful for code review, bug fixing, bug triaging and future developments.
The state of this design is still in progress.
The current patch has several issues in how the original design was translated into code. To name a few:
- To be validated
- The project makes a distinction between painting for display/rendering (vertex painting) and painting for modifiers and other parts (color attribute painting). I am not familiar with any designs for attribute painting so it could be that the patch is making assumptions that might be changed in the near future.
- The project wants to rename the current vertex painting to something else. This is might eventually be the case, but is this the right moment to do this as the future design is still unclear.
- To be validated
- [RENDER]: Vertex Color Node will only allow the selection for Sculpt Vertex Groups. To use the attribute vertex colors use the attribute node. Migration code could convert old files using the Vertex Color Node. Other alternative would be to support both Vertex colors in the Vertex color node, but that introduces UX complexity.
- [DRAWING]: Should we support per vertex transparency in the workbench engine? The workbench engine is optimized for animation playback speed, adding actual transparency in more detail than materials would in the right way would need more preprocessing to determine if alpha values are used in the vertex buffer.
During the code review the patch received new features on a regular basis, making the code review process totally not efficient. People are spending a lot of time in reviewing and all needs to reviewed the week after, where new features are added, where it is unclear if the issues that were addressed in the previous review are handled correctly.
It is unclear what the scope of the patch is. In the original discussion it was mentioned that after this project a attribute painting project should start. This patch somehow already tried to take this future project into account. Currently we need to reverse engineer the patch and try to understand what might be the scope of the project. This seems like lacking documentation.
The current patch scope is perhaps too limited as it can crash when you want to do for example attribute vertex painting.
- Color management: user is painting in display space.
- Vertex colors are actually averaged into a face color. But in the UI we say Vertex Colors. Reason for this is to have some visual similarity with masking. IMO we should not do this as it tells the users something different.
- Currently in the patch it is not possible to do attribute vertex painting. On technical level it will just crash and the old vertex paint mode forces workbench in the vertex color mode for the specific object, what than doesn't draw the colors you want to see, but the sculpt vertex colors. It has been mentioned that there is a attribute overlay needed to fix this, but that depends again on the workflow of attribute painting, what is not designed.
Personally I miss the information why the Sculpt Vertex Painting cannot use the MLoopCol. If this is possible the workflow for the user is more clear and the implementation does not have so many issues/limitations.
Alternative 1: current sculpt patch
The above gives an description of the current sculpt patch, after reverse engineering and discussions.
Alternative 2: expectation how I expected the original design to be implemented
Current design is a goal implementation where attribute painting has been added. As we currently don't have a clear understanding how attribute painting will look like this we should not make any assumptions yet on the implementation. Therefore my expectation was a hard separation between MVertCol and MLoopCol. Both could be used during rendering and an operation to sync between the active MVertCol and MLoopCol.
Current patch has parts of it, but as the current development is limiting functionality it is unclear if this alternative is actually what is the goal for
It is unclear what the scope is of Sculpt Vertex Painting. What makes it hard to describe a roadmap at this time. Below mentioned the initial idea I had when starting on reviewing the patch.
Long term road map
- Get the basics correct with the next use cases in mind
- A sculptor wants to paint during sculpting.
- A modeller/lighter wants to use vertex painting as it can hold more precise data.
- Design attribute painting
- Implement attribute painting
- Will merge current vertex painting into attribute painting
What should be done in the current patch
This part of the design isn't finished and will change when more and more gets clear in the current design.
Focus on the bare minimum and the stuff that has been agreed upon. Don't add fancy stuff on top of it, before we settle on the basics.
As in the initial design is mentioned that sculpt vertex painting is an implementation for an edge case, so should not take control of the other implementations as it currently does.
- It must be possible use sculpt vertex colors without vertex colors and vise versa.
- Remove the face averaging. It feels like a hack where users has no control over and communicates the wrong information to users. Or we should come up with an actual user benefit. If we were able to use MLoopCol this isn't a problem, but as we are not storing the data here this limitation introduces some edge cases with incorrect feedback to users. The later could also be solved by user documentation, but as there isn't any design or user documentation at all...
- Change the default name of sculpt vertex colors (Col) to something that does not clash with regular vertex colors.
- Add migration code for the Attribute/Vertex Color Shader node
- Fix existing the crashes
- Activate vertex painting mode (No vcol layer available in vertpaint, but batches requested anyway!)
- Vertex color drawing in the workbench should perhaps be mode specific. By default use Sculpt Vertex Colors, and when in attribute vertex color mode use the Vertex Colors
- If you want to support alpha rendering in the workbench we should use the transparency_accum buffers. The current implementation a hack to get it working in the viewport. This should be done in a separate patch. Note that doing this correctly (minor performance regressions) needs more work.
- Usability: When starting sculpting and there is no MVertCol layer, a default needs to be added.
- Usability: When Sculpt painting brush is active the context menu should have a color picker.
If this is the case, than we should also find better names for Sculpt Vertex Color...