Commit Graph

120055 Commits

Author SHA1 Message Date
Hans Goudey
01b0096b5e Mesh: Draw: Replace extractor abstraction for edit data buffer
Part of #116901.
Due to the BMesh data format, there is less optimization possible here.
2024-06-05 14:20:01 +02:00
Hans Goudey
5931c82238 Mesh: Draw: Replace extractor abstraction for UV angle stretch buffer
Part of #116901.
The algorithm is complicated and isn't tweaked here.
2024-06-05 14:20:01 +02:00
Hans Goudey
4a852cdaa7 Mesh: Draw: Replace extractor abstraction for UV area stretch buffer
Part of #116901.
Besides the typical changes from past similar refactors, the loops are
now multithreaded.
2024-06-05 14:20:01 +02:00
Hans Goudey
498f4ba284 Mesh: Draw: Replace extractor abstraction for mesh analysis buffer
Part of #116901.
The code was already structured to not use the extractor iterators, so I
only changed the entry point.
2024-06-05 14:20:01 +02:00
Hans Goudey
1adb557806 Mesh: Draw: Replace extractor abstraction for ocro buffer
Part of #116901.
A straightforward change like all the others.
2024-06-05 14:20:01 +02:00
Hans Goudey
0edae45d15 Mesh: Draw: Replace extractor abstraction for sculpt overlay buffer
Part of #116901.
Includes a general standardization of the code, removing constant
checks from hot loops, standardizing naming, tweaking BMesh face
iteration. And includes parallelization too.
2024-06-05 14:20:01 +02:00
Hans Goudey
17a3d065f4 Mesh: Draw: Replace extractor abstraction for skin roots buffer
Part of #116901.
To avoid resizing the buffer, the data is added to a temporary vector
first. That should be fine because the number of roots is expected to
be quite small compared to the size of the mesh.
2024-06-05 14:20:01 +02:00
Hans Goudey
f81cfe392d Mesh: Draw: Replace extractor abstraction for UV maps buffer
Part of #116901.
A straightforward change. I did a few smaller changes to make the
copying similar to elsewhere.
2024-06-05 14:20:01 +02:00
Hans Goudey
7d660ef9d1 Mesh: Draw: Replace extractor abstraction for lines adjacency buffer
Part of #116901.
The algorithm is very complicated to I didn't adjust it. The changes are just
removing the data struct and un-sharing some code to make things a bit
simpler. I also changed the loop to iterate over faces rather than triangles
to avoid the reverse triangle to face lookup. This removes the need to
create the `corner_tri_faces` map, saving 4 bytes per triangle.
2024-06-05 14:20:01 +02:00
Hans Goudey
6178ff6c99 Cleanup: Use vector arguments in mesh draw lines adjacency
Also rename variables to use more standard names.
2024-06-05 14:20:01 +02:00
Hans Goudey
6baaf57343 Cleanup: Use references in mesh draw lines adjacency
Also rename a variable.
2024-06-05 14:20:01 +02:00
Hans Goudey
ba45572f04 Cleanup: Reorder mesh draw function in file
Just to make a future diff smaller and easier to read.
2024-06-05 14:20:01 +02:00
Hans Goudey
405a11fb06 Mesh: Draw: Replace extractor abstraction for paint mask lines buffer
Part of #116901.
A straightfoward change this time; the algorithm wasn't adjusted,
it was just put inside of a single loop. I did change some nested if
statements to continue statements to reduce indentation though.
2024-06-05 14:20:01 +02:00
Hans Goudey
d1049f6082 Mesh: Draw: Replace extractor abstraction for edge factor buffer
Part of #116901.
The BMesh version of the algorithm was parallelized because BMesh has
edge to face topology lookup available.

This also allows removing `GPU_vertbuf_steal_data`, by just generating
the correct data type in the first place. Removing that should help dealing
with improvements to VBO data ownership in the future.
2024-06-05 14:20:01 +02:00
Hans Goudey
18e76b5938 Mesh: Draw: Replace extractor abstraction for face dots UV buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
4d72eac0ab Mesh: Draw: Replace extractor abstraction for face dots position buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
ef91db222e Mesh: Draw: Replace extractor abstraction for face dots index buffer
Part of #116901.
Very similar to 07eac30070.
2024-06-05 14:20:01 +02:00
Hans Goudey
28c41b1d42 Mesh: Draw: Replace extractor abstraction for vertex group buffers
Part of #116901.
For meshes, extract vertex group weights to a temporary vertex-sized
array, then gather them to the final VBO array. This reduces duplicate
work, and eventually the gather step could be done on the GPU too.
2024-06-05 14:20:01 +02:00
Hans Goudey
2f3aacb1ac Mesh: Draw: Replace extractor abstraction for indices buffers
Part of #116901.
Most of these loops were extremely simple, so function call overhead
would have been problematic in the existing code. However, they're
also so simple that they're most likely memory bound, so I wouldn't
expect a large performance change.
2024-06-05 14:20:01 +02:00
Hans Goudey
070ffeea22 Mesh: Draw: Replace extractor abstraction for facedot normals buffer
Part of #116901.
Also allows removing the "extractor overrides" code and deduplicating
the handling of high quality normals with templates.
2024-06-05 14:20:01 +02:00
Hans Goudey
2eaab5bbb0 Mesh: Draw: Replace extractor abstraction for tangents buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
a1b6989ddc Mesh: Draw: Replace extractor abstraction for vertex normals buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
Hans Goudey
782f3411d0 Sculpt: Start data-oriented refactor for draw brush
This PR establishes the beginning of the transition to data-oriented code
for sculpt brushes described in #118145. The final brush "API" design is
still in progress, and further iteration will be required as more brushes are
refactored and other areas can be cleaned up.

Currently the main goal is making the code paths more obvious and easing
future development, but this change itself may also give a performance
improvement. In a simple test with a large mesh, that was about 14%.

Co-authored-by: Sergey Sharybin <sergey@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/121835
2024-06-05 14:09:14 +02:00
Pratik Borhade
03d3f2fa73 Fix #81948: Regression: Sculpt mode Annotation tool cursor conflict
Sculpt brush cursor is still drawn when annotation tool is selected.
Use `SCULPT_poll` function for paint cursor poll function (`pc->poll`).
This new poll function checks whether active tool is brush. In case of
non-brush tools (transform, annotate), poll function will return false
which eventually prevents pc->draw() from drawing the brush cursor.

Fix is similar to !122657

Pull Request: https://projects.blender.org/blender/blender/pulls/122709
2024-06-05 13:46:59 +02:00
Omar Emara
9ca5289bc1 Merge branch 'blender-v4.2-release' 2024-06-05 14:32:15 +03:00
Omar Emara
9b33340675 Fix #60940: Film-like mapping is bad for RGB curves
The Film-like curve mapping option in the RGB Curves node in the
compositor produces bad results when editing its RGB curves. That's
because Film-like curve mapping only works with the combined curve by
definition, since it is a hue preserving mapping. Furthermore, the
Film-like option ignored the white balancing step altogether.

To fix this, we hide the current curve option for the File-like option
and only allow editing the combined curve, handing the same case for
versioning and RNA updates. Further, we port the implementation from the
realtime compositor which is both correct and takes white balancing into
account.

Pull Request: https://projects.blender.org/blender/blender/pulls/122762
2024-06-05 13:29:39 +02:00
Thomas Dinges
ac41116a1f Revert "Release: Updates for the 4.2 branch"
This reverts commit 618c497801.
2024-06-05 12:33:31 +02:00
Thomas Dinges
7c6d8154bd Merge branch 'blender-v4.2-release' 2024-06-05 12:33:09 +02:00
Thomas Dinges
618c497801 Release: Updates for the 4.2 branch
* Version bumps and pointing gitmodules to the branch.
* Splash screen by Blender Studio (studio.blender.org)
2024-06-05 12:31:19 +02:00
Thomas Dinges
5577fb4303 Bump version for 4.3 2024-06-05 12:10:14 +02:00
Clément Foucault
8d2421bcea Fix: EEVEE-Next: Broken Blend Mode versioning
This was caused by #122706 which moved the
versioning after linking where the engine is
already changed to EEVEE-Next. This made the
versioning never run.

# Conflicts:
#	source/blender/blenloader/intern/versioning_400.cc
2024-06-05 11:37:41 +02:00
Pratik Borhade
25351738f7 UI: Add title to tree view context menus
Add new string member in `AbstractView` class to store title/header of
tree view. Later use this to set title (`pup->title`) of context menu.

Pull Request: https://projects.blender.org/blender/blender/pulls/120694
2024-06-05 11:28:44 +02:00
Sebastian Parborg
38dd4a5e9a Fix: Wonky behaviour of "Frame All" and "Frame Selected" in the VSE
Both these operators would quite often put the framed strips offscreen.
This was in part due to the padding need to make sure that the strips
were not going to be obscured by the scrub area or overlays not being
applied or calculated correctly.

In addition to that, the view positioning logic was not in sync with the
vertical clamping code. This lead to the operators positioning the view
into a forbidden state. So the clamping logic would adjust the view
afterwards and thus put some of the framed strips offscreen.

This patch unifies the logic used by the "frame X" operators and the
clamping code, making them play nice with each other.

Pull Request: https://projects.blender.org/blender/blender/pulls/122219
2024-06-05 11:18:23 +02:00
Jacques Lucke
8beb91118c Cleanup: make format 2024-06-05 10:41:07 +02:00
Leon Schittek
db5d410164 Node Editor: add overlay to automatically label reroute nodes
Add an overlay option to automatically display a label on reroute nodes.

This automatic label is propagated through chained reroute nodes and
is based on the explicit label of linked reroute nodes.

The automatic label is dimmed to distinguish it from manually set ones.

Pull Request: https://projects.blender.org/blender/blender/pulls/113368
2024-06-05 10:02:37 +02:00
Nathan Burnham
1c92d26bfc PyAPI Doc: fix typos causing untyped parameters
The type for `bpy_struct.keyframe_insert()`'s `options` parameter was
instead applied to a non-existent `flag` parameter.

The description and type for `mathutils.Vector.Repeat()`'s `vector`
parameter was instead applied to a non-existent `tuple` parameter.

Also fix a reference to `BMElemeSeq` instead of `BMElemSeq`.

Ref: !122734
2024-06-05 16:25:05 +10:00
Lukas Stockner
5246fb5a57 Cycles: Implement blue-noise dithered sampling
This patch implements blue-noise dithered sampling as described by Nathan Vegdahl (https://psychopath.io/post/2022_07_24_owen_scrambling_based_dithered_blue_noise_sampling), which in turn is based on "Screen-Space Blue-Noise Diffusion of Monte Carlo Sampling Error via Hierarchical Ordering of Pixels"(https://repository.kaust.edu.sa/items/1269ae24-2596-400b-a839-e54486033a93).

The basic idea is simple: Instead of generating independent sequences for each pixel by scrambling them, we use a single sequence for the entire image, with each pixel getting one chunk of the samples. The ordering across pixels is determined by hierarchical scrambling of the pixel's position along a space-filling curve, which ends up being pretty much the same operation as already used for the underlying sequence.

This results in a more high-frequency noise distribution, which appears smoother despite not being less noisy overall.

The main limitation at the moment is that the improvement is only clear if the full sample amount is used per pixel, so interactive preview rendering and adaptive sampling will not receive the benefit. One exception to this is that when using the new "Automatic" setting, the first sample in interactive rendering will also be blue-noise-distributed.

The sampling mode option is now exposed in the UI, with the three options being Blue Noise (the new mode), Classic (the previous Tabulated Sobol method) and the new default, Automatic (blue noise, with the additional property of ensuring the first sample is also blue-noise-distributed in interactive rendering). When debug mode is enabled, additional options appear, such as Sobol-Burley.

Note that the scrambling distance option is not compatible with the blue-noise pattern.

Pull Request: https://projects.blender.org/blender/blender/pulls/118479
2024-06-05 02:29:47 +02:00
Hans Goudey
c1a9ccdf0b Cleanup: Sculpt: Remove redundant flag passed to bounds update
PBVH_UpdateRedraw was always combined with PBVH_UpdateBB.
The use for the "redraw update" isn't clear anyway, since there are
more specific tags for everything that would require a redraw.
2024-06-04 16:06:26 -04:00
Hans Goudey
1e85cdc9ad Cleanup: Sculpt: Move bounds functions to group them together 2024-06-04 16:06:25 -04:00
Hans Goudey
3fa25e3986 Cleanup: Sculpt: Rename and document PBVH bounds functions and fields 2024-06-04 16:06:25 -04:00
Bastien Montagne
fad031a3a9 Fix (unreported) crash when setting current frame from the UI.
Regression from f98b01e492. Better check if a Scene has a sequence
editor, before accessing its data...
2024-06-04 21:51:16 +02:00
Habib Gahbiche
ccdba13492 Compositor: remove viewer crosshair to set tile priority
The functionality has already been removed in https://projects.blender.org/blender/blender/pulls/121176. This patch removes the drawing in backdrop compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/122639
2024-06-04 21:15:17 +02:00
Habib Gahbiche
6521577e4a Fix compositor crop gizmo ignores offset
Backdrop gizmo of Crop Node ignores image offset caused by Transform or Translate node

Pull Request: https://projects.blender.org/blender/blender/pulls/122632
2024-06-04 21:14:35 +02:00
Aras Pranckevicius
078a737fd6 Format 2024-06-04 22:08:42 +03:00
Omar Emara
4f21b26675 Fix #121639: Glare shifts the colors of highlights
The Glare node shifts the color of the highlights when the threshold is
high. That's because the thresholding algorithm simply subtracts the
threshold from the RGB data, which is not expected to retain the same hue
of the color.

To fix this, we do the thresholding only on the luminance of the color
in HSV color space. This eliminates the color shifting and also helps to
smooth the edges of the highlights.

This is a breaking change, but it is more of a fix rather than a change
of behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/122570
2024-06-04 20:59:32 +02:00
Jesse Yurkovich
9ad2c7df0b USD: implement native Unicode support
Make use of USD's new UTF-8 support to allow our import/export code to
accept and generate appropriate USD files. This has been a long standing
shortcoming since USD's introduction, with incomplete and complicated
DCC-specific workarounds often attempted.

Summary of changes
- Export gets a new "Allow Unicode" option defaulting to "false". The
  new Unicode USD files are not backward compatible. DCCs using older
  versions of USD (before 24.03) will not be able to load such files so
  we want to provide this as an opt-in option for now.
- Every location which used to call either `USDHierarchyIterator::make_valid_name`
  or `pxr::TfMakeValidIdentifier` will now go through a new `make_safe_name`
  API instead
- Export code is responsible for passing in the `allow_unicode` option
- Import code will always pass in `true` meaning Blender will happily
  accept both existing and new Unicode USD files

Strangely, USD does not provide a convenient way of making valid UTF-8
identifiers and they left their old API unchanged. We had to roll our
own per their advice: https://forum.aousd.org/t/how-to-make-a-unicode-identifier-valid/1435

Pull Request: https://projects.blender.org/blender/blender/pulls/122471
2024-06-04 20:53:57 +02:00
Harley Acheson
f5131cdee0 Fix #122411: Sub-panels Not Clickable When Popover is Scaled
When a popover includes panels, the calculation of whether the mouse
is over the panel header does not take into consideration local 2D
scaling. Therefore the hit area is in the wrong location if scaled.

Pull Request: https://projects.blender.org/blender/blender/pulls/122696
2024-06-04 20:28:12 +02:00
Sean Kim
dd9ea5de6b Sculpt: Adjust Extrude Mode option descriptions
Adjusts the UI text to be similar to the manual description

Pull Request: https://projects.blender.org/blender/blender/pulls/122731
2024-06-04 20:26:44 +02:00
Hans Goudey
ed998449d4 Cleanup: Remove redundant prefixes in sculpt_boundary.cc
Remove parts of function names that are redundant with the namespace.
2024-06-04 14:22:13 -04:00
Hans Goudey
bf02cead33 Cleanup: Remove redundant prefixes in sculpt_expand.cc
Remove parts of function names that are redundant with the namespace.
2024-06-04 14:22:13 -04:00