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-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-29BLI: add Vector.append_and_get_index with rvalue parameterJacques Lucke
This makes it possible to use this method with `std::unique_ptr`.
2022-06-29Cleanup: Fix mul_v2_v2_ccw for repeated arguments (no functional changes)Chris Blackbourn
Prep for D15263
2022-06-28BLI: add kdtree range search method that accepts c++ lambdaJacques Lucke
This is easier to use in C++ code compared to passing a function and user-data separately.
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-27Cleanup: spelling in commentsCampbell Barton
2022-06-25BLI: improve support for trivial virtual arraysJacques Lucke
This commits reduces the number of function calls through function pointers in `blender::Any` when the stored type is trivial. Furthermore, this implements marks some classes as trivial, which we know are trivial but the compiler does not (the standard currently says that any class with a virtual destructor is non-trivial). Under some circumstances we know that final child classes are trivial though. This allows for some optimizations. Also see https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p1077r0.html.
2022-06-25Functions: avoid using Map for small valuesJacques Lucke
This leads to a 5-10% performance improvement in my benchmark that runs a procedure many times on a single element.
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-23Cleanup: Clang tidyHans Goudey
Mainly duplicate includes and else after return.
2022-06-21Cleanup: Grammar in commentsHans Goudey
2022-06-21Fix T99033: KDTree deduplication can erase valuesChris Blackbourn
Differential Revision: https://developer.blender.org/D15220
2022-06-20BLI: add min_inplace and max_inplace functionsJacques Lucke
2022-06-19BLI: avoid unnecessary allocation when converting virtual arrayJacques Lucke
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-09Cleanup: spelling in comments & variablesCampbell Barton
2022-06-08Fix: Incorrect curves and pointcloud bounding boxesHans Goudey
The generic bounds utility used an incorrect initial value. The value cannot be zero-initialized, because that breaks the case where all values are greater than zero.
2022-06-08Curves: Port set type node to new data-blockHans Goudey
This commit ports the "Set Spline Type" node to the new curves type. Performance should be improved in similar ways to the other refactors from the conversion task (T95443). Converting to and from Catmull Rom curves is now supported. There are a few cases where a lot of work can be skipped: when the number of points doesn't change, and when the types already match the goal type. The refactor has a few other explicit goals as well: - Don't count on initialization of attribute arrays when they are first allocated. - Avoid copying the entire data-block when possible. - Make decisions about which attributes to copy when changing curves more obvious. - Use higher-level methods to copy data between curve points. - Optimize for the common cases of single types and full selections. - Process selected curves of the same types in the same loop. The Bezier to NURBS conversion is written by Piotr Makal (@pmakal). Differential Revision: https://developer.blender.org/D14769
2022-06-07BLI: Math: Add description and test to `ceil_to_multiple` and `divide_ceil`Clément Foucault
I took the decision to assert on unexpected value as the behavior of these functions are not consistent across the whole integer domain.
2022-06-07BLI: Math: Add `math::divide_ceil` and `math::ceil_to_multiple`Clément Foucault
`math::divide_ceil` is just the vector implementation of `divide_ceil_u`. `math::ceil_to_multiple` is similar but finaly multiply by the divisor. It is handy to handle tile buffers resolutions.
2022-06-07Cleanup: spelling in comments, minor formatting tweaksCampbell Barton
2022-06-07Cleanup: spelling in comments, additional white spaceCampbell Barton
2022-06-06BLI: fix memory error when moving VArray_SpanJacques Lucke
The issue was that the new span still referenced data that was potentially stored in the old VArray_Span.
2022-06-05Curves: use uv coordinates to attach curves to meshJacques Lucke
This implements the new way to attach curves to a mesh surface using a uv map (based on the recent discussion in T95776). The curves data block now not only stores a reference to the surface object but also a name of a uv map on that object. Having a uv map is optional for most operations, but it will be required later for animation (when the curves are supposed to be deformed based on deformation of the surface). The "Empty Hair" operator in the Add menu sets the uv map name automatically if possible. It's possible to start working without a uv map and to attach the curves to a uv map later on. It's also possible to reattach the curves to a new uv map using the "Curves > Snap to Nearest Surface" operator in curves sculpt mode. Note, the implementation to do the reverse lookup from uv to a position on the surface is trivial and inefficient now. A more efficient data structure will be implemented separately soon. Differential Revision: https://developer.blender.org/D15125
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-05-31Functions: speedup preparing multi-function parametersJacques Lucke
My benchmark which spend most time preparing function parameters takes `250 ms` now, from `510 ms` before. This is mainly achieved by doing less unnecessary work and by giving the compiler more inlined code to optimize. * Reserve correct vector sizes and use unchecked `append` function. * Construct `GVArray` parameters directly in the vector, instead of moving/copying them in the vector afterwards. * Inline some constructors, because that allows the compiler understand what is happening, resulting in less code. This probably has negilible impact on the user experience currently, because there are other bottlenecks. Differential Revision: https://developer.blender.org/D15009
2022-05-31Cleanup: Simplify dependencies for GMP math headerHans Goudey
Previously, the base math headers included GMP headers in all cases. This was problematic because we don't want all modules that use the math headers to depend on GMP, and the unnecessary includes could theoretically have detrimental effects to compile times. Now `BLI_math_mpq.hh` depends on `BLI_math_base.hh`, so if a file needs to use exact arithmatic, it can just include the former. Differential Revision: https://developer.blender.org/D15079
2022-05-30Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz Differential Revision: https://developer.blender.org/D15057
2022-05-30Merge branch 'blender-v3.2-release'Jacques Lucke
2022-05-30Curves: make tangent computation more robustJacques Lucke
Previously, when there were multiple curve points at the same or almost the same position, the computed tangent was unpredictable. Now, the handling of this case is more explicit, making it more predictable. In general, when there are duplicate points, it will just use tangents from neighboring points now. Also fixes T98209. Differential Revision: https://developer.blender.org/D15016
2022-05-25BLI: use no_unique_address attributeJacques Lucke
Even though the `no_unique_address` attribute has only been standardized in C++20, compilers seem to support it with C++17 already. This attribute allows reducing the memory footprint of structs which have empty types as data members (usually that is an allocator or inline buffer in Blender). Previously, one had to use the empty base optimization to achieve the same effect, which requires a lot of boilerplate code. The types that benefit from this the most are `Vector` and `Array`, which usually become 8 bytes smaller. All types which use these core data structures get smaller as well of course. Differential Revision: https://developer.blender.org/D14993
2022-05-23Merge branch 'blender-v3.2-release'Brecht Van Lommel
2022-05-23Fix Eevee blackbody wrong with non-default scene linear color spaceBrecht Van Lommel
* Port over new code tables from Cycles * Convert Rec.709 to scene linear for lookup table. * Move code for wavelength and blackbody to IMB so they can access the required transforms, which are not in blenlib. * Remove clamping from blackbody shader to bypass the texture read. Since it's variable now easiest to just always read from the texture than pass additional parameters. * Fold XYZ to RGB conversion into the wavelength table. Ref T68926
2022-05-20Cleanup: don't use variable name that matches type aliasJacques Lucke
2022-05-19Cleanup: BLI_math_base.h: Document `power_of_2_max|min()`Clément Foucault
2022-05-19BLI: float4x4: Add == and != operatorsClément Foucault
2022-05-19BLI: float4x4: Add << operatorClément Foucault
Use nice formating to have lining up rows.
2022-05-18Merge branch 'blender-v3.2-release'Sergey Sharybin
2022-05-18Fix T97761: incorrect mixing of integersJacques Lucke
Sometimes integers are mixed using float weights. In those cases the mixed result has to be converted from into float again. Previously, this was done using a simple cast, which was unexpected because e.g. 14.999 would be cast to 14 instead of 15. Now, the values are rounded properly. This can affect existing files unfortunately without a good option for versioning. Gladly, very few files seem to depend on the details of the old behavior. Differential Revision: https://developer.blender.org/D14892
2022-05-18Cleanup: use "filepath" instead of "filename" for full paths, fileops.cCampbell Barton
Handle separately as fileops.c had to be tested on multiple platforms.
2022-05-18Cleanup: suppress dangling-pointer warning for GCC 12.1+Campbell Barton
2022-05-17Cleanup: Use `BLI_assert_unreachable()` as example in comment of ↵Bastien Montagne
`_BLI_assert_abort`. Using `BLI_assert(0)` should typically be avoided now that we have `BLI_assert_unreachable`...
2022-05-17Cleanup: Use `switch` and `BLI_assert_unreachable()` more.Bastien Montagne
Replace some `if/else if` chains by proper `switch` statement. Replace some `BLI_assert(0)` calls by `BLI_assert_unreachable()` ones.
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-05-11Fix: Build error on windows.Ray Molenkamp
Issue introduced by rBeef98e66cf9e BLI_math_rotation.h uses M_PI which gets defined inside BLI_math_base.h