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
2021-12-07Cleanup: Use rcti marking dirty regions when texture painting.Jeroen Bakker
Dirty regions when painting are not using rcti. Meaning less understandable code. Found issue when refactoring the image_gpu partial update. In a future change gpu partial update API will be using rcti also what makes the code even cleaner. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D13260
2021-12-02BLI: avoid invoking tbb for small workloadsJacques Lucke
We often call `parallel_for` in places with very variable sized workloads. When many elements are processed, using multi-threading is great, but when processing few elements (possibly many times) using `parallel_for` can result in significant overhead. I measured that this improves performance by >20% in the refactored realize instances code I'm working on separately. The change might also help with debugging sometimes, because the stack trace is smaller and contains fewer irrevelant symbols.
2021-11-30Cleanup: capitalize NOTE tagCampbell Barton
2021-11-30Cleanup: spelling in comments & stringsCampbell Barton
2021-11-27Merge branch 'blender-v3.0-release'Brecht Van Lommel
2021-11-27Fix build error with TBB 2021 and booleansBrecht Van Lommel
Linux distributions are using newer TBB versions than official releases, and TBB 2021 is an API breaking release. In general we should avoid using TBB directly and go through the abstractions in BLI_task.hh, though there is no abstraction for this. For 3.0 the safe option is to just not cancel the task but instead early out in the lambda function. Given the grain size of 2048 there should be no significant performance difference. Differential Revision: https://developer.blender.org/D13382
2021-11-26Cleanup: remove warningsJacques Lucke
This assert was producing warning in debug builds because it was never hit under some circumstances.
2021-11-26Geometry Nodes: optimize Set Position nodeJacques Lucke
This implements four optimizations in the Set Position node: * Check whether the position input is the current position and ignore it if it is. This results in a speedup when only the Offset input is used. * Use multi-threading when copying to computed values to the position attribute. All geometry types benefit from this. * Use devirtualization for the offset and position input. This optimizes the common case that they are either single values or computed in the fly in a span. * Write to `Mesh->mvert` directly instead of creating a temporary span. This makes setting mesh vertex positions even more efficient. In my simple benchmark I'm using a White Noise node to offset the position of 1,000,000 vertices. The speed is `20 ms -> 4.5 ms` in the multi-threaded case and `32 ms -> 22 ms` in the single-threaded case.
2021-11-26Geometry Nodes: deduplicate virtual array implementationsJacques Lucke
For some underlying data (e.g. spans) we had two virtual array implementations. One for the mutable and one for the immutable case. Now that most code does not deal with the virtual array implementations directly anymore (since rBrBd4c868da9f97a), we can get away with sharing one implementation for both cases. This means that we have to do a `const_cast` in a few places, but this is an implementation detail that does not leak into "user code" (only when explicitly casting a `VArrayImpl` to a `VMutableArrayImpl`, which should happen nowhere).
2021-11-25BLI: remove special cases for is_span and is_single methodsJacques Lucke
Those were not implemented consistently and don't really help in practice.
2021-11-24Fix T92962 Boolean output indices unstable.Howard Trickey
A parallel loop to create the interesection meshes for each triangle meant that with parallelism, the output order of the created meshes could vary with each execution. Keep the parallelism for doing the CDTs for interesection, but move the extraction of the new faces into a serial loop afterwards, for repeatability.
2021-11-24BLI: add slice method to index mask and generic spanJacques Lucke
2021-11-24Geometry Nodes: use simpler types when devirtualizing virtual arrayJacques Lucke
The compiler is more likely to optimize away the function call overhead when the used type is simpler and not virtual.
2021-11-23Cleanup: clang tidyJacques Lucke
The parameter name was inconsistent with the declaration.
2021-11-23Clean-up: Fix BLI_rect.h collision with windows.hRay Molenkamp
windows.h `#defines rct1` as a number which is problematic if we include `BLI_rect.h` after `windows.h` . by renaming `rct1/2` to `rct_a/b` we side step the collision and straighten up the naming with the functions directly above it.
2021-11-23Cleanup: Suppress clang-tidy warning.Jeroen Bakker
2021-11-19Merge branch 'blender-v3.0-release'Bastien Montagne
Conflicts: source/blender/blenkernel/BKE_blender_version.h source/blender/blenloader/intern/versioning_300.c
2021-11-19BLI_listbase: Add utils to search from string or index.Bastien Montagne
If a valid matching string is found, return that item, otherwise fallback to the item matching the given index, if any. This will be useful in RNA override code, and potentially other areas where data in lists can be referenced by their names or indices.
2021-11-19Cleanup: fix typos in comments and docsBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D13264
2021-11-16Geometry Nodes: refactor virtual array systemJacques Lucke
Goals of this refactor: * Simplify creating virtual arrays. * Simplify passing virtual arrays around. * Simplify converting between typed and generic virtual arrays. * Reduce memory allocations. As a quick reminder, a virtual arrays is a data structure that behaves like an array (i.e. it can be accessed using an index). However, it may not actually be stored as array internally. The two most important implementations of virtual arrays are those that correspond to an actual plain array and those that have the same value for every index. However, many more implementations exist for various reasons (interfacing with legacy attributes, unified iterator over all points in multiple splines, ...). With this refactor the core types (`VArray`, `GVArray`, `VMutableArray` and `GVMutableArray`) can be used like "normal values". They typically live on the stack. Before, they were usually inside a `std::unique_ptr`. This makes passing them around much easier. Creation of new virtual arrays is also much simpler now due to some constructors. Memory allocations are reduced by making use of small object optimization inside the core types. Previously, `VArray` was a class with virtual methods that had to be overridden to change the behavior of a the virtual array. Now,`VArray` has a fixed size and has no virtual methods. Instead it contains a `VArrayImpl` that is similar to the old `VArray`. `VArrayImpl` should rarely ever be used directly, unless a new virtual array implementation is added. To support the small object optimization for many `VArrayImpl` classes, a new `blender::Any` type is added. It is similar to `std::any` with two additional features. It has an adjustable inline buffer size and alignment. The inline buffer size of `std::any` can't be relied on and is usually too small for our use case here. Furthermore, `blender::Any` can store additional user-defined type information without increasing the stack size. Differential Revision: https://developer.blender.org/D12986
2021-11-12Cleanup: Improve commentHans Goudey
2021-11-03Cleanup: Remove effect-less constJulian Eisel
Using `const` on an enum type returned by value doesn't have an effect.
2021-11-03Cleanup: Avoid redundant template parameter in BLI serializing APIJulian Eisel
The `ContainerValue` template can obtain the type of the contained value via the given `Container` type, simply using `Container::value_type`. Use this as the default way to determine the value type which simplifies using the template. If necessary the value type can be passed explicitly still.
2021-11-02Fix T77681, T92634: noise texture artifacts with high detailBrecht Van Lommel
We run into float precision issues here, clamp the number of octaves to one less, which has little to no visual difference. This was empirically determined to work up to 16 before, but with additional inputs like roughness only 15 appears to work. Also adds misisng clamp for the geometry nodes implementation.
2021-11-02Fix T92736: Hole in mesh after Set PositionCharlie Jolly
The geometry node port of voronoi_smooth_f1 function has a division by zero when smoothness is set to zero. Using a safe_divide within the function causes issues and was noted in the original patch D12725. Solution in this case is to clamp zero smoothness to FLT_EPSILON. Reviewed By: JacquesLucke Maniphest Tasks: T92736 Differential Revision: https://developer.blender.org/D13069
2021-11-02BLI: avoid passing nullptr to strncmpJacques Lucke
This resulted in an ASAN warning.
2021-11-01Fix crash when "HOME" environment variable isn't definedCampbell Barton
Accessing the default directory in the file selector would crash if HOME was undefined. Add BKE_appdir_folder_default_or_root which never returns NULL.
2021-11-01BLI_path_util: assert to ensure BLI_join_dirfile is used correctlyCampbell Barton
2021-10-28Fix install paths for blender thumbnailer when not building a portable installSebastian Parborg
When doing a non portable build of blender, the executable blender-thumbnailer would be installed in two locations: /usr/bin/ /usr/ While cleaning up, also make the blender thumbnailer dll optional on windows to bring the logic in line with what it is on linux and mac. Reviewed By: Campbell Barton, Ray molenkamp Differential Revision: http://developer.blender.org/D13014
2021-10-27Cleanup: clang-format, clang-tidy, spellingCampbell Barton
2021-10-26Cleanup: clang-formatBrecht Van Lommel
2021-10-26Cleanup: spelling in commentsCampbell Barton
2021-10-26BlenLib: Add JSON Serialization/Deserialization Abstraction Layer.Jeroen Bakker
Adds an abstraction layer to switch between serialization formats. Currently only supports JSON. The abstraction layer supports `String`, `Int`, `Array`, `Null`, `Boolean`, `Float` and `Object`. This feature is only CPP complaint. To write from a stream, the structure can be built by creating a value (any subclass of `blender::io::serialize::Value` can do, and pass it to the `serialize` method of a `blender::io::serialize::Formatter`. The formatter is abstract and there is one implementation for JSON (`JsonFormatter`). To read from a stream use the `deserialize` method of the formatter. {D12693} uses this abstraction layer to read/write asset indexes. Reviewed By: Severin, sybren Maniphest Tasks: T91430 Differential Revision: https://developer.blender.org/D12544
2021-10-26Geometry Nodes: Optimise Voronoi texture nodeCharlie Jolly
This patch improves performance by only assigning or calculating data for connected sockets. It is recommended that artists use the lowest dimensions setting for noise based textures. E.g. Use 2D instead of 3D where possible. Using a scoped timer and single thread on 256,000 points. Smooth F1 3D : Debug build Timer 'Optimised' took 9.39991 s Timer 'Normal' took 16.1531 s This optimisation is only for GN and not shaders. Differential Revision: https://developer.blender.org/D12985
2021-10-24Cleanup: cross-reference right pointing arrow literalCampbell Barton
This value is defined in the UI module, but happens to be used in string_search.cc too. Note that these references need to be kept in sync. Use escaped utf-8 sequence since the literal can be avoided. Also replace BLI_str_utf8_as_unicode calls with constant assignments as these values are known there is no need to decode a utf-8 sequence.
2021-10-24Cleanup: spelling in commentsCampbell Barton
2021-10-22Cleanup: spelling in comments, use C style commentsCampbell Barton
2021-10-21Docs: note why BLI_string_join_arrayN needs to nil terminateCampbell Barton
2021-10-20Fix missing null-terminator in BLI_string_join_arrayNKévin Dietrich
Although the documentation says so, the null-terminator was missing. This could cause crashes when logging shader linking errors as shader sources are empty in this case.
2021-10-20Split and extend unit tests for vec_roll_to_mat3_normalized.Alexander Gavrilov
Separate the huge test into huge logical parts and add more cases to check. Also add a utility to check that the matrix is orthogonal, with arbitrary epsilon values and calculations in double. A couple of tests deliberately fail, to be fixed in following commits. Ref D9551
2021-10-20Cleanup: use elem macrosCampbell Barton
2021-10-20Cleanup: spelling in commentsCampbell Barton
2021-10-19Geometry Nodes: Add Wave texture nodeCharlie Jolly
Port shader wave texture node Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12733
2021-10-19Cleanup: use 'e' prefix for enum typesCampbell Barton
2021-10-19BLI: Support removing keys from a set during iterationHans Goudey
This adds the ability to mark slots as removed while iterating through a mutable set. Differential Revision: https://developer.blender.org/D12867
2021-10-19Fix: Build error with MSVCRay Molenkamp
noise.cc uses std::min and std::max without including the algorithm header required. Newer MSVC versions and GCC implicitly include it somewhere, which isn't something we should count on. Best to include what you use.
2021-10-18Geometry Nodes: Add shader Musgrave texture nodeCharlie Jolly
Port shader node musgrave texture Differential Revision: https://developer.blender.org/D12701
2021-10-18Cleanup: spelling in commentsCampbell Barton
2021-10-16Remove math for 2D affine transformRichard Antalik
Commit e1665c3d3190 added math to do 2D affine transformations with 3x3 matrices, but these matrices are also used for 3D transformations. Remove added functions and use 4x4 matrices for 2D transformation. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D12510
2021-10-15Geometry Nodes: Add Voronoi TextureCharlie Jolly
Port shader Voronoi to GN Reviewed By: JacquesLucke Differential Revision: https://developer.blender.org/D12725