Commit Graph

7527 Commits

Author SHA1 Message Date
Jeroen Bakker
8954099042 EEVEE: Fix Lights On High-res Monitors
When using EEVEE on high resolution monitors the light buffers might not
get initialized as there are range checks that pass in the first try.

- number of tiles needed is larger than the max_tile_count_threshold
- total_word_count is smaller than max_word_count_threshold as it is
  never set (still initialized to zero.

Solution is to not exit on the first try. In a later stage we might want
to use something that doesn't require any looping.

Fixes: #117128
Pull Request: https://projects.blender.org/blender/blender/pulls/117164
2024-01-16 13:29:25 +01:00
Hans Goudey
17040a0b24 Fix #117108: Memory leak report with static select engine data
Now that the select engine data uses non-trivial objects in its global
data, storing it at the global scope causes trouble due to arbitrary
construction and destruction order. Instead use the construct on first use
idiom to make the order clear. Though this struct probably shouldn't be
static at all, it does simplify memory management as well, it's nice to
remove the need to manually clear the arrays.

Pull Request: https://projects.blender.org/blender/blender/pulls/117147
2024-01-16 01:55:18 +01:00
Hans Goudey
3e76a1a6c2 Cleanup: Move BKE_lib_id.h to C++ 2024-01-15 12:44:14 -05:00
Hans Goudey
78587261da Cleanup: Use standard variable name for mesh face corner normals 2024-01-15 11:39:50 -05:00
Miguel Pozo
c4add0c19a FIx: EEVEE-Next: PlanaProbePipeline gbuffer layout 2024-01-15 15:50:12 +01:00
Hans Goudey
34e39c6b53 Cleanup: Add missing include and forward declaration to DRW header 2024-01-15 08:31:19 -05:00
Miguel Pozo
3feeede7bb Fix: EEVEE-Next: Nvidia compilation error
Workaround for:
error G30CBC1D0: C1317:
qualified actual parameter #3 cannot be converted to less qualified parameter
2024-01-15 12:15:08 +01:00
Campbell Barton
4e898dd944 Cleanup: spelling in comments 2024-01-14 11:42:50 +11:00
Clément Foucault
f2fe21fa2e Cleanup: EEVEE-Next: Deduplicate code 2024-01-14 11:46:27 +13:00
Clément Foucault
1e16d5da67 EEVEE-Next: Clamp reflection probe before downsampling
Use the same clamp parameter as raytracing as it applies
to indirect lighting.
2024-01-14 11:33:17 +13:00
Clément Foucault
813a98d461 EEVEE-Next: Remove specialization workarounds
This enables the full use of specialization constants
and their advantages on Vulkan and OpenGL
2024-01-14 10:28:30 +13:00
Clément Foucault
f70b8f76e9 EEVEE-Next: Simplify sphere probe storage
- Remove unlimited mip level.
- Make computation of sampling region simpler.
- Add correct mirroring of UV and border region.
- Fix crash when world probe is smaller than lightprobes.
2024-01-13 20:21:47 +13:00
Clément Foucault
29ec924f9f EEVEE-Next: Simplify sphere lightprobe coordinates
The storage coordinate is left unchanged and is
kept as `ReflectionProbeAtlasCoordinate`.
A new structure `ReflectionProbeCoordinate`
contain scale and offset for efficient sampling
without integer math.
The `ReflectionProbeWriteCoordinate` is only used
during the octahedral map processing.

This also has the benefit to centralize the coordinate
changes to a single class.

Pull Request: https://projects.blender.org/blender/blender/pulls/117011
2024-01-13 02:59:36 +01:00
Jason Fielder
dd0482da76 Metal: GPU: Add support for custom shader tuning parameters
Allows specification of per-shader threadgroup memory tuning
to optimise performance through increase of GPU occupancy.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/115238
2024-01-12 22:07:46 +01:00
Damien Picard
3bd41cf9bc I18n: Go over TIP_ and IFACE_ usages, change to RPT_ when relevant
The previous commit introduced a new `RPT_()` macro to translate
strings which are not tooltips or regular interface elements, but
longer reports or statuses.

This commit uses the new macro to translate many strings all over the
UI.

Most of it is a simple replace from `TIP_()` or `IFACE_()` to
`RPT_()`, but there are some additional changes:
- A few translations inside `BKE_report()` are removed altogether
  because they are already handled by the translation system.
- Messages inside `UI_but_disable()` are no longer translated
  manually, but they are handled by a new regex in the translation
  system.

Pull Request: https://projects.blender.org/blender/blender/pulls/116804

Pull Request: https://projects.blender.org/blender/blender/pulls/116804
2024-01-12 13:37:32 +01:00
Falk David
13ed151e3d Cleanup: GPv3: Use enum values for cap defaults instead of int 2024-01-12 10:38:22 +01:00
Falk David
ff12ee890d GPv3: Rendering "hardness" curve attribute
This adds support for rendering the hardness curve attribute.
The attribute cannot be written from within GPv3, but is added when
converting from the legacy Grease Pencil type.
2024-01-12 10:38:22 +01:00
Weizhen Huang
8bdb97e5ff EEVEE-Next: implement less noisy GGX VNDF sampling for reflections
from paper "Bounded VNDF Sampling for Smith–GGX Reflections"

Pull Request: https://projects.blender.org/blender/blender/pulls/116773
2024-01-12 10:32:40 +01:00
Weizhen Huang
ea669cb8dc EEVEE-Next: implement more efficient GGX VNDF sampling
from paper "Sampling the GGX Distribution of Visible Normals"
2024-01-12 21:20:28 +13:00
Miguel Pozo
935ed0791f Fix #116709: EEVEE-Next: Missing gbuffer closure writes
Outdated subpass_transition layout after f4275cc4df
2024-01-11 20:01:32 +01:00
Miguel Pozo
2bbf65f6e5 Fix #116985: Workbench: Skip volume depth test in Wireframe mode 2024-01-11 16:35:44 +01:00
Jacques Lucke
a94146b82c Cleanup: move BKE_pointcloud.h to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/116990
2024-01-11 10:54:47 +01:00
Campbell Barton
e904432a1f Fix #117015: Crash with subsurf mesh & loose edges in edit-mode
The result of bm_original_edge_get() was missing a null check,
all other callers check for null.
2024-01-11 18:19:20 +11:00
Campbell Barton
7a4f7a1d51 Cleanup: spelling in comments, comment blocks 2024-01-11 16:46:46 +11:00
Miguel Pozo
c08ba9b0bd FIx: EEVEE-Next: Forward SSS shader compilation 2024-01-10 18:35:00 +01:00
Miguel Pozo
31d8a6514f Fix: EEVEE(Legacy): Broken dielectric material shading
sss_radius r and g are already used for occlussion workarounds.
Use only sss_radius.b for flagging sss as disabled.
Regression from 2942147079.
2024-01-10 17:59:20 +01:00
Miguel Pozo
f2bc8108ef Fix #116964: EEVEE(Legacy): Crash during render
Fix shader compilation.
Update and add missing functions pre-declaration.
2024-01-10 17:55:29 +01:00
Miguel Pozo
bbf1e506f8 Fix: EEVEE: Fix crash on start
Add missing function pre-declaration.
Partially fixes issue ##116964.
(Render no longer crashes, but shading is broken)
2024-01-10 16:30:50 +01:00
Miguel Pozo
0681d79611 Fix: EEVEE-Next: Crash on start
Regression from 93b3553697
eevee_sampling_lib is still needed for sample_cylinder
2024-01-10 15:53:37 +01:00
Clément Foucault
20ccaa9d67 Fix: EEVEE-Next: HiZ: Wrong specialization constant default value 2024-01-10 22:46:43 +13:00
Clément Foucault
baa7f15476 Cleanup: EEVEE-Next: Remove unused random noise in lightprobe_eval
This is not needed as we want a noiseless evaluation.
2024-01-10 22:46:43 +13:00
Clément Foucault
01eef7dc56 EEVEE-Next: Enable subgroup optimization on Metal
This doesn't seem to offer a lot of benefit but it is the
way it should be.

Other area could make use of this later and the
implementation could be supported at the gpu module level.
2024-01-10 22:46:42 +13:00
Clément Foucault
93b3553697 EEVEE-Next: Remove sampling_lib from ray_generate_lib
Avoid top level dependency.
2024-01-10 22:46:42 +13:00
Clément Foucault
b24591baed EEVEE-Next: Split lightprobe volume eval to its own file
Simple cleanup to reduce dependencies in code.
2024-01-10 22:46:42 +13:00
Miguel Pozo
8d74af164e Fix: EEVEE-Next: Update gbuffer_fb bind_ex
Ensure it's in sync with the framebuffer configuration
2024-01-09 16:25:24 +01:00
Miguel Pozo
5e848c9956 Fix: EEVEE-Next: Use uint for header_tx.clear
Make sure it matches the texture format to fix assertions.
2024-01-09 16:20:31 +01:00
Clément Foucault
e578678290 EEVEE-Next: Fix incorrect lighting on refraction closures
Add placeholder code for when we support it.
For now, we just use the indirect lighting.
2024-01-09 16:39:17 +13:00
Clément Foucault
ea989ebf94 EEVEE/EEVEE-Next: Split Diffuse and Subsurface closure
Even if related, they don't have the same performance
impact.

To avoid any performance hit, we replace the Diffuse
by a Subsurface Closure for legacy EEVEE and
use the subsurface closure only where needed for
EEVEE-Next leveraging the random sampling.

This increases the compatibility with cycles that
doesn't modulate the radius of the subsurface anymore.
This change is only present in EEVEE-Next.

This commit changes the principled BSDF code so that
it is easier to follow the flow of data.

For legacy EEVEE, the SSS switch is moved to a
`radius == -1` check.
2024-01-09 16:39:17 +13:00
Campbell Barton
6b09360c3e Cleanup: remove unused variable 2024-01-09 12:11:58 +11:00
Miguel Pozo
cc13d58e53 Fix #116541: Wireframes with overlays and x-ray disabled 2024-01-08 18:23:34 +01:00
Miguel Pozo
694cb43e59 Fix: EEVEE-Next: Forward Material compilation 2024-01-08 15:50:09 +01:00
Miguel Pozo
18094d20c9 Fix: EEVEE-Next: GPU_framebuffer_clear assertion 2024-01-08 12:54:08 +01:00
Clément Foucault
4dad262dbe Fix: EEVEE-Next: Implicit type conversions
This was breaking compilation on Mesa drivers.
2024-01-08 22:12:01 +13:00
Clément Foucault
98e465109b EEVEE-Next: Replace lighting tiles by direct stencil setup
This avoid the cost of creating the tiles themselves which uses a lot
texture write. This was a bottleneck on Apple GPUs.

Also the per pixel classification allows us to remove certain checks in
the deferred lighting shader making it faster.

### TODO
- [x] Add gl_FragStencilRefARB support on other backend
- [x] Add workaround for when gl_FragStencilRefARB isnt supported

Pull Request: https://projects.blender.org/blender/blender/pulls/116704
2024-01-08 07:35:05 +01:00
Campbell Barton
617f7b76df Cleanup: comment block formatting 2024-01-08 11:31:43 +11:00
Campbell Barton
0ba83fde1f Cleanup: spelling in comments 2024-01-08 11:24:37 +11:00
Clément Foucault
f2b3403145 EEVEE-Next: Gbuffer Read optimizations
This modify most shader using the GBuffer to use the
`ClosureUndetermined`. This in turn reduces the amount
of duplicated data in the `GBufferReader` structure.

The most important part is the usage of fixed array
indices to access the `GBufferReader.closures[]`.
This avoid the struct to be moved from local register
to device memory and remove a huge performance penalty.

Pull Request: https://projects.blender.org/blender/blender/pulls/116772
2024-01-07 04:46:25 +01:00
Clément Foucault
6f51d7332b EEVEE-Next: Refactor Raytracing to support arbitrary closure
This refactors the whole pipeline to be closure agnostic.

This mean we can have only one raytracing step that covers
any closure type. In practice, it means that there is
3 objects having 1 closure each with a different closure
types each, we can run the raytracing once.

This create a huge overhead during the tile classification
stage. This is fixed by #116772 and will be merged separately.

Pull Request: https://projects.blender.org/blender/blender/pulls/116670
2024-01-07 02:52:04 +01:00
Hans Goudey
e90d844dd7 Cleanup: Grammar in comments
"it's own" -> "its own" again. Start new sentences properly.
2024-01-06 09:02:56 -05:00
Hans Goudey
0a8129e0cf Cleanup: Make format 2024-01-05 13:59:07 -05:00