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-02-10Fix T95666: Crash when attempting multires linear subdivideSergey Sharybin
The crash was happening when the mesh had loose edges. Loose edges are not part of OpenSubdiv topology and hence should not be communicated to the refiner. Pass ta boolean flag indicating whether an edge is loose or not in the mesh foreach routines, which seems to be the easiest way.
2022-01-20Subdivision: add support for vertex creasingKévin Dietrich
This adds vertex creasing support for OpenSubDiv for modeling, rendering, Alembic and USD I/O. For modeling, vertex creasing follows the edge creasing implementation with an operator accessible through the Vertex menu in Edit Mode, and some parameter in the properties panel. The option in the Subsurf and Multires to use edge creasing also affects vertex creasing. The vertex crease data is stored as a CustomData layer, unlike edge creases which for now are stored in `MEdge`, but will in the future also be moved to a `CustomData` layer. See comments for details on the difference in behavior for the `CD_CREASE` layer between egdes and vertices. For Cycles this adds sockets on the Mesh node to hold data about which vertices are creased (one socket for the indices, one for the weigths). Viewport rendering of vertex creasing reuses the same color scheme as for edges and creased vertices are drawn bigger than uncreased vertices. For Alembic and USD, vertex crease support follows the edge crease implementation, they are always read, but only exported if a `Subsurf` modifier is present on the Mesh. Reviewed By: brecht, fclem, sergey, sybren, campbellbarton Differential Revision: https://developer.blender.org/D10145
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: pass the sizeof(..) as the second arg for array allocationCampbell Barton
By argument naming and convention this is the intended argument order.
2021-07-05Cleanup: spelling in commentsCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2020-11-24Fix T77261: Multires creates spikes when subdividing ngonsSergey Sharybin
The spikes were caused by non-initialized tangent matrix used during smoothing process. The reason tangent matrix was not initialized was because wrong usage of API: n-gons should pass corner of 0 to the matrix construction function. Corrected usage of the API and added assert() to help catching such kind of non-initialized issues easier.
2020-07-10Cleanup: spellingCampbell Barton
2020-05-28Cleanup: spellingCampbell Barton
2020-05-13Multires: Fix wrong or missing mask propagationSergey Sharybin
Propagation when changing sculpt level was missing. In fact, the mask was simply completely removed when changing sculpt level. Subdivision worked for simple and linear subdivision, but Catmull-Clark was giving empty results. Fixes propagation part of T76386.
2020-05-13Multires: Update and add commentsSergey Sharybin
2020-05-13Multires: Fix mask interpolation weightsSergey Sharybin
Weights were in the different order from corners. Doesn't fix propagation issues, but fixes an essential step towards fully correct propagation.
2020-05-12Merge branch 'blender-v2.83-release'Sergey Sharybin
2020-05-12Multires: Cleanup, clarify commentsSergey Sharybin
2020-05-12Multires: Correct NULL-pointer checkSergey Sharybin
There is some hard-to-reproduce scenario when top level would have masks allocated, but without masks on the sculpt level. Need to check proper array before accessing its elements. The check for top-level masks is done by the caller.
2020-05-09Cleanup: double-spaces in commentsCampbell Barton
2020-04-30Fix crash when switching subdivision level in MultiresPablo Dobarro
When using multires_reshape_context_create_from_ccg to create the context mmd is null, so the subdivision smooth mode can't be checked there. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7579
2020-04-30Multires: Subdivide Simple and Subdivide LinearPablo Dobarro
This introduces two alternative subdivision modes that generates displacement on the grids that look as Simple subdivisions but while using the Catmull-Clark subdivision type in the modifier. This way, Simple and Catmull-Clark subdivision can be combined when creating new levels if needed, for example, to sculpt hard surface objects. Subdivide simple smooths the sculpted data when creating a new subdivision level. Subdivide linear also preserves the sharpness in the sculpted data. Reviewed By: sergey Differential Revision: https://developer.blender.org/D7415
2020-04-29Cleanup: use doxy sections for multires & subdiv sourcesCampbell Barton
2020-04-06Cleanup: spellingCampbell Barton
2020-04-02Sculpt: Store explicit value for multires sculpt levelSergey Sharybin
Allows to know what level sculpting has been done after the value has been changed in the MultiresModifierData. No functional changes, just preparing code to have everything needed for propagation undo. Differential Revision: https://developer.blender.org/D7307
2020-03-21Cleanup: compiler warningsBrecht Van Lommel
2020-03-19Multires: Support "Subdivide" for Simple subdivision typeSergey Sharybin
Is done by considering all base edges infinitely sharp. In the future can become a different operator option to allow to mix Catmull-Clark and simple subdivisions. For now just sticking to what old good Blender versions were doing. Fixes T74869: Simple subdivision type is not working as it should
2020-03-19Multires: Optimize memory usage furtherSergey Sharybin
Avoid storing any loose edges for the propagation process. Also avoid any edge which crease is zero.
2020-03-19Multires: Reduce memory footprint after previous fixSergey Sharybin
The idea is following: only store information about edges which are 1. Communicated to the OpenSubdiv topology. This rules out all loose edges, as they are not needed for the propagation process. 2. Correspond to edge from the base mesh. This avoids storing edges which are generated between inner face. Those are not to have any sharpness to allow smooth propagation. There is still possible to have memory peak in some obscure case when mesh contains a lot of loose edges. It can be optimized further by utilizing knowledge of the non-loose tags.
2020-03-19Multires: Subdiv, properly support base edge creaseSergey Sharybin
The title says it all actually. The test case is to get default cube, set some edges to non-zero crease, add multires modifier and hit the "Subdivide" button few times. The memory footprint might be optimized by not storing information about inner generated edges.
2020-03-19Multires: Add missing context initializationSergey Sharybin
Might have caused access to uninitialized memory when foreach() would have failed for some reason.
2020-03-19Multires: Cleanup, typo in type nameSergey Sharybin
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-13Multires: Fix Subdivide, Reshape and Apply BaseSergey Sharybin
This change fixes artifacts produced by these operations. On a technical aspect this is done by porting all of the operations to the new subdivision surface implementation which ensures that tangent space used to evaluate modifier and those operations is exactly the same (before modifier will use new code and the operations will still use an old one). The next step is to get sculpting on a non-top level to work, and that actually requires fixes in the undo system.