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-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
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-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-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-11Cleanup: rename BLI_str_format_attribute_domain_sizeCampbell Barton
This is useful without any functionality specific to attribute domains, rename to `BLI_str_format_decimal_unit` to follow naming of a similar function `BLI_str_format_byte_unit`.
2022-05-11Cleanup: use 'num' / 'size' suffix instead of 'sz'Campbell Barton
GPU code used `sz` as an abbreviation for size, as well as a few other places. Use size where this represents a size in bytes, see: T85728.
2022-05-10Merge branch 'blender-v3.2-release'Clément Foucault
2022-05-09Fix T97906: OpenEXR files with lower case xyz channel names not read correctlyBrecht Van Lommel
Adds some utility functions to avoid using toupper() which depends on the locale and should not be used for this type of parsing.
2022-05-04Nodes: Add general Combine/Separate Color nodesHallam Roberts
Inspired by D12936 and D12929, this patch adds general purpose "Combine Color" and "Separate Color" nodes to Geometry, Compositor, Shader and Texture nodes. - Within Geometry Nodes, it replaces the existing "Combine RGB" and "Separate RGB" nodes. - Within Compositor Nodes, it replaces the existing "Combine RGBA/HSVA/YCbCrA/YUVA" and "Separate RGBA/HSVA/YCbCrA/YUVA" nodes. - Within Texture Nodes, it replaces the existing "Combine RGBA" and "Separate RGBA" nodes. - Within Shader Nodes, it replaces the existing "Combine RGB/HSV" and "Separate RGB/HSV" nodes. Python addons have not been updated to the new nodes yet. **New shader code** In node_color.h, color.h and gpu_shader_material_color_util.glsl, missing methods hsl_to_rgb and rgb_to_hsl are added by directly converting existing C code. They always produce the same result. **Old code** As requested by T96219, old nodes still exist but are not displayed in the add menu. This means Python scripts can still create them as usual. Otherwise, versioning replaces the old nodes with the new nodes when opening .blend files. Differential Revision: https://developer.blender.org/D14034
2022-04-25BLI: optimize constructing new virtual arrayJacques Lucke
Differential Revision: https://developer.blender.org/D14745
2022-04-19Fix T97338: Correct reference count for COM handling and removal of gotosRobert Guetzkow
The fix ensures that the reference count for `IShellItem *pSI` is decremented, preventing a memory leak. For `IFileOperation *pfo` the decrement of the reference count is only attempted when `CoCreateInstance` is successful. Additionally, the gotos have been replaced with nested if/else statements. Reviewed By: brecht Differential Revision: https://developer.blender.org/D14681
2022-04-15Fix: Apply tilt in curves data-block normals calculationHans Goudey
The ported normal calculation from ceed37fc5cbb466a0 neglected to use the tilt attribute to rotate the normals around the tangents. This commit adds that behavior back, adding a new math header file to avoid duplicating the rotation function for normalized axes. Differential Revision: https://developer.blender.org/D14655
2022-04-14Metal: GPU_PRIM_LINE_LOOP alternative implementations.Jason Fielder
Prefer using immVertex3f when 3D shaders are used for 2D rendering due to overhead of vertex padding in hardware. CPU overhead is negligible. Authored by Apple: Michael Parkin-White Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D14494
2022-04-11Cleanup: malformed C-style comment blocks, spellingCampbell Barton
- Missing star prefix. - Unnecessary indentation. - Blank line after dot-points (otherwise doxygen merges with the previous dot-point). - Use back-slash for doxygen commands. - Correct spelling.
2022-04-08Add a utility for sampling segment indices and factors from arbitraryHans Goudey
lengths along a set of points. This can be used for the sample curves node, or finding new points along a curve when extending or shrinking it. This commit uses it in the snake hook brush as an example. The logic is similar to the uniform length sampling, but the next sample length is retrieved from the input instead of multiplication. For the sample node in the future, though this sort of sampling can be potentially done more efficiently for specific curve types besides poly curves, it's simpler, at least as a start, to work on a set of evaluated points that can be treated like a poly curve. Differential Revision: https://developer.blender.org/D14571
2022-04-07BLI: inline fast path of IndexRange::as_spanJacques Lucke
This frequently showed up in profiling but shouldn't. This also updates the code to use atomics for more correctness and adds multi-threading for better performance.
2022-04-07Cleanup: Compilation warning about virtual functionsSergey Sharybin
Method which overrides a base class's virtual methods are expetced to be marked with `override`. This also gives better idea to the developers about what is going on.
2022-04-07BLI: add missing materialize methods for virtual arraysJacques Lucke
This does two things: * Introduce new `materialize_compressed` methods. Those are used when the dst array should not have any gaps. * Add materialize methods in various classes where they were missing (and therefore caused overhead, because slower fallbacks had to be used).
2022-04-05Cleanup: fix various typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D14443
2022-04-05Curves: new Grow/Shrink brushJacques Lucke
This adds a new Grow/Shrink brush which is similar to the Length brush in the old hair system. * It's possible to switch between growing and shrinking by hold down ctrl and/or by changing the direction enum. * 3d brush is supported. * Different brush falloffs are supported. * Supports scaling curves uniformly or shrinking/extrapolating them. Extrapolation is linear only in this patch. * A minimum length settings helps to avoid creating zero-sized curves. Differential Revision: https://developer.blender.org/D14474
2022-04-05Cleanup: use doxygen links to struct membersCampbell Barton
2022-03-31Cleanup: spelling, trailing space for comment-blocksCampbell Barton
2022-03-30Cleanup: use "num" as a suffix in: source/blender/blenlibCampbell Barton
Also replace "num" with: - "number" when it's not used to denote the number of items. - "digits" when digits in a string are being manipulated.
2022-03-30Curves: Add length cache, length paramerterize utilityHans Goudey
This commit adds calculation of lengths along the curve for each evaluated point. This is used for sampling, resampling, the "curve parameter" node, and potentially more places in the future. This commit also includes a utility for calculation of uniform samples in blenlib. It can find evenlyspaced samples along a sequence of points and use linear interpolation to move data from those points to the samples. Making the utility more general aligns better with the more functional approach of the new curves code and makes the behavior available elsewhere. A "color math" header is added to allow very basic interpolation between two colors in the `blender::math` namespace. Differential Revision: https://developer.blender.org/D14382
2022-03-26Fix T95901: Crash in Fill curve (set to N-gon)Howard Trickey
The code that eats away faces until you find input faces in the Constrained Delaunay Triangulation goes too far and crashes when there are no input faces. In the test case there were input faces but they only had two vertices, so were all ignored.
2022-03-25Cleanup: use count or num instead of nbrCampbell Barton
Follow conventions from T85728.
2022-03-24BLI: Add utility for tacking average and min runtimeHans Goudey
This is useful to save time manually averaging many timing results. The minimum is included because often it can be more stable than an average, and it can help to expose calls from other contexts with lower times that would make the average useless. Differential Revision: https://developer.blender.org/D14417
2022-03-24Geometry Nodes: Improve performance writing to vertex groupsHans Goudey
In a test file from T96282, this commit reduces the runtime of the delete geometry node from 82 ms to 23 ms, a 3.6x improvement. Writing to vertex groups in other cases should be faster too. The largest improvement comes from not writing a new weight of zero if the vertex is not in the group. This mirrors the behavior of custom data interpolation in `layerInterp_mdeformvert`. Other improvements come from using `set_all` for writing output attributes and implementing that method for vertex groups. I also implemented `materialize` methods. Though I didn't obverse an improvement from this, I think it's best to remove virtual method call overhead where it's simple to do so. The test file for the delete geometry node needs to be updated. These methods could be parallelized too, but better to do that later. Differential Revision: https://developer.blender.org/D14420
2022-03-23Curves: improve Comb brushJacques Lucke
New supported features: * 3D/spherical brush that samples a good position on the curves. * Falloff. The custom falloff curve mapping is not yet available in the ui because that requires some more ui reorganization. This is better done when we have a better understanding of what settings we need exactly. Currently, the depth of the 3d brush is only sampled once per stroke, when first pressing LMB. Sometimes it is expected that the depth of the brush can change within a single brush. However, implementing that in a good way is not straight forward and might need additional options. Therefore that will be handled separately. Some experimentation results are in D14376. Ref T96445. Differential Revision: https://developer.blender.org/D14376
2022-03-22Fix build when using WITH_TBB=OFF after recent changesBrecht Van Lommel
And wrap tbb::parallel_sort in blender namespace similar to other TBB functionality.
2022-03-19BLI: generalize converting CPPType to static typeJacques Lucke
Previously, the conversion was done manually for a fixed set of types. Now, there is a more general utility that can be used in other contexts (outside of geometry nodes attribute processing) as well.
2022-03-19BLI: move generic data structures to blenlibJacques Lucke
This is a follow up to rB2252bc6a5527cd7360d1ccfe7a2d1bc640a8dfa6.
2022-03-18Cleanup: Compilation warningsSergey Sharybin
Mainly -Wset-but-unused-variable. Makes default compilation on macOS way less noisy. Differential Revision: https://developer.blender.org/D14357
2022-03-18BLI: move CPPType to blenlibJacques Lucke
For more detail about `CPPType`, see `BLI_cpp_type.hh` and D14367. Differential Revision: https://developer.blender.org/D14367
2022-03-17BLI: add probabilistic rounding utilityJacques Lucke
2022-03-17Cleanup: spelling in commentsCampbell Barton
Use <pre>..</pre> for pseudo-code.
2022-03-16Cleanup: rename cnt to countCampbell Barton
Follow naming from T85728.
2022-03-11Cleanup: use M_PI_2 and M_PI_4 where possibleHallam Roberts
The constant M_PI_4 is added to GLSL to ensure it works there too. Differential Revision: https://developer.blender.org/D14288
2022-03-09Cleanup: use ELEM macroCampbell Barton
2022-03-08Cleanup: spelling in commentsCampbell Barton