Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-02-11File headers: SPDX License migrationCampbell Barton
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
2022-01-20Revert "Sculpt: Multires Heal Brush"Joseph Eagar
This reverts commit ae349eb2d50524b030f702b8ed3fd75531d4db7e.
2022-01-20Sculpt: Multires Heal BrushJoseph Eagar
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.
2021-12-27OpenSubDiv: add support for an OpenGL evaluatorKévin Dietrich
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
2021-10-14Cleanup: avoid using size for array length in namingCampbell Barton
Confusing when array allocation takes two kinds of size arguments.
2021-10-14Cleanup: pass the sizeof(..) as the second arg for array allocationCampbell Barton
By argument naming and convention this is the intended argument order.
2021-10-12Cleanup: spelling in commentsCampbell Barton
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-18Cleanup: clang-tidyCampbell Barton
2021-06-08Improve multires performance.Joseph Eagar
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
2021-06-08Revert "Improve multires performance."Joseph Eagar
. . .because I accidentally committed submodule references. This reverts commit 482465e18aa7c9f74fcb90ec1002f157a580e240.
2021-06-08Improve multires performance.Joseph Eagar
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
2020-10-15Fix Multires edge adjacency info returning wrong vertex indicesPablo Dobarro
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
2020-08-12Sculpt: Multires Displacement Eraser BrushPablo Dobarro
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
2020-08-12Subdiv CCG: Cleanup, remove redundant castsSergey Sharybin
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
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-05Cleanup: spellingCampbell Barton
2020-08-05Fix T78665: Face Set visibility reverted when chaning Multires LevelsPablo Dobarro
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
2020-08-05Fix missing duplicates in the subdiv_ccg neighbors functionPablo Dobarro
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
2020-07-09Fix T78664: Implement Mesh and Face Set boundary automasking in MultiresPablo Dobarro
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
2020-06-22Subdiv CCG: Add access to first grid index of a faceSergey Sharybin
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.
2020-06-22Subdiv: Cleanup, remove unused codeSergey Sharybin
2020-04-29Cleanup: use doxy sections for multires & subdiv sourcesCampbell Barton
2020-04-22Merge branch 'blender-v2.83-release'Sebastián Barschkis
2020-04-22Cleanup: Spelling in function nameSergey Sharybin
Should be no functional changes.
2020-04-17Task: Separate Finalize into Reduce And FreeJeroen Bakker
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
2020-04-01Subdiv: Split evaluation begin+refine into separate stepsSergey Sharybin
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.
2020-04-01Cleanup: quiet discarded-qualifiers, unused warningsCampbell Barton
2020-04-01Multires: Initial Face Sets supportPablo Dobarro
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
2020-02-25Fix T72721: Add visibility flags updates to the PBVHPablo Dobarro
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
2019-10-10Cleanup: clang-format, spellingCampbell Barton
2019-10-08Sculpt: support automasking, pose and mask expand for multiresBrecht Van Lommel
These were the last remaining new sculpt tools that did not support multires. Performance could be improved still, but it should work. Fixes T68899
2019-10-08Cleanup: avoid converting from CCGElem to SubdivCCGCoordBrecht Van Lommel
The other direction is faster.
2019-10-04Subdiv CCG: add utility functions for accessing multires vertex neighborsSergey Sharybin
This is to be used by the new sculpting tools.
2019-10-03Subdiv CCG: Cleanup, remove unused data from adjacency storageSergey Sharybin
Makes it easier to initialze adjacency, avoid extra re-allocations during initialization, reduces memory footprint.
2019-10-03Cleanup: argument naming, redundant NULL checksCampbell Barton
2019-09-26Fix T70163: Error painting with Subdivision at end of stackSergey Sharybin
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.
2019-09-18Subdiv: Cleanup, split function into smaller onesSergey Sharybin
2019-08-01Cleanup: misc spelling fixesCampbell Barton
T68035 by @luzpaz
2019-07-30BLI_task: Cleanup: rename some structs to make them more generic.Bastien Montagne
TLS and Settings can be used by other types of parallel 'for loops', so removing 'Range' from their names. No functional changes expected here.
2019-07-15Fix T66712: A model shows artifacts in the sculpt modeSergey Sharybin
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
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
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
2019-03-08Fix T61961; Smooth brush distorts multiresSergey Sharybin
The issue was caused by lack of proper accumulation for averaging. Doing it incrementally introduced a bias.
2019-03-08Cleanup: Spelling in commentSergey Sharybin
2019-03-07Multires: Fiux memory leakSergey Sharybin
The work data for materials flags was never freed.
2019-02-26Cleanup: indentation, trailing spaceCampbell Barton
2019-02-22Multires: Support smooth shading when sculptingSergey Sharybin
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.
2019-02-18doxygen: add newline after \fileCampbell Barton
While \file doesn't need an argument, it can't have another doxy command after it.