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-08-26Merge branch 'blender-v3.3-release'Bastien Montagne
2022-08-26Fix T55284: error in Hybrid MultiFractal Musgrave textureLuis Pereira
The calculation was revised to address two issues: * Discontinuities occurring when detail was a non-integer greater than 2. * Levels of detail in the interval [0,1) repeating the levels of detail in the interval [1,2). This fixes Cycles, Eevee and geometry nodes. Differential Revision: https://developer.blender.org/D15785
2022-08-26Cleanup: reduce variable scopeCampbell Barton
2022-08-25Cleanup: rename mat3_to_quat_is_ok to mat3_to_quat_legacyCampbell Barton
Update comment, noting why this is kept.
2022-08-25BLI_math: ensure non-negative matrices for mat3_to_quat calculationsCampbell Barton
Making the callers responsible for this isn't practical as matrices are often passed indirectly to a functions such as mat3_to_axis_angle, BKE_object_mat3_to_rot & BKE_pchan_mat3_to_rot. Or the matrix is combined from other matrices which could be negative. Given quaternions calculated from negative matrices are completely invalid and checking only needs to negate matrices with a negative determinant, move the check into mat3_to_quat and related functions. Add mat3_normalized_to_quat_fast for cases no error checking on the input matrix is needed such as blending rotations.
2022-08-25Cleanup: remove outdated, unhelpful commentsCampbell Barton
2022-08-24BLI_math: assert mat3_normalized_to_quat doesn't use a negative matrixCampbell Barton
Add an assert to ensure callers don't pass in negative matrices as the resulting quaternion is invalid.
2022-08-24Cleanup: use determinant_m3(m) < 0 to implement is_negative_m3/m4Campbell Barton
Use a more direct method of checking if a matrix is negative instead of using cross & dot product. Also replace some determinant_m3() < 0 checks with is_negative_m3.
2022-08-23Cleanup: simplify partition functionsCampbell Barton
- Assign return arguments last instead of manipulating them. - Remove redundant NULL assignment of return arguments.
2022-08-22Cleanup: match names between functions & declarationsCampbell Barton
Mostly update the declarations, in some cases rename in the function especially when the names used were inconstant with related functions.
2022-08-18CMake: support building with musl libclistout
Instead of using macros like GLIBC we can use the CMake build systems internal functions to check if some header or functions are present on the running system's libc. Add ./build_files/cmake/have_features.cmake to add checks for platform features which can be used to set defines for source files that require them. Reviewed By: campbellbarton Ref D15696
2022-08-17Cleanup: strip blank lines around comment blocksCampbell Barton
2022-08-15Cleanup: simplify sin_cos_from_fractionChris Blackbourn
Multiply numerator and denominator by 8 to split circle into octants. Use symmetry and negation to increase precision.
2022-08-12Cleanup: repeated words in commentsCampbell Barton
2022-08-09Cleanup: use own username in code-comment tagsCampbell Barton
2022-07-30UI: UI_MENU_ARROW_SEP Unicode CharacterHarley Acheson
Use a smaller arrow text character as menu item separator. See D15578 for examples and details. Differential Revision: https://developer.blender.org/D15578 Reviewed by Julian Eisel
2022-07-28BLI_math: improve symmetrical values from sin_cos_from_fractionCampbell Barton
When plotting equally distant points around a circle support an extra axis of symmetry so twice as many exact values are repeated than originally added in [0], see code-comments for a detailed explanation. Tests to ensure accuracy and exact symmetry have been added too. Follow up on fix for T87779. [0]: 087f27a52f7857887e90754d87a7a73715ebc3fb
2022-07-28BLI_math: improve symmetrical values from sin_cos_from_fractionCampbell Barton
When plotting equally distant points around a circle support an extra axis of symmetry so twice as many exact values are repeated than originally added in [0], see code-comments for a detailed explanation. Tests to ensure accuracy and exact symmetry have been added too. Follow up on fix for T87779. [0]: 087f27a52f7857887e90754d87a7a73715ebc3fb
2022-07-26Cleanup: spelling in commentsCampbell Barton
2022-07-23Fix an assert trip in boolean tickled by D11272 example.Howard Trickey
The face merging code in exact boolean made an assumption that the tesselated original face was manifold except at the boundaries. This should be true but sometimes (e.g., if the input faces have self-intersection, as happens in the example), it is not. This commit makes face merging tolerant of such a situation. It might leave some stray edges from triangulation, but it should only happen if the input is malformed. Note: the input may be malformed if there were previous booleans in the stack, since snapping the exact result to float coordinates is not guaranteed to leave the mesh without defects. This is the second try at this commit. The previous one had a typo in it -- luckily, the tests caught the problem.
2022-07-22Fix T87779: Asymmetric vertex positions in circles primitivesCampbell Barton
Add sin_cos_from_fraction which ensures each quadrant has matching values when their sign is flipped.
2022-07-21Geometry Nodes: add debug check for whether AttributeWriter.finish is calledJacques Lucke
Calling `finish` after writing to generic attributes is currently necessary for correctness. Previously, this was easy to forget. Now there is a check for this in debug builds.
2022-07-20Curves: Port fillet node to the new data-blockHans Goudey
This commit ports the fillet curves node to the new curves data-block, and moves the fillet node implementation to the geometry module to help separate the implementation from the node. The changes are similar to the subdivide node or resample node. I've resused common utilities where it makes sense, though some things like the iteration over attributes can be generalized further. The node is now multi-threaded per-curve and inside each curve, and some buffers are reused per curve to avoid many allocations. The code is more explicit now, and though there is more boilerplate to pass around many spans, the more complex logic should be more readable. Differential Revision: https://developer.blender.org/D15346
2022-07-16Fix T99744: NULL pointer free with corrupt zSTD readingCampbell Barton
2022-07-15BLI_bitmap: ability to declare by-value, and function to find lowest unset bitAras Pranckevicius
In preparation for a larger change (D14162), some BLI_bitmap functionality that could be submitted separately: - Ability to declare a fixed size bitmap by-value, without extra memory allocation: BLI_BITMAP_DECLARE - Function to find the index of lowest unset bit: BLI_bitmap_find_first_unset - Test coverage of the above. Reviewed By: Campbell Barton, Bastien Montagne Differential Revision: https://developer.blender.org/D15454
2022-07-14BLI: fix finding indices from virtual arrayJacques Lucke
The sorting of index vectors assumed that all vectors have at least one element. Now this is checked for more explicitely.
2022-07-14Fix T99684: Upgrade Averages Island Scale with options Scale UV and ShearChris Blackbourn
Differential Revision: https://developer.blender.org/D15421
2022-07-12Fix: set dangling pointer to nullJacques Lucke
The data has been moved somewhere else, the span should not keep a pointer to it.
2022-07-12Fix: Incorrect coordinates used in BLI_rct*_isect_segment functionsSiddhartha Jejurkar
Ref D15330.
2022-07-11Revert "Fix an assert trip in boolean tickled by D11272 example."Howard Trickey
This reverts commit 65432901162c0dff124d55a04875050fd0f1ac22. It broke tests and I don't know why, so reverting this while figuring that out.
2022-07-10Fix an assert trip in boolean tickled by D11272 example.Howard Trickey
The face merging code in exact boolean made an assumption that the tesselated original face was manifold except at the boundaries. This should be true but sometimes (e.g., if the input faces have self-intersection, as happens in the example), it is not. This commit makes face merging tolerant of such a situation. It might leave some stray edges from triangulation, but it should only happen if the input is malformed. Note: the input may be malformed if there were previous booleans in the stack, since snapping the exact result to float coordinates is not guaranteed to leave the mesh without defects.
2022-07-07BLI: make some spans default constructibleJacques Lucke
`GSpan` and spans based on virtual arrays were not default constructible before, which made them hard to use sometimes. It's generally fine for spans to be empty. The main thing the keep in mind is that the type pointer in `GSpan` may be null now. Generally, code receiving spans as input can assume that the type is not-null, but sometimes that may be valid. The old #type() method that returned a reference to the type still exists. It asserts when the type is null.
2022-07-04BLI: Use simpler sliced generic virtual arrays when possibleHans Goudey
This is just a theoretical improvement currently, I won't try to justify it with some microbenchmark, but it should be better to use the specialized single and span virtual arrays when slicing a `GVArray`, since any use of `GVArrayImpl_For_SlicedGVArray` has extra overhead. Differential Revision: https://developer.blender.org/D15361
2022-07-02BLI: refactor length parameterizationJacques Lucke
This refactor had two main goals: * Simplify the sampling code by using an algorithm with fewer special cases. * Generalize the sampling to support non-sorted samples. The `SampleSegmentHint` optimization was inspired by `ValueAccessor` from OpenVDB and improves performance 2x in my test cases. Differential Revision: https://developer.blender.org/D15348
2022-07-02BLI: improve span access to virtual arraysJacques Lucke
* Make the class names more consistent. * Implement missing move-constructors and assignment-operators.
2022-07-01Cleanup: Simplify logic building in length parameterizationHans Goudey
We can construct an IndexRange directly rather than retrieving it.
2022-07-01IO: print import & export times of Alembic & USDAras Pranckevicius
Many existing importers/exporters do log the time it takes to system console (some others log more information too). In particular, OBJ (C++ & python), STL (C++ & python), PLY, glTF2 all log the time it takes. However, neither USD nor Alembic do. And also it's harder to know the time it takes there from a profiler, since all the work normally is done on a background job and is split between several threads (so you can't just find some top-level function and see how much time it took). This change: - Adds import/export time logging to USD & Alembic importer/exporter, - In the time utility class (also used by OBJ & STL), improve the output formatting: 1) print only one decimal digit, 2) for long times, print seconds and also produce a hours:minutes:seconds form. Reviewed By: Michael Kowalski, Kévin Dietrich Differential Revision: https://developer.blender.org/D15170
2022-07-01Metal: MTLMemoryManager implementation includes functions which manage ↵Jason Fielder
allocation of MTLBuffer resources. The memory manager includes both a GPUContext-local manager which allocates per-context resources such as Circular Scratch Buffers for temporary data such as uniform updates and resource staging, and a GPUContext-global memory manager which features a pooled memory allocator for efficient re-use of resources, to reduce CPU-overhead of frequent memory allocations. These Memory Managers act as a simple interface for use by other Metal backend modules and to coordinate the lifetime of buffers, to ensure that GPU-resident resources are correctly tracked and freed when no longer in use. Note: This also contains dependent DIFF changes from D15027, though these will be removed once D15027 lands. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15277
2022-06-29LineArt: Shadow and related functionalities.Yiming Wu
This patch includes the full shadow functionality for LineArt: - Light contour and cast shadow lines. - Lit/shaded region selection. - Enclosed light/shadow shape calculation. - Silhouette/anti-silhouette selection. - Intersection priority based on shadow edge identifier. Reviewed By: Sebastian Parborg (zeddb) Differential Revision: https://developer.blender.org/D15109
2022-06-29Cleanup: Fix mul_v2_v2_ccw for repeated arguments (no functional changes)Chris Blackbourn
Prep for D15263
2022-06-27BLI: Math: Add ceil_to_multiple_u()Clément Foucault
Standalone version of a function added to `BLI_math_vector.hh`.
2022-06-25Cleanup: add missing overrideJacques Lucke
2022-06-25BLI: improve check for common virtual array implementationsJacques Lucke
This reduces the amount of code, and improves performance a bit by doing more with less virtual method calls. Differential Revision: https://developer.blender.org/D15293
2022-06-23Geometry Nodes: Optimize selection for virtual array inputHans Goudey
This makes calculation of selected indices slightly faster when the input is a virtual array (the direct output of various nodes like Face Area, etc). The utility can be helpful for other areas that need to find selected indices besides field evaluation. With the face area node used as a selection with 4 million faces, the speedup is 3.51 ms to 3.39 ms, just a slight speedup. Differential Revision: https://developer.blender.org/D15127
2022-06-21Fix T99033: KDTree deduplication can erase valuesChris Blackbourn
Differential Revision: https://developer.blender.org/D15220
2022-06-17BLF: Fallback Font StackHarley Acheson
Allow use of multiple fonts acting together like a fallback stack, where if a glyph is not found in one it can be retrieved from another. See D12622 for much more detail Differential Revision: https://developer.blender.org/D12622 Reviewed by Brecht Van Lommel
2022-06-15math: improve accuracy of Linear->sRGB conversion SIMD pathAras Pranckevicius
srgb_to_linearrgb_v3_v3 is using an approximation of powf that is SIMD. However, while the accuracy of it is ok, a larger issue is that it produces different results on Intel compared to ARM architectures. On ARM (e.g. AppleSilicon), the result of the SIMD code path is much closer to the reference implementation. This seems to be because of _mm_rsqrt_ps usage in _bli_math_fastpow512. The ARM/NEON code path emulates inverse square root with a combination of vrsqrteq_f32 followed by two Newton-Raphson iterations, because blender uses the SSE2NEON_PRECISE_SQRT define. This commit adds similar NR iterations to the "actual SSE" code path as well. Max error of srgb->linear->srgb conversion roundtrip goes from 0.000211 down to about 0.000062. Reviewed By: Sergey Sharybin Differential Revision: https://developer.blender.org/D15193
2022-06-11Fix T98517: Curve Fill Node creating extra edges.Howard Trickey
The delaunay2d function, with mode CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES sometimes didn't eat away all of the edges. Doing a prepass to remove the outer edges until they hit the constraints solves this problem.
2022-06-09Cleanup: use const variables & argumentsCampbell Barton
2022-06-07Cleanup: spelling in comments, additional white spaceCampbell Barton