Commit Graph

7325 Commits

Author SHA1 Message Date
Campbell Barton
8aff65daf2 Cleanup: naming for GPUSelectResult
Prefer the name 'hit_result' since 'result' was sometimes used for
a vector of GPUSelectResult and is often used a functions return value.

Use hit_results for the span/vector and hit_result for a single hit.

Also assign struct members for new GPUSelectResult as it reads better
and avoids depending on struct order.
2023-12-01 09:45:02 +11:00
Miguel Pozo
2e27791df3 Fix: EEVEE-Next: Alpha hashed transparency doesn't converge
Use sub-pixel alpha hash scale when the camera is not moving.
This provides cleaner results, while maintaining temporal coherence on
camera movement.

Pull Request: https://projects.blender.org/blender/blender/pulls/115620
2023-11-30 20:18:08 +01:00
Campbell Barton
15db0cb446 Cleanup: use style for doxygen comment blocks 2023-11-30 14:15:11 +11:00
Campbell Barton
8c473df8c3 Cleanup: suppress CLANG warnings, remove unused variables 2023-11-30 10:48:33 +11:00
Campbell Barton
3b5031f1cb Cleanup: use 'r_' prefix for output arguments, order last
Also clarify some naming.
2023-11-30 10:42:18 +11:00
Hans Goudey
8c59532106 Cleanup: Use C++ arrays to store subdiv ccg data
Decrease the amount of manual memory management
and pointer arithmetic.
2023-11-29 12:39:33 -05:00
Hans Goudey
1a36feb7e5 Cleanup: Use references instead of pointers in subdiv_ccg.cc 2023-11-29 11:40:10 -05:00
Hans Goudey
c28cb3d0ac Cleanup: Remove unused curve positions variable 2023-11-29 10:35:21 -05:00
Miguel Pozo
21712cf746 Fix: EEVEE-Next: Object::visibility_flag in material_sync
Take `OB_HIDE_SHADOW` into account. (fix #115488)
Include the relevant visibility flags into `MaterialKey`.

Pull Request: https://projects.blender.org/blender/blender/pulls/115575
2023-11-29 15:44:15 +01:00
casey bianco-davis
1970de9d19 GPv3: Fix #113994: Overlay: Hide points for locked layers.
This makes so that locked layers don't show the points and the lines aren't visibly selected.

This separate the batch ensure function into two function, one for handling the visible grease pencil batch and one for handling the edit mode overlay batch.

This also makes it so that only selected curves show the points that make up it, (this matches legacy grease pencil).

Pull Request: https://projects.blender.org/blender/blender/pulls/114751
2023-11-29 11:31:50 +01:00
Campbell Barton
807993d2b7 Cleanup: use single underscore prefixes
Double underscores are reserved for implementation macros.
2023-11-29 18:09:01 +11:00
Campbell Barton
a385a98e8e Cleanup: spelling in comments 2023-11-29 15:56:17 +11:00
Hans Goudey
19b9b8d431 Cleanup: Move mesh looptri real edges function 2023-11-28 16:49:55 -05:00
Hans Goudey
7e3ba529ea Cleanup: Move four blenkernel headers to C++ 2023-11-28 16:05:12 -05:00
Campbell Barton
9dda667fd4 Cleanup: spelling in comments 2023-11-28 15:19:20 +11:00
Ray molenkamp
dbb2844ed9 Cleanup: CMake: Modernize bf_functions dependencies
Pretty straightforward

- Remove any bf_functions paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115427
2023-11-28 01:14:15 +01:00
Hans Goudey
14e3523ac2 Refactor: Further improvements to geometry bounds
Implement the next phases of bounds improvement design #96968.
Mainly the following changes:

Don't use `Object.runtime.bb` for performance caching volume bounds.
This is redundant with the cache in most geometry data-block types.
Instead, this becomes `Object.runtime.bounds_eval`, and is only used
where it's actually needed: syncing the bounds from the evaluated
geometry in the active depsgraph to the original object.

Remove all redundant functions to access geometry bounds with an
Object argument. These make the whole design confusing, since they
access geometry bounds at an object level.

Use `std::optional<Bounds<float3>>` to pass and store bounds instead
of an allocated `BoundBox` struct. This uses less space, avoids
small heap allocations, and generally simplifies code, since we
usually only want the min and max anyway.

After this, to avoid performance regressions, we should also cache
bounds in volumes, and maybe the legacy curve and GP data types
(though it might not be worth the effort for those legacy types).

Pull Request: https://projects.blender.org/blender/blender/pulls/114933
2023-11-27 16:14:49 +01:00
Falk David
3a743018b1 Fix: GPv3: Wrong location in paint_init_pivot
The `paint_init_pivot` calculates the `location` based
on the midpoint of the bounds of the object. For grease pencil
the bounds depend on the current frame (for original data).

This fixes the issue by making the `bounds_min_max` function
dependent on the `frame` and by introducing a `bounds_min_max_eval`
for evaluated data.
2023-11-27 15:06:38 +01:00
Miguel Pozo
fe90c82b20 EEVEE-Next: Fix ObjectHandle::recalc
Implement the EEVEE side of #114112.
Use ObjectRuntime::last_update to compute the ObjectHandle::recalc
flags.

Fix #114135
Fix #114696
Fix #114170

Pull Request: https://projects.blender.org/blender/blender/pulls/115243
2023-11-27 12:23:18 +01:00
Campbell Barton
1eff48a838 Cleanup: spelling in code 2023-11-27 10:55:39 +11:00
Campbell Barton
27c660707d Cleanup: spelling in comments, variables 2023-11-27 09:54:36 +11:00
Campbell Barton
343b48663b Cleanup: format 2023-11-27 09:30:52 +11:00
Ray Molenkamp
1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp
6b70c04724 Cleanup: CMake: Modernize bf_depsgraph dependencies
Pretty straightforward

- Remove any bf_depsgraph paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115422
2023-11-25 22:51:59 +01:00
Ray Molenkamp
ae25298774 Cleanup: CMake: Modernize bf_blenfont dependencies
Pretty straightforward

- Remove any bf_blenfont paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115365
2023-11-24 18:29:09 +01:00
Ray Molenkamp
b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Jason Fielder
18f7d158fe GPU: cleanup texture view usage flags
Texture usage flag `GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW`
was originally implemented and used too conservatively for many
cases in which the underlying API flags were not required.

Renaming to `GPU_TEXTURE_USAGE_FORMAT_VIEW` to reflect
the only essential use case for when a texture view is initialized with
a different texture format to the source texture. Texture views can
still be created without this flag when mip range or base level is
adjusted,

This flag is still required by stencil views and internally by the Metal
backend for certain feature support such as SRGB render toggling.

Patch also includes some small changes to the Metal backend to
adapt to this new compatibility and correctly capture all texture view
use-cases.

Related to #115269

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115300
2023-11-24 15:21:00 +01:00
Clément Foucault
ab7505c7ce EEVEE-Next: Disable distant light if world contains absorption
This restrict the usage of distant light if the world shader
contains absorption phenomenon.

Why this is needed is described in #114062.

At the same time, this removes the parameter for enabling
volume light as this is now an auto-detected optimization.

This also contains a few small cleanups.

Pull Request: https://projects.blender.org/blender/blender/pulls/115284
2023-11-24 13:51:07 +01:00
Clément Foucault
2ece99891b Fix: EEVEE-Next: Metal shader compilation error
`vertex` is the name of the function entry point and is
defined as a macro. Renaming fixes the issue.
2023-11-23 23:53:23 +01:00
Miguel Pozo
13139f593e Fix: EEVEE-Next: Add transparency blending back
The flag was incorrectly removed in 440f39f2e5
2023-11-23 20:22:34 +01:00
Miguel Pozo
1d2a27d49e Fix: EEVEE-Next: Motion Vectors for non float4 position buffers
Use a compute shader to copy non float4 position vertex buffers into the
`geometry_steps` buffer.

Fix #113730
Fix #114775
Fix #114144

Pull Request: https://projects.blender.org/blender/blender/pulls/115309
2023-11-23 19:49:56 +01:00
Miguel Pozo
ae1e2951c7 Fix #115144: isect_data_setup compiler error
Rename `isect_data_setup` functions to avoid shader compiler errors.

Pull Request: https://projects.blender.org/blender/blender/pulls/115175
2023-11-23 16:02:10 +01:00
Miguel Pozo
cb9584b561 Fix #114482: EEVEE-Next: Wrong Texture Coordinates
Fix Texture Coordinates in World material and screen_coordinates
when using overscan.

Pull Request: https://projects.blender.org/blender/blender/pulls/115057
2023-11-23 15:58:08 +01:00
Miguel Pozo
3197881ca3 Fix #114302: EEVEE Next: Curves material compilation errors
Add missing includes and remove the attributes_lib from shaders
that don't need them.

Pull Request: https://projects.blender.org/blender/blender/pulls/114598
2023-11-23 15:47:56 +01:00
Harley Acheson
ff04d50eee Cleanup: Make format
Formatting changes resulting from running Make Format
2023-11-22 12:50:31 -08:00
Clément Foucault
440f39f2e5 Fix: EEVEE-Next: blending of dithered material
The code removed in #115066 forgot to remove the
blend method.
2023-11-22 19:21:47 +01:00
Clément Foucault
2c8fbde612 Fix: EEVEE-Next: Ambient Occlusion pass broken 2023-11-22 18:31:52 +01:00
Clément Foucault
beee7db425 Cleanup: EEVEE-Next: Remove use of deprecated DRWView API 2023-11-22 18:08:46 +01:00
Clément Foucault
14d4da7555 EEVEE-Next: Add back transparent render pass
Straight forward implementation.
2023-11-22 17:48:58 +01:00
Miguel Pozo
7ab622475d Fix: EEVEE-Next: MaterialKey
Options are no longer smaller than sizeof(*mat).
2023-11-22 16:40:12 +01:00
Miguel Pozo
b4f62180fb Fix #114291: EEVEE-Next: Deferred tranparency blending
Disable blending in the deferred pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/115066
2023-11-22 15:10:24 +01:00
Jeroen Bakker
fdf9750df9 EEVEE-Next: Cleanup Lookdev as its shaders are never deferred compiled
Code assumed that lookdev shaders could be deferred compiled, but
that is never the case. This PR cleans up some related code and
mechanisms that were introduced because we thought it was the case.

Pull Request: https://projects.blender.org/blender/blender/pulls/114368
2023-11-22 14:44:57 +01:00
Clément Foucault
a001cf9f2b EEVEE-Next: Displacement Option
This add the displacement option to EEVEE materials.
This unifies the option for Cycles and EEVEE.

The displacement only option is not matching cycles
and not particularly useful. So we decided to not
support it and revert to displacement + bump.

Pull Request: https://projects.blender.org/blender/blender/pulls/113979
2023-11-21 19:55:38 +01:00
Xavier Hallade
14500953ed Overlay: Wireframe: avoid using custom depth bias with xray enabled
e000dcb849 has a performance
impact as it prevents early depth test, it's best to restrict it to when
xray is disabled.

Pull Request: https://projects.blender.org/blender/blender/pulls/114466
2023-11-21 19:23:59 +01:00
Clément Foucault
3097d5d821 EEVEE-Next: Add horizon scan to raytracing module
This uses the principles outlined in
Screen Space Indirect Lighting with Visibility Bitmask
to compute local and distant diffuse lighting.

This implements it inside the ray-tracing module as a fallback when the
surface is too rough. The threshold for blending between technique is
available to the user.

The implementation first setup a radiance buffer and a view normal
buffer. These buffer are tracing resolution as the lighting quality is
less important for rough surfaces. These buffers are necessary to avoid
re-projection on a per sample basis, and finding and rotating the
surface normal.

The processing phase scans the whole screen in 2 directions and outputs
local incomming lighting from neighbor pixels and the remaining
occlusion for everything that is outside the view.

The final steps filters the result of the previous phase while applying
the occlusion on the probe radiance to have an energy conserving mix.

Related #112979

Pull Request: https://projects.blender.org/blender/blender/pulls/114259
2023-11-21 16:24:14 +01:00
Miguel Pozo
9320742b45 Fix #114651: EEVEE-Next: SSS NaNs
Before #112901, subsurface scattering was skipped if its radius was
less than 1 pixel.
Aside from an optimization, this also avoided divisions by zero in
`burley_eval`.
This just brings back the early return when `pixel_footprint < 1.0`.

Pull Request: https://projects.blender.org/blender/blender/pulls/114928
2023-11-21 15:47:51 +01:00
Jason Fielder
3f3f4c3478 EEVEE Next: Ensure HiZ buffer update flag is cleared
HiZ dirty flag was previously not cleared upon update
resulting in duplicate updates in several places, without
source depth input having changed.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/115235
2023-11-21 12:44:27 +01:00
Hans Goudey
8d2b203a3d Cleanup: Remove unnecessary keywords in C++ header 2023-11-20 22:12:27 -05:00
Hans Goudey
ea78af4b5d Cleanup: Move draw_subdivision.h to C++ 2023-11-20 22:07:11 -05:00
Hans Goudey
301731692e Cleanup: Access sculpt attributes with C++ attribute API
Access masks and face sets through the `BKE_attribute.hh` API. This
us more flexibility long term, and makes code a bit simpler in the
meantime.
2023-11-20 13:14:34 -05:00