Commit Graph

8741 Commits

Author SHA1 Message Date
Clément Foucault
e6f8924870 Cleanup: Overlay: Avoid non-uniform control flow for texture sampling 2024-10-16 17:01:17 +02:00
Clément Foucault
0d7bfb0711 Fix: Overlay-Next: Missing wireframe in wireframe mode 2024-10-16 17:01:17 +02:00
Clément Foucault
88b5a42d2d Fix: Overlay-Next: Light and lightprobe object appearing in UV view
A more consistent fix would be to split the 2D view and 3D view
overlay. Unfortunately, this is more difficult than it should
with the current legacy codebase expecting a base class
in various places with reinterpret cast.
2024-10-16 17:01:16 +02:00
Clément Foucault
6c9db47e53 Cleanup: Overlay-Next: Add missing includes and simplify prepass logic 2024-10-16 12:37:46 +02:00
Clément Foucault
aa8f2c0e3d Fix: Overlay-Next: Grid is occluded by scene geometry in wireframe mode
It was still using the depth buffer from Workbench.

Use the dummy texture and point sampling to avoid
more invasive changes.
2024-10-16 12:37:46 +02:00
Clément Foucault
cc1c952692 Fix: Overlay-Next: UV face overlay not visible
Was caused by grid being drawn in front of the
overlays.
2024-10-16 12:37:46 +02:00
Clément Foucault
1d264b4589 Overlay-Next: Avoid undefined memory as object handle
Fixes selection
2024-10-16 12:37:46 +02:00
Clément Foucault
8a2acc731d EEVEE: Avoid automatic printf injection in debug build
Fixes a crash in debug build when closing blender.
2024-10-16 10:30:35 +02:00
Clément Foucault
7f03a305eb EEVEE: Avoid printf injection in debug build
This avoid a crash in debug build caused by the printf
feature to be not so stable.
2024-10-16 09:50:55 +02:00
Campbell Barton
93c984283e Cleanup: quiet compiler warnings 2024-10-16 15:07:13 +11:00
Clément Foucault
d712be0662 GPU: Change global scope variable to defines to avoid overhead on Metal 2024-10-15 20:06:46 +02:00
Clément Foucault
62826931b0 GPU: Move more linting and processing of GLSL to compile time
The goal is to reduce the startup time cost of
all of these parsing and string replacement.

All comments are now stripped at compile time.
This comment check added noticeable slowdown at
startup in debug builds and during preprocessing.

Put all metadatas between start and end token.
Use very simple parsing using `StringRef` and
hash all identifiers.

Move all the complexity to the preprocessor that
massagess the metadata into a well expected input
to the runtime parser.

All identifiers are compile time hashed so that no string
comparison is made at runtime.

Speed up the source loading:
- from 10ms to 1.6ms (6.25x speedup) in release
- from 194ms to 6ms (32.3x speedup) in debug

Follow up #129009

Pull Request: https://projects.blender.org/blender/blender/pulls/128927
2024-10-15 19:47:30 +02:00
Sebastian Parborg
1ca1855ca6 Merge branch 'blender-v4.3-release' 2024-10-15 18:27:04 +02:00
Clément Foucault
e943d8b0a4 EEVEE: Use imageLoad/StoreFast when possible
Extracted from #115195

Pull Request: https://projects.blender.org/blender/blender/pulls/128844
2024-10-15 15:48:37 +02:00
Falk David
715a37b662 Fix #129049: Solid mode doesn't render strokes correctly
Caused by 364d62e59b.

In draw mode, we want to make sure to show vertex colors by default
because users can draw with them. Otherwise this can lead to unexpected
behavior in solid shading mode when vertex colors used to not be
rendered in draw mode.

The previous fix tried to do this by enforcing the `V3D_SHADING_VERTEX_COLOR`
mode in draw mode. But this has the side effect that the material
stroke and fill color are overriden with pure white.

To fix the issue correctly, simply ensure that `vert_col_opacity` in
`grease_pencil_layer_cache_add` is set to 1.0f. This means that
vertex colors and material colors are shown just like in the render.

Also resolves #128680.

Pull Request: https://projects.blender.org/blender/blender/pulls/129054
2024-10-15 13:47:24 +02:00
Damien Picard
5715693a97 UI: Use title case for Grease Pencil, Freestyle, Line Art
This was already the case for the vast majority of occurrences, and is
recommended by the human interface guideline's writing style.

Pull Request: https://projects.blender.org/blender/blender/pulls/129000
2024-10-15 13:00:47 +02:00
Campbell Barton
11e41f7276 Merge branch 'blender-v4.3-release' 2024-10-15 16:22:09 +11:00
Campbell Barton
44d0452a78 Cleanup: spelling in comments 2024-10-15 12:51:05 +11:00
Clément Foucault
d9aad850b0 GPU: GLSL preprocess: Remove invalidly processed header
Add assert in the preprocessor that these file don't get
processed.
2024-10-12 14:21:51 +02:00
Campbell Barton
3350eeba62 Merge branch 'blender-v4.3-release' 2024-10-12 22:48:08 +11:00
Campbell Barton
15be0030f6 Cleanup: various non-functional C++ changes
- Avoid shadowing.
- Use default functions.
- Remove unused struct member from GpencilBatchCache.
2024-10-12 22:44:19 +11:00
Clément Foucault
2514e119cb Merge branch 'blender-v4.3-release'
# Conflicts:
#	source/blender/draw/intern/shaders/draw_view_info.hh
2024-10-11 18:30:11 +02:00
Clément Foucault
ac1069805c Fix: DRW: Broken multiview support with inverted scale object instances
If a `DrawGroup` contained both inverted and non-inverted scale
the command generate shader would output the `resource_id`
content at conflicting indices. This is because the number of
instances stored inside the `DrawGroup` are the original
count before multiview. Actually, only `start` was taking the
multi-view count into account.

We cannot modify the value on CPU otherwise it would increase
the instance count for each submission. So the fix is to
pass the view count to the command generate shader and
multiply the instance count where needed.

Fix #128085

Pull Request: https://projects.blender.org/blender/blender/pulls/128854
2024-10-11 18:09:57 +02:00
Clément Foucault
3764f53b1b Fix: EEVEE: Point lights with zero radius create in shadow artifact
This is likely caused by local_ray_up being degenerate with
very small radii. This is a temporary fix and should be revisited
later.

The issue is that the real fix is likely to have a higher
performance cost.

Fix #124636
2024-10-11 18:06:47 +02:00
Clément Foucault
d8ccaa62fb Merge branch 'blender-v4.3-release'
# Conflicts:
#	tests/data
2024-10-11 14:11:58 +02:00
Falk David
24019cc863 Fix: GPv3: Effects not showing in right modes
The object mode flags of the cache population for the effects
were outdated.

This fix makes sure the right flags are used.
2024-10-11 10:54:49 +02:00
Jeroen Bakker
8a6d469cfd Merge branch 'blender-v4.3-release' 2024-10-11 10:06:35 +02:00
Jeroen Bakker
483f96ce73 Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL
When using OpenGL on Intel ARC the driver reports a max 3d allowed size
of 2048. The volume probe will create a texture that doesn't fit in this
dimension when selecting a probe size of 512 or 1024 MB.

This PR will reshape the volume pool atlas texture until it found a shape
that is optimal and fit on the device. When reshaping selects a different
pool size a warning message will be displayed as it might change the
visual quality.

When reshaping the smallest row size will be selected in order
to improve the occupancy. Reshaping will only happens when a
different setting is set in the `Performance->Memory->Light Probes Volume Pool`.

NOTE: Needs to be backported to 4.2

Pull Request: https://projects.blender.org/blender/blender/pulls/128877
2024-10-11 10:05:56 +02:00
blastframe
70280e9d12 Fix: typo in shadow error message
The error message related to shadow updates in `eevee_shadow.cc`
currently contains a typo:
`"Error: Too many shadow updates, some shadow might be incorrect."`
This sentence should use the plural form of "shadows" to correctly
describe the context.

Fixing this typo ensures clarity and correctness in the error message,
providing developers and users with the appropriate feedback when
encountering shadow update issues.

Pull Request: https://projects.blender.org/blender/blender/pulls/128865
2024-10-11 09:41:31 +02:00
Ray Molenkamp
de5ac7395e Merge remote-tracking branch 'origin/blender-v4.3-release' 2024-10-10 12:09:25 -06:00
Clément Foucault
bc3fdc3293 Fix: EEVEE: Object wihtout volume probe visibility don't cast shadow
Object without lightprobe visibility should still
cast shadows during baking. They should only not
bounce indirect lighting.

This is more visible now that shadow linking is supported.

Fix #128812
2024-10-10 16:25:59 +02:00
Clément Foucault
5b70445460 Merge branch 'blender-v4.3-release'
# Conflicts:
#	scripts/addons_core/bl_pkg/bl_extension_ops.py
2024-10-10 16:21:51 +02:00
Clément Foucault
b78354152e Revert "Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL"
Reverted as it breaks render test on some configs (AMD+Mesa+Linux).
This reverts commit 7d5712be9b.
2024-10-10 16:20:44 +02:00
Clément Foucault
d8b295bfae EEVEE: Add TODO about code going against design 2024-10-10 16:19:14 +02:00
Clément Foucault
27963d652b EEVEE: Update the GGX LUTs
Pull Request: https://projects.blender.org/blender/blender/pulls/128821
2024-10-10 13:56:13 +02:00
Weizhen Huang
313a7d6236 Fix: EEVEE BXDF LUT generation
Fixes:
1. Mixed use of `sample_reflection` and `sample_refraction`.
`sample_reflection` is intended for when only reflection is required.
For refraction, `sample_vndf` or `sample_refraction` should be used.
2. Wrong weight when accumulating the contribution. Previously
`brdf * NV / (fresnel * pdf)` always evaluates to `GL`, but with the new
technique of bounded VNDF sampling this is not true anymore. Fixed by
adding a field `weight` in the struct `BsdfEval`.
3. Schlick's approximation of the fresnel factor is
`F + (1 - F) * (1 - cos(theta))^5`, but BSDF LUT was using
`cos^2(theta)`, which was incorrect.
2024-10-10 13:56:11 +02:00
Weizhen Huang
0cf7484817 Refactor: EEVEE: separate ggx reflection and transmission functions
They use different techniques, separating them helps with commenting and
readability
2024-10-10 13:56:11 +02:00
Weizhen Huang
3d29979edf EEVEE: improve GGX NDF precision at small roughness
See !125919
2024-10-10 13:56:11 +02:00
Weizhen Huang
3db43b6705 Cleanup: EEVEE: remove unused code block and simplify computations 2024-10-10 13:56:11 +02:00
Weizhen Huang
5df1afad1d Cleanup: EEVEE: remove unnecessary check of normal visibility
We always sample visible normals, this check is unnecessary
2024-10-10 13:56:11 +02:00
Jeroen Bakker
a62fa40b58 Merge branch 'blender-v4.3-release' 2024-10-10 11:28:53 +02:00
Jeroen Bakker
7d5712be9b Fix #128407: EEVEE: Cannot allocate volume pool on Intel ARC/OpenGL
When using OpenGL on Intel ARC the driver reports a max 3d allowed size
of 2048. The volume probe will create a texture that doesn't fit in this
dimension when selecting a probe size of 512 or 1024 MB.

This PR will reshape the volume pool atlas texture until it found a shape
that is optimal and fit on the device. When reshaping selects a different
pool size a warning message will be displayed as it might change the
visual quality.

When reshaping the smallest row size will be selected in order
to improve the occupancy. Reshaping will only happens when a
different setting is set in the `Performance->Memory->Light Probes Volume Pool`.

Pull Request: https://projects.blender.org/blender/blender/pulls/128518
2024-10-10 11:28:09 +02:00
Campbell Barton
8771952ce9 Merge branch 'blender-v4.3-release' 2024-10-09 22:37:36 +11:00
Campbell Barton
233cf07866 Cleanup: remove unused functions 2024-10-09 22:29:16 +11:00
Lukas Tönne
ab75dc35ea Merge branch 'blender-v4.3-release' 2024-10-09 10:28:39 +02:00
Lukas Tönne
5c57e24fea Cleanup: GPv3: Remove unused BKE functions from GPv2
Removes unused GPv2 functions in blenkernel.

Notes:
-  Functions for layer masks are still in use, but annotations never
  have layer masks in the first place. Would be good to remove the data
  structures so we can remove the functions too.
- Some multi-frame edit functions are also still nominally used, but
multi-frame editing is not an active feature for annotations. This
  should also be removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/128709
2024-10-09 10:27:45 +02:00
Weizhen Huang
33be4d18ed Merge branch 'blender-v4.3-release' 2024-10-08 21:47:21 +02:00
Weizhen Huang
52f2bb53b9 Fix #128654: EEVEE: improve precision of cubic solver in light LTC
by rescaling the polynomial coefficients and bringing them to the same
magnitude.

Pull Request: https://projects.blender.org/blender/blender/pulls/128753
2024-10-08 21:45:51 +02:00
Weizhen Huang
e2c0e049f4 Fix: EEVEE: missing negative sign when computing refraction pdf
`LH` was computed using `dot(-L, H)`, so there needs to be a negative
sign when computing `Ht2`.

`pdf` is only used for denoising, the change oesn't seem to affect the
regression test.
2024-10-08 21:43:27 +02:00
Laurynas Duburas
fc5f89a520 Curves: Support View3DOverlay.display_handle property
Support for View3DOverlay.display_handle property accessible in "Curves Edit Mode Overlays" panel.

Rel #105037

Pull Request: https://projects.blender.org/blender/blender/pulls/128142
2024-10-08 21:17:16 +02:00