Commit Graph

137006 Commits

Author SHA1 Message Date
Hans Goudey
e598d92e3d BLI: Inline math::min_max
For some reason this was not inlined. Considering it's a very simple function
and function call overhead could be measurable. In the case of the simple
brush benchmark file from the current sculpting project (#118145), this
improved performance by 6%, from 2.44s to 2.29s.
2024-06-05 13:27:52 -04:00
Pablo Vazquez
561f26e31a Docs: Update favicon
Use a higher resolution PNG version of the icon, matching other
websites related to development.

The previous favicon.ico is from the days of the old Typo3 blender.org

Part of infrastructure/blender-org#57107
2024-06-05 19:21:36 +02:00
Hans Goudey
84c4ddbbb9 Cleanup: GPU: Use references for some vertex buffer functions
Pull Request: https://projects.blender.org/blender/blender/pulls/122784
2024-06-05 18:47:22 +02:00
Pablo Vazquez
c1cf43e25e Merge branch 'blender-v4.2-release' 2024-06-05 17:58:05 +02:00
Pablo Vazquez
7b601464c3 UI: Add new TAG icon
Introduce a new icon: `TAG`. A generic tag/label, to be used anywhere
there are tags.

Details and images in the pull request.

Pull Request: https://projects.blender.org/blender/blender/pulls/122738
2024-06-05 17:56:51 +02:00
Ray Molenkamp
70ed48a089 Merge remote-tracking branch 'origin/blender-v4.2-release' 2024-06-05 09:31:34 -06:00
Ray Molenkamp
880193d689 Deps: add libx265 build support
This updates the deps builder only, further integration into blender
is still needed to expose it in blender itself.
2024-06-05 09:29:28 -06:00
Hans Goudey
905ceaeacc Merge branch 'blender-v4.2-release' 2024-06-05 10:33:04 -04:00
Hans Goudey
05142b3ea8 Fix #122523: Crash/missing loose edge drawing with two viewports
With two viewports, and one viewport with overlays turned off, one viewport
first requests positions without calculating loose geometry, then the second
viewport can request the loose geometry index buffer. In that case the
previously-calculated positions VBO has the wrong size.

To fix this, always calculate loose geometry when the positions are requested.
That's required because we no simple way of checking whether the previously
uploaded positions included loose geometry. That was the state before recent
refactors in this area anyway.

This makes it clear that the optimization to not calculate loose geometry is
meaningless, because the positions buffer will always be requested at some
point when drawing a mesh.
2024-06-05 10:32:27 -04:00
Lukas Stockner
f436d45cb6 Merge branch 'blender-v4.2-release' 2024-06-05 16:28:11 +02:00
Lukas Stockner
56ff0d414a Fix #121032: Shader Node preview crash for muted nodes with multiple editors
It seems that when ensure_nodetree_previews calls duplicate_material,
ntreeLocalize removes the muted node from the copy of the nodetree,
so later in ensure_nodetree_previews nodeFindNodebyName can't find it
and therefore parent is NULL.

With this change, the muted node just doesn't get its preview updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/122776
2024-06-05 16:27:28 +02:00
Clément Foucault
8f895ec781 Fix: EEVEE-Next: Wrong sun shadow pixel radius calculation
This fixes a number of issue with the pixel radius calculation.
- Fix factor of 2 being in the wrong place.
- `narrowing` is removed as this is not what we want
  to compute (see comment).
- The `lod_min` is not the actual minimum LOD. Clamp by
  both `clipmap_lod_min` and `clipmap_lod_max`.
2024-06-05 16:17:55 +02:00
Lukas Tönne
28ad3e59a7 GPv3: Fix crash when converting LineArt modifiers.
This was using the wrong modifier type identifier, cause conversion code
to use the wrong callbacks and causing buffer overflow.
2024-06-05 15:53:12 +02:00
Falk David
a40a4ccb2f GPv3: Draw Tool: Make "Simplify" option a screen space threshold
Previously, the "Simplify" option was a world space distance threshold.
This meant that zooming in and out of the view changed the way
this option behaved. There were complaints from artists about this.

This change improves two things:
* The simplify algorithm uses the screen space coordinates rather than the
  3D positions.
* The UI setting is in pixels making it much easier to tweak (no need
  for values in the 1e-4 range).

Pull Request: https://projects.blender.org/blender/blender/pulls/122719
2024-06-05 15:06:49 +02:00
Falk David
dd63668790 GPv3: Brush strength conversion
In GPv2 the brush strength was it's own setting in the
`brush->gpencil_settings`. Now we just use the `brush->alpha`
like all other brushes.

Note: The versioning will be done when GPv3 becomes the default.

Pull Request: https://projects.blender.org/blender/blender/pulls/122565
2024-06-05 14:28:11 +02:00
Hans Goudey
92bfb754af Cleanup: Use unique_ptr for MeshRenderData
Also slightly simplify the main task graph node creation.

Pull Request: https://projects.blender.org/blender/blender/pulls/122722
2024-06-05 14:20:05 +02:00
Hans Goudey
24055d1837 Cleanup: Remove unused MeshExtract virtual iteration abstraction
Part of #116901.
This has been removed step by step in the previous commits.
2024-06-05 14:20:01 +02:00
Hans Goudey
eb4f3516a6 Mesh: Draw: Replace extractor abstraction for attributes buffers
Part of #116901.
The last extractor removed. This was already written in a data-oriented
manner so only the entry point changes in this commit.
2024-06-05 14:20:01 +02:00
Hans Goudey
deedbee971 Mesh: Draw: Replace extractor abstraction for UV edit index buffers
Part of #116901.
This file contains the creation of four different UV edit index buffers:
triangles, lines, points, and face dots. The main changes are about making
it clearer when faces are skipped. Other than that, changes are faily
extensive but straightfoward. In a few places some parts of existing
loops have been split out and parallelized, but the bulk of the work for
each IBO remains largely single threaded.
2024-06-05 14:20:01 +02:00
Hans Goudey
7292667db6 Mesh: Draw: Replace extractor abstraction for face dots UV edit data buffer
Part of #116901.
2024-06-05 14:20:01 +02:00
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
Julian Eisel
a6ed013baa Refactor: Get asset data via asset representation, not file
The "active_file" context member as a way to get the active asset should be
avoided, in favor of "asset". This moves us away from the file browser backend
as basis of the asset system,
2024-06-05 13:46:33 +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