Commit Graph

4711 Commits

Author SHA1 Message Date
Clément Foucault
f16f9d9a96 EEVEE-Next: Use closure_light_set in foward lib
Was missing from the commit that introduced it.
2024-05-13 16:33:05 +02:00
Iliya Katueshenock
75d17b1db5 Cleanup: Move BKE_node to namespace
Move all header file into namespace.
Unnecessary namespaces was removed from implementations file.
Part of forward declarations in header was moved in the top part
of file just to do not have a lot of separate namespaces.

Pull Request: https://projects.blender.org/blender/blender/pulls/121637
2024-05-13 16:07:12 +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
ab48b08cde Fix: EEVEE-Next: Avoid syncing issues on AMD with cryptomatte
There was a missing barrier, which created
blocky, non-deterministic artifacts in the
cryptomatte render tests.
2024-05-13 14:10:26 +02:00
Clément Foucault
bbde7cdcb6 EEVEE-Next: Limit cost of transmission evaluation
This uses specialization constants to compile
optimized deferred lighting shader for when
transmission is not needed.
2024-05-10 20:01:22 +02:00
Clément Foucault
5b903c8624 Cleanup: EEVEE-Next: Use shadow renderpass id instead of boolean
for specialization constant. This is supported by all backends
now.
2024-05-10 19:18:30 +02:00
Jason Fielder
aa994f3cba EEVEE Next: Optimize closure light stack array access
This PR ensures the ClosureLightStack is only accessed
with constant indices. This reduces compiler spill and allows
furhter constant folding, improving the deferred lighting
evaluation performance by 30%.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121124
2024-05-10 19:13:46 +02:00
Sergey Sharybin
7b4232e8aa Compositor: Move Execution Mode and Precision from bNodeTree to Scene
This allows to expose these settings in the Performance panel in the
render buttons. Also moves compositor-specific options away from the
generic node tree structure.

For the backwards-compatibility the options are still present in the
DNA for the bNodeTree. This is to minimize the impact on the Studio
which has used the GPU compositor for a while now. They can be
removed in a future release.

There is no functional changes expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/121583
2024-05-10 18:08:33 +02:00
Clément Foucault
994646f172 Fix: EEVEE-Next: Lingering shadows after shader compilation
This was fixed for transparent issues but still persisted for
volumes and displacement materials.
2024-05-10 17:49:34 +02:00
Clément Foucault
5a76ba9892 Fix: EEVEE-Next: Wrong thickness for Hybrid material
The thickness was evaluated after the surface nodetree.
So the effective thickness for shader to RGB BSDFs was
undefined.

Fix #120791
2024-05-10 12:27:53 +02:00
Campbell Barton
0196c6330d Cleanup: unused variables 2024-05-10 09:30:45 +10:00
Clément Foucault
6efb69a5fe EEVEE-Next: Fixing shifted blur for non constant Shutter Curve
The function `cdf_invert` was not doing linear interpolation
between the correct values. This fixes the issue and
make sure that `x` is never perfectly 0 nor 1.

Fixes #117755
2024-05-09 19:20:10 +02:00
Jason Fielder
996014e537 EEVEE Next: Disable TILE_COPY shadow update method
Disabling tile_copy method for shadow update for
stability in scenes with large geometry counts
which may exceed parameter buffer size.

This pass can be re-used in future if the workload
distribution for shadow updates is changed to
better suit this method.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121623
2024-05-09 15:50:53 +02:00
Clément Foucault
c988b4a9cf EEVEE-Next: Shadow: Remove sun shadow trace distance
This has no effect anymore after #121616.
2024-05-09 13:58:24 +02:00
Clément Foucault
1c97e97aef EEVEE-Next: Shadow: Use atan_fast instead of atan 2024-05-09 13:58:24 +02:00
Clément Foucault
b1c9be51b3 EEVEE-Next: Compute maximum safe trace distance for sun shadow
We only trace in a radius of 1 tile. This removes the
need for a dedicated distance parameter for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/121616
2024-05-09 13:38:15 +02:00
Clément Foucault
86a2664246 Fix: EEVEE-Next: Sun shadows incorrectly sharp
The cone sampling function was broken.
2024-05-09 12:46:30 +02:00
Clément Foucault
94a83bcf04 EEVEE-Next: Make Specular BSDF work
This removes the ambient occlusion socket as this
have no use in EEVEE-Next.

Add correct material flags for noiseless clear coat
and fix transparency.
2024-05-09 11:59:27 +02:00
Jason Fielder
e97e06ea2c Metal: Re-enable loadstore config for EEVEE Next framebuffer
A previous PR resolved the loadstore config setup on bind, so
we can now re-enable load-store config with clearing of the
header texture via render pass.

Authored by Apple: Michael Parkin-White

Pull Request: https://projects.blender.org/blender/blender/pulls/121610
2024-05-09 11:27:37 +02:00
Clément Foucault
7859e0f606 EEVEE-Next: Rename engines and set it default in startup file
Finally.

Pull Request: https://projects.blender.org/blender/blender/pulls/121592
2024-05-08 20:57:00 +02:00
Clément Foucault
b619c1d13a EEVEE-Next: Subsurface indirect lighting for probe only lighting
This avoid black subsurface if only the world is lighting it.
This isn't yet supported when raytracing is on but then
the diffuse reflections are also working.
2024-05-08 20:10:23 +02:00
Clément Foucault
8b626c2d79 Fix: EEVEE-Next: Broken punctual shadows lod bias
Broken by be1f527cb4
2024-05-08 19:35:10 +02:00
Clément Foucault
c36f09e7f7 Fix: EEVEE-Next: Volume probe data clipping not starting from 0 2024-05-08 19:06:29 +02:00
Clément Foucault
96ee9e8044 EEVEE-Next: Display surfel density cube
Allows feedback on what is the density without
resorting to show the currently debug only
surfel visualization.
2024-05-08 19:05:51 +02:00
Clément Foucault
0e4e05ec97 EEVEE-Next: Make volume light-probe surfel density scale dependant
This avoids wrong default values and make setup easier.

This changes the RNA and DNA to create a new nice default
depending on resolution.
2024-05-08 18:22:44 +02:00
Clément Foucault
ad6e553ad8 Fix: EEVEE-Next: Wrong pixel radius calculation for LIGHT_SUN_ORTHO
Fix #121388
2024-05-08 15:24:40 +02:00
Vitaljok
be1f527cb4 EEVEE Next: Fixing sun shadows in ortho camera
Fix #120566 case.

Moved initial `lod_bias` calculations from `Light` struct to
`ShadowDirectional` and `ShadowPunctual` classes to avoid value
runaway during subsequent syncs. Changed internal functions to
use member variable instead of parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/121541
2024-05-08 13:07:39 +02:00
Campbell Barton
3290e25dc4 Cleanup: spelling in comments & code 2024-05-08 20:57:05 +10:00
Clément Foucault
bd34a74439 Fix: EEVEE-Next: Incorrect Alpha in AOVs
Was caused by float imprecision and storage precision
conversion. Use same fix as combined pass but
more selective as the alpha channel can contain
other data for AOVs.

Fix #118494
2024-05-07 18:39:33 +02:00
Clément Foucault
f5a4dec458 Fix: EEVEE-Next: Missing shadow refresh after compilation
This affects only transparent materials. Ideally, the shader
compilation should trigger a tag update on the object but
that's bad level call.

Instead, we just discard all shadows after finishing recompiling
a transparent material. This is overly conservative but it fixes
the issue.

Fixes #119624
2024-05-07 17:53:35 +02:00
Clément Foucault
286cbc8317 Fix: EEVEVE-Next: Wrong material reused for transmission material
This is caused by #121137 as the bug disappear if
`can_use_default_cb` returns false.


The issue is caused by the material binning system.
`ShaderKey` uses the `GPUMaterial` to differentiate between
material. But with #121137, different materials can reuse the
same `GPUMaterial`.

The fix is to not reuse the shader for the prepass (even if opaque)
for transmission enabled shaders.

Fix #121343
2024-05-07 17:34:36 +02:00
Clément Foucault
d9915b86a6 EEVEE-Next: Remove shadow softness factor parameter
This parameter was introduced to mitigate shadow tracing
artifacts. These are no longer present since #121317 and
leaving this parameter breaks PBR rules which opens other
issues with shadow disconnected from shading.
2024-05-07 15:49:49 +02:00
Jeroen Bakker
32e6042230 EEVEE-Next: Fix division by zero when copying motion vectors
Due to recent changes geometry without any vertices could lead to
a division by zero when copying motion vectors.

This PR fixes this by skipping the copy step when there are no
vertices to copy.

Pull Request: https://projects.blender.org/blender/blender/pulls/121516
2024-05-07 15:43:51 +02:00
Clément Foucault
d6aa790301 Cleanup: EEVEE-Next: Remove warnings 2024-05-07 15:07:41 +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
Clément Foucault
d97e22f2cd Fix: EEVEE-Next: Missing world diffuse lighting
Caused by c99e7519c4

Missed the initial `local_radiance` value.
2024-05-07 12:53:28 +02:00
Jeroen Bakker
c99e7519c4 Fix #120919: EEVEE-Next: Intel UHD support for probe remapping.
Windows/Intel UHD 600 iGPUs crash when compiling probe remapping shader.
The cause is that there is a balanced barrier inside a forloop. When removing
the barrier the compilation works. This is a driver bug and most likely not
being solved as the driver maintenance mode will only be updated for critical
fixes.

This PR works around the issue making the loop condition less complex.

Pull Request: https://projects.blender.org/blender/blender/pulls/121105
2024-05-06 17:02:46 +02:00
Jeroen Bakker
9d07f6d5a0 EEVEE-Next: Fix motion blur large geom on iGPU HD520 devices
Detected when testing mr_elephant on an Intel HD520. When copying
the velocity buffer using the copy shader, the number of scheduled
workgroups could be larger than supported by the device.

This PR fixes this by copying multiple vertices per thread when
the work size cannot cover all the pixels.

Pull Request: https://projects.blender.org/blender/blender/pulls/120915
2024-05-06 17:02:23 +02:00
Jeroen Bakker
62b871d572 Fix #121467: EEVEE-Next: Write varying interfaces in world shader
Intel drivers on Windows platform require all varying interface data
to be written to in the previous stage.

It was detected that the world shader didn't do that as the interface
contains data used for regular objects.

There are several ways how this could be solved:
- Change nodes to use a different path for world materials.
- Include of the draw_model_lib/common_view_lib
- set the failing interface directly.

I chose to set the failing interface directly but I am fine to include
any missing library.

Pull Request: https://projects.blender.org/blender/blender/pulls/121477
2024-05-06 14:58:39 +02:00
Lukas Tönne
fe6c1f4659 Fix #121353: GPv3: Reset shading group pointers for polling in overlays
Grease Pencil overlay drawing code uses the existence of shading groups
to determine which parts of the overlay need to be drawn. If the tool
settings change the shading groups need to be set to null, otherwise
the drawing code will still draw points in curve selection mode.

Pull Request: https://projects.blender.org/blender/blender/pulls/121472
2024-05-06 13:25:34 +02:00
Campbell Barton
98f319ce02 Cleanup: spelling in comments 2024-05-04 15:24:46 +10:00
Campbell Barton
9918488bb1 Cleanup: use uppercase tags, following own style guide 2024-05-03 11:33:21 +10:00
Campbell Barton
5529a94f14 Cleanup: spelling in comments 2024-05-03 11:33:18 +10:00
Falk David
370712fc1b Fix #121354: GPv3: object mode selection outline too big
This was caused by c2504eb779.
The commit changed the factor for the radii, but didn't update the
overlay code for the outlines.

This fix makes sure we're using the right conversion factor.
2024-05-02 16:32:06 +02:00
Campbell Barton
f6b7464b4c Cleanup: spelling in comments 2024-05-02 16:44:10 +10:00
Miguel Pozo
67d292c0e9 Fix: EEVEE-Next: Never tag default materials as GPU_MAT_USE_DEFAULT
Fix issue from a8f8745dcb
2024-05-01 18:03:36 +02:00
Clément Foucault
ab30784076 EEVEE-Next: Implement spherical harmonic deringing
This avoids negative color darkening caused by strong
directionnal lighting.

However, this reduce the contrast a lot since the
deringing is done on the unclampped spherical harmonics
which is itself extracted from unclamped values from
the world.

The solution to this is to add the parameter for
clamping the world light. This setting will be
reused for #68478.

Fix #116036

Pull Request: https://projects.blender.org/blender/blender/pulls/121303
2024-05-01 16:18:51 +02:00
Clément Foucault
826d2ed4ec EEVEE-Next: Move shadow resolution scale to the sampling panel 2024-05-01 14:45:51 +02:00
Clément Foucault
643f4eaedf Fix: EEVEE-Next: Compilation error
Caused by accidentally merging two comflicting
PRs that had no merge conflict.
2024-04-30 20:40:48 +02:00
Clément Foucault
303f91a09c EEVEE-Next: Add slab thickness and thickness from shadow options
Implement the design discussed in #120384.

This adds two parameters. One for changing the approximation
method, and another to use the thickness from shadow map.

We pack the former in the gbuffer by dividing the 16bits
used for thickness by two and use one bit to store the
method.

The thickness from shadow map is now decoupled from the
light evaluation shader. This makes it more performant and
compatible with ray-tracing. This commit also uses the
same biases as shadow mapping to avoid aliasing artifacts
(fix #119339).

This refactors the light evaluation quite a bit to
remove unused bits bits and make the whole transmission
light evaluation without too much complexity.

Pull Request: https://projects.blender.org/blender/blender/pulls/121171
2024-04-30 20:32:46 +02:00