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
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
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
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
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
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
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
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.
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
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
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
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
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.
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
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
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
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
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
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
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.
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
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