Commit Graph

126132 Commits

Author SHA1 Message Date
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
Jeroen Bakker
567d992a69 Cleanup: Silence Compilation Warnings in GHOST
Pull Request: https://projects.blender.org/blender/blender/pulls/110260
2023-07-19 12:59:49 +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
nutti
308da08221 Docs: Fix layout of bpy.types.Object Python API documents
Fix the layout of Python API documents of bpy.types.Object.
2023-07-18 23:32:00 +10: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
Jeroen Bakker
6a3c865129 Cleanup: Make format 2023-07-18 12:04:13 +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
Campbell Barton
ac9f66e742 Cleanup: correct struct member comments 2023-07-18 14:34:59 +10:00
Campbell Barton
db345366fe Cleanup: struct member comments for DrawEngineType & RenderEngineType 2023-07-18 14:34:59 +10:00
Campbell Barton
2c9aa2c8e5 code checker: add 'make check_struct_comments'
This utility uses Python's clang module to validate comments intended
to match the struct member names. `cmake_static_check_clang.py` has
been written to support adding other checkers in the future.
2023-07-18 14:34:59 +10:00
Campbell Barton
17563e9a91 Cleanup: use C++ function style casts, NULL -> nullptr 2023-07-18 14:18:07 +10:00
Campbell Barton
29c2e71d1f Cleanup: quiet warnings 2023-07-18 14:18:06 +10:00
Ray Molenkamp
eec5c867d3 Cleanup: Make format 2023-07-17 13:00:30 -06:00
Colin Marmond
899f8a8500 Refactor: use ImBuf instead of a raw buffer for compositor previews
In order to better suit the upcoming changes of shader node previews, this
patch replaces the old implementation of the storage of the compositor
previews. It also prevents memory loss for future modification.

BKE_node_preview_clear_tree was removed as it is no longer needed and
will not be used by the new shader node previews.

Pull Request: https://projects.blender.org/blender/blender/pulls/110064
2023-07-17 20:13:52 +02:00
–kaspian.jakobssongmail.com
b767a62f32 Fix #109679: Normal Map node strength interpolation artifacts
Previously the normal strength linearly interpolated and extrapolated
the normal in world space. Instead do it in tangent space, in a way
that ensure the normal remains above the surface and valid.

Pull Request: https://projects.blender.org/blender/blender/pulls/109763
2023-07-17 20:06:41 +02:00
Harley Acheson
69cc84fa6c Cleanup: Make format
Removing unnecessary whitespace added with 1b1349cee4
2023-07-17 10:56:03 -07:00
Harley Acheson
1b1349cee4 UI: Indeterminate Button State
No user visible changes expected, the new button state is not used yet.

Setting a new uiBut drawflag shows items in an indeterminate state, not
indicating a specific value or state.

Pull Request: https://projects.blender.org/blender/blender/pulls/108210
2023-07-17 19:37:15 +02:00
Jason Fielder
3f99b6e71c EEVEE Next: Avoid out of bounds cryptomatte buf and image access
Resolves shader validation error in Metal backend for EEVEE Next.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/110215
2023-07-17 17:56:04 +02:00
Clément Foucault
9305778fb5 Fix: EEVEE-Next: bindpoint collision from Object 2023-07-17 16:46:16 +02:00
Falk David
ba1795ec81 GPv3: Add tagging drawing for topology change 2023-07-17 16:39:37 +02:00
Falk David
965a6bad3e Cleanup: GPv3: use strokes functions
This replaces `drawing->geometry.wrap()` with
`drawing.strokes()`.
2023-07-17 16:37:46 +02:00