Commit Graph

126702 Commits

Author SHA1 Message Date
Brecht Van Lommel
8ff98504ea Refactor: add single entry point for creating USD materials
To be used by both USD and Hydra.
2023-08-07 16:21:08 +02:00
Brecht Van Lommel
6e4b1f78cd Refactor: move default initialization of USDExportParams to definition
Matching the default file export settings.
2023-08-07 16:20:05 +02:00
Brecht Van Lommel
288fe44d4c Refactor: move USD hierarchy iterator out of export context
With goal of using this context in Hydra where there is no hierachy iterator.
2023-08-07 16:20:05 +02:00
Sergey Sharybin
d7886ee759 Color management: Further relax threshold for sRGB detection
Apparently, the SSE optimization in the OCIO is not nearly as accurate
as a naive implementation. For example, exponent transform of 1 gives
result of 1.000024.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110895
2023-08-07 15:53:03 +02:00
Brecht Van Lommel
fa34d893f1 Fix wrong render test comparison for Storm USD and Hydra 2023-08-07 15:13:03 +02:00
Amelie Fondevilla
242e94acec GPv3: Fix floating-point error in the hard eraser tool.
The hard eraser tool was not working properly when trying to erase closely to existing points, leading either to the insertion of various close points in the stroke, or to deleting a whole stroke segment.

This was due to the differenciation between the computation of the intersections between the eraser and the stroke, and the computation of whether a point lie inside the eraser, which lead to inconsistencies in the interpretation of the result.

This patch solves this issue by  :
 * computing if the point is inside the eraser based on the result of the intersection, to avoid unconsistencies,
 * computing with integers and not float (we are in screen space anyways),
 * adding the ability for source points to be cuts, and not only the inner intersections.

Pull Request: https://projects.blender.org/blender/blender/pulls/110801
2023-08-07 15:11:34 +02:00
Brecht Van Lommel
3549e1fd40 Fix mistake in bpy.types.HydraRenderEngine API example 2023-08-07 15:09:51 +02:00
Jeroen Bakker
b1357f6790 Vulkan: Error When Creating Windows Offscreen Context
Thanks to UPBGE developers to point this one out.

Pull Request: https://projects.blender.org/blender/blender/pulls/110892
2023-08-07 14:58:06 +02:00
Jeroen Bakker
8de4b5a5ed Vulkan: Shader Compilation Errors
Fixing several shader compilation errors when using the vulkan backend.

* `eevee_lightprobe_irradiance_load_comp`: local variables used same name as push constants.
* `compositor_summed_area_table_compute_complete_y_prologues`: loop with texture_size call

Pull Request: https://projects.blender.org/blender/blender/pulls/110891
2023-08-07 14:49:08 +02:00
Jeroen Bakker
6273a2dca4 GPU: Disable Multi-Bindings for AMD Official Drivers
AMD official driver reports that they support multi-bindings, but
in the cases we are using it it fails. This is noticable in Eevee-
next where the shadows aren't rendered.

This fix disables multi-bindings for images for AMD Official drivers
n all OS's. Textures will still use multi-bindings.

Pull Request: https://projects.blender.org/blender/blender/pulls/110882
2023-08-07 14:47:46 +02:00
Sergey Sharybin
d50b139b06 Color management: Relax threshold for sRGB detection
The current core was only detecting sRGB transform when it is defined
as sRGB->Linear using srgb.spi1d. If it is defined as an inverse of
Linear->sRGB using srgb_inv.spi1d, or as an analytical formula using
ExponentWithLinearTransform then the code did not detect the color
as sRGB on anything by Apple Silicon platform.

The naming of the checks could be improved to make it more clear that
the check is only used to allow lossless access to 8bit sRGB textures.

Ref #110685

Pull Request: https://projects.blender.org/blender/blender/pulls/110889
2023-08-07 14:32:16 +02:00
Campbell Barton
0f120b6364 Fix hydra API, incorrect Python API handling of invalid arguments
Exceptions must return nullptr, not None.
2023-08-07 22:10:35 +10:00
Campbell Barton
b086bd411e Cleanup: use listbase macros 2023-08-07 22:02:19 +10:00
Campbell Barton
ae4286d12b Cleanup: function style casts for C++, nullptr & other minor changes 2023-08-07 22:02:15 +10:00
Bastien Montagne
f3537d4154 I18N: Updated UI translations from svn trunk (r6659). 2023-08-07 11:27:41 +02:00
Nathan Vegdahl
d4d0daa934 Fix #110169: nearly flat normalized fcurves jump around in editor
The root cause was a classic fixed-size epsilon issue.  The code that
checked if an fcurve was effectively flat, and thus shouldn't be
normalized, used a fixed-size epsilon that was reasonable for values
close-ish to zero, but didn't work well for values >= 1.0.

This patch addresses the issue by introducing a new function
`ulp_diff_ff()` that robustly computes the number of floating point
steps between two floats, and using that to ensure that a minimum
number of representable floats exist between the min/max values
of the curve.  This approach scales appropriately up and down to
both huge and tiny values.

This patch also updates the existing `compare_ff_relative()` function
to use the new robust ulps code for the ulps-based part of its
comparison, resolving an issue documented in its unit tests where
it behaved poorly for values close to zero.

Pull Request: https://projects.blender.org/blender/blender/pulls/110796
2023-08-07 10:53:01 +02:00
Lukas Tönne
14bc097015 Nodes: Remove the experimental "node panels" feature
This feature is going to be replaced with a more thorough refactoring
of the node group interface UI, which has actual node drawing support
and a new API for integration of panels into nodes.

Design task: #109135
Implementation: #110272

Pull Request: https://projects.blender.org/blender/blender/pulls/110803
2023-08-07 10:40:29 +02:00
Jeroen Bakker
8c0591459e Cleanup: Make Format 2023-08-07 09:20:26 +02:00
Alaska
52ed6a216f Fix #110255: Cover up CPU/GPU differences with small suns in light tree
This pull request covers up a subtle difference between the CPU and GPU
when rendering with a light tree. Specifically a case where the user
has a sun light with a small angle.

The difference was caused by the dot() function being different between
CPU and GPU backends, with the GPU showing more meaningful
floating-point precision losses when working with small suns.

Pull Request: https://projects.blender.org/blender/blender/pulls/110307
2023-08-07 07:29:14 +02:00
Campbell Barton
58e4a7ae2b Cleanup: minor changes for add-on & module listing
Use list-comprehension for addon_utils.paths and other minor changes.
2023-08-07 10:46:45 +10:00
Bastien Montagne
93728fee53 LibOverride: Extend unittest to cover more advanced/complex cases.
These tests now have basic coverage of:
* Linking data and creating liboverride hierarchy from it.
* Linking that liboverride again.
* Creating liboverride of liboverride.
* Modifying data hierarchy in the library, and testing (recursive)
  resync of it.
* ID name collision handling (between modified linked data and
  existing overrides).
2023-08-06 23:11:19 +02:00
Bastien Montagne
f32f775e5b Fix (unreported) missing 'need resync' detection in overrides of overrides.
In case the reference data of a liboverride is aslo a liboverride, and
is already tagged for resync, the override of the override also needs to
be resynced.

Note that linked overrides are guaranteed to be processed by apply code
(and hence get checked for needed resync) before the liboverrides using
them.
2023-08-06 23:11:18 +02:00
Clément Foucault
cc34a0ae2e EEVEE-Next: Irradiance Volume: Allow object copy
This copies the baked lighting data during object
duplication. This allows library overrides to
work as expected on irradiance volumes.
2023-08-06 21:30:30 +02:00
Clément Foucault
453cc9b84a EEVEE-Next: Irradiance Pool Size
Add pool size to allow predictable memory
footprint.
2023-08-06 20:30:08 +02:00
Clément Foucault
5d2e351baf EEVEE-Next: Irradiance Grid Compositing
This allows irradiance volume that have less priority to
transfer lighting to the ones with higher priority.
Meaning interactive relighting from the world or
lookdev HDRI is now supported if the world isn't baked
inside the volume data.

This should improve workflow with larger scenes and
interactivity with light setups.

To help setup with dynamic objects, this patch introduce
3 new parameter to remove some components from the
irradiance grids.

Pull Request: https://projects.blender.org/blender/blender/pulls/110838
2023-08-06 16:30:12 +02:00
Clément Foucault
5ac026c23a EEVEE-Next: Irradiance Volume validity weighting
This avoid samples inside walls to contribute to
the interpolated lighting. This help preventing
light leaking.

Pull Request: https://projects.blender.org/blender/blender/pulls/110851
2023-08-06 13:43:17 +02:00
Campbell Barton
8b8fe49d34 License headers: add SPDX-FileCopyrightText 2023-08-06 18:59:05 +10:00
Campbell Barton
845a5146e7 Cleanup: avoid term '_len' for buffer size 2023-08-06 16:09:04 +10:00
Campbell Barton
9e3dc02bed Cleanup: naming consistency for find functions
- find_from_name -> find_by_name.
- find_from_index -> find_index.

This matches naming used elsewhere in Blender API's.
2023-08-06 15:57:24 +10:00
Campbell Barton
0701c65d93 Cleanup: use DNA_struct_default_alloc utility function, doxy section 2023-08-06 15:47:50 +10:00
Clément Foucault
d870f9e841 EEVEE-Next: Add back visibility group for irradiance volumes 2023-08-05 20:23:38 +02:00
Clément Foucault
46a17df415 Fix EEVEE-Next: Incorrect Irradiance Volume sorting
`world_to_grid_transposed` contains the resolution of
the grid and is also transposed which isn't what we
need for computing the volume.
2023-08-05 19:47:16 +02:00
Campbell Barton
b879a4f2d8 Cleanup: replace MEM_callocN with MEM_mallocN when overwritten afterward
Also pair allocation with memcpy calls.
2023-08-05 20:06:42 +10:00
Jacques Lucke
9150f6d1a9 BLI: refactor string search to use C++ API
The API becomes much simpler by using C++. Also, it removes the need
for manual memory management.

Pull Request: https://projects.blender.org/blender/blender/pulls/110826
2023-08-05 10:54:23 +02:00
Jacques Lucke
b41c6489bc Cleanup: set node struct ui names at run-time
The goal is to get to closer to removing `NOD_static_types.h` and to define all/most
aspects of a node in the node file itself instead. Data defined in node files is not
available when rna structs are created currently, because that happens in a preprocessing
step. This patch moves part of what was defined in `rna_nodetree.cc` to `node.cc` which
makes it easier to replace when `NOD_static_types.h` is removed.

Pull Request: https://projects.blender.org/blender/blender/pulls/110824
2023-08-05 09:12:27 +02:00
Jacques Lucke
4719caf660 Cleanup: move BLI_string_search.h to C++ 2023-08-05 08:52:29 +02:00
Jacques Lucke
607d203b98 Cleanup: fix compilation errors and warnings 2023-08-05 08:31:31 +02:00
Campbell Barton
19c3d7ee7d Tools: add use_listbase_foreach_macro edit to code_clean utility
Replaces loops on list bases with LISTBASE_FOREACH &
LISTBASE_FOREACH_BACKWARD.
2023-08-05 14:42:42 +10:00
Campbell Barton
a81063e4a1 Cleanup: use const mtex for TexCallData & multitex_* functions 2023-08-05 14:26:29 +10:00
Campbell Barton
bf2b1f7e01 Cleanup: simplify enum typedefs 2023-08-05 14:22:48 +10:00
Campbell Barton
a86ef5d3f6 Cleanup: minor changes to logic that shows render window
- Rename find_area_showing_r_result -> *find_area_showing_render_result.
- Only set the return window argument when the render area is found
  instead of leaving this value set to the last window.
- Use doxygen sections.
2023-08-05 14:05:43 +10:00
Campbell Barton
9ea8477c23 Cleanup: various non-functional C++ changes 2023-08-05 13:57:29 +10:00
Campbell Barton
7f34ad736a Cleanup: spelling in comments 2023-08-05 13:54:25 +10:00
Hans Goudey
07019e7ef5 Cleanup: Remove more struct keywords from C++ headers 2023-08-04 22:47:29 -04:00
Campbell Barton
7e06454663 Fix build error from references to unknown types 2023-08-05 12:23:01 +10:00
Hans Goudey
88de2f25ed Cleanup: Remove unnecessary struct keyword from editors includes 2023-08-04 22:15:25 -04:00
Hans Goudey
ffe4fbe832 Cleanup: Move editors headers to C++
See #103343

Pull Request: https://projects.blender.org/blender/blender/pulls/110820
2023-08-05 02:57:52 +02:00
Hans Goudey
c15d391e86 Cleanup: Various cleanups in newly C++ headers
Mostly remove unnecessary struct and typedef keywords.
Move a few more small wm headers to C++ as well.
2023-08-04 17:55:14 -04:00
Hans Goudey
bc8c892c65 Cleanup: Move WM headers to C++
Also move a few more headers that included WM headers.

Pull Request: https://projects.blender.org/blender/blender/pulls/110815
2023-08-04 23:11:22 +02:00
Hans Goudey
aa5b142e98 Cleanup: Move fsmenu.c to C++
See #103343

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Pull Request: https://projects.blender.org/blender/blender/pulls/110797
2023-08-04 22:15:03 +02:00