Commit Graph

21 Commits

Author SHA1 Message Date
Bastien Montagne 65a6350250 Merge branch 'blender-v4.0-release' 2023-10-23 12:13:57 +02:00
Damien Picard c7a6ede996 Fix #113981: ID plural names using spaces instead of underscores
Translation markers `N_()` were added to IDs' plural names in !113912.
I also renamed some of those because I thought there were only display
names.

This commit reverts the renaming, leaving only the addition of the
markers.

Pull Request: https://projects.blender.org/blender/blender/pulls/114030
2023-10-23 12:05:28 +02:00
Bastien Montagne 3aa5644751 Merge branch 'blender-v4.0-release' 2023-10-19 21:42:26 +02:00
Damien Picard e3fc935349 I18n: disambiguate and extract a few messages
Extract:
- Sculpt filter types from the Sculpt menu. Some of these types use a
  custom label, different  from those defined in the operator RNA,
  which was never extracted.
- "Today" and "Yesterday" from the file browser modification date.
- All name_plural from IDs, as these are used in the UI to list which
  data block is to be removed, when calling outliner.orphans_purge.

Disambiguate:
- "Area", meaning the measurement of a surface as opposed to a place.

Some messages reported by Satoshi Yamasaki in #43295.

Pull Request: https://projects.blender.org/blender/blender/pulls/113912
2023-10-19 21:39:58 +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
Hans Goudey 3db523ab3e Cleanup: Move BLO headers to C++
Except for BLO_readfile.h, which is still included by C files.

Pull Request: https://projects.blender.org/blender/blender/pulls/111610
2023-08-28 15:01:05 +02:00
Bastien Montagne b53c7a804a Readfile: Replace the 'lib_link' specific code by generic usage of foreach_id.
The `lib_link` callback cannot always be fully replaced/removed, as in
some case it is also doing some validation checks, or data editing based
on the result of lib_linking internal ID pointers.

The callback has been renamed for that purpose, from `read_lib` to
`read_after_liblink`. It is now called after all ID pointers have been
fully lib-linked for the current ID, but still before the call to
`do_versions_after_linking`.

This change should not have any behavioral effect. Although in theory
the side-effect of this commit (to split lib linking itself, and the
validation/further processing code) into two completely separated steps
could have some effects, in practice none are expected, and tests did
not show any changes in behavior either..

Part of implementing #105134: Removal of readfile's lib_link & expand code.
2023-08-24 16:33:31 +02:00
Bastien Montagne 8bb5916183 Readfile: Replace the 'expand' specific code by generic usage of foreach_id.
The `expand` callback is 'trivial' to replace, since it is only iterating
over ID pointers and calling a callback.

The only change in behavior here is that some pointers that were not
processed previously will now be.

In practice this is not expected to have any real effect (usually
the IDs used by these pointers would have been expanded through other
usages anyway). But it may solve a few corner cases, undocumented issues
though.

Part of implementing #105134: Removal of readfile's lib_link & expand code.
2023-08-23 16:44:56 +02:00
Bastien Montagne a083e1cd0f Cleanup: Remove unused `image` Image pointer from LigthPrope data.
This pointer was fully unused, no point in keeping it around.
2023-08-17 18:57:54 +02:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Bastien Montagne 6a79a6a24a Cleanup/Refactor: Move animdata read/write code into generic ID handling.
There is no reason at all for each ID read/write callbacks to have to
deal with this generic, common data explicitely. Generic ID read/write
code is the place to handle such data (just like asset, liboverride,
etc. data are handled already).

Note behavioral change expected here.
2023-08-14 16:30:53 +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 0dc3318ffd EEVEE-Next: Irradiance Bake: Virtual Offset
Implement capture point bias. This offsets the capture
points to reduce the amount bad capture locations (i.e.:
inside objects, near walls etc...).

Two new parameters are added:
- Capture Surface Bias: Ensure a minimum distance between
capture points and surrounding geometry. This is expressed as the
relative distance between two capture point. Requires re-bake
to take effect.
- Capture Escape Bias: Moves capture points enclosed inside
objects above the nearest surface. This bias defines how far a
capture point can be moved for escaping the object. This is
expressed as the relative distance between two capture point.
Requires re-bake to take effect.

This is called virtual offset in the reference material.

A quick prepass runs before the baking to offset the samples away
from any surface that could potentially make bad samples.

In order to speedup the process, we create cluster list of surfels
near each irradiance grid point. This allow access to neighboring
surfels that can contribute to the virtual offset which should
never be more than half a cell wide.

Pull Request: https://projects.blender.org/blender/blender/pulls/110355
2023-08-03 16:47:05 +02:00
Clément Foucault 8e33b20de9 EEVEE-Next: Irradiance Bake: Add validity based dilation
Implement invalid sample points filling. Improves invalid regions
but introduce light leak.

Grid sample points are considered invalid if they have a ratio of
front-face ray hit under the given threshold. This is a post-processing
pass on the baked lighting that fills dark regions produced by
invalid sample location (e.g.: inside walls) with valid neighbor
samples data.

Two new parameters are added:

- Dilation Threshold: Validity threshold under which grid samples are
considered invalid. Invalid samples will gather valid lighting data
from valid neighbors inside the dilation radius.
- Dilation Radius: Radius of the dilation process. Expressed in grid
sample distance.

The validity of each point is progressively refined just like the
lighting data during the baking process.

The dilation process is implemented as a post-processing pass during
the loading of the grid data into the irradiance atlas. This allows
live tweaking the dilation parameters.

Pull Request: https://projects.blender.org/blender/blender/pulls/110386
2023-08-03 15:48:33 +02:00
Campbell Barton 81ee130063 Cleanup: use C++ system headers
Apply clang-tidy modernize-deprecated-headers to source/
2023-07-22 11:27:25 +10:00
Sergey Sharybin c1bc70b711 Cleanup: Add a copyright notice to files and use SPDX format
A lot of files were missing copyright field in the header and
the Blender Foundation contributed to them in a sense of bug
fixing and general maintenance.

This change makes it explicit that those files are at least
partially copyrighted by the Blender Foundation.

Note that this does not make it so the Blender Foundation is
the only holder of the copyright in those files, and developers
who do not have a signed contract with the foundation still
hold the copyright as well.

Another aspect of this change is using SPDX format for the
header. We already used it for the license specification,
and now we state it for the copyright as well, following the
FAQ:

    https://reuse.software/faq/
2023-05-31 16:19:06 +02:00
Bastien Montagne a9193a9ad2 Refactor ID liblinking on readfile to take ID pointer.
The usage of the lib pointer was cryptic to say the least, it was
essentialy used to allow or not local IDs results in the mapping
old_id_pointer -> new_id_pointer lookup result.

Now:
- Explicitely pass a boolean to allow or not local ID as result in
  lower-level code.
- Pass the 'self ID' pointer instead of its library to the whole
  liblinking code (that was already the case in a few places).

Note that naming of the 'self id' pointer is currently very inconsistent
throughout the readfile liblink code, this will have to be cleaned up in
a separate step later. For now, `self_id` has been chosen for new code
as it matches the terminology in lib_query code.

The later change can also allow finer handling of lookup on undo, based
on how it was re-read (or not), should the need for this arise.
2023-05-17 16:38:56 +02:00
Campbell Barton 6859bb6e67 Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
Clément Foucault a8feb20e1c DNA: Move irradiance grid light cache data to Object level
This is the first step for refactoring the lightcache system.
Each probe instance (as in `Object`) will now store its own baked data.
The data is currently stored in uncompressed readable format.

This introduces two new operators for baking to avoid confusion with
the previous light baking pipeline. These do nothing other than
creating empty caches that will be populated by EEVEE later on.

The DNA storage is made to be able to include multiple caches
in case of baked simulation over time but it isn't yet supported.

I prefer to keep the implementation simple for now as the long term
goals for this feature are uncertain.
There is still a type flag (`LightProbeObjectCache.cache_type`) that
will be used for versioning.

The naming convention of structs is a bit weird but that's all I
found in order to avoid interfering with the old scene light cache
that is still used by (old) EEVEE.

Related task #106449.

Pull Request: https://projects.blender.org/blender/blender/pulls/106808
2023-04-17 17:12:19 +02:00
Clément Foucault a041297e54 Fix: build error after moving lightprobe.c to c++
Error introduced in 3dd24b9ae7

Pull Request: https://projects.blender.org/blender/blender/pulls/106635
2023-04-06 18:40:58 +02:00
Clément Foucault 3dd24b9ae7 Cleanup: Move lightprobe.c to c++
This is to allow clearner code in the new object-level lightprobe
cache. See #106449 .
2023-04-06 17:41:59 +02:00