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-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
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
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-09-25Cleanup: typos in code and comments.Kévin Dietrich
No functional changes.
2020-10-01Fix subdivision surface wrong for non-limit surface and subdivision level 1Brecht Van Lommel
Remove the workaround for T59395 that increases the minimal refinement to 2 to work around an OpenSubdiv bug. This bug appears to be fixed in the latest OpenSubdiv version we are using. Problem found by Piotr Ostrowski. Ref D9076
2020-09-30Subdivision Surfaces: add boundary smooth option to modifiersPiotr Ostrowski
This adds the option to either smooth the entire boundary, or to keep corners sharp, for the Subdivision Surface and Multiresolution modifiers. This mainly helps with compatibility with other software. The default behavior remains to smooth the entire boundary. Differential Revision: https://developer.blender.org/D8485
2020-08-07Code Style: use "#pragma once" in source directoryJacques Lucke
This replaces header include guards with `#pragma once`. A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`), because they are used in other places. This patch has been generated by P1561 followed by `make format`. Differential Revision: https://developer.blender.org/D8466
2020-05-18OpenSubdiv: Cleanup, Remove from legacy SubsurfCCG codeSergey Sharybin
The CPU side implementation is done on a new dedicate base ground. The GPU side must be redone anyway.
2020-03-29Cleanup: spelling, commentsCampbell Barton
2020-03-19Subdiv: Make Blender crease to OSD sharpness reusableSergey Sharybin
Makes it so conversion is centralized in a single place. We might consider removing any conversion, passing value as-is which will be easier for I/O scripts to match crease. The downside of that would be loose of control range in certain qualities and values of crease. There shouldn't be any functional changes in this commit.
2020-03-02Cleanup: make remaining blenkernel headers work in C++Jacques Lucke
2020-02-19Subdiv: Clarify Subdiv settingsSergey Sharybin
The actual naming might also be a subject to change, especially the one around `level`. Tricky part here is that at some point in the API there will be change from Blender modifier's Quality to OpenSubdiv's Level, but which API level is most suitable for this? At least now meaning of settings is better documented ans should be clear what's going on.
2019-09-30Cleanup: spellingCampbell Barton
2019-08-25Cleanup: redundant struct declarationsCampbell Barton
2019-06-17Cleanup: comment, RNA spellingCampbell Barton
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-04-05Fix T63283: Second subdivision modifier does not ignore creaseSergey Sharybin
This is something where there is no single correct behavior, sometimes it's needed to ignore the crease to make mesh more smooth. But sometimes crease is to be considered after first subdivision surface: for example, when adding extra subdivisions for render-time displacement. Made it an option whether modifier needs to take crease into account or not. Existing files should be openable in the 2.7 compatible way, to re-create an old behavior the options is to be manually disabled in the modifier settings. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D4652
2019-04-05Cleanup: SpellingSergey Sharybin
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.
2019-02-06Cleanup: remove redundant doxygen \file argumentCampbell Barton
Move \ingroup onto same line to be more compact and make it clear the file is in the group.
2019-02-02Cleanup: remove author/date info from doxy headersCampbell Barton
2019-02-01Cleanup: remove redundant, invalid info from headersCampbell Barton
BF-admins agree to remove header information that isn't useful, to reduce noise. - BEGIN/END license blocks Developers should add non license comments as separate comment blocks. No need for separator text. - Contributors This is often invalid, outdated or misleading especially when splitting files. It's more useful to git-blame to find out who has developed the code. See P901 for script to perform these edits.
2019-01-22Fix T59395: Subdivision modifier with quality 1 crashes blenderSergey Sharybin
This is actually a workaround for the crash in OpenSubdiv. Topology refiner will have a crash when special conditions are met: - Refiner is configured to use infinitely sharp patches. - Refinement happens for the level 1 (which we call Quality 1 on Blender side). - Mesh has non-quad faces. The workaround is to force refinement to happen to level 2 (or quality 2 on Blender side) when those conditions are met. Later on with the next OpenSubdiv update we can remove this workaround, since there was work done on OpenSubdiv side to deal better with such configurations. The modifier will now be somewhat slower, but this will be compensated with upcoming topology cache enabled by default. The workaround is done when initializing settings, so the comparison of topology refiner settings is happening without any extra workarounds there.
2019-01-18Multires: Correct averagingSergey Sharybin
Before that only normal component was averaged, which is not really correct. Unfortunately, the new code is somewhat slower due to more involved math to deal properly with non-quad faces, but the plan is to move averaging from runtime to edit time, This means, that mdisps will always be continuous around the edges and no averaging on every frame change of animated character will be needed.
2019-01-18Multires: Correct function name, to match behaviorSergey Sharybin
2019-01-18Multires: Cleanup, move utility function to a more public placeSergey Sharybin
2019-01-18Multires: Cleanup, more clear namingSergey Sharybin
2019-01-16Subdiv: Reset evaluator creation statisticsSergey Sharybin
Makes it more clear to see what was exactly happening at the last invocation of subsurf modifier.
2019-01-16Subdiv: Initial implementation of topology cacheSergey Sharybin
This commit makes it so OpenSubdiv's topology refiner is kept in memory and reused for until topology changes. There are the following modifications which causes topology refiner to become invalid: - Change in a mesh topology (for example, vertices, edges, and faces connectivity). - Change in UV islands (adding new islands, merging them and so on), - Change in UV smoothing options. - Change in creases. - Change in Catmull-Clark / Simple subdivisions. The following limitations are known: - CPU evaluator is not yet cached. - UV islands topology is not checked. The UV limitation is currently a stopper for making this cache enabled by default.
2019-01-16Subdiv: Cleanup, pass mesh by const pointerSergey Sharybin
2019-01-16Subdiv: Cleanup, commentsSergey Sharybin
2019-01-10Cleanup: ensure header guards come firstCampbell Barton
Causes clang-format not to detect header guards, indenting all preprocessor lines in the header.
2019-01-04Fix T60124: Multires modifier not reading data from external filesSergey Sharybin
2018-11-01Subdiv: Cleanup, de-duplicate some codeSergey Sharybin
2018-11-01Subdiv: Cleanup, deduplicate some codeSergey Sharybin
2018-10-31OpenSubdiv: API, expose vertex boundary interpolation optionSergey Sharybin
Only affects internal API, bout could be exposed as an option for the compatibility reasons with other software. Is a part of some ongoing development of multires, but might or might not be used.
2018-09-11Subdiv: Initial implementation of CCGSergey Sharybin
Attempts to substitude CCGDM with an OpenSubdiv based structure which has less abstraction levels. The missing part in this substitude is a face pointers which old CCGDM/multires code was using to stitch faces (averaging boundaries). Another curial bit missing: "reshaping" of multires CD_MDISPS to the state of new PBVH grids. The new code is only available when OpenSubdiv modifier is enabled (WITH_OPENSUBDIV_MODIFIER=ON) and with debug value of 128. This is so this WIP code is not interfering with current production machines in the studio. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D3685
2018-09-07Subdiv: Add ptex offsets to a subdiv structureSergey Sharybin
This is something what we need to know quite often from various places. Added it as a cached value in Subdiv itself, so it can be queried easily from any area. Shouldn't be a problem from memory usage point of view, it's 4MB per 1M faces coarse mesh. This is very low percentage of mesh itself, and even lower percentage of highres subdivided mesh.
2018-09-04Subdiv: Move mesh creation functionality to own headerSergey Sharybin
2018-09-04Subdiv: Move evaluation functionality to own headerSergey Sharybin
2018-09-04Subdiv: Move FOREACH functionality to own headerSergey Sharybin
2018-09-04Subsurf: Clarify what Subdiv structure is forSergey Sharybin
2018-08-24Multires: Fix wrong apply deform results when multires has sculpt alreadySergey Sharybin
2018-08-22Subsurf: Implement foreach traversal for subdivsion topologySergey Sharybin
This makes it more generic process to perform actions which depend on ptex face + (u, v) and on subdivided vertex index. Currently it is still just a subdivision calculation process, but same foreach callbacks can easily be used to propagate displacement from known vertex locations back to displacement grids.
2018-08-22Cleanup: styleCampbell Barton
2018-08-15Multires: Initial groundwork to hook up displacement to new Subdiv objectSergey Sharybin
Adds a displacement support for OpenSubdiov based subsurf object implemented as a callback which gives vector displacement in object space. Currently is implemented to calculate displacement based on myltires displacement grids, but we can support things in the future if needed. Submitting to review to see if there is something obviously wrong in the direction (old multires code was sharing same displacement code to both calculate final displaced mesh and reshape an existing one, which is rather confusing and probably can be done more cleanly?). Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D3604
2018-08-14Multires: Begin hooking it up to the new subdiv codeSergey Sharybin
Currently behaves same as subsurf, support of displacement is the next task in the line to tackle!
2018-08-13Subsurf: Make uv boundaries easily extendibleSergey Sharybin
This replaces old single toggle option to subdivide UVs with an enum which can have more options. The usecase for this is to be compatible with other software. But we also might choose different subdivision type as default in the future. DNA and underlying code supports all possible options, but only the ones which are compatible with old subdivision code are currently exposes. Reviewers: brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D3575