Commit Graph

114591 Commits

Author SHA1 Message Date
Campbell Barton
eb837ba17e Cleanup: format 2022-05-05 17:33:43 +10:00
Hans Goudey
6513ce258f Geometry Nodes: Improve performance of mesh to points node
There are fancier possibilities for improvements, like taking ownership
of existing arrays in some cases, but this patch takes a simpler brute
force approach for now.

The first change is to move from the previous loop to using the new
`materialize_compressed_to_uninitialized` method on virtual arrays,
which adds only the selected values to the output. That is a nice
improvement in some cases, corresponding to the "Without Threading"
column in the chart below.

The next change is to call that function in parallel on slices of
the output. To avoid generating too much code, we can avoid
templating based on the type and devirtualizing completely.

The test input is a 4 million point grid, generated by the grid
primitive node. Color and 2D vector attributes were also transferred
to the points.

| Test      | Before | Final No Threading | Final  | Change |
| --------- | ------ | ------------------ | ------ | ------ |
| All Verts | 209 ms | 186 ms             | 170 ms | 0.8x   |
| 1%        | 148 ms | 143 ms             | 133 ms | 0.9x   |
| All Faces | 326 ms | 303 ms             | 87 ms  | 0.27x  |
| 1%  Faces | 70 ms  | 68 ms              | 34 ms  | 0.49x  |

Differential Revision: https://developer.blender.org/D14661
2022-05-05 09:28:46 +02:00
Campbell Barton
0f567ada9d Docs: add doc-string for BMFace.mat_nr struct member 2022-05-05 17:18:50 +10:00
Harley Acheson
ddbac88c08 Win32: Dark Mode Title Bar Color
Blender will respect Windows "Dark Mode" setting for title bar color.

See D14847 for details.

Differential Revision: https://developer.blender.org/D14847

Reviewed by Ray Molenkamp
2022-05-04 20:19:10 -07:00
Campbell Barton
836fbb90aa Cleanup: mark library locations as advanced 2022-05-05 11:38:19 +10:00
Campbell Barton
e33c15951b Cleanup: spelling in comments 2022-05-05 10:55:51 +10:00
Campbell Barton
d0c2fd0570 Cleanup: use 'r_' prefix for return arguments 2022-05-05 10:44:25 +10:00
Campbell Barton
d3c895fc41 Cleanup: shadow and format warnings 2022-05-05 10:44:25 +10:00
Campbell Barton
777b72b5cb Cleanup: unused argument warnings 2022-05-05 10:44:25 +10:00
Germano Cavalcante
73fa571598 Merge branch 'blender-v3.2-release' 2022-05-04 21:43:56 -03:00
Germano Cavalcante
adbe71c3fa Fix T97835: crash when creating hair particle system on Mac
Recently `gpu_shader_3D_smooth_color_frag.glsl` had the uniform declarations removed.

For shaders without `ShaderCreateInfo` that require this source this results in the error:
```
ERROR (gpu.shader): hair_refine_shader_transform_feedback_workaround_create FragShader:
      |
   54 |   fragColor = finalColor;
      |
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:5:0: Error: Use of undeclared identifier 'finalColor'
      |
   55 |   fragColor = blender_srgb_to_framebuffer_space(fragColor);
      |
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
      | gpu_shader_3D_smooth_color_frag.glsl:6:0: Error: Use of undeclared identifier 'fragColor'
```

So port that shader to use `ShaderCreateInfo`.
2022-05-04 21:42:38 -03:00
Harley Acheson
8960c6e060 IMBUF: Faster JPEG Thumbnails
Make preview thumbnails of JPEG files in less time and with less RAM.

See D14727 for more details.

Differential Revision: https://developer.blender.org/D14727

Reviewed by Brecht Van Lommel
2022-05-04 16:55:59 -07:00
Juanfran Matheu
ed0964c976 UI: Add Gizmos toggle to SpaceImage
This patch adds the show_gizmo and show_gizmo_navigate properties to the Image and UV editors.

Image Editor:
{F13026317}
UV Editor:
{F13026319}

VIDEO:
{F13026324}

Reviewed By: #user_interface, campbellbarton

Differential Revision: https://developer.blender.org/D14755
2022-05-05 00:23:25 +02:00
Brecht Van Lommel
f11dba8892 Fix Cycles world light group confusing UI
Move to a subpanel of the Settings panel. Otherwise it seems like it's a
setting of one of the shader nodes.
2022-05-04 21:23:18 +02:00
Lukas Stockner
0fa1c65ee3 Fix T95644: Cycles doesn't update modified object attributes on GPU
evice_update_preprocess is supposed to detect modified attributes and flag the
device_vector for a copy through device_update_flags. However, since object
attributes are only created in device_update_attributes afterwards, they can't
be included in that check.

Change the function that actually updates the device_vector to tag it as
modified as soon as its content gets updated.

Differential Revision: https://developer.blender.org/D14815
2022-05-04 20:07:19 +02:00
Brecht Van Lommel
54f447ecde Fix T96718: Cycles invalid pixels when using bump normal for light emission
A shader node setup accidentally used the bump normal as emission. Bump
mapping nodes are excluded from light shader evaluation to reduce kernel size
and register pressure, but in that case should write zero instead of leaving
memory uninitialized.

Thanks to Lukas for helping identify the cause.
2022-05-04 20:01:04 +02:00
Brecht Van Lommel
ac9ebc9de3 Fix Cycles division by zero in material preview render
If the render gets cancelled before the first sample finishes.
2022-05-04 20:01:04 +02:00
Kévin Dietrich
319a772b7f Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-04 19:37:48 +02:00
Kévin Dietrich
fc0f6d19ad Fix T96845: artifacts with GPU subdivision and mirror modifier
The coarse polygon count was set to the one of the BMesh instead of
the the one of the mesh used for subdivision, which caused the
compute shaders to output wrong data.
2022-05-04 19:31:53 +02:00
Brecht Van Lommel
5d7ee44406 Fix T95527: wrong motion blur with rigid bodies
This index is not meant for the point cache data array, it's already offset.
2022-05-04 19:28:17 +02:00
Kévin Dietrich
1a98bec40e Subdivision node: add input for vertex creases
This adds an input to the Subdivision node to specify a field to use
for controling vertex creases. Common code with edge creasing was
extracted into utility functions to avoid redundancy.

Differential Revision: https://developer.blender.org/D14199
2022-05-04 18:59:08 +02:00
Hallam Roberts
82df48227b Nodes: Add general Combine/Separate Color nodes
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-05-04 18:44:03 +02:00
Bastien Montagne
7d41e1ed40 Merge branch 'blender-v3.2-release' 2022-05-04 17:30:26 +02:00
Bastien Montagne
60772baebf Fix T97709: Compositor: Scenes are being set to no users after doing a full copy.
Similar issue/solution as in rB5188c14718c5 from this Monday actually,
there may be more of those still lurking around... Quite surprising they
all get reported now, this behavior has been in Blender since years.
2022-05-04 17:29:50 +02:00
Antonio Vazquez
8ff5836766 Merge branch 'blender-v3.2-release' 2022-05-04 17:19:25 +02:00
Antonio Vazquez
b5c3885bf0 Fix T97851: GPencil Bake object transform operator wrong transformation
The problem was the layer transformation was already applied in the layer and if we apply in the bake, we are doing double transformation.

Differential Revision: https://developer.blender.org/D14844
2022-05-04 17:18:58 +02:00
Germano Cavalcante
d2271cf939 Transform: use a threshold for UV snapping
Unlike 3Dview snapping, UV snapping is always done to the UV closest to
the mouse cursor, no matter the distance.

From the user's point of view, this appears to be an inconsistency (See
{T93538}).

Therefore, set a minimum distance for snapping and, as in 3D View and
highlight the snap with a drawing of a circle.

Release Note: https://wiki.blender.org/wiki/Reference/Release_Notes/3.3/Modeling

Reviewed By: #uv_editing, campbellbarton

Maniphest Tasks: T93538

Differential Revision: https://developer.blender.org/D13873
2022-05-04 12:08:17 -03:00
Brecht Van Lommel
5559ea59a1 Cycles: mark all CUDA 11.x versions as supported
All released versions appear to work fine. Also slightly change wording.
2022-05-04 17:07:39 +02:00
Brecht Van Lommel
b5b6ae06f9 Build: update outdated description of WITH_TBB option 2022-05-04 17:07:39 +02:00
YimingWu
08daeb9472 LineArt: Clean up file name and license.
lineart_cpp_bridge.cpp changed to .cc
2022-05-04 22:32:50 +08:00
YimingWu
03aba8046e LineArt: Object loading optimization
This patch replaces BMesh conversion into index-based triangle adjacent
lookup method, and use multithread in many steps to speed up object
loading for line art.

Differential Revision: https://developer.blender.org/D14627

Reviewed By: Sebastian Parborg (zeddb)
2022-05-04 22:11:33 +08:00
Jacques Lucke
8bd0ed6bd2 Curves: show direction in panel for Grow / Shrink brush settings 2022-05-04 15:37:59 +02:00
Jeroen Bakker
a0d139076c Silenced compilation warning on clang. 2022-05-04 15:04:30 +02:00
Jacques Lucke
a52fbeadb1 Merge branch 'blender-v3.2-release' 2022-05-04 15:02:55 +02:00
Jacques Lucke
54b293237e Fix T97375: changing node tree from Python is very slow
The issue was that the `NodeTreeRef` acceleration data structure was
rebuild much more often than necessary. That happened because the
Map Range node accidentally tagged the node tree for change even
though it did not actually change.

Differential Revision: https://developer.blender.org/D14842
2022-05-04 15:02:19 +02:00
Jacques Lucke
82bf11e73f Cleanup: unused parameter 2022-05-04 14:36:16 +02:00
Kévin Dietrich
dc1793e85b Merge remote-tracking branch 'origin/blender-v3.2-release' 2022-05-04 14:33:13 +02:00
Kévin Dietrich
d86d7c935e Fix T97827: material preview not displaying textures
Caused by rB281bcc1c1dd6 which did not properly made use
of `vec4` for UVs which are now loaded as attributes.
2022-05-04 14:30:52 +02:00
Jacques Lucke
5162135e14 Curves: add second experimental option for new curves tools
Now there are two experimental feature options:
* "New Curves Type": Enables the new data type and a couple of tools
  that are meant to be in the first release that comes with the new curves object.
* "New Curves Tools": This is only available when the new curve type is available
  as well. It mainly exists to keep some tools experimental even after the initial
  curves object is release officially.
  * For now this only includes the curves edit mode which is not usable yet and
    probably won't be for the initial release.

Differential Revision: https://developer.blender.org/D14840
2022-05-04 14:18:42 +02:00
Aras Pranckevicius
3bdda67e50 Merge branch 'blender-v3.2-release' 2022-05-04 15:11:25 +03:00
Aras Pranckevicius
cbeb8770cc Fix T97794: new OBJ importer does not handle quoted MTL paths
Fixes T97794 (which is a reintroduction of an older issue T67266 that
has been fixed in the python importer, but the fix was not in the C++
one). Some software produces OBJ files with mtllib statements like
mtllib "file name in quotes.mtl", and the new importer was not stripping
the quotes away.

While at it, I noticed that MTLParser constructor was taking a StringRef
and treating it as a zero-terminated string, which is not necessarily
the case. Fixed that by explicitly using a StringRefNull type.

Reviewed By: Howard Trickey
Differential Revision: https://developer.blender.org/D14838
2022-05-04 15:10:54 +03:00
Hans Goudey
48c0738d4a Cleanup: Adjust variable names, miscellaneous changes
Use `src` and `dst` instead of less common variable names,
less redundant logic, simpler use of const, and "typename"
for template arguments instead of "class".
2022-05-04 14:10:22 +02:00
Hans Goudey
9ee9dd257f Curves: Add method to find indices for curve type in a selection
For example, this can be used to find the indices of all Bezier curves
inside an existing selection. The important part is that it is optimized
for the case when all curves have the same type.
2022-05-04 13:55:13 +02:00
Hans Goudey
16011e34f0 Curves: Optimize filling all curves with a single type
If all curves are selected for setting the new type,
skip counting the types and just set it directly.
2022-05-04 13:55:13 +02:00
Falk David
7d7047058a Merge branch 'blender-v3.2-release' 2022-05-04 13:00:04 +02:00
Yann Lanthony
b31f5b8ce7 GPencil: Apply layer transforms to visible frames
Fix regression described in T97799.

Apply layer transform and layer parenting to all visible frames, i.e. active frame + onion skinning frames.

Reviewed By: #grease_pencil, antoniov

Maniphest Tasks: T97799

Differential Revision: https://developer.blender.org/D14829
2022-05-04 12:58:57 +02:00
Hans Goudey
0f2cc50fc6 Cleanup: Avoid asan overflow warning for RNG seed 2022-05-04 12:58:45 +02:00
Hans Goudey
caeea212cf Merge branch 'blender-v3.2-release' 2022-05-04 12:28:05 +02:00
Hans Goudey
302584bd6e Fix T97831: Curve to mesh node can create invalid wire mesh
When the profile only has one control point, its segment count was
determined incorrectly. There needs to be a special case for a single
control point, when there are no segments even if the curve is cyclic.
2022-05-04 12:26:59 +02:00
Campbell Barton
14d845192a Merge branch 'blender-v3.2-release' 2022-05-04 19:32:12 +10:00