This makes the pose brush easier to control
Details
Diff Detail
- Repository
- rB Blender
- Branch
- sculpt-pose-preview (branched from master)
- Build Status
Buildable 4952 Build 4952: arc lint + arc unit
Event Timeline
| source/blender/editors/sculpt_paint/paint_cursor.c | ||
|---|---|---|
| 1348 | This introduces a memory leak as it never frees the allocated memory, not something you want to do during drawing. As we only need the pose_origin, can we extract that to a function and call it in both places. Calculating the pose_origin is heavy. Is it an option to calculate it only when it changes. This will improve the performance when TAA is enabled for example. | |
| 1398 | Reset depth testing after use. On my VEGA it shows artifacts when used. | |
- Update pose origin preview only on active vertex changes
- Don't allocate memory to update the preview
- Reset depth test after drawing preview
Not related to these changes, just a note current master also has a memory leak. Looking at the code I cannot find the freeing of the pose_factor. We should fix this in master.
Error: Not freed memory blocks: 2, total unfreed memory 1.531639 MB Pose factor len: 801996 0x7fdf38716038 BKE_pbvh_search_gather len: 1024 0x7fdf39d84b38
Also a general note is (totally not related to this patch) but we could think about making the brush drawing relative to the screen DPI. This way it will look the same in low and high DPI displays.
| source/blender/editors/sculpt_paint/paint_cursor.c | ||
|---|---|---|
| 1440 | GPU_depth_test resets the GPU's what should be minimalized. One (or both) statements seems to be incorrect. | |
| source/blender/editors/sculpt_paint/sculpt.c | ||
| 3611–3612 | I would still suggest to split this function as it is also called outside the initialization of the brush. It makes the code more readable. Something like this. | |
| 3647 | mevit.v is not set when is_symmetry_iteration_valid returns false, and not reset in the next loop. So it can be 0. Seems to be code-wise incorrect, but I am not up to speed with the exact details here. Best that you decide if this implementation is correct. If it is correct, we should add a comment why. | |
| source/blender/editors/sculpt_paint/paint_cursor.c | ||
|---|---|---|
| 1393 | This behavior seems to be different then shown in the video. Is this intentionally. Now the line intersects with mesh very easily and you don't see it. You could also draw the line twice. one in back (with a higher alpha) and one in front. This makes it more clear to the user where the intersection takes place. | |
I disabled the depth test in the pose preview and the dynamic mesh preview. The idea is to draw this lines on top of everything in the scene, but interacting with another preview elements (symmetry plane previews, brush textures...).
Do you think that the depth test is also the cause of T69728?
