Commit Graph

7153 Commits

Author SHA1 Message Date
Omar Emara
405ec79a0a Fix #112883: GPU compositor crops viewed image
The GPU compositor crops the viewed images to the render resolution.
While the original size and content of the input to the viewer should be
retained as is.

This patch fixes that by specializing compositors that can use composite
outputs to be able to view images of any arbitrary size. This is still
missing the translation offset of the viewer, but this shall be tackled
separately.
2023-10-12 14:03:12 +03:00
Clément Foucault
c8e0a9765e EEVEE-Next: Sphere Probe: Allow evaluation of volume probe
This avoid too dark surfaces if there is no light
in the scene. This prevent energy loss.
2023-10-12 12:50:56 +02:00
Clément Foucault
de2ea031bc Fix EEVE-Next: Broken Parallax
Parallax distance was not actually use.
It was affecting the world and had
unwanted effect if lower than
influence radius.
2023-10-12 12:41:15 +02:00
Clément Foucault
1f12b90ef2 Cleanup: EEVEE-Next: Use references for bind_resources 2023-10-12 12:19:41 +02:00
Clément Foucault
1b4b6bc2f4 Fix EEVEE-Next: Forward Pipeline: Missing resource binds 2023-10-12 12:15:15 +02:00
Jeroen Bakker
83b23d37e7 EEVEE: Fix Compilation Errors
The push constant `double_sided` and `Surfel.double_sided` collided. Due
to the macros that the vulkan backend is creating it isn't possible to
use the same attribute name as an existing push constant.

Pull Request: https://projects.blender.org/blender/blender/pulls/113576
2023-10-12 08:57:25 +02:00
Campbell Barton
b4504c7840 Cleanup: spelling in comments 2023-10-12 16:03:18 +11:00
Clément Foucault
4bddbe85f6 EEVEE-Next: Move out of experimental options
See #93220
2023-10-11 20:38:28 +02:00
Clément Foucault
df523f3bf1 EEVEE-Next: Add back lightprobe influence
I had to do a huge refactor in order to do this.

The way ReflectionProbe were referencing the UBO
data was conflicting with the way EEVEE-Next
object should behave.

So like light, shadow and irradiance grids, every
probe is synced with it's GPU data as base struct
and the data is just copied into the UBO
when using `set_view`.

To simplify many parts of the reflection probe
code, I isolated the atlas coordinate of a probe
to its own struct that can be easily copied.

Pull Request: https://projects.blender.org/blender/blender/pulls/113518
2023-10-11 20:19:37 +02:00
Miguel Pozo
1ba16edaf0 EEVEE-Next: Rename light probes
Update to the new naming convention for `Light Probes`:

`Reflection Cubemap` -> `Sphere`
`Reflection Plane` -> `Plane`
`Irradiance Grid` -> `Volume`

Note that this breaks the Python API (`bpy.types.LightProbe.type`).

Pull Request: https://projects.blender.org/blender/blender/pulls/113452
2023-10-11 19:38:42 +02:00
Sergey Sharybin
926c6782fe Sculpt: Support Float2 attributes for dynamic topology
It was a missing case in the code which is responsible for in the code
which is responsible for filling in VBO data. It is now implemented for
vertex and corner attributes.

Co-Authored-By: Hans Goudey <hans@blender.org>

Pull Request: https://projects.blender.org/blender/blender/pulls/113536
2023-10-11 12:12:37 +02:00
Sergey Sharybin
e36626b02d Merge branch 'blender-v4.0-release' 2023-10-11 12:05:26 +02:00
Sergey Sharybin
a12a3dc73a Fix #113496: Crash in sculpt mode when Float2 attributes used on Vertices
The old logic had a hard-coded assumption that Float2 attribute is an
UV-map. This assumption is now resolved.

Pair programming session with Hans.

Pull Request: https://projects.blender.org/blender/blender/pulls/113535
2023-10-11 12:04:30 +02:00
Campbell Barton
91ec9bc5a7 Cleanup: don't use DOXYGEN blocks for inline comments 2023-10-11 10:49:07 +11:00
Clément Foucault
a82e9586c4 Fix EEVEE-Next: Compilation on Metal 2023-10-10 23:52:04 +02:00
Hans Goudey
a6a2af5fdd Fix: Sculpt dynamic topology doesn't draw active/render color attribute
Pass the mesh to the drawing functions so it doesn't have to be
retrieved from the PBVH. It's nice to rely less on the PBVH `me`
pointer, since it's a fairly ugly "back pointer" which isn't necessarily
good design.
2023-10-10 18:22:50 +02:00
Miguel Pozo
e235913c0d Fix: EEVEE-Next: Handle ObjectKey padding bytes 2023-10-10 17:55:23 +02:00
Miguel Pozo
26154aae81 Fix: EEVEE-Next: Bake regression
Missing `hiz_buffer.set_source` call after 80a6a8efe9
2023-10-10 17:40:28 +02:00
Miguel Pozo
7d28b8cb5b Merge branch 'blender-v4.0-release' 2023-10-10 15:49:56 +02:00
Miguel Pozo
96d6003b92 Cleanup: Draw: max_orphan_cycles clarification 2023-10-10 15:49:28 +02:00
Jeroen Bakker
25a1cea8e2 EEVEE-Next: Scene Reflection Probe Resolution
This PR reuses the scene specific reflection probe resolution for all
reflection light probes in the scene. The target is to have a automatic
detection for the resolution. But as long as we don't have a mechanism
for detection it is better to not introduce a new UI element that will
be removed within the foreseen future.

This setting is currently used by EEVEE and EEVEE-Next. EEVEE supports
resolutions upto 4096px. This will be clamped to 2048 when using
EEVEE-Next.

The motivation for this is that EEVEE-Next will soon replace
EEVEE and 4096 can then be removed from the choices that the user can
made. Adding as separate option could need synchronization, and that
option would also be temporary as it will be removed by the resolution
detection mechanism.

Pull Request: https://projects.blender.org/blender/blender/pulls/113491
2023-10-10 14:50:17 +02:00
Clément Foucault
80a6a8efe9 EEVEE-Next: Ray-Tracing: Add Planar Tracing
This traces planar lightprobe captures just like
the screen-space tracing does.

This is implemented as a separate shader that
loads the ray before the screen trace and
check if it can be traced against any available
planar probe. If it does it marks the ray as
traced (negative pdf) so that the screen tracing
pass does not override the result or try to
trace it.

Pull Request: https://projects.blender.org/blender/blender/pulls/113453
2023-10-10 12:55:18 +02:00
Jeroen Bakker
9c52b4e606 Fix #113470: EEVEE-Next doesn't stop sampling
After performing a transformation EEVEE-Next non-stops resets the
sampling. The cause is that the `recalc` flag that are stored in the
Object isn't consumed. When transforming it was always filled with
`ID_RECALC_TRANSFORM` and kept on resetting the sampling.

Regression introduced by PR #113252.

Pull Request: https://projects.blender.org/blender/blender/pulls/113484
2023-10-10 11:49:37 +02:00
Campbell Barton
137f8dd7bc Cleanup: spelling in comments 2023-10-10 09:44:57 +11: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
Miguel Pozo
f54205cfdd EEVEE Next: Optional surfel backface culling
Allow disabling surfels backfaces from contributing to volume probes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113362
2023-10-09 17:02:14 +02:00
Germano Cavalcante
ffaf3e30ef DRW: Simplify Selection Engine
The selection engine has some complex tricks that improve performance.
These are:
- Only draws objects whose bounding box intersects the selection
threshold;
- If the viewport or objects are not "dirty", it does not clean the
texture IDs and only adds objects that have not yet been drawn;
- Only updates the depth buffer if a new object is drawn;
- Skip drawing if no object is found;

These tricks were initially implemented so that this engine could be
used for snapping.

But this initial idea has changed and now the engine is only used to
select Vertices, Edges or Faces.

Due to this limited use, these tricks bring no real benefit.
In fact, it's even worse with the Retopology Overlay, as it forces the
Depth buffer to be redrawn.

This commit removes these tricks and only keeps those that indicate
whether the drawing needs to be updated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113308
2023-10-09 11:06:53 -03:00
Jeroen Bakker
701c14acea EEVEE-Next: Support for Intel ARC GPUs
This PR adds support for Intel ARC GPUs. Due barriers inside a non
uniform control flow the Intel ARC can stall the whole system.

The cause is that a barrier is used, but some threads in the shader
have completed. The barriers might wait until it gets the signal from
the exited threads and stalls the system.

Although some implementations support it it is safer to limit the
number of HiZ levels.

Pull Request: https://projects.blender.org/blender/blender/pulls/113447
2023-10-09 15:29:26 +02:00
Hans Goudey
f27ac434f6 Fix: Incorrect early return in recent cleanup 2023-10-09 15:27:04 +02:00
Jeroen Bakker
f6df5d3514 Fix: EEVEE-Next: Planar Probes First Sample
When the first planar probe is added to the scene, or the last probe
is removed from the scene the samples needs to be reset. This removes
artifacts when only a single sample is used.

Pull Request: https://projects.blender.org/blender/blender/pulls/113440
2023-10-09 14:49:49 +02:00
Miguel Pozo
25160def62 Fix: EEVEE-Next: Nvidia compilation error
Workaround Error: C1317: qualified actual parameter #1 cannot be converted to less qualified parameter
2023-10-09 13:17:19 +02:00
Jeroen Bakker
03040f3b7f Cleanup: Make format 2023-10-09 12:49:02 +02:00
Miguel Pozo
744bdb84f7 Merge branch 'blender-v4.0-release' 2023-10-09 12:13:18 +02:00
Bastien Montagne
df0d7c9c3d WM Jobs: Refactor all worker status variables into a single shared struct.
Move the three current 'status variables' (stop, update and progress)
into a single 'WorkerStatus' struct. This is cleaner and will allow for
future workin this area without having to edit tens of 'startjob'
callbacks signatures all the time.

No functional change expected here.

Note: jobs' specific internal code has been modified as little as
possible, in many cases the job's own data still just store pointers to
these three values. Ideally in the future more refactor will be using a
single pointer to the shared `wmJobWorkerStatus` data instead.

Pull Request: https://projects.blender.org/blender/blender/pulls/113343
2023-10-09 12:12:22 +02:00
Miguel Pozo
2b805e777a Fix: Workbench: resolve_shader_cache initialization 2023-10-09 12:10:56 +02:00
Jeroen Bakker
79c0cd0646 Fix: EEVEE-Next: Planar Reflection During Sculpting
This PR fixes an issue that the shading pass isn't filled when
sculpting. Was detected when querying code that landed
in main.

Pull Request: https://projects.blender.org/blender/blender/pulls/113439
2023-10-09 11:03:20 +02:00
Jeroen Bakker
5f49efc084 Fix: EEVEE-Next: Crash Removing Last Planar Probe
When deleting the last planar probe in the scene the color and
depth textures are resized with 0 layers. This isn't allowed.

This is fixed by adding an early exit and creating dummy textures.

Pull Request: https://projects.blender.org/blender/blender/pulls/113437
2023-10-09 09:35:02 +02:00
Jeroen Bakker
61b463d5e4 EEVEE-Next: Planar Probe Pipeline
This PR is contains the initial capture pipeline for planar probes.

It requires work to generate the correct view to capture and to include
the result during ray tracing. These will be developed in a separate PR.

This PR detects if a planar probe is active in the scene. If this is
the case the planar probe pipeline will be activated. During rendering
this is done by querying the depsgraph, during viewport drawing this
is done during sync. If an planar probe is detected and the pipeline
wasn't activated. The pipeline will be activated and the sampling
will be reset to ensure the pipeline is filled with all objects.

Per object the user can set the visibility of the object in planar
reflections.
![image](/attachments/fcfb40f9-f174-491c-bfba-e7f00f49aa1c)

For a reflection plane the resolution and clipping offset can be set.
EDIT: Resolution option was removed because too complex to
implement with the little time we have at the moment.
![image](/attachments/e42ad9ce-8af8-45d1-aa3a-630db1901ad3)

Related to #112966

Co-authored-by: Clément Foucault <foucault.clem@gmail.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/113203
2023-10-08 19:49:58 +02:00
Clément Foucault
3cca8680e0 EEVEE-Next: Split Thickness Approximation
This moves the thickness from shadow map
approximation out of the lighting and shadowing
loop. Instead of using the thickness from
the shadow tracing from each individual light
before SSS evaluation, we precompute the
average thickness from all shadowed light.
This is then mixed with the nodetree thicknes.

## SSS Translucency
This add back SSS transmission support by using
the mentionned thickness computation, and applying the
transmission profile on it. This is then applied on top of a
flipped normal LTC computation.

Pull Request: https://projects.blender.org/blender/blender/pulls/113401
2023-10-08 00:29:06 +02:00
Clément Foucault
7c694c9d04 EEVEE-Next: Refactor Light evaluation
This allow splitting shadow and light evaluation.
This is the first step to deferred shadowing.

The evaluate closure types can be dynamically
set which mean we can have arbitrary BSDF
evaluation inside the same shader.

This also contain some refactor to `light_lib.glsl`
for more consistency and less clutter.

Note that this breaks the SSS translucency
as the shadow evaluation changes for these.
A new solution for this feature is to be found

Pull Request: https://projects.blender.org/blender/blender/pulls/113257
2023-10-08 00:15:41 +02:00
Hans Goudey
ce4663403b Cleanup: Return early to reduce indentation for 3D cursor drawing 2023-10-07 09:09:33 -04:00
Campbell Barton
4b3e7b3928 License headers: add SPDX header 2023-10-07 18:13:22 +11:00
Clément Foucault
5e43bf3483 EEVEE-Next: Refactor Lightprobe irradiance evaluation
This refactor the lightprobes sample so that we always query
the spherical probe and the volume probe.

Then, given the BSDF type, we reconstruct the incoming radiance
differently depending on the ray probability blending between
the spherical and volume probe depending on ray probability.

Moreover, we implement cubemap normalization using
volume probe spherical harmonic data at spherical probe
position and at the shading point position.

Pull Request: https://projects.blender.org/blender/blender/pulls/113301
2023-10-06 23:37:38 +02:00
Hans Goudey
5052fe489c Cleanup: Simplify filling constant value per triangle in PBVH draw 2023-10-06 18:33:21 +02:00
Hans Goudey
9d201dc16b Cleanup: Simplify BMesh PBVH draw data upload
Instead of using a lambda with a FunctionRef argument, just write the
loops explicitly. This results in a bit more boilerplate code and a bit
more repetition, but the overall design and flow is much simpler. Based
on the results in f10965dcb8, it can improve performance too.
2023-10-06 18:16:30 +02:00
Sergey Sharybin
9a44445667 Fix assert in PBVH face set drawing code
The assert was assuming that the attribute request is properly
initialized and that was not the case: the "special" data layers
like coordinates, normals, masks, and face sets did not initialize
domain in the attribute request.

The domain is now properly initialized. As well as there is an
assert added in other PBVH types for the face sets. It is possible
to add asserts in more places, but it is not directly related to
this CL.

Pull Request: https://projects.blender.org/blender/blender/pulls/113354
2023-10-06 18:05:59 +02:00
Clément Foucault
eb9d765eea Fix EEVEE-Next: Broken compilation on Metal 2023-10-06 17:53:29 +02:00
Hans Goudey
0fc3e3dd98 Fix: Debug build error from incorrect PBVH draw assert 2023-10-06 15:47:54 +02:00
Sergey Sharybin
12e9894a75 Sculpt: Improve support of face sets with dyntopo
Two aspects to this change:

- Do not clear face sets when enabling dynamic topology
- Draw face sets in viewport when dynamic topology is enabled

Newly added faces in the dynamic topology will have face
sets properly assigned. It is only edge collapse which can
potentially lead to undesired results w.r.t face set boundaries.
That will be worked on further as follow up development.

Pull Request: https://projects.blender.org/blender/blender/pulls/113348
2023-10-06 15:42:22 +02:00