Commit Graph

105247 Commits

Author SHA1 Message Date
Hans Goudey
a416677d4e Cleanup: Remove unnecessary "using namespace" lines 2023-12-11 15:47:11 -05:00
Hans Goudey
99f6f13add GPv3: Avoid creating cyclic attribute when unnecessary in duplicate operator
None of the final curves will be cyclic if none of the original curves were cyclic.
2023-12-11 15:47:11 -05:00
Hans Goudey
d8497e48e1 Cleanup: Use is_empty() instead of size() == 0 2023-12-11 15:47:11 -05:00
Richard Antalik
4e10aa6e71 Fix #115086: Retimed hard split sound strip does not seek correctly
Content cut off by `anim_startofs` is as if it does not exist for
sequencer. But Audaspace seeking relies on having animation buffer
initialized for whole sequence. Initialize pitch of cut content to 1.
2023-12-11 21:18:49 +01:00
Clément Foucault
fe2a7f4b8d EEVEE-Next: Support ShaderToRGBA on Dithered materials
This adds a new hybrid mode where the light and lightprobe
textures are bound to the gbuffer pass and used by
shaders that use ShaderToRGBA.

The counterpart is that these shaders have less texture
slots available but still two more than the Blended
materials.

These materials will correctly write to the AOVs and
render passes.

This is not too invasive in terms of implementation. The
only quirk was that we needed another fragment shader to
simplify the dependencies on the resources. But if we ever
get pre-processor support in our include / require system
this could be cleaned up.
2023-12-11 20:32:58 +01:00
Clément Foucault
8ab23ea17d Fix: EEVEE-Next: Missing indirect light in ShaderToRGBA
Silly mistake. The lighting was not added to the right
variable.
2023-12-11 20:32:58 +01:00
Miguel Pozo
73a5826bf5 Fix: EEVEE-Next: Film matrix
Fixes motion vectors for static geometry.
Regression from beee7db.
2023-12-11 20:23:04 +01:00
laurynas
feae0b4173 Curves: Support for edit mode draw tool
Adds new curves support to "Draw Curve" operator. This is a direct copy
and replace of the old code to the new editors directly, with a change to
create the new data structure instead of the old one. There is no attempt
at code deduplication, since that would complicate removing the old
curve type when it comes time.

To replace the "2D curve" option a new operator property is added
for projecting to the Z=0 plane.

Pull Request: https://projects.blender.org/blender/blender/pulls/115864
2023-12-11 19:44:19 +01:00
Clément Foucault
3313e9976a Fix: EEVEE-Next: Broken Shadow usage tagging
Broken after recent changes.

Caused by 85f9758302
2023-12-11 19:20:27 +01:00
Hans Goudey
eefe19a7de Fix #115994: Crashes with edit mode tools using custom data correction
Caused by 15cff1fddb reversing source and result arguments.
2023-12-11 13:11:02 -05:00
Hans Goudey
6bc3445e65 Fix: Crash copying BMesh from typo in CustomData copy 2023-12-11 13:11:02 -05:00
Omar Emara
bcea221021 Realtime Compositor: Cache bokeh kernel image
This patch creates a static cached resource from bokeh kernel images,
for better performance and reusability, since it will be used by the
Defocus node as well.
2023-12-11 19:43:03 +02:00
Clément Foucault
4c14557424 Fix: EEVEE-Next: Undefined behavior with only diffuse material
Diffuse materials still needs the feedback buffer for correct
horizon scan.
2023-12-11 18:24:40 +01:00
Clément Foucault
5fa44c0ff8 Fix: EEVEE-Next: Broken HiZ for planar probe
This was caused by missing resources.
2023-12-11 18:09:06 +01:00
Clément Foucault
3df81b0b86 Fix: EEVEE-Next: Planar Probe rendering broken
Was caused by several small mistakes.
2023-12-11 18:08:20 +01:00
Clément Foucault
85f9758302 Fix: EEVEE-Next: Crash when using Planar Probe
This was caused by missing cryptomatte and
depth buffer input for shadow tagging.
2023-12-11 17:27:10 +01:00
Clément Foucault
a32b4ecd83 EEVEE-Next: Make Hi-Z buffer swap on set_source
This fixes a case where the source was set but the
internal pointers for binding were not updated.

This also tag for update internally.

Cleanup and remove the redundant tagging.

This also use the planar depth buffer as layer view.
2023-12-11 17:27:10 +01:00
Miguel Pozo
b484018d42 Fix: EEVEE-Next: ObjectKey
memset is not guaranteed to clear padding bytes,
which breaks the use of memcmp for comparison.
2023-12-11 17:26:04 +01:00
Jeroen Bakker
fa2f9ef33b Vulkan: Generate Correct GLSL After Changing Workarounds
During normal execution it isn't possible to switch workarounds.
However when running test cases we want to check if shaders and
other tests work when work arounds are enabled. Currently shader
patches are cached globally.

This PR moves the cached shader patch to the device level which
is rebuild every time a device needs to be reinitialized.

For OpenGL this is also an issue, but harder to solve as the concept
device doesn't exist there.

Pull Request: https://projects.blender.org/blender/blender/pulls/116042
2023-12-11 16:25:41 +01:00
Clément Foucault
bac94fe307 EEVEE-Next: Make AO node respect the normal input 2023-12-11 14:50:58 +01:00
Clément Foucault
4ed9b4fed0 EEVEE-Next: More work into supporting horizon scan in AO node
This is only part of making inverted scan work.
There are still issues with background not being
considered outside objects.
2023-12-11 14:50:57 +01:00
Clément Foucault
809365d24a Cleanup: EEVEE-Next: Add pipeline defines 2023-12-11 14:50:57 +01:00
Falk David
aa40e9b3c1 Cleanup: GPv3: render engine 2023-12-11 14:23:57 +01:00
Hans Goudey
8157f33911 Cleanup: Move opensubdiv C-API headers to C++
All the relevant code is C++ now, so we don't need to complicate things
with the trip through C anymore. We will still need some wrappers, since
opensubdiv is an optional dependency though. The goal is to make it
simpler to remove the unnecessary/costly abstraction levels between
Blender mesh data and the opensubdiv code.
2023-12-11 07:50:29 -05:00
Jeroen Bakker
01eade9a02 Fix: Assert When Using Shader Builder
Depending on the compiler shader builder could assert due to an
uninitialized attribute. This PR initializes the attribute.

Pull Request: https://projects.blender.org/blender/blender/pulls/116034
2023-12-11 13:41:55 +01:00
Omar Emara
eabe386e8e Compositor: Use full precision inputs for GPU compositor
Store render pass cache using full precision since some passes will only
make sense in full precision, like Cryptomatte and Z Depth.
2023-12-11 13:22:02 +02:00
Nathan Vegdahl
274dc815eb Fix: update collada export code to use the new bone collections array
I missed this in the previous commit, which broke building Blender.
2023-12-11 12:06:38 +01:00
Nathan Vegdahl
089383a53a Cleanup: rename bArmature.collections -> bArmature.collections_legacy
And leave a TODO to remove it entirely in Blender 5.0.

Pull Request: https://projects.blender.org/blender/blender/pulls/115931
2023-12-11 10:54:34 +01:00
Jeroen Bakker
1b99987043 GPU: Shader Builder Filter
This PR introduced some filters to improve the workflow when using
shader_builder. Shader builder is used to validate shader compilation
during buildtime and can be enabled using `WITH_GPU_BUILDTIME_SHADER_BUILDER`.

During backend development shader builder is also handy as you can
pin-point it to the shader/backend you're focusing on. Without filters
you would insert temporary code to break on a specific shader.

* `--gpu-backend` can be used to only check a specific backend.
  possible values are `vulkan`, `metal` or `opengl`. When argument
  isn't passed, all backends will be validated.
* `--gpu-shader-filter` can be used to only check a subset or indivisual
  shader. The filter is a name starts with filter. Use
  `--gpu-shader-filter eevee` to validate all eevee shaders

Pull Request: https://projects.blender.org/blender/blender/pulls/115888
2023-12-11 10:44:09 +01:00
Hans Goudey
fb5d03b5ba Fix: Typo in recent commit to BMesh copy function
Mistake in 0b1049b41d used the vertex map for edges.
Thanks to Philipp for pointing this out.
2023-12-10 18:52:24 -05:00
Damien Picard
6d70e9b05f UI: fix and improve a few messages
- "Frame Step" -> "Number of frames to skip forward while baking each
  frame": expand description which was just copying the prop name.
- "b-bone" -> "B-Bone": title case.
- "Volumes Lighting" -> "Volume Lighting": typo.
- "Volumes Shadows" -> "Volume Shadows": typo.
- "Insert Blank Keyframe (All Layer)" -> "(All Layers)": typo.
- "the an" -> "an", typo.
- "Inverse" -> "Invert": use verb instead of noun for an action.
- "Desination" -> "Destination": typo.
- "Hides all other F-Curves other than the ones being framed": remove
  extra "other".
- "Remove Bone from Bone collections" -> "Collection", singular because
  the operator is only applied to the active collection. Also title
  case on "Collection".
- "Change Stroke material with selected material" -> "Assign the
  active material slot to the selected strokes": rephrase by reusing
  the message from the non-Grease Pencil materials.
- "VisAction", "VisArea" -> "Visibility Action", "Visibility Area":
  expand abbreviation. This is not exposed in the UI right now but
  will show up in the API docs.
- "Stop Mode Right / Global Down" -> "Stop Move" (typo).
- "... for node input  %s": remove extra space.
- "Move along their normal" -> "Move shadows along their normal":
  rephrase unclear sentence.
- "Stat Vis" -> "Mesh Analysis": stands for "Statistical
  visualization"? Unclear and not shown anywhere. Reuse the label
  specified in the UI code instead.
- " Output data...": remove leading space.
- "Attribute domain for the selection and group id inputs": title case
  on "Selection" and "Group ID" as that is how they appear in the UI.
- "Ior" -> "IOR": uppercase acronym, for consistency.

Pull Request: https://projects.blender.org/blender/blender/pulls/115964
2023-12-11 00:23:03 +01:00
Jason Fielder
6ebe196c0b Metal: Add support for attachment-less framebuffer
Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115296
2023-12-10 22:18:54 +01:00
Hans Goudey
edb7656c06 Cleanup: Remove unused BoundBox functions 2023-12-10 15:52:29 -05:00
Hans Goudey
4eee57fc3b Fix #115979: Object bounds display type doubled size
The "size" of a bounding box that used to be calculated by
`BKE_boundbox_calc_size_aabb` was actually the dimensions
divided by two.
2023-12-10 15:52:29 -05:00
Clément Foucault
ae70d25959 EEVEE-Next: Refactor Raytracing pipeline
This de-duplicate some passes in the raytracing
pipeline and make it more ready for adoption
of arbitrary closure evaluation. This last part
means the removal of some per closure type
options.

The put in common the tile classification step
that is now done only once for all 3 closure
type. Also add some speedup to the tile
compaction phase that is now only twice
faster.

The horizon-scan setup was also de-duplicated
and run only if needed, which can save up to
0.5ms is complex scenes.

However, this moves the max-roughness and and
resolution scaling to a common parameter.
This is to be able to support arbitrary closure
evaluation where multiple closure with conflicting
parameters could be evaluated in one tracing pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/116009
2023-12-10 21:38:23 +01:00
Clément Foucault
91fd6b18f3 Fix #115288: EEVEE-Next: Horizon Scan light leaking
This was caused by the normal test being wrong and
not taken into account at all.
2023-12-10 21:36:06 +01:00
Campbell Barton
12c4d22e6d Fix #115937: Context override fails to restore screen
The recent addition screen override [0] failed to account for the
override windows screen being overridden when restoring the context.

When overriding the window and screen, it's incorrect to use the
original contexts screen when restoring the screen of the overriding
window.

This window's screen may not be in the original context or the
overriding screen. Resolve the bug by storing this separately
and use it when restoring the context.

[0]: 6af92e1360
2023-12-10 23:33:08 +11:00
Campbell Barton
22d65bad95 Cleanup: pass BMesh by pointer instead of reference
The version of BM_elem_attrs_copy that took a map used a reference
the version without a map didn't, which is fairly confusing.

Pass by pointer now unless this is part of a wider refactor
to move to references everywhere.
2023-12-10 22:12:34 +11:00
Campbell Barton
ffc84da541 Cleanup: use const variables & arguments, remove unused assignments 2023-12-10 21:24:37 +11:00
Campbell Barton
ff47eb3e37 Cleanup: minor style tweaks, surround ELEM by parenthesis 2023-12-10 17:12:53 +11:00
Campbell Barton
21fbd9dbd7 Cleanup: add missing header, sort files 2023-12-10 16:38:15 +11:00
Campbell Barton
21525b4ea6 License headers: add SPDX headers 2023-12-10 16:35:15 +11:00
Campbell Barton
ded36920d7 Cleanup: spelling in comments 2023-12-10 16:33:54 +11:00
Campbell Barton
49c6e4ed5a PyAPI: micro optimization accessing keyword arguments for bpy functions
Check the string length before comparing with memcmp,
gives 20-30% speedup for the lookup function.
2023-12-10 16:18:35 +11:00
Campbell Barton
7ee8de9ba4 Cleanup: replace WM_cursor_set with WM_cursor_wait for image copy/paste
WM_cursor_wait is more common and doesn't assume the current cursor
is WM_CURSOR_DEFAULT.
2023-12-10 15:58:10 +11:00
Richard Antalik
79dff8174b Cleanup: VSE waveform drawing variables
Code had variables `frame_start` and `start_frame` for different purpose
confusing. Variables were sorted and math simplified.

Fixes broken waveform to pixel grid alignment.
2023-12-09 20:53:10 +01:00
Richard Antalik
b5ce6b6de7 Fix #114951: Waveform drawn incorrectly in strips with hold offset
Caused by not applying the offset to start frame calculation.
Also fixes reverse offsetting of waveform when start offset was
negative - content start frame was used instead of handle frame.
2023-12-09 20:18:58 +01:00
ok_what
5e07e9f7e2 Fix (unreported): Set Color Tag broken when inside meta strip
When editing inside a meta strip, running the "Set Color Tag" operator
would set the color tag of the top-most meta strip, rather than that of
the intended strip.

Pull Request: https://projects.blender.org/blender/blender/pulls/115950
2023-12-09 19:37:08 +01:00
Campbell Barton
15cff1fddb BMesh: optimize attribute copying by reusing BMCustomDataCopyMap
Continuation of fix for #115776. Removes attribute copy functions
that calculate the map inline, this is error prone as it's easy to
call these functions from a loop which may result in poor performance.
2023-12-09 23:16:21 +11:00
Hans Goudey
0b1049b41d BMesh: Optimize copying attributes from many elements at once
Fixes #115776

Create a minimal structure that contains the instructions necessary to
copy from one custom data format to another. This structure is similar
to the one used in dfacaf4f40. It should have been used in
9175d9b7c2, which instead introduced quadratic performance
relative to the number of layers when copying every element.

In this commit, copying the entire mesh and adding new custom data
are explicitly changed to use the new map to speed up copying many
elements at a time.

The non-map attribute copy functions are also changed to check for when
the source and result BMeshes are the same. In that case it's much
faster to call the "same format" function from 9175d9b7c2.

For numbers, the timings are arbitrarily influenced by how many layers
I add in my testing. With 50 or so layers, a 10x difference is easily
observable though.

Pull Request: https://projects.blender.org/blender/blender/pulls/115824
2023-12-09 05:37:37 +01:00