Commit Graph

100206 Commits

Author SHA1 Message Date
Jeroen Bakker
c71d198dfd Vulkan: Mipmap Generation
Implement Mipmap generation for the Vulkan backend.
This patch implements `GPU_texture_update_mipmap_chain`.

Pull Request: https://projects.blender.org/blender/blender/pulls/108699
2023-06-08 09:15:07 +02:00
Jeroen Bakker
2231b819a5 Vulkan: Workaround for 24bit depth component
Some vulkan platforms don't support 24bit depth components. In this
case we will allocate float depth component. During readback the data
should be converted back to what is expected.

Pull Request: https://projects.blender.org/blender/blender/pulls/108698
2023-06-08 08:53:12 +02:00
Campbell Barton
f9e0f873bd Cleanup: move text editor files to C++
A workaround for over 128 else-if's in a row was needed for MSVC
as it caused error C1061.
2023-06-08 16:04:00 +10:00
Chris Blackbourn
55f9abfd3c Merge branch 'blender-v3.6-release' 2023-06-08 14:26:21 +12:00
Chris Blackbourn
9d25c4aaa6 Fix #104513: UV packing produces different results on x86 vs apple silicon
During uv unwrapping and uv packing, certain floating point algorithms
have extreme sensitivity to round-off errors. These can produce very
different layouts even when given inputs which are only slightly different.

The root cause is that the two main types of CPUs used to run Blender,
namely x86 and Apple Silicon, produce slightly different results on some
math functions, including `sinf()`, `cosf()` and `atan2f()`.

* sinf(0.8960554599761962890625) = 0.780868828296661376953125 (Intel i7)
* sinf(0.8960554599761962890625) = 0.78086888790130615234375 (Apple M1)

This fix, and others that came before it [0], improve accuracy by using
double-precision to hide the differences between the CPUs.

[0] e.g. 0eba9e41bf
[1] See also #107829
2023-06-08 14:23:44 +12:00
YimingWu
116cbcbc86 Fix #108229: Wider tolerance shuffling NLA strips
In `transdata_get_time_shuffle_offset_side`, the tolerance for
terminating the loop is too tight, sometimes it will lead to a infinite
loop due to non-integral start/end values. Now fixed.

Pull Request: https://projects.blender.org/blender/blender/pulls/108257
2023-06-08 04:15:45 +02:00
Chris Blackbourn
c9988ffc6a Cleanup: format 2023-06-08 13:19:08 +12:00
Lukas Stockner
a89aa0c731 Merge branch 'blender-v3.6-release'
Slightly messed-up history due to a push conflict on
blender-v3.6-release, sorry about that.
2023-06-08 03:14:49 +02:00
Chris Blackbourn
e08dde04c1 Fix: Invalid UV Packing on windows debug build
Uninitialized variables can produce bad results during UV packing,
including UVs that are NaN or infinite.
2023-06-08 13:05:35 +12:00
Campbell Barton
7a1e2c4d0c Cleanup: spelling in code 2023-06-08 10:43:55 +10:00
Campbell Barton
9c28eebc9a Cleanup: minor clarifications & corrections, use doxygen comments
Also replace full URL's in with #ID.
2023-06-08 10:43:55 +10:00
Campbell Barton
abca216a1d Cleanup: use C++ comments for disabling code
[0] used doxygen comment to disable code. Use '//' instead &
move the old doc-string to the newly added flag.

[0]: 7dc85e68fe
2023-06-08 10:32:00 +10:00
Campbell Barton
47189c5253 Docs: improve doc-strings for window size & startup file
Document the purpose of zero sized window & when wm_init_state is used.
Noticed when looking into #108643.
2023-06-08 10:32:00 +10:00
Campbell Barton
989b5de8e9 Cleanup: remove unused window states, add doc-strings
Note that the GHOST_TWindowState is stored in DNA & that
values shouldn't be changed.
2023-06-08 10:32:00 +10:00
Brecht Van Lommel
3ca1e828e2 Cleanp: compiler warnings 2023-06-07 20:09:30 +02:00
Brecht Van Lommel
ff7dc64234 Cleanup: remove unused USD plugin path registration
It is now in a location where USD automatically picks it up.
2023-06-07 20:06:22 +02:00
Bastien Montagne
32bbfbb06e Fix #108643: Blender window does not open to full dimensions of the desktop.
When opening 'homefile' (i.e. startup or factory startup) at Blender
start (i.e. when there is no existing WM yet), the size of the windows
in the newly read WM is reset to zero, which will then cause `WM_check`
to re-size them the the maximum possible size on current monitor.

Regression from ebb5643e59.
2023-06-07 20:01:11 +02:00
Bastien Montagne
16d077e7e4 Cleanup: Comment to relevant other code in versioning for 400. 2023-06-07 19:56:55 +02:00
Brecht Van Lommel
5f8391ca2d Fix anisotropic BSDF versioning code being in the wrong place
Ref #104445
2023-06-07 18:04:51 +02:00
guishe
67193e4e32 UI: Remove duplicate subsequent separators in Properties Navbar Tabs
Remove duplicate subsequent separators between tabs in Properties Navbar

Pull Request: https://projects.blender.org/blender/blender/pulls/107693
2023-06-07 18:01:54 +02:00
Bastien Montagne
cb75792c4c Merge branch 'blender-v3.6-release'
Conflicts:
	source/blender/blenkernel/BKE_blender_version.h
	source/blender/blenloader/intern/versioning_300.cc
2023-06-07 17:11:56 +02:00
Bastien Montagne
3405472672 Cleanup: correct comment for .empty. versioning block. 2023-06-07 17:05:09 +02:00
Bastien Montagne
a1e5d57b59 Cleanup/fix: Add file subversion bump to 3.6 for 'unversioned' versioning.
`blo_do_versions_300` still had some 'no version number' versioning code
at its end, should have been handled when 3.6 branch was created.
2023-06-07 17:01:33 +02:00
Germano Cavalcante
c310cf6a2f Merge branch 'blender-v3.6-release' into main 2023-06-07 11:59:11 -03:00
Germano Cavalcante
981dd12394 Fix #108665: Project 3D cursor on Geometry not working in X-ray
Caused by 98bfa8d458

Occlusion must consider several factors:
- The `Viewport Display` > `Display As` setting  of the object.
- The X-Ray mode of the scene.
- Whether only Snap to Face is being used.
- Whether Snap is set to Cage (always transparent) in edit mode.
- Whether the object is hidden.

In the case of Cage, the final geometry should be utilized for occlusion.
However, to prevent excessive and risky modifications, it was followed
the same approach as before and verified the `Display As` setting of
the object.
2023-06-07 11:56:53 -03:00
Sergey Sharybin
97197bd53e BLI: Add more per-element functions for vectors
This includes square root and reciprocal, and their safe versions.

For the reciprocal use name rcp, which matches Cycles and allows
to implement the same function for per-element operation on matrices.

Pull Request: https://projects.blender.org/blender/blender/pulls/108705
2023-06-07 15:15:37 +02:00
Sergey Sharybin
db3a96492f BLI: Use math:: functions for per-element vector operations
Use math functions from blender::math for those operations, which
allows to device vectors of non-standard types.
2023-06-07 15:15:35 +02:00
Philipp Oeser
963f8893a5 Merge branch 'blender-v3.6-release' 2023-06-07 14:50:13 +02:00
Philipp Oeser
7b8bbabece Fix #106155 : Hair dynamics not working well when converted from curves
In particular, the root was not sticking to mesh with hair dynamics.
Reason for this is missing HairKey weight upon conversion (everything
had zero weight). This then can not be corrected (since weight tool does
not allow to paint on roots).

So now, give the hair a default 1.0 to 0.0 weight gradient upon
conversion [which is in line with the default weight distribution for a
hair particle system].

Pull Request: https://projects.blender.org/blender/blender/pulls/108651
2023-06-07 14:49:20 +02:00
Omar Emara
f06929766b Realtime Compositor: Implement Movie Distortion node
This patch implements the Movie Distortion node for the realtime
compositor. The distorted coordinates are computed and cached for a
particular tracking camera distortion parameters. So for expensive
distortion models, the first run will take some time to compute, but
subsequent runs will be fast.

An alternative implementation would be to implement each of the
distortion modes in the shader, but that was decided against for a few
reasons:

1. We want to hide the implementation details of the distortion models,
   since it is provided through an external library (Libmv).
2. Some distortion models are expensive to solve accurately, and can be
   quite slow to solve each time the shader runs.
3. The typical usage of the node does not involve interactive editing of
   the distortion parameters, rather, the parameters are computed during
   camera calibration, so caching seems most fitting in that case.

Pull Request: https://projects.blender.org/blender/blender/pulls/108230
2023-06-07 14:45:46 +02:00
Brecht Van Lommel
0c2baf39c2 Cleanup: compiler warnings 2023-06-07 14:33:28 +02:00
Hans Goudey
decf089e06 Cleanup: Remove unused deprecated socket type
"SOCK_MESH" was used for a particle nodes experiment,
never in a released version of Blender as far as I know.
2023-06-07 08:31:46 -04:00
Brecht Van Lommel
65fc10bd33 Compositor: first steps to use realtime compositor for renders
* Enable "Experimental Compositors" in preferences, then choose
  Realtime GPU execution mode in node editor sidebar.
* Only supports combined pass input and Render Result combined output.
* No viewer nodes, no file output nodes, and no node previews yet.

Pull Request: https://projects.blender.org/blender/blender/pulls/108629
2023-06-07 14:17:48 +02:00
Brecht Van Lommel
db43a8fb57 Refactor: realtime compositer context changes for render compositing
* Provide render data, node tree and color management directly instead
  of going through scene, as these may be modified by the render pipeline.
  Also better for cached texture hits this way.
* Change legacy pass type to pass name.
* Skip file output node when not doing final render.
* Gracefully handle incomplete render results.

Pull Request: https://projects.blender.org/blender/blender/pulls/108629
2023-06-07 14:17:37 +02:00
Campbell Barton
6704881708 Cleanup: spelling in comments 2023-06-07 21:47:45 +10:00
Alaska
7285f13163 Cycles: Fix Principled BSDF tooltip for MultiGGX
In a recent commit the MultiGGX code was changed, and along with it
the tool tip for MutliGGX. This commit fixes the issue where the
tooltip was not updated for the MultiGGX option in the Principled BSDF.

Pull Request: https://projects.blender.org/blender/blender/pulls/108589
2023-06-07 13:46:13 +02:00
Bastien Montagne
5399c7a79f BlendFile versioning: Fix mistake (inconsistency) in 8e059b569b.
File version was bumped to (400, 5), but new doversion check was done
against (400, 4).
2023-06-07 12:17:34 +02:00
Bastien Montagne
ace8875014 Merge branch 'blender-v3.6-release' 2023-06-07 11:46:20 +02:00
Bastien Montagne
7ceb33e06e I18N: Revert part of d95486af95 removing check for main thread.
Part of the checks to see if translating a UI string is allowed or not
is that current thread is the main one. This was a requirement years ago
of the Boost backend for translations.

Not sure whether this can be removed or not now, but it needs to be
carefully checked, done it as its own commit, and not in a beta release
branch. ;)

Sorry for the noise, totally missed this during the patch review
yesterday.
2023-06-07 11:31:34 +02:00
Philipp Oeser
288460aded Merge branch 'blender-v3.6-release' 2023-06-07 11:21:49 +02:00
Philipp Oeser
c51467cd4c Fix #108096: UI: copy-paste buttons can change source properties
Pasting numerical array buttons happens with `Ctrl + Alt + V`.
Holding `Alt` also triggers uiSelectContext, so having other nodes/
objects etc. selected while doing this would try to copy the pasted
values back to other objects (possibly to the ones you pasted from) and
that happens relative to the original value, so the value actually
changes.

NOTE: the `Ctrl + Alt + V` shortcut can also be used on non-array buttons, so was an issue for them as well.

To prevent the "copy-to-selected" behavior, refine the `IS_ALLSELECT_EVENT` macro to be more specific.

Pull Request: https://projects.blender.org/blender/blender/pulls/108270
2023-06-07 11:19:05 +02:00
Campbell Barton
96bfcd0597 Cleanup: rename __SOCK_MESH to SOCK_MESH_DEPRECATED
Double underscores didn't communicate that this was deprecated,
and are typically for internal or platform defined identifiers and
shouldn't be used for public API's.
2023-06-07 17:53:08 +10:00
Jeroen Bakker
b7963d247c Vulkan: Low Precision Float Conversion
This PR adds conversion template to convert between Low Precision float
formats. These include Binary32 floats and lower. It also adds support
to convert between unsigned and signed float formats and float formats
with different mantissa and exponents.

Additionally overflows (values that don't fit in the target float
format) will be clamped to the maximum value.

**Reasoning**:
Up to now the Vulkan backend only supported float and half float
formats, but to support workbench, 11 and 10 unsigned floats have to be
supported as well. The available libraries that support those float
formats targets scientific applications. Where the final code couldn't
be optimized that well by the compiler.

Data conversion for color pixels have different requirements about
clamping and sign, what could eliminate some clamping code in other
areas in Blender as well. Also could fix some undesired overflow when
using pixels with high intensity that didn't fit in the texture format
leading to known artifects in Eevee and slow-down in the image editor.

**Future**
In the future we might want to move this to the public part of the GPU
module so we can use this as well in other areas (Metal backend), Imbuf clamping
See 3c658d2c2e69e9cf97dfaa7a3c164262aefb9e76 for a commit that uses
this and improves image editor massively as it doesn't need to reiterate over
the image buffer to clamp the values into a known range.

Pull Request: https://projects.blender.org/blender/blender/pulls/108168
2023-06-07 07:50:04 +02:00
Jeroen Bakker
934111caf6 Eevee-next: Fix Background When Not On Origin
Backgrounds in Eevee-next were different compared to Eevee-legacy.
Only when viewed from the world origin the background matched.

This change will make sure that the results of both engines matches.

Pull Request: https://projects.blender.org/blender/blender/pulls/108509
2023-06-07 07:48:01 +02:00
Campbell Barton
1251b7c400 Text: always use TEXT_OT_jump_to_file_at_point for jumping to source
Now the operator is used for both the internal & external editor,
so there is no need for the caller to call this operator only when
the preferences are set.
2023-06-07 15:28:09 +10:00
YimingWu
0a891184fa Fix #107789: Prevent area maximizing when dragging
Calling screen maximize while dragging could lead to UI layout change
which affects context, this lead to crashes in the icon drawing and
selection code. This patch prevents maximize operator from running if
dragging is in progress.

Might need to look into why `drag->imb->rect` is None immediately after
calling maximize, we might want it to work since it's sometimes
more convenient to drag then put into a big recieving box. But since
`wmDropBox` is predetermined, this can be a somewhat problematic.

Pull Request: https://projects.blender.org/blender/blender/pulls/107803
2023-06-07 06:21:01 +02:00
guishe
e16ec95a16 UI: Add a custom text editor preference
Add a user preference to set up a custom text editor for editing text
files with the "Edit Source" action in the UI context menu.

- An operator TEXT_OT_jump_to_file_at_point has been added.
- A custom editor can be set in the user preferences.
- A preset has been included for "Visual Studio Code".
- When the editor is not set, use Blender's internal editor.

Ref !108299.
2023-06-07 14:09:19 +10:00
Campbell Barton
3b634d6f7f Merge branch 'blender-v3.6-release' 2023-06-07 13:40:32 +10:00
Campbell Barton
51c15ec933 Merge branch 'blender-v3.6-release' 2023-06-07 13:39:36 +10:00
Campbell Barton
c0bfb81e04 Fix material paste setting the nodetree's owner_id to null
Resolves assert in debug builds when changing the material color
after pasting.
2023-06-07 13:32:27 +10:00