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-11-09Merge branch 'blender-v3.4-release'Brecht Van Lommel
2022-11-09Fix T100883: crash with particle instancing and clumpingBrecht Van Lommel
Properly initialize clump curve mapping tables for duplis and other cases where this was missed by making a generic init/free function instead of duplicating the same logic in multiple places. Also fold lattice deform init into this.
2022-11-09Merge branch 'blender-v3.4-release'Brecht Van Lommel
2022-11-09Fix T102214: inconsistenty between bake and render with invalid material indexBrecht Van Lommel
When the materal slot index on mesh faces exceeds the number of slots, rendering would use the last material slot while other operations like baking would fall back to the default material. Now consistently use the last material slot in such cases, since preserving backwards compatibility for rendering seems most important. And if there is one material slot, it's more useful to use that one rather than falling back to the default material.
2022-11-05Cleanup: use bool instead of short for job stop & do_update argumentsCampbell Barton
Since these values are only ever 0/1, use bool type.
2022-11-04Cleanup: use bool for render types ok/result_okCampbell Barton
2022-11-04Cleanup: quiet unused argument warningCampbell Barton
2022-11-02Fix memory leak with Freestyle renders after recent changesBrecht Van Lommel
Render stored a shallow copy of the scene view layers and views for thread safety, without proper functions to free it. But with the CoW depsgraph this scene is already a copy of the original and an additional copy is not needed. Refactor to use the scene view layers and some other settings directly instead of making a copy.
2022-11-02Refactor: Rename Object->imat to Object->world_to_objectSergey Sharybin
The goal is to improve clarity and readability, without introducing big design changes. Follows the recent obmat to object_to_world refactor: the similar naming is used, and it is a run-time only rename, meaning, there is no affect on .blend files. This patch does not touch the redundant inversions. Those can be removed in almost (if not all) cases, but it would be the best to do it as a separate change. Differential Revision: https://developer.blender.org/D16367
2022-11-01Refactor: Rename Object->obmat to Object->object_to_worldSergey Sharybin
Motivation is to disambiguate on the naming level what the matrix actually means. It is very easy to understand the meaning backwards, especially since in Python the name goes the opposite way (it is called `world_matrix` in the Python API). It is important to disambiguate the naming without making developers to look into the comment in the header file (which is also not super clear either). Additionally, more clear naming facilitates the unit verification (or, in this case, space validation) when reading an expression. This patch calls the matrix `object_to_world` which makes it clear from the local code what is it exactly going on. This is only done on DNA level, and a lot of local variables still follow the old naming. A DNA rename is setup in a way that there is no change on the file level, so there should be no regressions at all. The possibility is to add `_matrix` or `_mat` suffix to the name to make it explicit that it is a matrix. Although, not sure if it really helps the readability, or is it something redundant. Differential Revision: https://developer.blender.org/D16328
2022-11-01Cleanup: spelling in commentsCampbell Barton
2022-10-20Fix T93382: Blender still generates subsurface render passesLukas Stockner
In T93382, the problem was that the Blender-side rendering code was still generating the subsurface passes because the old render pass flags were set, even though Cycles doesn't generate them anymore. After a closer look, it turns out that the entire hardcoded pass creation code can be removed. We already have an Engine API function to query the list of render passes from the engine, so we might as well just call that and create the returned passes. Turns out that Eevee already did this anyways. On the Cycles side, it allows to deduplicate a lot of `BlenderSync::sync_render_passes`. Before, passes were defined in engine.py and in sync.cpp. Now, all passes that engine.py returns are created automatically, so sync.cpp only needs to handle a few special cases. I'm not really concerned about affecting external renderer addons, since they already needed to handle the old "builtin passes" in their Engine API implementation anyways to make them show up in the compositor. So, unless they missed that for like 10 releases, they should not notice any difference. Differential Revision: https://developer.blender.org/D16295
2022-10-17Cleanup: replace BLI_join_dirfile with BLI_path_joinCampbell Barton
These functions are almost identical, the main difference being BLI_join_dirfile didn't trim existing slashes when joining paths however this isn't an important difference that warrants a separate function.
2022-10-13Mesh: Move runtime data out of DNAHans Goudey
This commit replaces the `Mesh_Runtime` struct embedded in `Mesh` with `blender::bke::MeshRuntime`. This has quite a few benefits: - It's possible to use C++ types like `std::mutex`, `Array`, `BitVector`, etc. more easily - Meshes saved in files are slightly smaller - Copying and writing meshes is a bit more obvious without clearing of runtime data, etc. The first is by far the most important. It will allows us to avoid a bunch of manual memory management boilerplate that is error-prone and annoying. It should also simplify future CoW improvements for runtime data. This patch doesn't change anything besides changing `mesh.runtime.data` to `mesh.runtime->data`. The cleanups above will happen separately. Differential Revision: https://developer.blender.org/D16180
2022-10-13Cleanup: Use correct blenkernel namespace for mesh functionsHans Goudey
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-10-07Cleanup: Avoid inconsistent naming in mesh topology APIHans Goudey
Mesh corners are called "loops" in the code currently. Avoid diverging naming and just use that convention in some newly added code.
2022-10-05Cleanup: Clang tidyHans Goudey
Also remove unnecessary struct keywords in C++ files.
2022-10-04Cleanup: remove unused members from RenderResultBrecht Van Lommel
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-10-03Images: remove option to choose between BW/RGB/RGBA for multilayer EXR saveBrecht Van Lommel
This was not properly respected, and in general with multiple passes and layers it's unclear what this should do exactly without breaking some render passes. Better to keep this image format for raw unmodified render results.
2022-10-02GPU: Fix issue with GPU render boundaries being opened while a GPUBackend ↵Jason Fielder
does not exist. Fixes regression introduced by rBe8bcca4bdc94 (D15900) Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D16085
2022-09-28Mesh: Add C++ implementaiton of topology mappingsHans Goudey
Because they are friendlier to use in C++ code than the existing mesh mapping API, these mappings from one domain to another were often reimplemented in separate files. This commit moves some basic implementations to a `mesh_topology` namespace in the existing mesh mapping header file. These is plenty of room for performance improvement here, particularly by not using an array of Vectors, but that can come later. Split from D16029
2022-09-26Cleanup: remove redundant parenthesisCampbell Barton
2022-09-26Cleanup: use 'u' prefixed integer types for brevity in C codeCampbell Barton
This also simplifies using function style casts when moving to C++.
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: use 'u' prefixed integer types for brevity & cast styleCampbell Barton
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
2022-09-23Cleanup: float literalsCampbell Barton
2022-09-22GPU: Ensure rendering operations occur within GPU render boundaries.Jason Fielder
This is required by the Metal backend to perform flushing of temporary objective-C resources. This is implemented as a global autoreleasepool, and is to ensure consistency such that all rendering operations, whether called via events, or via main loop will be within an autoreleasepool. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Differential Revision: https://developer.blender.org/D15900
2022-09-22Metal: MTLContext implementation and immediate mode rendering support.Thomas Dinges
MTLContext provides functionality for command encoding, binding management and graphics device management. MTLImmediate provides simple draw enablement with dynamically encoded data. These draws utilise temporary scratch buffer memory to provide minimal bandwidth overhead during workload submission. This patch also contains empty placeholders for MTLBatch and MTLDrawList to enable testing of first pixels on-screen without failure. The Metal API also requires access to the GHOST_Context to ensure the same pre-initialized Metal GPU device is used by the viewport. Given the explicit nature of Metal, explicit control is also needed over presentation, to ensure correct work scheduling and rendering pipeline state. Authored by Apple: Michael Parkin-White Ref T96261 (The diff is based on 043f59cb3b5835ba1a0bbf6f1cbad080b527f7f6) Reviewed By: fclem Differential Revision: https://developer.blender.org/D15953
2022-09-14Adding `const Scene*` parameter in many areas.Monique Dewanchand
Related to {D15885} that requires scene parameter to be added in many places. To speed up the review process the adding of the scene parameter was added in a separate patch. Reviewed By: mont29 Maniphest Tasks: T73411 Differential Revision: https://developer.blender.org/D15930
2022-09-12Fix T100956: Cycles GPU context assert after recent changesBrecht Van Lommel
We don't need to be on the main thread to destroy the context.
2022-09-10Cleanup: spelling in commentsCampbell Barton
2022-09-09Cleanup: remove BLI_make_file_stringCampbell Barton
This function did multiple things making it difficult to know what was intended by the caller: - Directory & file join. - Expand relative '//' prefix to an optional directory. - Expand drive letters on windows (guessing with fall-backs). - Switch slashes to native direction. This functionality wasn't needed as the full directory was always passed in, so guessing the drive letter wasn't needed. If functionality to add drive letters onto paths is needed in the future a function that only does this can be added.
2022-09-09Realtime Compositor: Implement blur nodeOmar Emara
This patch implements the blur node for the realtime compositor. The patch is still missing the Variable Size option because it depends on the Erode/Dilate node, which is yet to be implemented. Furthermore, there are a number of optimizations that can be implemented, the most important of which is the IIR implementation of the Fast Gaussian filter, as well as the use of hardware filtering and thread local memory. The latter of which was attempted but was not robust enough, so it will be submitted as separate patch. Differential Revision: https://developer.blender.org/D15663 Reviewed By: Clement Foucault
2022-09-07Cleanup: Tweak naming for recently added mesh accessorsHans Goudey
Use `verts` instead of `vertices` and `polys` instead of `polygons` in the API added in 05952aa94d33eeb50. This aligns better with existing naming where the shorter names are much more common.
2022-09-05Mesh: Remove redundant custom data pointersHans Goudey
For copy-on-write, we want to share attribute arrays between meshes where possible. Mutable pointers like `Mesh.mvert` make that difficult by making ownership vague. They also make code more complex by adding redundancy. The simplest solution is just removing them and retrieving layers from `CustomData` as needed. Similar changes have already been applied to curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of the pointers generally makes code more obvious and more reusable. Mesh data is now accessed with a C++ API (`Mesh::edges()` or `Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`). The CoW changes this commit makes possible are described in T95845 and T95842, and started in D14139 and D14140. The change also simplifies the ongoing mesh struct-of-array refactors from T95965. **RNA/Python Access Performance** Theoretically, accessing mesh elements with the RNA API may become slower, since the layer needs to be found on every random access. However, overhead is already high enough that this doesn't make a noticible differenc, and performance is actually improved in some cases. Random access can be up to 10% faster, but other situations might be a bit slower. Generally using `foreach_get/set` are the best way to improve performance. See the differential revision for more discussion about Python performance. Cycles has been updated to use raw pointers and the internal Blender mesh types, mostly because there is no sense in having this overhead when it's already compiled with Blender. In my tests this roughly halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million face grid). Differential Revision: https://developer.blender.org/D15488
2022-09-02Cleanup: Fix clang-tidy warnings: [readability-else-after-return]Clément Foucault
2022-09-02Cleanup: Fix clang-tidy warnings: ↵Clément Foucault
[readability-inconsistent-declaration-parameter-name]
2022-09-02Cleanup: Fix clang-tidy warnings: [modernize-use-bool-literals]Clément Foucault
2022-09-02Cleanup: Fix clang-tidy warnings: [modernize-deprecated-headers]Clément Foucault
2022-08-31Fix part of T100626: Cycles not using tiles for bakingBrecht Van Lommel
Leading to excessive memory usage compared to Blender 2.93. There's still some avoidable memory usage remaining, due to the full float buffer in the new image editor drawing and not loading the cached EXR from disk in tiles. Main difficulty was handling multi-image baking and disk caches, which is solved by associating a unique layer name with each image so it can be matched when reading back the image from the disk. Also some minor header changes to be able to use RE_MAXNAME in RE_bake.h.
2022-08-31Mesh: Move material indices to a generic attributeHans Goudey
This patch moves material indices from the mesh `MPoly` struct to a generic integer attribute. The builtin material index was already exposed in geometry nodes, but this makes it a "proper" attribute accessible with Python and visible in the "Attributes" panel. The goals of the refactor are code simplification and memory and performance improvements, mainly because the attribute doesn't have to be stored and processed if there are no materials. However, until 4.0, material indices will still be read and written in the old format, meaning there may be a temporary increase in memory usage. Further notes: * Completely removing the `MPoly.mat_nr` after 4.0 may require changes to DNA or introducing a new `MPoly` type. * Geometry nodes regression tests didn't look at material indices, so the change reveals a bug in the realize instances node that I fixed. * Access to material indices from the RNA `MeshPolygon` type is slower with this patch. The `material_index` attribute can be used instead. * Cycles is changed to read from the attribute instead. * BMesh isn't changed in this patch. Theoretically it could be though, to save 2 bytes per face when less than two materials are used. * Eventually we could use a 16 bit integer attribute type instead. Ref T95967 Differential Revision: https://developer.blender.org/D15675
2022-08-31Cleanup: quiet MSVC warning using flag flag operations on booleanCampbell Barton
While harmless it wasn't clear if other bits might be set but ignored, assign the value instead.
2022-08-30Cleanup: simplify comparison, clarify commentCampbell Barton
2022-08-29Cleanup: move Cycles display driver context handling to render moduleBrecht Van Lommel
This is highly coupled to Blender logic so doesn't belong in Cycles.
2022-08-29Cleanup: move part of render module to C++Brecht Van Lommel
2022-08-23Cleanup: match names between functions & declarationsCampbell Barton
2022-08-22Cleanup: remove dead codeCampbell Barton
2022-08-15Merge branch 'blender-v3.3-release'Sergey Sharybin