Age | Commit message (Collapse) | Author |
|
Use a shorter/simpler license convention, stops the header taking so
much space.
Follow the SPDX license specification: https://spdx.org/licenses
- C/C++/objc/objc++
- Python
- Shell Scripts
- CMake, GNUmakefile
While most of the source tree has been included
- `./extern/` was left out.
- `./intern/cycles` & `./intern/atomic` are also excluded because they
use different header conventions.
doc/license/SPDX-license-identifiers.txt has been added to list SPDX all
used identifiers.
See P2788 for the script that automated these edits.
Reviewed By: brecht, mont29, sergey
Ref D14069
|
|
This reverts commit ae349eb2d50524b030f702b8ed3fd75531d4db7e.
|
|
This brush fixes the random spikes that
occasionally happen in multires models.
These spikes can be nearly impossible to
fix manually and can make working with
multires a nightmare.
|
|
This evaluator is used in order to evaluate subdivision at render time, allowing for
faster renders of meshes with a subdivision surface modifier placed at the last
position in the modifier list.
When evaluating the subsurf modifier, we detect whether we can delegate evaluation
to the draw code. If so, the subdivision is first evaluated on the GPU using our own
custom evaluator (only the coarse data needs to be initially sent to the GPU), then,
buffers for the final `MeshBufferCache` are filled on the GPU using a set of
compute shaders. However, some buffers are still filled on the CPU side, if doing so
on the GPU is impractical (e.g. the line adjacency buffer used for x-ray, whose
logic is hardly GPU compatible).
This is done at the mesh buffer extraction level so that the result can be readily used
in the various OpenGL engines, without having to write custom geometry or tesselation
shaders.
We use our own subdivision evaluation shaders, instead of OpenSubDiv's vanilla one, in
order to control the data layout, and interpolation. For example, we store vertex colors
as compressed 16-bit integers, while OpenSubDiv's default evaluator only work for float
types.
In order to still access the modified geometry on the CPU side, for use in modifiers
or transform operators, a dedicated wrapper type is added `MESH_WRAPPER_TYPE_SUBD`.
Subdivision will be lazily evaluated via `BKE_object_get_evaluated_mesh` which will
create such a wrapper if possible. If the final subdivision surface is not needed on
the CPU side, `BKE_object_get_evaluated_mesh_no_subsurf` should be used.
Enabling or disabling GPU subdivision can be done through the user preferences (under
Viewport -> Subdivision).
See patch description for benchmarks.
Reviewed By: campbellbarton, jbakker, fclem, brecht, #eevee_viewport
Differential Revision: https://developer.blender.org/D12406
|
|
Confusing when array allocation takes two kinds of size arguments.
|
|
By argument naming and convention this is the intended argument order.
|
|
|
|
This shows the text as part of the assertion message.
|
|
|
|
|
|
|
|
Added a new api function to stich multires grids
on specific faces in a mesh,
subdiv_ccg_average_faces_boundaries_and_corners,
and changed multires normal calc to use it.
VTune profiling showed that this was a major
performance hit once you get above 10,000 or so
base mesh faces and/or have a high number of
subdivision levels.
Here's a video comparing the difference. Note the
bpy.app_debug switch is not in the final commit.
{F10145323}
And the .blend file:
{F10145346}
Reviewed By: Sergey Sharybin (sergey)
Differential Revision:
https://developer.blender.org/D11334
|
|
. . .because I accidentally committed
submodule references.
This reverts commit 482465e18aa7c9f74fcb90ec1002f157a580e240.
|
|
Added a new api function to stich multires grids
on specific faces in a mesh,
subdiv_ccg_average_faces_boundaries_and_corners,
and changed multires normal calc to use it.
VTune profiling showed that this was a major
performance hit once you get above 10,000 or so
base mesh faces and/or have a high number of
subdivision levels.
Here's a video comparing the difference. Note the
bpy.app_debug switch is not in the final commit.
{F10145323}
And the .blend file:
{F10145346}
Reviewed By: Sergey Sharybin (sergey)
Differential Revision:
https://developer.blender.org/D11334
|
|
ME_POLY_LOOP_NEXT and ME_POLY_LOOP_PREV expect the offset of
the loop in the poly as an argument, in other words, corner index of the poly.
This was violated in some places. It didn't cause issues when base mesh consists
of only quads due to the way how modulus worked inside of the macro. However,
if mesh had non-quad faces adjacency information was returning wrong vertex
indices. This was causing multiple brushes to work erratically, including brushes
like Face Set, Boundary automasking, mesh relax, and others.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D9173
|
|
This brush deletes displacement information of the Multires Modifier,
resetting the mesh to the subdivision limit surface.
This can be use to easily delete parts of the sculpt or to fix
reprojection artifacts after applying a shrinkwrap.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8543
|
|
If one of the operands of a binary operator a float, integer
operand gets promoted to float as well.
Differential Revision: https://developer.blender.org/D8552
|
|
Also order sizeof(..) first to promote other values to size_t.
|
|
|
|
Face Sets where only set and updated on the PBVH after starting a sculpt
tool. In order to preserve the visibility they store when changing
levels, they need to be updated and sync also on PBVH creation
Reviewed By: sergey
Maniphest Tasks: T78665
Differential Revision: https://developer.blender.org/D8225
|
|
Duplicates of a grid corner adjacent to an edge which are on the
adjacent grid of the same face were not added when requested.
Needed for D8356 to work, it may also fix some other bug in Multires.
Reviewed By: sergey
Differential Revision: https://developer.blender.org/D8385
|
|
This implements the SCULPT_vertex_is_boundary and SCULPT_vertex_has_unique_face_set functions for PBVH_GRIDS, which makes features such as automasking now work in multires. It also fixes some other face sets related features in multires, like face set boundary smoothing.
This uses the BKE_subdiv_ccg_coarse_mesh_adjacency_info_get function to get the vertex indicies in the base mesh from multires. This way the API functions can get topology or face set information directly from it. In the future, these vertex indices can be used to get any other information from the base mesh from multires, like seams, sharp edges, disconnected elements IDs...
Reviewed By: sergey
Maniphest Tasks: T78664
Differential Revision: https://developer.blender.org/D8227
|
|
Is lazily-initialized array owned by the SubdivCCG. Allows to access
index of a first grid of a given face in the flat array of grids.
Currently unused, but is needed for multires bake.
|
|
|
|
|
|
|
|
Should be no functional changes.
|
|
In preparation of TBB we need to split the finalize function into reduce
and free. Reduce is used to combine results and free for freeing any
allocated memory.
The reduce function is called to join user data chunk into another, to reduce the
result to the original userdata_chunk memory. These functions should have no side
effects so that they can be run on any thread.
The free functions should free data created during execution (TaskParallelRangeFunc).
Original patch by Brecht van Lommel
{rB61f49db843cf5095203112226ae386f301be1e1a}.
Reviewed By: Brecht van Lommel, Bastien Montagne
Differential Revision: https://developer.blender.org/D7394
|
|
Actually, begin will do the entire initialization.
Refine will only refine if there is a topology refiner associated
with the Subdiv descriptor.
Allows to refine Subdiv to new coarse positions without touching
displacement evaluation. Will be needed to update SubdivCCG during
sculpt undo.
|
|
|
|
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
|
|
Currently, there its a function that sets manually the fully_hidden flag
of the nodes from the visibility operators in paint_hide.c. The undo
code was not updating the flag, so the visibility state of the nodes was
incorrect after preforming undo operations. This sometimes was drawing
fully hidden nodes with empty buffers, causing artifacts in the
geometry.
I added a function to mark nodes which visibility state changed (similar
as we are updating the mask flags and the nodes bounding boxes). This
way, the tools, operators and undo code don't have to update the
visibility flags, making everything much simpler to understand and
maintain.
I did not remove the flag update code from the current visibility
operators in this patch, but after reimplementing them (and all the new
ones) in the new visibility system, all visibility updates should be
done using this method and the BKE_pbvh_node_fully_hidden_set function
should be removed.
Reviewed By: jbakker
Maniphest Tasks: T72721
Differential Revision: https://developer.blender.org/D6767
|
|
|
|
These were the last remaining new sculpt tools that did not support multires.
Performance could be improved still, but it should work.
Fixes T68899
|
|
The other direction is faster.
|
|
This is to be used by the new sculpting tools.
|
|
Makes it easier to initialze adjacency, avoid extra re-allocations during
initialization, reduces memory footprint.
|
|
|
|
Deformation of subdivision surface modifier was using wrong coordinates
for the coarse mesh: as the modifier flow goes the coordinates are to be
taken from the input array of coordinates.
|
|
|
|
T68035 by @luzpaz
|
|
TLS and Settings can be used by other types of parallel 'for loops', so
removing 'Range' from their names.
No functional changes expected here.
|
|
Was a mistake in normals calculation: need to consider all grids for correct
average in the center of the face.
Reviewers: brecht
Reviewed By: brecht
Maniphest Tasks: T66712
Differential Revision: https://developer.blender.org/D5254
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
The issue was caused by lack of proper accumulation for
averaging. Doing it incrementally introduced a bias.
|
|
|
|
The work data for materials flags was never freed.
|
|
|
|
On CCG side it is done similar to displacement, where we have
a dedicated functor which evaluates displacement. Might be seemed
as an overkill, but allows to decouple SubdivCCG from mesh entirely,
and maybe even free up coarse mesh in order to save some memory.
Some weak-looking aspect is the call to update normals from the
draw manager. Ideally, the manager will only draw what is already
evaluated. But it's a bit tricky to find a best place for this since
we avoid dependency graph updates during sculpt as much as possible.
The new code mimics the old code, this is how it was in 2.7.
Fix shading part of T58307.
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|