128 Commits

Author SHA1 Message Date
Clément Foucault
e5f13a727a Refactor: EEVEE: Make surfel ray list stable and baking workload auto-adjust
This avoid putting too much work in only one thread for building very long surfel lists.

Instead of insertion sort, we use a prefix sum where all surfel scan the whole ray
list to know their position. Only the coplanar surfel patching is dispatched as
one thread per list.
This is currently a bruteforce approach and could be optimized further.

On top of this, we add a heuristic to scale the amount of work from the baking
depending on the scene complexity. Complex scene will have more overhead but
will remain responsive during baking, while simple scene will be faster to bake.
This avoids hitting TDR in most cases.

The update refresh is now limited to 1 per second to avoid the readback overhead.

Fix #142988

Pull Request: https://projects.blender.org/blender/blender/pulls/146848
2025-10-08 15:59:43 +02:00
Clément Foucault
9d0fe5573b GPU: FrameBuffer: Remove GPUFrameBuffer wrapper opaque type
This is the first step into merging DRW_gpu_wrapper.hh into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/146372
2025-09-16 17:50:48 +02:00
Clément Foucault
e19e9e57ee EEVEE: Split eevee_shader_shared.hh into multiple files
The goal of this patch is to reduce final shader code footprint to
hopefully reduce shader compile time (see #145347).

This also contains a pass over most shader file to remove unused
include or use more granular ones to reduce final shader code
length.

Testing with the same setup as #145347:
|          | main (ms) |  PR (ms) |   Delta (ms) |
| -------- | ----------- | ------------ |------------ |
| Nvidia   |         257 |  207 (1.24x) |         50 |
| Mesa AMD |         323 |  295 (1.09x)    |        28 |

In barbershop test scene however the saving are not so noticeable:
|          | main (s) |  PR (s) |   Delta (s) |
| -------- | ----------- | ------------ |------------ |
| Nvidia (OpenGL)  |         40 |  39 (1.02x) |         1 |
| Nvidia (Vulkan)   |         29 |  29 (1.0x) |         0 |

Pull Request: https://projects.blender.org/blender/blender/pulls/145803
2025-09-12 14:09:35 +02:00
Clément Foucault
ba4589e894 DRW: New Curve Drawing
Implementation of the design task #142969.

This adds the following:
- Exact GPU interpolation of curves of all types.
- Radius attribute support.
- Cyclic curve support.
- Resolution attribute support.
- New Cylinder hair shape type.
![image.png](/attachments/a8e7aea0-b0e5-4694-b660-89fb3df1ddcd)

What changed:
- EEVEE doesn't compute random normals for strand hairs anymore. These are considered legacy now.
- EEVEE now have an internal shadow bias to avoid self shadowing on hair.
- Workbench Curves Strip display option is no longer flat and has better shading.
- Legacy Hair particle system evaluates radius at control points before applying additional subdivision. This now matches Cycles.
- Color Attribute Node without a name do not fetch the active color attribute anymore. This now matches Cycles.

Notes:
- This is not 100% matching the CPU implementation for interpolation (see the epsilons in the tests).
- Legacy Hair Particle points is now stored in local space after interpolation.

The new cylinder shape allows for more correct hair shading in workbench and better intersection in EEVEE.

|      | Strand | Strip | Cylinder |
| ---- | --- | --- | --- |
| Main | ![main_strand.png](/attachments/67d3b792-962c-4272-a92c-1c0c7c6cf8de) | ![main_strip.png](/attachments/f2aa3575-368e-4fbb-b888-74df845918f1) | N/A |
| PR   | ![pr_strand.png](/attachments/cc012483-25f0-491f-a06e-ad3029981d47) | ![pr_strip.png](/attachments/73fa2f5c-5252-4b30-a334-e935ed0fb938) | ![pr_cylinder.png](/attachments/3133b2d4-a6f2-41ee-8e2d-f6fd00db0c8d) |

|      | Strand | Strip | Cylinder |
| ---- | --- | --- | --- |
| Main | ![main_strand_closeup.png](/attachments/730bd79c-6762-446d-819b-3ea47961ff9f) |![main_strip_closeup.png](/attachments/d9ace578-cfeb-4895-9896-3625b6ad7a02) | N/A |
| PR   | ![pr_strand_closeup.png](/attachments/ac8f3b0c-6ef6-4d54-b714-6322f9865036)|![pr_strip_closeup.png](/attachments/8504711a-955b-4ab2-aa3d-c2d114baf9d4)| ![pr_cylinder_closeup.png](/attachments/1e2899a8-0a5c-431f-ac6c-5184d87e9598) |

Cyclic Curve, Mixed curve type, and proper radius support:
![image.png](/attachments/7f0bf05e-62ee-4ae9-aef9-a5599249b8d7)

Test file for attribute lookup: [test_attribute_lookup.blend](/attachments/1d54dd06-379b-4480-a1c5-96adc1953f77)

Follow Up Tasks:
- Correct full tube segments orientation based on tangent and normal attributes
- Correct V resolution property per object
- More attribute type support (currently only color)

TODO:
- [x] Attribute Loading Changes
  - [x] Generic Attributes
  - [x] Length Attribute
  - [x] Intercept Attribute
  - [x] Original Coordinate Attribute
- [x] Cyclic Curves
- [x] Legacy Hair Particle conversion
  - [x] Attribute Loading
  - [x] Additional Subdivision
- [x] Move some function to generic headers (VertBuf, OffsetIndices)
- [x] Fix default UV/Color attribute assignment

Pull Request: https://projects.blender.org/blender/blender/pulls/143180
2025-08-27 09:49:43 +02:00
Clément Foucault
1388a70914 GPU: Remove wrapper type for gpu::Shader
This is the first step into merging DRW_gpu_wrapper.hh into
the GPU module.

This is very similar to #119825.

Pull Request: https://projects.blender.org/blender/blender/pulls/144229
2025-08-11 09:34:28 +02:00
Clément Foucault
32d64d35bb Refactor: GPU: Texture: Replace eGPUTextureFormat by TextureFormat
This offers better semantic and safety of the API.

Part of #130632

Pull Request: https://projects.blender.org/blender/blender/pulls/142818
2025-07-22 14:58:54 +02:00
Miguel Pozo
6d9ad29c2a Merge branch 'blender-v4.5-release' 2025-07-09 15:16:46 +02:00
Miguel Pozo
88f812bf9a Fix #141253: Bring back the global Draw lock
Alternative solution to #141392 / #141564.

As a recap, the DST global lock (which prevented running drawing code
from multiple threads concurrently) was removed for 4.5 (#134690).
One unforeseen issue is that Images (and their GPUTextures) are shared
across dependency graphs (and therefore multiple threads), meaning we
are running into data race issues with them.

@fclem did #141392 and I continued it #141564. However, this is only a
partial solution, parts of the GPUTexture API and the whole BKE_image
API are still unsafe.
Trying to solve all the possible underlying issues seems unrealistic for
4.5 given the time frame and that the extension of the code affected by
this issue is quite large.

So this PR just brings the 4.4 locking behavior instead, which, while
risky on its own, seems much safer to me than the alternative.

This effectively undoes the improvements from #134690 by disabling
concurrent rendering, but instead of reverting all the code, it just
ensures we hold the lock in the same places we did in 4.4.
This means there's some redundant code that is not technically needed
anymore, like the `submission_mutex`, but it's probably best to make as
few modifications as possible, given how close we are to release and
that this is only intended as a temporary measure.

Pull Request: https://projects.blender.org/blender/blender/pulls/141618
2025-07-09 15:11:29 +02:00
Miguel Pozo
760b3c5403 Refactor: Draw: ResourceHandle/Index split
Split the `ResourceHandle` class as proposed in
https://projects.blender.org/blender/blender/pulls/140611#issuecomment-1609918

Pull Request: https://projects.blender.org/blender/blender/pulls/140932
2025-07-03 16:04:48 +02:00
Jacques Lucke
27b5e02eaf Fix: compiler error due to missing template parameter 2025-06-17 06:34:10 +02:00
Mattias Fredriksson
407dcb39d4 Tests: EXPECT_EQ_SPAN utility macro
Replaces pointer based EXPECT_EQ_ARRAY with EXPECT_EQ_SPAN in most cases
as they already used spans (or span compatible datastructures).
Currently EXPECT_EQ_ARRAY only takes in one size variable and doesn't
compare the  number of elements between arguments (requiring an
additional line to do so).

This should make the code cleaner and safer. Goal is also to promote
the use Spans in new test code.

Pull Request: https://projects.blender.org/blender/blender/pulls/140340
2025-06-16 20:31:00 +02:00
Clément Foucault
d3053fead0 GPU: Assert that a shader is not bound when deleting it
This caused UB in the tests now that tests are all ran
inside the same context.

A shader could be free but its pointer would be dangling
inside the `Context`. A new shader could have the same
address and generate UB after binding.

This is not the best way to solve this issue but at least
we prevent the use of the UB.

Pull Request: https://projects.blender.org/blender/blender/pulls/139109
2025-05-20 12:43:58 +02:00
Clément Foucault
daadf38780 Fix: DRW: Tests: Asserts in test_draw_submit_only
The setup was not setuping a correct rendering
environment (missing resource + framebuffer).
2025-04-29 18:16:10 +02:00
Clément Foucault
f2cfa822da Fix: DRW: Broken or non-deterministic tests
The test_draw_submit_only was broken because of the
empty pass optimization #135875. Making the passes
non-empty fixes the test.

`eevee_surfel_list` has non-deterministic result. This
should be investigated in the future.
2025-04-16 21:48:47 +02:00
Clément Foucault
0b2a178efc Fix: DRW: Uninitialized mutex in tests
Tests were calling the submission mutex without
init. Adding functions to expose only setting
up the submission mutex instead of the full
DRW context (which is uneeded here).
2025-04-16 21:38:19 +02:00
Clément Foucault
894c7fa4e2 EEVEE: Remove EEVEE Next mention inside the code
This only changes file and function names.
The EEVEE identifier is still `BLENDER_EEVEE_NEXT`.

No functional changes.
2025-03-17 15:37:04 +01:00
Clément Foucault
94c7c84bcd Refactor: DRW: Simplify the DRWContext classes and methods
This refactor part of `draw_manager_c.cc` to make it more understandable
and less bug prone.

- Splits the context handing to `draw_gpu_context.cc`
- Rename `draw_manager_c.cc` to `draw_context.cc`
- Merge `DRWContextState` into `DRWContext`
- Merge lots of static functions into `DRWContext` to avoid global access
- Deduplicate code between entry point functions
- Move context init logic to `DRWContext` constructor
- Move resource init logic to `DRWContext::acquire_data`
- Move extraction `TaskGraph` out of `DRWContext`
- Reduce / centralize complexity of enabling draw engines
- Reduce the amount of `drw_get` calls
- Remove unused code

Pull Request: https://projects.blender.org/blender/blender/pulls/135821
2025-03-13 13:47:02 +01:00
Clément Foucault
7a3ef6a8ab Cleanup: DRW: Remove draw_manager_c from DRW_gpu_wrapper.hh dependencies
This makes dependency on the draw manager clearer and improve
build time.
2025-02-18 12:50:30 +01:00
Clément Foucault
5b6f4d4759 Cleanup: DRW: Remove unused API functions
Pull Request: https://projects.blender.org/blender/blender/pulls/134461
2025-02-17 12:37:53 +01:00
Brecht Van Lommel
569e0f5e7f Fix: Build error in eevee tests after recent cleanups 2025-01-31 18:46:01 +01:00
Brecht Van Lommel
61eedabae9 Cleanup: Various clang-tidy warnings in draw
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
2025-01-31 17:03:18 +01:00
Brecht Van Lommel
d5d686d540 Fix: Build error with draw test after recent cleanup 2025-01-23 13:17:20 +01:00
Jeroen Bakker
6cb8cdaa45 Fix: Draw: Tests
Visibility test is not setup correctly and only tests positives. This
test should be adapted with better testing. For now we skip the test.

Resource id test was wrong as it didn't add the null resource for
drawcalls with no handle. Ref `DrawCommandBuf::generate_commands`.

Pull Request: https://projects.blender.org/blender/blender/pulls/133040
2025-01-14 12:11:32 +01:00
Clément Foucault
eeeac09241 DRW: Update reference for pass_all_commands and manager_sync tests
These were not updated after functional changes.
2024-11-18 21:33:17 +01:00
Clément Foucault
63a91c8d82 Fix: DRW: Tests: GPU backend error because of missing resources 2024-11-10 23:47:21 +01:00
Clément Foucault
20d09435ab DRW: Add split visibility and command generation function
This adds the possibility to the user code to
group visibility and command generation compute
dispatch together to reduce the overhead of
PSO and pipeline switch.

This PR also make passes that have been submitted
(i.e.: that generated commands) as read-only.

This allows to automatically remove redundant
command generation when submitting the same
pass with the same view multiple times, or,
remove redundant visibility calculation for the
same view in multiple passes. This automation
is done for the common usage of the API (using `submit`).

Custom usage (using `submit_only`) needs to abide by
the rule of the API and update visibility and commands
when required.

Pull Request: https://projects.blender.org/blender/blender/pulls/129170
2024-10-21 13:32:54 +02:00
Clément Foucault
65efde82c3 EEVEE: Update shadow finalize test 2024-08-23 16:11:28 +02:00
Jeroen Bakker
f13e51543c Cleanup: Fix spelling mistake
Attachement -> Attachment

Pull Request: https://projects.blender.org/blender/blender/pulls/122988
2024-06-10 09:57:15 +02:00
Clément Foucault
e0b3dee35a EEVEE-Next: Jittered Soft Shadows
Jittered Soft Shadows support.
Improves soft shadow quality at the cost of re-rendering shadow maps every sample.
Disabled by default in the viewport unless enabled in the Scene settings.

| Tracing-only | Jitter-only | Jitter+Over-blur |
| --- | --- | --- |
| ![imagen](/attachments/e5ca6120-0666-4e86-b6e0-3d7512587b86) | ![imagen](/attachments/a72631aa-14f8-4e10-a748-848fc4bd4ab2) | ![imagen](/attachments/07c5de65-61d2-48e7-b78c-9c3cbdcaf844) |

Tracing-only is the method used by default in EEVEE-Next.
Jitter-only is the method used by EEVEE-Legacy Soft Shadows.
Jitter+Over-blur combines both.

Co-authored by Miguel Pozo @pragma37 (initial patch #119753)

Pull Request: https://projects.blender.org/blender/blender/pulls/121836
2024-05-18 17:21:47 +02:00
Clément Foucault
c7bc3334ad EEVEE-Next: Shadow: Add Maximum Resolution Option
This adds a light parameter to avoid near camera pixels
allocating too much shadow resolution.

This is more intuitive than the scale shadow setting and
allows reducing the precision without changing the look
of distant shadows.

For sun lights, the property sets the minimum pixel
size the shadow can contains. This allows to
remove a lot tilemap close up.

For local lights, there is another additional property
to set the maximum resolution in shadow space (like
EEVEE-Legacy) instead of in world space (like sun
lights). This allows making older files lighter and
allow a more conservative approach to resolution.

This add versionning code to handle EEVEE-Legacy files
that had fixed resolution per light type.

The resolution setting is always in world space distance
as the maximum shadow resolution distribution might change
in the future or be dependent on other parameters
(like beam angle). This ensure that there is no
dependency on these parameters, but make the
setting use very small units. But this is more of
a UI problem.

Pull Request: https://projects.blender.org/blender/blender/pulls/121701
2024-05-13 14:34:11 +02:00
Clément Foucault
87d164c56b EEVEE-Next: Improve shadow tracing
The goal of this PR is to remove the per face, NDC space
tracing for shadow maps.

This requires custom occluder extrapolation but in return
removes quite a lot of complexity in other areas, namely:
- No more per face transform before the tracing
- No more per face jittering (fix #119565)
- No more frustum padding (increased maximum precision)
- Better use of 32bit precision shadow map
- Fix #121343

This improve softness at relatively low step count (default 6
is better) and reduces light leaking at very low sample
count (sharper). It makes it more intuitive now that
higher sample count is smoother.

Pull Request: https://projects.blender.org/blender/blender/pulls/121317
2024-05-07 14:52:47 +02:00
Campbell Barton
9918488bb1 Cleanup: use uppercase tags, following own style guide 2024-05-03 11:33:21 +10:00
Clément Foucault
bb44bce95c EEVEE-Next: Improve shadow bias
The goal of this PR is to remove any user facing parameter
bias that fixes issues that are caused by inherent nature of
the shadow map (aliasing or discretization).

Compute shadow bias in the normal direction to avoid
both shadow leaking at certain angles or shadow
acnee.

This bias is computed automatically based on the minimum
bias amount required to remove all errors. The render
setting is removed as of no use for now.

#### Normal bias
We do the bias in world space instead of shadow space
for speed and simplicity. This requires us to bias using
the upper bound of biases for the same location in space
(using biggest texel world radius instead of UVZ bias).
This isn't much of an issue since the bias is still less
than 2 texel. The bias is still modulated by facing
ratio to the light so surfaces facing the light have no
biase.

This fixes both self shadowing and flat occluders aliasing
artifacts at the cost of moving the shadow a bit on the
side. This is the blue arrow in the diagram.

We always bias toward the normal direction instead of the
light direction. This is alike Cycles geometric offset for
the shadow terminator fix. This is better since it does'nt
modify the shading at all.

#### Slope bias
To avoid aliasing issue on zero slope receiver, we still
have to use the slope bias with a size of 1 pixel.

#### PCF filtering
We now parametrize the filter around the normal instead of
using the shadow map local space. This requires to use
a disk filter instead of box, which is also more pleasant
for most light shapes (all except rectangle lights).

Setting the filter around normal avoid overshadowing from
zero slope occluders. This cannot be fixed by more slope bias
in light space PCF. We could fix it in light space by projecting
onto the normal plane but that gives an unbounded bias when `N.L`
is near 0 which causes either missing shadows or self shadow if
using an arbitrary max offset value.

To avoid overshadowing from any surface behind the shading
point, we reflect the offset to always face the light.
Doing so instead of using the perpendicular direction
is better for very sharp geometric angles, has less
numerical precision issue, is symetrical and is cheaper.

To avoid any self shadowing artifact on zero slope receivers
with angled neighbors (like a wall and the floor), we have
to increase the slope bias according to the filter size.
This might be overkill in most situation but I don't feel
this should become a setting and should be kept in sync
with the filter. If it has to become an option, it should
simply a factor between unbiased filter and best bias.

#### Shadow terminator

The remaining artifacts are all related to shadow terminator
one way or another. It is always caused by the shading
normal we use for biasing and visibility computation not
being aligned with the geometric normal.

This is still something we need a setting for somewhere.

Pull Request: https://projects.blender.org/blender/blender/pulls/121088
2024-04-27 14:30:52 +02:00
Clément Foucault
e725cc3494 Fix: EEVEE-Next: Shadow: Casters behind area lights cast shadow
This introduces fragment clipping for the shadow pipeline.

The fragments are culled using a sphere distance test
for sphere lights, which is then re-purposed as a simple
distance test for area lights.

However, in the case of area lights, this introduces some
light bleeding. To mitigate this, we bring the shadow origin
back towards the light center so that this artifact only
appears if using larger shadow tracing.

Fixes #119334

Pull Request: https://projects.blender.org/blender/blender/pulls/120992
2024-04-24 17:08:12 +02:00
Clément Foucault
7797231c6d EEVEE-Next: Shadow: Add LOD system to directional clipmap shadows
This act in multiple phases:

- A shader scan the whole clipmap after tilemap finalize to gather
where valid tiles from lower LODs are available and write the page
location and LOD offset at invalid tiles location.

- At sampling time we add the LOD offset before the pixel page
modulo operation. This offset is equal to the amount of pages of
the **sampling** LOD needed to have the same modulo result as the
**sampled** LOD.

The whole thing being very tricky, I added a lot of unit testing.

This has no use for now but the system is needed to implement:
- Shadows from Volumetrics at lower cost & memory footprint.
- Fixing soft shadows artifacts.

These will be implemented in separate PRs.

Pull Request: https://projects.blender.org/blender/blender/pulls/120031
2024-03-29 16:22:55 +01:00
Clément Foucault
2a600b4a83 EEVEE-Next: Shadow: Limit view per shadow map projection
This limits the number of tilemaps per LOD that can be fed to avoid the
easy to hit "Too many shadow updates" (#119757).

This allows for a max 64 tilemaps to be updated at once at their lowest
requested LOD (so ~10.6667 point lights if every faces of the punctual
shadow map is needed, but likely more in practice).

Unfortunately this is still quite low and will surely be hit quite soon
with directional shadow added to it. One idea to workaround this would
be to time slice the update of some lights, but this opens a whole can
of worms that I'm not ready to open for now so I created #119890 for
future reference.

Some notes, most lights seems to request around 3 LODs. It might help
to allow requesting at least 2 LODs if we are rendering since volumes
might want lower LOD available for volumes.

I added a very simplistic heuristic that also lowers the max tilemaps
when transforming, animation playback or navigating the 3D view to
improve the responsiveness of the engine. Note that this doesn't
only lowers the resolution to the minimum requested one. So it should
be good enough in most cases.

Pull Request: https://projects.blender.org/blender/blender/pulls/119889
2024-03-26 20:33:31 +01:00
Hans Goudey
fe76d8c946 Refactor: Remove unnecessary C wrappers for vertex and index buffers
Now that all relevant code is C++, the indirection from the C struct
`GPUVertBuf` to the C++ `blender::gpu::VertBuf` class just adds
complexity and necessitates a wrapper API, making more cleanups like
use of RAII or other C++ types more difficult.

This commit replaces the C wrapper structs with direct use of the
vertex and index buffer base classes. In C++ we can choose which parts
of a class are private, so we don't risk exposing too many
implementation details here.

Pull Request: https://projects.blender.org/blender/blender/pulls/119825
2024-03-24 16:38:30 +01:00
Hans Goudey
a099061feb Cleanup: Move remaining draw headers to C++ 2024-03-23 14:51:59 +01:00
Hans Goudey
8b514bccd1 Cleanup: Move remaining GPU headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/119807
2024-03-23 01:24:18 +01:00
Jeroen Bakker
2f30d220fb Draw: Fix 'draw_resource_id_gen' test
The test uses a none points shader to draw points, which is incorrect
and asserts when using Vulkan. It also didn't test the gpu part of the
pipeline (PassMain).

When using PassMain the order of the resources are expected to be
different as the draw calls are ordered based on the primitive type and
handles.

Pull Request: https://projects.blender.org/blender/blender/pulls/117714
2024-02-01 14:10:51 +01:00
Jeroen Bakker
97852056b2 Cleanup: Incorrect Parameter Order for Expect
The expect and actual parameters were switched in eevee_surfel_list.
2024-02-01 12:05:28 +01:00
Clément Foucault
39397fd73e Cleanup: EEVEE-Next: Fix compilation warnings in shadow tests
Warnings were variable used before initialization.
2024-01-30 17:27:00 +01:00
Jeroen Bakker
062a9f9540 Fix: Compiling EEVEE test cases
Due to recent changes eevee test cases didn't compile anymore.
The issue was that a header file was migrated from C to CPP.

Pull Request: https://projects.blender.org/blender/blender/pulls/117436
2024-01-23 09:14:10 +01:00
Hans Goudey
5b55c1dc10 Cleanup: Move five draw headers to C++ 2024-01-05 13:26:22 -05:00
Jeroen Bakker
5dbc276eed Fix: Compiling EEVEE Test cases
Was introduced when BKE_main got a CPP header file.

Pull Request: https://projects.blender.org/blender/blender/pulls/115743
2023-12-04 09:55:48 +01:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Miguel Pozo
0db6d8a5fc EEVEE-Next: Fix shadow tests
Fix an issue in `find_first_valid` where Nvidia would incorrectly
increment `src` after return.
This should fix the issue where some tiles would stay corrupted
until resetting EEVEE.

Initialize tiles_data in `TestAlloc` so it doesn't fail in debug builds.

Pull Request: https://projects.blender.org/blender/blender/pulls/114550
2023-11-06 20:35:14 +01:00
Hans Goudey
8f27baf388 Merge branch 'blender-v4.0-release' 2023-10-09 23:54:43 +02:00
Hans Goudey
976eaae02f Cleanup: Move BKE_object.hh to C++
Simplifies the fix to #111120, where the object bounds functions
may return a C++ type instead of `BoundBox`.

Pull Request: https://projects.blender.org/blender/blender/pulls/113462
2023-10-09 23:41:53 +02:00
Jason Fielder
57a3ab29cc Metal: EEVEE Next: Optimize Virtual shadow maps for Apple Silicon
Optimization of EEVEE Next's Virtual Shadow Maps for TBDRs.
The core of these optimizations lie in eliminating use of
atomic shadow atlas writes and instead utilise tile memory to
perform depth accumulation as a secondary pass once all
geometry updates for a given shadow view have been updated.

This also allows use of fast on-tile depth testing/sorting, reducing
overdraw and redundant fragment operations, while also allowing
for tile indirection calculations to be offloaded into the vertex
shader to increase fragment storage efficiency and throughput.

Authored by Apple: Michael Parkin-White

Co-authored-by: Michael Parkin-White <mparkinwhite@apple.com>
Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/111283
2023-10-05 19:02:39 +02:00