Commit Graph

128893 Commits

Author SHA1 Message Date
Campbell Barton b434d40dbf CMake: quiet noisy messages on every run
Printing that a library is found every time CMake runs isn't helpful.
Restrict these messages for the first execution so messages are limited
to information developers may need to know such as features being
disabled because of incompatible configurations.
2023-10-07 18:20:30 +11: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
Jacques Lucke 144a5aa512 Cleanup: replace use of std::iota with more specific function
`iota` is name that has no meaning, it's not an acronym or initialism.
It's usually very cryptic when I come across it. Replacing it with a
specialized function makes the code more readible.
2023-10-06 23:01:16 +02:00
Hans Goudey 4cbcaf51cb Cleanup: Use "vert" term consistently in mesh randomization debug code
In this area the contraction is usally used. It's nice to be consistent.
2023-10-06 16:50:52 -04:00
Hans Goudey 36f7d33121 Fix: False positive geometry randomization in split edges node
See cc7da09c1b.

Splitting edges only potentially affects the order of edges and
vertices. Face corner vertex and edge indices are affected, but their
order isn't affected, and faces aren't affected at all. This didn't
cause problems, but correcting it shows users they can rely on
these consistencies after this operation.
2023-10-06 16:46:49 -04:00
Jacques Lucke bef0d6c067 Functions: extract remapped-params to make it reusable
This idea is of remapping parameters of lazy-functions is useful
not only for the repeat zone. For example, it could be used for the
for-each zone as well.

Also, moving it to a more general place indicates that there is no
repeat-zone specific stuff in it.
2023-10-06 22:32:51 +02:00
Brecht Van Lommel f9bf2a71b4 Merge branch 'blender-v4.0-release' into main 2023-10-06 21:43:56 +02:00
Brecht Van Lommel 60ffec5a91 Tests: add dedicated directory for principled BSDF tests 2023-10-06 21:17:50 +02:00
Bastien Montagne 106d54554a Merge branch 'blender-v4.0-release' 2023-10-06 20:20:03 +02:00
Bastien Montagne 5f7f6b65f3 Fix (unreported) crash in 'startup.blend' GP default update code.
This commit fixes two different issues in
`BLO_update_defaults_startup_blend`:
* No check were done whether a given 'paint mode' tool settings actually
  exist or not before trying to 'update' it, leading to hard crash when
  some did not.
* Only the first Scene in loaded 'startup' Main would be processed -
  nothing prevents a `startup.blend` file to have more than one scene!
2023-10-06 20:19:26 +02:00
Brecht Van Lommel 1e567d05e9 Merge branch 'blender-v4.0-release' into main 2023-10-06 20:11:54 +02:00
Brecht Van Lommel c1b4af86b9 Cycles: Speed up principled BSDF when IOR = 1.0
Skip the specular layer of the principled BSDF when IOR=1.0
since it has no visual impact on the material.

Pull Request: https://projects.blender.org/blender/blender/pulls/111586
2023-10-06 20:09:35 +02:00
Alaska 33cbe4c108 Fix Cycles SVM not using IOR Level for Subsurface entry
Make it consistent with OSL.

Pull Request: https://projects.blender.org/blender/blender/pulls/113192
2023-10-06 19:07:59 +02:00
Alaska 61a8d1f7d0 Cycles: Use tabulated Sobol for old files, for better compatibility
This only has an effect when using Cycles debug settings.

Pull Request: https://projects.blender.org/blender/blender/pulls/112553
2023-10-06 19:07:54 +02:00
Jacques Lucke d6f4a9a09b Merge branch 'blender-v4.0-release' 2023-10-06 18:38:07 +02:00
Jacques Lucke b04f006a4c Fix: dynamic node declaration is not resetting update-skip flag 2023-10-06 18:37:46 +02:00
Hans Goudey 5052fe489c Cleanup: Simplify filling constant value per triangle in PBVH draw 2023-10-06 18:33:21 +02:00
Jacques Lucke 57e914fc8a Cleanup: move join geometry functionality to separate file
This allows us to reuse the functionality more easily.
2023-10-06 18:31:44 +02:00
Jacques Lucke 6279be4157 Geometry Nodes: use socket name instead of identifier as debug names
This makes it easier to read generated lazy-function graphs, especially when
there are zones or group nodes, because the socket identifiers on those
are some generated internal name.
2023-10-06 18:31:44 +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
Clément Foucault a09d85cb2a EEVEE-Next: Make the shading lighting panel accessible 2023-10-06 17:51:37 +02:00
Miguel Pozo 026b81ce7c Merge branch 'blender-v4.0-release' 2023-10-06 17:49:15 +02:00
Miguel Pozo c6194afc41 Fix: Workbench: Missing texture flag
Drawing volumes would trigger an assertion after fe39456ba5.
2023-10-06 17:48:40 +02:00
Lukas Tönne 711c9c5553 Fix for wobbly volume object outlines in the viewport
The outlines of volume grids in the viewport are noticeable "wobbly"
when they should simply represent grid boxes. This is especially
noticeable on simple regular grids such as the "Volume Cube" geometry
node output.

The reason is that the outlines generated by taking a triangulated mesh
of the grid boxes and then growing it by successively scaling each
triangle. The offset for each vertex grows proportional to its degree
(number of connected edges). The fix is to divide each vertex's offset
by its degree.

The resulting mesh is much more regular and closer to to 1% desired
growth factor.

Old: ![Screenshot_20230829_155602](/attachments/87fbdca3-fb9d-49d8-b4f5-6780d1c72f79)
New: ![Screenshot_20230829_155648](/attachments/4452c52b-96df-4200-a02f-3d0d8aa8680e)

Pull Request: https://projects.blender.org/blender/blender/pulls/111657
2023-10-06 17:43:07 +02:00
Jacques Lucke 87bf783479 Merge branch 'blender-v4.0-release' 2023-10-06 17:28:14 +02:00
Jacques Lucke 2fdb38f972 Fix: failing string search test 2023-10-06 17:27:48 +02:00
Germano Cavalcante cf93c16775 Fix #112580: Limit Constraint with 'Affect Transform' not working properly in 'World Space'
The problem is observed with the "Limit Distance" and "Limit Location"
constraints.

There is an incorrect usage of `td->mtx` and `td->smtx` when converting
`TransData` space from local to global.

In this case, the code is concatenating matrices instead of converting
the location component space.

Also, these matrices only inform the global transformation components
of rotation and scale. They do not include location.

Since the "Limit Distance" and "Limit Location" constraints only require
the location component, it is not necessary to convert the rotation and
scale components.

So, the solution is to convert the location component space instead of
concatenating matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/112601
2023-10-06 12:19:53 -03:00
Germano Cavalcante 7e078b724a Fix #112580: Limit Constraint with 'Affect Transform' not working properly in 'World Space'
The problem is observed with the "Limit Distance" and "Limit Location"
constraints.

There is an incorrect usage of `td->mtx` and `td->smtx` when converting
`TransData` space from local to global.

In this case, the code is concatenating matrices instead of converting
the location component space.

Also, these matrices only inform the global transformation components
of rotation and scale. They do not include location.

Since the "Limit Distance" and "Limit Location" constraints only require
the location component, it is not necessary to convert the rotation and
scale components.

So, the solution is to convert the location component space instead of
concatenating matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/112601
2023-10-06 17:14:25 +02:00
Jacques Lucke c37faf8c2f Merge branch 'blender-v4.0-release' 2023-10-06 16:41:38 +02:00
Jacques Lucke 0aa91a30dd Fix #113092: take highlighted part of search item into account in more places
When using menu-search, only the last part of a search item is highlighted.
When sorting the search results, this should be taken into account and
the highlighted words should be prioritized.

This was already partially implemented in 56e98f8ba6. Now it's also
taken into account with prefix search. For example, `TC` now prefers
`Input > Texture Coordinate` over `Texture > Checker Texture`.
2023-10-06 16:38:45 +02:00
Jacques Lucke 046155572d UI: use recent search for weighting only if the query is short
The idea is that accessing recent searches is mostly only useful when actually
searching for something very recent, which means that it would show up at the
top even if the query is empty or extremely short. If the user is typing a longer
query, it likely means that what is at the top is not what is actually desired, so
it's better to not take recent searches into account anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/113338
2023-10-06 16:16:07 +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
Miguel Pozo c567f7ccae Merge branch 'blender-v4.0-release' 2023-10-06 15:36:37 +02:00
Miguel Pozo fe39456ba5 Workbench: Fix: Performance Regressions
Optimize Workbench performance so it's on par with the previous
implementation.
Most of these changes are barely noticeable on powerful GPUs,
but can cause a notable performance improvement on old or low-end
hardware.

* Avoid unnecessary texture copies and draw directly to the viewport
   textures.
* Optimize-out depth/stencil reads, using stencil testing instead.
* Avoid using `Texture::clear` and use framebuffer clears instead.
* Avoid framebuffer state changes (always use the same attachments).
* Avoid constant variation of acquired `TextureFromPool`s.

Fix #113010

Pull Request: https://projects.blender.org/blender/blender/pulls/113251
2023-10-06 15:31:44 +02:00
Miguel Pozo 57cfe20e5b EEVEE-Next: Fix DupliObject ObjectKey
Fixed version of #112544 (reverted).

`DRW_drawdata_get` reuses the same `DrawData` for all duplis,
so they all end up using the same `ObjectHandle` and `ObjectKey`,
which breaks motion vectors.

* Don't rely on `DRW_drawdata_get` for storing `ObjectKey`s.
* Simplify `ObjectKey`.

This also solves the issue of objects created "on the fly" always having
the `ID_RECALC_ALL` flag.

Pull Request: https://projects.blender.org/blender/blender/pulls/113252
2023-10-06 15:29:50 +02:00
Jeroen Bakker 1aca58cf16 Vulkan: Enable as Experimental Option
This PR enables vulkan backend as experimental option.
It will only be available in alpha builds on Linux and Windows.

This option is highly experimental and enabled to get some insight
on supported platforms. Don't expect a fully working Blender
yet. Also don't expect it to have usable performance.

**What is known to not work?**

* OCIO textures are not supported on Intel and AMD GPUs. sRGB/Standard is supported
  on those platforms.
* AMD Polaris based GPUs on Linux will generate a crash when drawing the 3d cursor as it
  doesn't support the needed vertex format. Comment out `DRW_draw_cursor` in `DRW_draw_region_info`.
* The colors in the node editor and sequencer are of as sRGB viewports aren't detected correctly.
* The image / UV editor isn't working as many texture formats haven't been tested yet. Some
  tweaks are also needed to do correct depth testing.
* 3D Viewport is known to be flickering. Sometimes workbench doesn't display anything.
* 3D Viewport wireframe will crash as it uses a framebuffer with gaps between color attachments,
  which isn't supported yet. (#113141)
* Rotate the view widget is partially drawn due to incompatible depth clipping.
* GPU Selection isn't working. It is expected to be solved when Overlay-Next will become the
  default engine. For now disable GPU depth picking in the preferences.
* Cycles/EEVEE are known to not work with Vulkan yet. Cycles requires Vulkan Pixel Buffer.
   Cuda <-> Vulkan interop might require a different approach than OpenGL as Vulkan doesn't allow
  importing memory from a Cuda context. EEVEE uses features that aren't available yet in the backend
* Workbench is working, except Workbench shadows.
* EEVEE-Next basics are working. Shadows, lights are known to be not working. Materials/Shading
  works in simple scenes. Changes are expected in EEVEE-Next that will break Vulkan compatibility
  in the near future.
* Systems with multiple GPUs is not expected to work.
* Wayland support is in development and requires some iterations. You can start Blender, but
  the protocols are not aligned yet.
* OpenXR hasn't been modified and is expected to fail.
* The backend is very strict when mis-using the GPU module. In debug builds it may crash
  on asserts.
* Older drivers/GPUs might not have all the features that we require. The workarounds
  for the missing features still need to be implemented.

**A word about performance**

In the project planning we focus first on stability and platform support. The performance of Vulkan is
around 20% of what we want to achieve. The reason is that each command sent to the
GPU is done one at a time. The implementation even waits until we have feedback that the GPU
is idle again.

Geometry is currently stored in System RAM. The GPU will read and cache the data when
accessing geometry. This slows down when using objects with much geometry.
Some performance features like MDI (Multi-Draw-Indirect) hasn't been implemented and
falls back to Single Draw Indirect.

**Why enable it is an experimental option?**

* Ensures that new features are being tested with Vulkan
* Ensure that building with Vulkan is possible on supported platforms
* Get feedback from developers if Vulkan can run on their system or that
  there are special cases that we are not aware of. Main development
  environment has been Linux/X11 with occasionally testing using Windows.
* Validate Add-ons that use the `gpu` module.
* Possible to enable GLSL validation on the buildbot. (Needs more work).
* Does it compile on all machines or does it require more changes to cmake
  config. We expect it to be able to compile without installing the Vulkan SDK.
  The Vulkan SDK is a very powerful tool, but only when actually doing GPU
  development. Otherwise it is an overhead which slows down other
  activities.

**How can the backend be enabled?**

Currently the Vulkan backend can be enabled per Blender session by starting
using the command line argument `--gpu-backend vulkan`. In the future, when
the backend is more mature, we will add a user preference to switch between
OpenGL and Vulkan.

Pull Request: https://projects.blender.org/blender/blender/pulls/113057
2023-10-06 15:24:21 +02:00
Jeroen Bakker 9a654c04de Vulkan: Wayland Windowing
Wayland WSI would crash the system when used. The reason is that the
wayland vulkan WSI doesn't provide windowing support. Vulkan gets full access
to the desktop of the OS and it is the responsibilty of the application to
do the right thing.

For OpenGL Wayland proved basic windowing support using `wayland-egl.h`.
Which essentially is a tiny wrapper that keeps track of the window position and
size.

This PR changes a few things to make the Wayland surface usable:

- Do not load debug extensions when blender isn't started with
  `--debug-gpu`.
- Recreate swapchain images when surface size changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/113007
2023-10-06 14:45:09 +02:00
Jeroen Bakker 44882ceb7b EEVEE-Next: Several Fixes Reflection Probes Workflow
This fixes several issues related to using reflection probes in EEVEE-Next.

- When using a single sample, the reflection probes weren't always updated.
- Composite world background in reflection probes
- Removing reflection probes wasn't working
- Update UBO when world and reflection probes are active in the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/113347
2023-10-06 14:43:19 +02:00
Iliya Katueshenock 1a30e0597b Fix #113095: deduplicate attributes in search
Pull Request: https://projects.blender.org/blender/blender/pulls/113097
2023-10-06 14:41:33 +02:00
Lukas Tönne 642ad4110b Merge branch 'blender-v4.0-release' 2023-10-06 14:34:08 +02:00
Lukas Tönne dd9c906840 Fix #113134: Use a valid socket in node groups for custom nodes
Custom node trees may not suppor the default NodeSocketFloat socket
type. In case this default type is not supported, search all registered
socket types and pick the first one that is supported by the custom
node tree.

Pull Request: https://projects.blender.org/blender/blender/pulls/113330
2023-10-06 14:33:35 +02:00
Hans Goudey 73e345f85f Sculpt: Draw color attribute during dynamic topology sculpting
Previously the colors were just uploaded as white, the default value.
Even if they aren't interpolated properly, it is still helpful to see
the colors. At worst, the unaffected parts of the mesh will still look
right.

A previous commit made vertex colors interpolate properly, but
face corner colors will still reset to their default value.

As a reminder, only color and byte color attributes are currently
supported for the specialized PBVH drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/113333
2023-10-06 14:31:25 +02:00
Sergey Sharybin 491bd7fff0 Cleanup: Remove redundant mask interpolation in dyntopo
Since the recently added support for vertex interpolation the
manual mask interpolation is not needed anymore.
2023-10-06 14:31:23 +02:00
Sergey Sharybin 2a7e06b98d Sculpt: Add vertex interpolation for the dynamic topology
This change makes it so the newly added vertices have properly
interpolated attributes. This includes things like vertex colors.
New vertices are created by splitting edges, so the interpolation
mixes between the edge's two vertices equally.

Co-Authored-By: Hans Goudey <hans@blender.org>
2023-10-06 14:31:23 +02:00
Sergey Sharybin 1885116a9a Fix: Noisy false-positive assert in dyntopo sculpt
This assert triggers whenever dyntopo is used, even when all the
objects and environment is pristine. The semantic of the assert
is not very clear either.

Avoid having a false-positive trigger which gets in the way of any
development in the area.
2023-10-06 14:31:23 +02:00
Jacques Lucke ac4fa638c1 Merge branch 'blender-v4.0-release' 2023-10-06 14:00:54 +02:00