Commit Graph

101323 Commits

Author SHA1 Message Date
Campbell Barton
ecd729433d Cleanup: pass rcti to WM_window_open & ED_screen_temp_space_open
Pass a single rcti instead of 4 int arguments.
2023-07-20 16:55:24 +10:00
Omar Emara
6400190836 Fix #110281: Keying node despill is wrong on GPU
The Keying node produces wrong despilling on the GPU evaluator.

That's because the despill amount could be negative, which was not
accounted for.

Additionally, the saturation indices were changed to match the CPU
implementation, just as was done in bdb042c243.
2023-07-20 09:44:58 +03:00
Campbell Barton
246292f486 Cleanup: various non-functional changes (mainly for C++)
- Remove redundant void, struct.
- Remove redundant parenthesis.
- Use STR_ELEM(..)
- Use function style casts.
2023-07-20 11:55:34 +10:00
Campbell Barton
08f4f1f41e Cleanup: spelling in comments, capitalize tags 2023-07-20 09:42:00 +10:00
Campbell Barton
9d73926873 Cleanup: move code-comments into doc-string, use boolean argument 2023-07-20 09:40:29 +10:00
Germano Cavalcante
b6e4042a38 Cleanup: remove unused member in 'ViewOpsData' 2023-07-19 17:57:49 -03:00
Omar Emara
bdb042c243 Fix #109868: Keying node differ between GPU and CPU
The Keying node produces different mattes between the GPU and CPU
evaluators.

That's because the CPU implementation doesn't use the full argmax to
determine indices, rather, it only considers the first argmax and uses
the minimum and maximum of the other two as a form of determinism or
stability.

The algorithm seems arbitrary and makes little sense to me, so for now,
the CPU implementation was ported for consistent results.
2023-07-19 21:02:20 +03:00
Jacques Lucke
3525a0c070 Editors: move code to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110267
2023-07-19 18:37:21 +02:00
casey bianco-davis
1629eb61a1 GPv3: UI and RNA for layer opacity
Adds the UI for layer opacity in the layer panel.

Currently layer blending rendering is not implemented, so the last layer's opacity will affect all of the layers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110177
2023-07-19 17:34:05 +02:00
Clément Foucault
7f905a0b06 Fix: EEVEE-Next: Make irradiance baking use world probe
The texture and ubo weren't using references. So they could
be referenced before creation.

The ray direction was also inverted.
2023-07-19 16:38:10 +02:00
Falk David
46d60aacd8 Array Utils: Add find_all_ranges function
This functions returns a vector of all the index ranges for which the
span contains consecutive values that equal to the value given.

Pull Request: https://projects.blender.org/blender/blender/pulls/110265
2023-07-19 16:37:50 +02:00
Falk David
93855a5efd IndexMask: Add tests for IndexMask::from_union 2023-07-19 16:24:31 +02:00
Nate Rupsis
7146371964 Animation: Vertically locking the NLA so it doesn't scroll to infinity
Applying vertical scroll lock from #104516 to NLA editor

Pull Request: https://projects.blender.org/blender/blender/pulls/109473
2023-07-19 16:12:15 +02:00
Germano Cavalcante
734b01d9c0 Fix #110259: snapping with Xray alpha 1.0 occludes edited geometry
The edited mesh is not occluded even with Xray alpha 1.0, but it still
occludes other meshes that are not in edit mode.

Therefore, to resolve, alpha is still considered in general occlusion,
but is ignored in occlusion of edited meshes.
2023-07-19 10:56:51 -03:00
Jacques Lucke
18096bd18a Editors: move curve directory to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110262
2023-07-19 15:28:46 +02:00
Omar Emara
a79680b4d1 Fix: End of non void function error in previous commit 2023-07-19 15:51:36 +03:00
Omar Emara
817a1a5c8f Fix: End of non void function error in last commit 2023-07-19 15:20:01 +03:00
Clément Foucault
cdb8a8929c GHOST: Delete Mac OpenGL support
The maximum OpenGL versions supported on mac
doesn't meet the minimum required version (>=4.3) anymore.

This removes all the OpenGL paths in GHOST
Cocoa backend and from the drop down menu in
the user preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/110185
2023-07-19 14:16:03 +02:00
Omar Emara
940558f9ac Realtime Compositor: Implement Classic Kuwahara
This patch implements the Classic Kuwahara node for the Realtime Compositor.

A naive O(radius^2) implementation is used for radii up to 5 pixels, and a
constant O(1) implementation based on summed area tables is used for higher
radii at the cost of building and storing the tables.

This is different from the CPU implementation in that it computes the variance
as the average of the variance of each of the individual channels. This is done
to avoid computing yet another SAT table for luminance. The CPU implementation
will be adapted to match this in a future commit.

The SAT implementation is based on the algorithm described in:

Nehab, Diego, et al. "GPU-efficient recursive filtering and summed-area tables."

Additionally, the Result class now allows full precision texture allocation, which
was necessary for storing the SAT tables.

Pull Request: https://projects.blender.org/blender/blender/pulls/109292
2023-07-19 14:04:18 +02:00
Omar Emara
4c72dc98c2 Fix #109869: Switch View node crashes on editing
The Switch View node crashes on editing the compositor node tree with
the GPU compositor enabled.

That's because interactive edits are are in contexts that are not
multi-view, which is indicated by an empty view name.

To fix this, we fallback to the first input for non multi-view contexts.
2023-07-19 14:51:34 +03:00
Jeroen Bakker
9cacdf6c42 EEVEE-Next: Extract Spherical Harmonics from World
This PR adds diffuse light from environment to the scene without having an
irradiance volume in the scene.

It does this by extracting the sperical harmonics from the world probe and
store it in the irradiance brick that is reserved for world diffuse light
in the irradiance cache.

This also fixes that selecting an LookDev HDRI didn't update the diffuse
light.

**Known Issues**

- When sampling probes with lower resolution strokes are visible, leading
  to flickering and instability in the spherical harmonics. This is an
  issue that should be solved in a separate patch as it is already visible
  in main
- When selecting a lookdev HDRI all irradiance volumes needs to be disabled
  manually for the expected results (but this also disabled GI). In the future
  this will be done automatically or we will add a solution to separate the
  world diffuse light from the irradiance cache so we can update it on the fly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110110
2023-07-19 13:48:31 +02:00
Sergey Sharybin
ae543c01a4 Refactor: Make viewport to use ViewRender
This change replaces a bare RenderEngine owned by a viewport
with a VeiwRender. This unlocks a possibility of accessing
RenderResult for viewport renders. Currently it is not done,
but it will be needed for an upcoming work towards unification
of the render passes handling.

Ref #108618

Pull Request: https://projects.blender.org/blender/blender/pulls/110244
2023-07-19 12:12:09 +02:00
Sergey Sharybin
78c544a571 Refactor: Allow Render to manage lifetime of resources 2023-07-19 12:12:07 +02:00
Sergey Sharybin
0307ae7bd9 Refactor: Move re-usable parts of Render to a base class
Currently no functional changes.

Preparing for introduction of a Render structure for the viewport
render which will hold both engine and the render result for
passes access.
2023-07-19 12:12:07 +02:00
Sergey Sharybin
b647bdb8f2 Refactor: Make Render a real C++ structure
Use proper allocation and destruction for it.

Since the allocation is no longer zero-initialized make sure the
fields are explicitly zeroed out. This also allows to use an easier
way to initialize mutexes.

Currently no functional changes, preparing for a bigger refactor.
2023-07-19 12:12:07 +02:00
Sergey Sharybin
434f27ebdf Refactor: Use C++ list internally in render pipeline
Used for the global list of the Render structures.

Using C++ container helps moving towards reliable "real" C++
structure for the Render, without worrying about the offset of
the next/prev fields.

Should be no functional changes on the user side.
2023-07-19 12:12:07 +02:00
Sergey Sharybin
f7881a98d1 Cleanup: Remove unused field from Render 2023-07-19 12:12:07 +02:00
Sergey Sharybin
29d9d00a14 Cleanup: Use C++ style struct definition 2023-07-19 12:12:07 +02:00
Sergey Sharybin
bd7c137ac9 Cleanup: Better comments in the RE_engine_draw_acquire() 2023-07-19 12:12:07 +02:00
Falk David
2e3813f02c IndexMask: Add unoptimized from_union function
This adds a `IndexMask::from_union(...)` function. This is not very optimized, but shouldn't perform too terribly either.

Pull Request: https://projects.blender.org/blender/blender/pulls/110241
2023-07-19 10:45:13 +02:00
Campbell Barton
2877d65ccc Fix error in pop menu key accelerators from recent commit
Correct error in own fix [0] popovers (F9-redo) were handled the same
as popup menus. `F4,P` wasn't opening the preferences as it used to.
Resolve by checking if the parent was a menu.

[0]: c3bf00cd2d
2023-07-19 18:10:17 +10:00
Jeroen Bakker
56f0f4b2a5 Fix: World Light Direction in Irradiance Cache
The world light direction in the irradiance cache was inverted due
to misunderstanding of a code review comment. This PR fixes this
so the captured light from a direction is stored in the SH correctly.

Pull Request: https://projects.blender.org/blender/blender/pulls/110258
2023-07-19 09:20:02 +02:00
Campbell Barton
c3bf00cd2d Fix #107838: accelerator keys fail in enums/menus spawned from popups
Enum popups don't set an active button so accelerator keys didn't work.
Always use accelerator keys in popups because these are typically
launched from non-menus (the redo popup for e.g.) where it doesn't
make sense to pass the event to the parent.
2023-07-19 11:26:58 +10:00
Jason Fielder
a8c29fb221 EEVEE Next: Ensure correct resource usage flags for Metal
Shader write must be correctly specified where required for
shaders which perform direct image and buffer writing operations.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/110219
2023-07-18 19:18:33 +02:00
Omar Emara
5be226699f Fix #109676: GPU compositor crashes on muting output nodes
The Realtime GPU compositor crashes when muting output or viewer nodes.

This happens because output nodes are scheduled regardless of their
muted statued, however, the initial reference count takes the muted
status into account, resulting in a use after free error, hence the
crash.

To fix this, we simply do not schedule muted output nodes.
2023-07-18 19:12:56 +03:00
YimingWu
93c27bf958 Fix #110176: Grey out "Flip" in mirror modifier when "Bisect" is off
"Flip" option in mirror modifier is only effective for when "Bisect" is
enabled, thus grey out the flip option when it's ineffective to avoid
confusion on the user interface.

Pull Request: https://projects.blender.org/blender/blender/pulls/110191
2023-07-18 15:49:14 +02:00
Alexander Gavrilov
4d0dbab5b1 Mesh Edit: implement X symmetry in the Propagate To Shapes operator.
Since the operator affects shape keys rather than current mesh
coordinates, this only symmetrizes the selection.

Pull Request #105421
2023-07-18 16:42:55 +03:00
Alexander Gavrilov
0bd95dd963 Mesh Edit: implement X symmetry in the Blend From Shape operator.
This symmetrizes selection and vertex positions like any other operator.

Pull Request #105421
2023-07-18 16:42:55 +03:00
Alexander Gavrilov
d32748cdf4 Shape Key editing: propagate updates through basis chains.
It is possible to organize shape keys into a tree through the
reference key setting. Mesh editing and sculpting a reference
key is supposed to update all its children, but this was only
done for one level of dependencies.

This changes the code to retrieve the complete set of dependent
keys and update them all.
2023-07-18 16:30:51 +03:00
Miguel Pozo
548ff9dc8d Cleanup: EEVEE Next: Clarify sampling rng functions usage
Pull Request: https://projects.blender.org/blender/blender/pulls/110221
2023-07-18 15:23:50 +02:00
Colin Marmond
1c8f04f214 Fix #110155: Hiding entire overlay does not hide node previews
Pull Request: https://projects.blender.org/blender/blender/pulls/110163
2023-07-18 15:07:15 +02:00
Philipp Oeser
c275f4219f Fix #110204: Anim Player draws non-uniformly scaled when resizing window
Caused by fd3e44492e.

Images were drawn filling the entire window, now use available size/
offset inside the window and pass these as `rctf` to
`draw_display_buffer`.

Should be good for 3.6/3.3 LTS

Pull Request: https://projects.blender.org/blender/blender/pulls/110206
2023-07-18 14:10:11 +02:00
Falk David
280ff8284f Fix: Compiler error on macOS
Use `math::max` instead of `std::max`.
2023-07-18 13:08:36 +02:00
Falk David
0c8c3f091d Fix: Compiler error
The file `ED_curves.h` no longer exists and is now `ED_curves.hh`.
2023-07-18 12:02:51 +02:00
Jeroen Bakker
d82cbcaa96 Fix: Eevee-next world only probe didn't update
When scenes only have a world probe the world probe had several
artifacts.

- The first sample didn't update the world.
- When switching between viewports the world didn't get updates
- When rendering it ignored the resolution that was set by the user

The reason was that the ubo was only updated when the probes where
synced. This PR adds an exception to also update when there is only
the world probe.

Pull Request: https://projects.blender.org/blender/blender/pulls/110238
2023-07-18 11:58:00 +02:00
Amelie
d9277b19f3 GPv3: Stroke smoothing operator
Implementation of the smoothing operator for grease pencil strokes.
Works on `CurvesGeometry` position and other attributes, such as radius.

Based on the gaussian blur like algorithm in `BKE_gpencil_stroke_smooth_point` by Henrik Dick.

Pull Request: https://projects.blender.org/blender/blender/pulls/109635
2023-07-18 11:54:34 +02:00
Lukas Tönne
3e3133192a Nodes: Move node socket RNA definition into its own file.
This is a fairly verbose part of nodes RNA, which defines the base
NodeSocket and NodeSocketInterface types as well as all the subtypes
required for showing correct properties based on socket type.

The RNA for this part of nodes is quite self-contained, so moving it
to a separate files works well and reduces the overall size of
rna_nodetree.cc considerably (~1700 LoC). This does not include any
functional changes.

Moving this to a separate file will make it easier to improve the node
group interface (#109135).

Pull Request: https://projects.blender.org/blender/blender/pulls/110220
2023-07-18 11:17:31 +02:00
Martijn Versteegh
b199f10204 Fix #110164: Trigger spreadsheet redraw on animation pause
When playing and then pausing the animation the spreadsheet would show stale data,
not only during playback but also afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/110224
2023-07-18 09:56:11 +02:00
Campbell Barton
7fe1f14116 BLI_linklist_stack: restore type safety without needing explicit casts
Add casts back into the macro (removed in [0]), removing the need for
them to be manually included, use `decltype(..)` for C++.

[0]: 129f78eee7
2023-07-18 17:22:09 +10:00
Jeroen Bakker
e9dbb68729 Fix: Eevee-next LOD selection
The LOD selection for reflection probes wasn't correct and would
select a noisier texture than required. This change will improve
the LOD selection making less noise in the rendered image.

Pull Request: https://projects.blender.org/blender/blender/pulls/110234
2023-07-18 09:21:40 +02:00