Age | Commit message (Collapse) | Author |
|
|
|
|
|
* Added a limited "fast draw" mode to pbvh drawing
that tries to limit data sent to the GPU.
- Facesets and mask data are disabled.
- Indexed mode is forced.
- Does not work (at all) for multires.
* Finally fixed some outstanding bmesh sculpt undo bugs:
- Forgot to mark pbvh nodes to update their bounds, which
produced a bug I had thought was caused by something else.
- Hopefully fixed a long-standing occasional memory corruption
bug.
|
|
* The PBVH draw subsystem is now told whether any viewports
have drawtype >= OB_MATERIAL before anything in any windows
are drawn. There are no alternatives given the design
constraints of sculpting, where simply uploading data to the GPU
quickly becomes a bottleneck.
* Fixed flat vcol shading mode.
|
|
Also:
* added BMLog function to save mesh IDs.
- Used by SCULPT_UNDO_DYNTOPO_BEGIN/END instead of
saving the whole mesh, which was the previous behavior.
* SCULPT_UNDO_DYNTOPO_BEGIN no longer pushes a non-dyntopo
geomtry undo node, as this is no longer necassary.
This greatly speeds up going into/out of sculpt mode
with dyntopo enabled, as before it was copying
the mesh twice.
|
|
* PBVH_BMESH now supports faces other then triangles;
* Dyntopo triangulates faces as it finds them.
- I looked into methods of preserving quads and failed to
find anything that worked well in practice; it actually
worked better to use topology rake to align triangles
into quads and then mark diagonal edges for later dissolving
then to try to preserve quads explicitly (I've not
implementated that here, that was research code).
- To avoid excessive cache-destroying loops over vertex-faces,
DynTopo flags which verts have non-triangle faces.
* PBVHTriBuf now builds edge buffers so we can avoid drawing
tesselation phantom edges.
* BMLog also now supports arbitrary faces. It still does not
support edges though.
TODO:
* Fix vcol cell shading mode
* Make sure indexed drawing works
|
|
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
pbvh drawing.
* Dyntopo now stores a list of PBVHTriBufs in leaf nodes, one per material
used by the node.
* Actual drawing buffers live in a new mat_draw_buffers PBVHNode member.
|
|
|
|
a more generic (and maintainable) way.
|
|
a new one from scratch, an operation that can be slow despite being
threaded.
PBVH building is a memory bound operation (not just on the CPU side
either, remember the draw buffers have to be fully regenerated too).
Incrementally updating it this way is enormously faster (about as fast
as non-dyntopo undo).
The downside is we don't have the convienience of users regularly
building the pbvh from scratch anymore. Dyntopo does try to
join empty PBVH nodes (which happens after every stroke), but
that's not a complete substitute for a decent tree balancer.
That's on the todo list.
|
|
|
|
active/render/clone/mask layers indices.
* Fixed sculpt color bugs in pbvh drawing for bmesh.
|
|
|
|
|
|
* Added UI for editing local brush dyntopo settings.
|
|
draw mode.
|
|
Before only the active layer was uploaded to the GPU, now all of them
(except the autogenerated original color layer) are.
|
|
|
|
* Normals are now updated in threads.
* The sculpt neighbor code was using the slower BM_LOOPS_OF_VERT
instead of BM_EDGES_OF_VERT, fixed.
|
|
I think I will end up writing a less accurate version and be done
with it. This is a consistent hotspot in profiling.
* Fixed a few more undo bugs
|
|
instead of interpolating (it's next to "draw smooth" in the dyntopo
settings panel).
|
|
sets" tool and do more testing.
|
|
which calls into BMLog which, while now threadsafe (ish?) causes
threads to get bogged down in lock contention.
|
|
NOTE: I've added a new function, DRW_make_cdlayer_attr_aliases, for
this. It's patterned after extract_uvs. The appropriate devs from the
draw engine team should take a look.
|
|
|
|
|
|
Also added support for uvs to dyntopo gpu buffer building code.
|
|
It seems fast enough for simple cases, I make no promises that it
will be fast in crazy cases lots if there's lots of vgroup layers.
Note I still need to interface properly with the sculpt colors code.
|
|
|
|
This removes the limitation of the sculpt overlays not being visible
with modifiers active.
Reviewed By: fclem
Maniphest Tasks: T68900
Differential Revision: https://developer.blender.org/D8673
|
|
This is just a cleanup to isolate the internals of the vertbuf.
This adds some getters to avoid refactor of existing code.
|
|
Also order sizeof(..) first to promote other values to size_t.
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/gpu` module.
No functional changes.
|
|
Clang Tidy reported a couple of false positives. I disabled
those `NOLINTNEXTLINE`.
Differential Revision: https://developer.blender.org/D8199
|
|
This disables all Sculpt Vertex Colors tools, operators, panels and rendering capabilities and puts them under the "Use Sculpt Vertex Colors" experimental option.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D8239
|
|
The face sets color copy to the GPU was done outside of the loop,
probably after a merge error in a rebase.
Also, the default color was initialized using the wrong type.
Reviewed By: sergey
Maniphest Tasks: T78188
Differential Revision: https://developer.blender.org/D8106
|
|
Sculpt Vertex Colors is a painting system that runs inside sculpt mode, reusing all its tools and optimizations. This provides much better performance, easier to maintain code and more advanced features (new brush engine, filters, symmetry options, masks and face sets compatibility...). This is also the initial step for future features like vertex painting in Multires and brushes that can sculpt and paint at the same time.
This commit includes:
- SCULPT_UNDO_COLOR for undo support in sculpt mode
- SCULPT_UPDATE_COLOR and PBVH flags and rendering
- Sculpt Color API functions
- Sculpt capability for sculpt tools (only enabled in the Paint Brush for now)
- Rendering support in workbench (default to Sculpt Vertex Colors except in Vertex Paint)
- Conversion operator between MPropCol (Sculpt Vertex Colors) and MLoopCol (Vertex Paint)
- Remesher reprojection in the Voxel Remehser
- Paint Brush and Smear Brush with color smoothing in alt-smooth mode
- Parameters for the new brush engine (density, opacity, flow, wet paint mixing, tip scale) implemented in Sculpt Vertex Colors
- Color Filter
- Color picker (uses S shortcut, replaces smooth)
- Color selector in the top bar
Reviewed By: brecht
Maniphest Tasks: T72866
Differential Revision: https://developer.blender.org/D5975
|
|
Probably did not cause an actual, the assert is a performance warning.
Ref T76858
|
|
When the number of triangles in a node became zero, the wireframe batch was
not freed along with the triangles batch and could still reference a freed
vertex buffer.
Ref T76858
|
|
This removes the smooth shading rendering from the face set overlay when
smooth shading is enabled.
Reviewed By: jbakker
Maniphest Tasks: T74906, T74622, T75331, T76530
Differential Revision: https://developer.blender.org/D7105
|
|
Should be no functional changes.
|
|
These values were hardcoded before Face Sets were enabled for Multires,
so enable the show_face_sets checks now.
Reviewed By: jbakker
Maniphest Tasks: T75329
Differential Revision: https://developer.blender.org/D7444
|
|
|
|
This implements the Sculpt Mode API functions needed for Face Sets and
visibility management for PBVH_GRIDS. No major changes were needed in
the operators and the sculpt mode code. This implementation stores the
face sets in the base mesh, so faces created in higher subdivision
levels can't be modified individually. Also, we are not checking for
multiple face sets per vertex (that can be added in the future), so
relax tools don't work yet. The rest of the features (paint, undo,
visibility operators..) work as expected.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D7168
|
|
Using a float to store and render the mask seems like a waste of memory
without any noticeable difference in the viewport for its use case.
After this commit, the mask and the face sets combined should take the
same amount of GPU memory than only the mask in previous versions.
Reviewed By: jbakker
Differential Revision: https://developer.blender.org/D7148
|
|
SCULPT_FACE_SET_NONE default value is 0 and it is rendered hidden, so
the invert sign operation to show it was not working. Now the show all
function sets this face set to ID 1 before setting its sign.
I also refactored this check in gpu_buffers.
Not related to the reported issue, but the mesh in attached contains non
manifold geometry with hidden loose vertices, so the visibility state
was not syncing correctly to those vertices. Now the toggle operators
checks the current visibility only on the face sets, so no manifold
vertices are ignored (as they are in the rest of operations in sculpt
mode).
Reviewed By: jbakker
Maniphest Tasks: T74780
Differential Revision: https://developer.blender.org/D7188
|
|
The default face set color is white, so we can skip drawing the default
face set. This allows to enable again the optimization of not drawing
overlays in nodes where the mask is empty.
This will still slow down the viewport when a new face set is created
for the whole mesh or when inverting the mask, like in previous
versions.
I also renamed the function to make more clear that now it is checking
for both mask and face sets.
Reviewed By: brecht
Maniphest Tasks: T74692
Differential Revision: https://developer.blender.org/D7207
|