Commit Graph

9096 Commits

Author SHA1 Message Date
Hans Goudey
75ede253aa Cleanup: Remove unused Grease Pencil legacy code 2024-12-17 11:43:34 -05:00
Miguel Pozo
5bdb146e85 Fix #131967: Overlay: In-Front doesn't work in preview/viewport-render 2024-12-17 17:28:24 +01:00
Aras Pranckevicius
496a3749d7 Cleanup: rename namespace realtime_compositor->compositor
Pull Request: https://projects.blender.org/blender/blender/pulls/132008
2024-12-17 11:39:04 +01:00
Aras Pranckevicius
a401089a9d Cleanup: move compositor files out of realtime_compositor folder
By now it is just a "compositor", so move the files one folder up.
Things that were under realtime_compositor/intern move into
already existing intern folder.

Pull Request: https://projects.blender.org/blender/blender/pulls/132004
2024-12-17 10:34:24 +01:00
Jacques Lucke
b8228303bc Materials: take object and geometry material slot counts into account
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.

This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.

This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/131869
2024-12-16 18:08:06 +01:00
Campbell Barton
94d39aac0c Cleanup: spelling (make check_spelling_*) 2024-12-14 23:17:49 +11:00
Jacques Lucke
c36567d156 Revert "Materials: take object and geometry material slot counts into account"
This reverts commit 47c255e2da.

There are unexpected problems with mesh rendering. Looks like some `max(1, ...)`
are missing.
2024-12-13 16:54:08 +01:00
Miguel Pozo
37e09218f5 Cleanup: Overlay: Remove redundant setting
The EARLY_FRAGMENT_TEST(true) from select_id_patch already implies
DEPTH_WRITE(DepthWrite::UNCHANGED)
2024-12-13 16:46:13 +01:00
Clément Foucault
556c69f66d Fix: EEVEE: ASAN use after free during baking with hair
This was caused by the `custom_pipeline_wrapper` being
broken up between sync and submit. This was invalid
API usage.
2024-12-13 16:41:54 +01:00
Miguel Pozo
9ec5a0cb02 Fix #131846: Overlay: Wireframe missing
Regression from b295df7345
Fix fragment/selection logic
2024-12-13 16:04:51 +01:00
Jacques Lucke
47c255e2da Materials: take object and geometry material slot counts into account
Previously, the number of material slots on the geometry (e.g. mesh) was the
ground truth. However, this had limitations in the case when the object had more
material slots than the evaluated geometry. All extra slots on the object were
ignored.

This patch changes the definition so that the number of materials used for
rendering is the maximum of the number of material slots on the geometry and on
the object. This also implies that one always needs a reference to an object
when determining that number, but that was fairly straight forward to achieve in
current code.

This patch also cleans up the material count handling a fair amount by using the
`BKE_object_material_*_eval` API more consistently instead of manually accessing
`totcol`. Cycles uses the the same API indirectly through RNA.

Pull Request: https://projects.blender.org/blender/blender/pulls/131761
2024-12-13 15:47:04 +01:00
Clément Foucault
b006a2c67b Fix: EEVEE: ASAN memcpy-param-overlap when reading float3 passes
Using a temporary variable fixes the issue.
2024-12-13 15:04:55 +01:00
Hans Goudey
09ef6c1a12 Fix: Stack buffer overflow in BoneStickData constructor
`float4(float3 &)` is currently problematic because of implicit conversions
to and from `float *`. Writing the constructor explicitly fixes the problem.
Also add const to the arguments.

Pull Request: https://projects.blender.org/blender/blender/pulls/131828
2024-12-13 10:29:20 +01:00
Campbell Barton
48bf2c08b7 Fix experemental preference use when "Developer Extras" is disabled
When "Developer Extras" is disabled, the experemental options
must not be used.

Some checks for experemental options weren't using the macro which
checks both are set.

Add comment to avoid this happening in the future.
2024-12-13 11:25:39 +11:00
Miguel Pozo
b295df7345 Refactor: Overlay: Port "next" shaders declarations to static CreateInfos
Use static CreateInfos for Overlay-Next shaders using a similar approach to Workbench shader variations.

Remove unused infos and shader sources.
Remove the `gpu_shader_create_info_get_unfinalized_copy` workaround.

Pull Request: https://projects.blender.org/blender/blender/pulls/131514
2024-12-12 23:05:00 +01:00
Clément Foucault
afb0d41107 EEVEE: Make sampling.reset() and sampling.is_reset() viewport only
This commit ensures correct usage of these functions.
Usage of them was not guarded and caused issues in render.

Fix #131804
2024-12-12 18:49:58 +01:00
Philipp Oeser
a01fd34f2d Fix #131785: EEVEE samples affected by (disabled motionblur) samples
This was reported for freestyle, but was also the case for regular
renders.

So even though MotionBlurModule::init and MotionBlurModule::step return
early when motionblur is disabled, Sampling::init would still up the
samples with motionblur samples (even if motionblur was disabled
alltogether).

To resolve, only do this when motionblur is enabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/131795
2024-12-12 14:03:49 +01:00
Clément Foucault
f6ecd033de Cleanup: DRW: Remove unused functions and variables 2024-12-12 12:53:20 +01:00
Jeroen Bakker
d7c45e6e0c Fix #131754: Out of bounds when drawing active UDIM tile.
There is a case where the active image index could be placed on an
non-existing tile. This PR fixes this by keeping track of the active
tile when looping over all tiles.

Pull Request: https://projects.blender.org/blender/blender/pulls/131789
2024-12-12 12:29:06 +01:00
Miguel Pozo
9584c9917a Fix #131040: EEVEE: First sample rendered with queued shaders
The first check for `materials.queued_shaders_count > 0` was done
before any synchronization, so it would always pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/131756
2024-12-11 19:43:23 +01:00
Clément Foucault
9a21d67a54 Fix #131652: DRW: Viewport/EEVEE retained ghost image of object
This was caused by a bad state where a texture (likely the viewport)
texture, could be bound as texture by the viewport blit function
and kept bound as texture input during the subsequent redraw.
This would provoke a feedback loop which is UB.

It is still unknown why this is not catched by our GL layer
and why it isn't an issue in Vulkan or Metal nor other GL
implementations.

Add back all missing calls from previous `DRW_state_reset` to
avoid more regressions.
2024-12-11 18:13:21 +01:00
Matthew-Kabin
661facbde0 Fix #131370: Curves: Sculpt selection overlay missing
Selecting curves in sculpt mode is once again visible.

Pull Request: https://projects.blender.org/blender/blender/pulls/131550
2024-12-11 17:07:36 +01:00
Hans Goudey
071fb86a07 Cleanup: Remove unused function 2024-12-11 10:23:45 -05:00
Clément Foucault
81a6cd40e3 Fix #131732: Selection: Selecting in wireframe shading is broken
In the process of fixing, add some convenience functions.
2024-12-11 14:20:20 +01:00
Clément Foucault
40b8ccefbe Fix: Overlay: Crash cause by grid enabled for nodetree areas 2024-12-11 09:40:14 +01:00
Campbell Barton
560b6e2831 Cleanup: spelling (make check_spelling_*) 2024-12-11 11:23:51 +11:00
Campbell Barton
e0f6a067c0 Cleanup: quiet undeclared function warning 2024-12-11 11:23:51 +11:00
Clément Foucault
f8da7ecfe1 Cleanup: DRW: Move DRW_SHADER_FREE_SAFE and DRW_UBO_FREE_SAFE to GPU 2024-12-11 00:43:32 +01:00
Clément Foucault
9bd1a92778 Cleanup: DRW: Remove unused code 2024-12-11 00:38:10 +01:00
Clément Foucault
0ad4696125 Cleanup: DRW: Remove remaining of DRWTexture API 2024-12-10 22:47:46 +01:00
Clément Foucault
ad5efd4a5c Cleanup: Compositor: Use texture pool API directly 2024-12-10 22:42:53 +01:00
Clément Foucault
37f9ec7235 Refactor: Grease Pencil: Remove legacy texture pool API usage 2024-12-10 22:26:16 +01:00
Clément Foucault
5566e7f20e Fix: EEVEE: Material not always finish compiling when baking volume probes
Use the same workaround as for render.
Wrap the sync inside its own `custom_pipeline_wrapper` so that
we don't freeze the main thread when waiting for these 50ms.

Also remove the `manager->begin_sync()` and `manager->end_sync()`
as they are already present inside `render_sync`.

Pull Request: https://projects.blender.org/blender/blender/pulls/131678
2024-12-10 17:25:07 +01:00
Clément Foucault
7a889b21bc Fix #131587: Overlay: Crash switching workspaces
- Make sure to initialize the `State` struct.
- Make sure to consider space node as 2D for grid overlay.
2024-12-10 14:08:05 +01:00
Weizhen Huang
b67b0c2847 Fix: Overlay: Volume wireframe visible regardless of setting
guard the drawing behind `show_surface_wire`

Pull Request: https://projects.blender.org/blender/blender/pulls/131527
2024-12-10 13:07:21 +01:00
Clément Foucault
fe228d26b4 Cleanup: DRW: Remove unused part of DRWTexture API 2024-12-10 11:33:00 +01:00
Clément Foucault
a005efd680 Refactor: Grease Pencil: Port usage of DRW_texture_create_* to Texture
Removes call to legacy API.

Pull Request: https://projects.blender.org/blender/blender/pulls/131636
2024-12-10 11:21:32 +01:00
Jeroen Bakker
0ac92bda89 Fix #131602: Workbench: Incorrect texture usage depth of field.
Depth of field attaches the half res and scene color texture, but
doesn't provide the correct usage flags. This resulted in validation
errors in Metal & Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/131655
2024-12-10 11:06:51 +01:00
Jeroen Bakker
f33433485e Fix #131512: Missing border in image editor overlay
Incorrect framebuffer was attached.

Pull Request: https://projects.blender.org/blender/blender/pulls/131651
2024-12-10 10:47:23 +01:00
Clément Foucault
2e0f4eea66 Cleanup: DRW: Replace DRW_TEXTURE_FREE_SAFE by GPU_TEXTURE_FREE_SAFE 2024-12-09 23:23:53 +01:00
Clément Foucault
74a2b61fb5 Overlay: Remove call to legacy API 2024-12-09 23:23:53 +01:00
Clément Foucault
d01b689302 Overlay: Port usage of DRW_texture_create_* to Texture
Removes call to legacy API.
2024-12-09 23:11:29 +01:00
Miguel Pozo
4d8f9bb88e Fix #131420: EEVEE: Temporal projection+Motion blur artifacts
Regression from #131134.

The shader still reads `vel.obj.ofs[STEP_NEXT]`  even when in the
viewport.

- Ensure that `vel.obj.ofs[STEP_NEXT]` points to a valid memory
  location even if the computed value is still wrong.
- Ensure that the viewport always uses a 2 channel  vector_tx and all
  texture reads are always swizzled.

This also seems to fix the motion vector pass for the realtime compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/131445
2024-12-09 18:16:34 +01:00
Jeroen Bakker
cf0db73571 Workbench: Separate depth of field shaders
Workbench shaders uses one fragment shaders, but uses different
resources based on the step of the effect. This failed in vulkan as all
defined resources should be found. This PR separates the steps in its
own fragment shader and adds sampler binding per step.

- Removed the max coc input texture as it wasn't used.
- Removed the background texture as it wasn't used.
- Renumbered the resources.

Pull Request: https://projects.blender.org/blender/blender/pulls/131606
2024-12-09 16:01:41 +01:00
Clément Foucault
695620120b Fix #131588: Workbench: Missing or frozen geometry when AA is disabled
The view was not synced when AA was turned off.
2024-12-09 10:55:22 +01:00
Campbell Barton
a3213dc82a Cleanup: trailing space 2024-12-09 09:23:23 +11:00
Campbell Barton
5dd67c6e1c Cleanup: sort CMake path lists 2024-12-09 09:18:50 +11:00
Campbell Barton
21ecc1a804 Cleanup: use function style casts 2024-12-09 09:14:46 +11:00
Campbell Barton
083b690fb5 Cleanup: spelling in comments 2024-12-09 09:14:44 +11:00
Clément Foucault
c89be1b774 Fix: EEVEE: Missing overlay when viewport resolution scale is greater than 1
This is a partial fix as it doesn't fix the gpencil
scene intersection.
2024-12-08 21:54:03 +01:00