Commit Graph

100698 Commits

Author SHA1 Message Date
Brecht Van Lommel
7a3a4b58e6 Fix realtime compositor not correctly handling multiple scene render layers
Pull Request: https://projects.blender.org/blender/blender/pulls/108909
2023-06-23 20:00:28 +02:00
Iliya Katueshenock
25c48782e1 Geometry Nodes: Avoid index lookup from index mask
Recent `IndexMask` refactors introduced log(N) complexity for `mask[i]`.
The greater the fragmentation of the mask, the greater the complexity.
Also, new `IndexMask` implementation has new iterators represented
both real index, and position (`index = mask[position]`).
This PR simply replace manual loops by new methods for iterating.
Added `optimized` in some place as slightly speed up.

The Attribute Statistic became 5 times better, due to multithreading.
The Extrude (Faces Individual) has average changed 42 ms -> 36 ms.
Duplicate Elements (Faces) has average changed 220 ms -> 150 ms.
Transform Instances has average changed 12 ms -> 8 ms.
Other nodes have approximately similar improvement numbers.
All tests use Random(50%) selection as mask.

Pull Request: https://projects.blender.org/blender/blender/pulls/109174
2023-06-23 19:20:24 +02:00
Hans Goudey
cd6a428259 Cleanup: Use newer IndexMask implementation in split edges node
Use a utility added in 2cfcb8b0b8.
2023-06-23 13:06:40 -04:00
Omar Emara
c2361381cd Realtime Compositor: Add node previews for shader operations
This patch adds support for node previews for shader operations, making
node previews fully supported.

The patch was started as an effort to refactor the compositor compiler
to split the shader operators when node previews increase past hardware
limits. However, I realized that the better approach would be to remove
those limits altogether by using texture arrays instead of individual
textures for operation results, then use texture views to slice that
array. This is not implemented in this patch and will require some
prerequisites, namely adding target conversion to GPU texture views as
well as support texture arrays in the DRW texture pool.

Pull Request: https://projects.blender.org/blender/blender/pulls/109250
2023-06-23 18:46:18 +02:00
Omar Emara
c6e5be9a36 Nodes: Compute logically linked sockets to outputs
The `logically_linked_sockets` runtime data of sockets is only initialized
for inputs. This patch also initializes it for output sockets through
the inversion the inputs logically_linked_sockets structure.

Pull Request: https://projects.blender.org/blender/blender/pulls/109249
2023-06-23 18:31:49 +02:00
Hans Goudey
eff0f54e44 Merge branch 'blender-v3.6-release' 2023-06-23 12:13:43 -04:00
Hans Goudey
c9a8b1f13f Fix #109231: Python defined socket type switching broken
The dynamic declarations introduced by 7026096099 didn't
work properly for custom node socket types yet since changes weren't
detected and new sockets in group nodes or group inputs/outputs weren't
created correctly. The fix is simple, we just copy the pattern from the other
socket types.

Pull Request: https://projects.blender.org/blender/blender/pulls/109298
2023-06-23 17:47:37 +02:00
Hans Goudey
b1d83e9bef Cleanup: Remove redundant name copying when building dynamic sockets
The new names are copied to the new socket by the (single) caller of
`update_or_build`, so it doesn't need to be done in each function.
2023-06-23 11:45:44 -04:00
Sergey Sharybin
9e346a4892 Cleanup: Strict compiler warning
warning: a function declaration without a prototype is deprecated
in all versions of C [-Wstrict-prototypes]
2023-06-23 17:24:30 +02:00
Hoshinova
f7589751f1 Cleanup: Use defines in Voronoi GLSL implementation
Use defines in Voronoi GLSL implementation instead of magic numbers.

Pull Request: https://projects.blender.org/blender/blender/pulls/109289
2023-06-23 17:16:53 +02:00
Hans Goudey
b226c115e2 Fix #109236: Split Edges node skips loose edges
With the previous fix to the node, 8a11f0f3a2, the new edge
indices are built with the changed corner vertices from a previous step
in the algorithm. That doesn't work for loose edges though, since they
aren't used by any face corners. The best solution I could come up with
was adding a second loop over the split vertices that adjusts the vertex
indices of loose edges. This can be skipped when there are none.

Pull Request: https://projects.blender.org/blender/blender/pulls/109262
2023-06-23 17:07:05 +02:00
Miguel Pozo
ff2f16db6d Draw: Fix RenderDoc and Nvidia compatibility
Disable deferred shader compilation for RenderDoc sessions on Nvidia GPUs to avoid crashes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109214
2023-06-23 16:02:19 +02:00
Hoshinova
3efc63b398 Fix #109253: Voronoi Smooth F1 breaks when Smoothness is 0
The Voronoi Smooth F1 mode breaks when the Smoothness is 0 for OSL. This is
due to a zero division in the shader.

To fix this, standard F1 is used when Smoothness is 0.

Pull Request: https://projects.blender.org/blender/blender/pulls/109255
2023-06-23 15:56:09 +02:00
Sergey Sharybin
d8cc8fcf7f Refactor: Move color space information to ImBuf buffers
Before this change the ImBuf struct had dedicated fields for the
buffer data. Now the color space is stored inside of the struct
which wraps around the buffer information.

This only changes the field placement, without changing the way
it is handled. In the future one might imagine that operations
like stealing buffer data should null-ify the buffer colorspace
pointer. Such changes would need to have more accurate thinking
before implementation.

Should be no functional changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/109291
2023-06-23 15:55:42 +02:00
Falk David
62e7ed0da5 Cleanup: remove unused variable 2023-06-23 15:45:29 +02:00
Falk David
0d6fda3b26 Fix: GPv3 layer operators missing undo flag 2023-06-23 14:12:40 +02:00
Guillermo Venegas
3f26bdf840 Cleanup: simplify keyword recognition in text editor
Arrays are used to eliminate the use of many nested if else's that
compare a string value against to many other strings.

These arrays are sorted to be able to perform binary searches on these
string literals arrays.

ref !108775.
2023-06-23 20:11:52 +10:00
lolloz98
fdc0402a50 GPv3: Select Alternate
Adds a "Select Alternate" operator for the new Grease Pencil data type.
This replaces the previous `gpencil.select_alternate`.

Resolves #109204.

Pull Request: https://projects.blender.org/blender/blender/pulls/109240
2023-06-23 11:34:00 +02:00
Falk David
fae170ed7a Fix: Assert in gpencil next engine
The `GPENCIL_NEXT` was no longer defined, so the shader is split and only loaded for gpencil next.

Pull Request: https://projects.blender.org/blender/blender/pulls/109010
2023-06-23 11:18:30 +02:00
Campbell Barton
4eca65f7f8 Cleanup: format 2023-06-23 18:05:01 +10:00
Clément Foucault
ddd88c00b4 EEVEE-Next: Irradiance Cache: Initial Implementation
This is a full rewrite of the irradiance volume baking.
The baking is much faster and doesn't scale linearly with the number
of irradiance samples in the volumes.

Ref #105643

Pull Request: https://projects.blender.org/blender/blender/pulls/108639
2023-06-23 08:39:46 +02:00
Germano Cavalcante
cd08a55a68 Fix compiler error caused by 9383d06688
`prop_snap_source` does not exist.
2023-06-23 00:12:51 -03:00
Germano Cavalcante
9383d06688 Fix measure tool snapping to perpendicular while not dragging 2023-06-22 23:21:46 -03:00
Germano Cavalcante
f1fa2ecbf5 Fix 'Set Snap Base' not working with 'Face Project' or 'Face Nearest' 2023-06-22 22:54:47 -03:00
Hans Goudey
eeecc24014 Cleanup: BLI: Deduplicate bounds merging
Also declare variables and arguments consta
2023-06-22 21:24:48 -04:00
Campbell Barton
fa9a513bc2 BLI_bpath: don't change paths when making absolute/relative fails
Technically this is a foundational change, although from a user
level it's not expected behavior that failing to make a path
absolute/relative would perform some other change to it.
2023-06-23 10:09:03 +10:00
Campbell Barton
1a04a231ec Fix buffer overflow in BKE_bpath_foreach_path_fixed_process
It was assumed destination buffers were at least 1024 bytes which could
overflow by 256 bytes for sequencer directories. Resolve by passing the
destination buffer size to BKE_bpath_foreach_path_fixed_process.

Also remove strcpy use in foreach_path_clean_cb.
2023-06-23 10:09:01 +10:00
Campbell Barton
06cb4ca376 Fix potential buffer overflow in text to object conversion
BLI_strlen_utf8_ex was used to calculate the array size
while strlen was used to fill it which could exceed the utf8 size
if invalid utf8 sequences exist in the text.
2023-06-23 10:09:00 +10:00
Campbell Barton
b06afe575e UI: resolve inconsistency with modifier labels while assigning shortcuts
Reuse WM_keymap_item_to_string to ensure labels match
(would show Cmd on Linux, then refresh to OS once set).
2023-06-23 10:08:58 +10:00
Hans Goudey
dc5b99fa49 Merge branch 'blender-v3.6-release' 2023-06-22 17:29:51 -04:00
Clément Foucault
8d2d2d4620 GPU: Math: Add safe_rcp and safe_normalize to math libs 2023-06-22 22:51:23 +02:00
Hans Goudey
fa1121765d Fix: Mistakenly duplicated code in previous split edges fix 2023-06-22 16:19:16 -04:00
Julian Eisel
b1f7c87b99 Cleanup: Use const for UI coordinate conversion functions 2023-06-22 20:30:46 +02:00
Harley Acheson
e1d227c5fc Refactor: Simplify vfontdata_freetype.c
Simplification of the functions related to the conversion of FreeType
font glyph outlines into curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/109224
2023-06-22 20:29:14 +02:00
Richard Antalik
c1e7c02f14 Fix #109213: Retime tool value slider crash blender
Crash caused by reading beyond boundary of allocated memory.
2023-06-22 19:19:34 +02:00
Harley Acheson
080a00bda2 UI: Fix Scrollbar overlaps sidebar on zoom
When zooming an area with panel category tabs, ensure that the vertical
scroll bar is repositioned to not overlap the tabs.

Pull Request: https://projects.blender.org/blender/blender/pulls/108295
2023-06-22 18:56:29 +02:00
Julian Eisel
9e8bc1d579 Fix unused variable warning 2023-06-22 15:20:54 +02:00
Almaz Shinbay
888cfd29c3 Outliner: Port object elements to new tree-element code design
No user visible changes expected.

Part of #96713, continuation of work started in 249e4df110 and 2e221de4ce.
Refer to these for a motivation and design overview.

Adds a new tree-element class for object IDs.

Pull Request: https://projects.blender.org/blender/blender/pulls/109162
2023-06-22 15:04:53 +02:00
Iliya Katueshenock
333e820ed7 Cleanup: Remove unused variable from recent commit
Pull Request: https://projects.blender.org/blender/blender/pulls/109242
2023-06-22 14:37:10 +02:00
Falk David
a4ef0ac05a GPv3: Add hide and lock buttons to layer UI
This adds two buttons to the items for hiding and locking the layer.
2023-06-22 14:12:08 +02:00
Iliya Katueshenock
a711c5004c Geometry Nodes: Simplify code in duplicate elements face mode
This node splits all faces to duplicate each time. Corner edges and
vertices are just ordered sequences of indices. Most likely, due to
historical reasons, this was overlooked and as a result the code became
so complex with potential simplicity. The problem was found in a
benchmark of #109174. The code in the lambda could not be optimized.

Timings improved by about 30%, from 154 to 120 ms.

Pull Request: https://projects.blender.org/blender/blender/pulls/109222
2023-06-22 13:45:43 +02:00
Falk David
dddc69d0be GPv3: Add layers RNA
This adds `layers` as a collection to the new grease pencil RNA.

Additionally, layers have 3 properties:
 - `name`
 - `hide`
 - `lock`

Pull Request: https://projects.blender.org/blender/blender/pulls/109235
2023-06-22 13:37:23 +02:00
Hans Goudey
c5fe62ac8e Cleanup: Quiet unused warnings in rna_mesh.cc
Pull Request: https://projects.blender.org/blender/blender/pulls/109165
2023-06-22 13:27:36 +02:00
Julian Eisel
d695619a55 Fix file/asset previews showing document icon on initial load
Since 4a3b6bfeac, there should be a loading/wait icon while the previews
are being loaded. However when initially loading the file list, the big
document icon we use when no preview was found showed up for a short
moment. This is because preview loading is only triggered after the file
list is fully loaded, and so the preview loading tag isn't set yet. But
we only checked for this tag. Now the waiting icon is displayed when
either the file list or the preview is still loading.
2023-06-22 13:09:40 +02:00
Julian Eisel
fcd1bb170c Cleanup: Use const for File Browser file list queries 2023-06-22 13:09:40 +02:00
Pratik Borhade
c1d6f8b567 Fix: change poll function for add and remove layer operators
Current poll functions allows to use these operator only in edit mode.
Correct function would be `active_grease_pencil_poll` (check for active grease
pencil object instead of the context mode)

Pull Request: https://projects.blender.org/blender/blender/pulls/109238
2023-06-22 13:04:47 +02:00
Omar Emara
d6cd3db13b Fix: Wrong reference count for shader operation
The reference count computation for shader operation outputs is wrong,
because it considers internal links as references to the result, which
is not the case.

This patch fixes that by only consider external links.
2023-06-22 13:57:31 +03:00
Campbell Barton
2ff522c23f CMake: show install hint for ninja as well as make
Use the absolute destination path in the message too as the path
relative to the CMAKE_INSTALL_PREFIX isn't so meaningful.
2023-06-22 20:28:03 +10:00
Falk David
16e187778b Fix compiler warnings 2023-06-22 11:11:55 +02:00
Falk David
b3f3b41d09 GPv3: Initial Layer Tree UI
Adds a new UI template to view the current layer tree of the active Grease Pencil object.

This UI tree view implements the following features (for now):
 - Displaying all the layers with their names and highlighting the active layer.
 - Changing the active layer by clicking on an item.
 - Adding new layers (using a new operator).
 - Removing the active layer (using a new operator).
 - Renaming a layer.

Pull Request: https://projects.blender.org/blender/blender/pulls/109197
2023-06-22 10:51:43 +02:00