33 Commits

Author SHA1 Message Date
Omar Emara
a113121562 Compositor: Perform LGG Color Balance in linear space
This patch adjusts the LGG Color Balance mode to operate in linear space
as opposed to sRGB space, which is more inline with other software and
is more expected to the user.

Versioning was added using pre and post gamma correction, but it is
very slightly different in the blacks because the gamma node only does
power correction.

Pull Request: https://projects.blender.org/blender/blender/pulls/147533
2025-10-07 17:04:34 +02:00
Omar Emara
d9d8f8e777 Fix #147284: Dilate threshold test fails on Qualcomm GPU
The dilate threshold test fails on Qualcomm GPU due to an unknown
reason, but the tests shows significant differences in all platforms
regardless, they are just small enough to pass the test threshold. The
difference is most likely the new SMAA implementation done to match the
GPU version, so updating the reference is reasonable here.

Pull Request: https://projects.blender.org/blender/blender/pulls/147451
2025-10-06 15:26:54 +02:00
Omar Emara
488efb8ca9 Fix #147289: Keying Screen node test succeed with bad result
The result of the Keying Screen node tests is very different yet the
test succeeds, that's because the test result has a very small number of
pixels compared to the final image. To fix this, we match the size of
the result with the render size.

This also updated the test reference which should have been updated
after the new RBF interpolation implementation of the node.

Pull Request: https://projects.blender.org/blender/blender/pulls/147449
2025-10-06 15:23:03 +02:00
Brecht Van Lommel
e91c8300a6 OpenEXR: Write colorspace metadata for multilayer EXR
Previously it was only working for the single layer case. For multipart
we write the colorspace in each part. For single part we write the first
non-data colorspace, and hope data passes will be identified based on channel
name like Blender does (e.g. XYZ instead of RGB).

Reading is unchanged and still the same as before, in that it only reads the
colorspace from the first part. There is only one color space per image
datablock, so we can not store anything more currently. In practice it
would be unusual for all passes in a file not to either have the same
colorspace or be data.

All the compositor file output test images were updated to include the
metadata, so that the test will check if the metadata is there.

Ref #144911

Pull Request: https://projects.blender.org/blender/blender/pulls/146809
2025-09-25 23:27:14 +02:00
Brecht Van Lommel
be1619f4ad OpenEXR: Multi-part writing
New "Interleave" option in image format settings, enabled by default in old
files and disabled by default in new files to write multi-part files.

By not storing all channels interleaved, it is possible for other applications
to load individual passes more efficiently. This might also work better with
compression.

We follow the OpenEXR docs in that the channel name is the full
Layer.Pass.Channel rather than just Channel. Some other renderers
(e.g. Houdini Karma) write just the channel and that is what our reading
code assumed so far.

I've verified that Nuke can read the multipart EXR files produced by Blender,
including multiview and cryptomatte.

Fix #123727

Pull Request: https://projects.blender.org/blender/blender/pulls/146650
2025-09-25 22:58:11 +02:00
Omar Emara
7ec89d1bfb Compositor: Reorder inputs accordingly to importance
This patch reorders the inputs of some of the compositor nodes
accordingly to their importance. The importance is already quantified
internally using the domain priority of the input, so we needn't make
any subjective judgement and just order by the priority.

This breaks forward and backward compatibility if input indices were
used as opposed to input identifiers due to the different order.
Handling compatibility is not impossible, but is difficult, and it was
already ignored in many past node changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/146311
2025-09-23 17:32:07 +02:00
Brecht Van Lommel
2eaa8dc7d5 Compositor: Add Convert to Display node
This applies an OpenColorIO display, view and look transform on a color
in the scene_linear colorspace.

In general, OpenColorIO configurations do not contain a colorspace for
every view + display, especially if they are modern configs using the
display colorspace and shared view mechanisms. Nor do they include looks.
So the Convert Colorspace node is not sufficient.

Additionally, we would like to avoid making the colorspace list too long
in the default config, as we are adding many new views and transforms.

Exposure, gamma curves and white point functionality are not included
in this node, as there are native ways of doing that in the compositor.
These settings are marked non-editable in the Python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/145069
2025-09-01 16:28:07 +02:00
Ian Yoo
6ad010a1eb Tests: Reorganize group tests
This was to be done as group node related tests are added, to match the
node groupings. Moved group output test into the new folder

Pull Request: https://projects.blender.org/blender/blender/pulls/144827
2025-08-25 11:16:35 +02:00
Omar Emara
68dc278fe5 Compositor: Redesign File Output node
This patch redesigns the File Output node to provide better UX and UI.
This is mainly achieved by allowing the user to create inputs by
dragging into an Extend socket and adjust existing inputs using the
familiar UI list design available in Blender. Additionally, various UI
changes were done:

- The Use Node Format option was renamed to Override Node Format for
  clarity.
- Socket types are now fixed and do not change as new links are made,
  allowing users to specify the exact output type and employ implicit
  conversion if needed.
- The distinction between images and Multi-Layer EXR was made clearer.
- Final output paths are drawn in the UI to remove guess work.
- The Base Path was split into a Directory and a File Name.
- Panels were added to group options, include a panel for the node
  format, items, and item formats.

Pull Request: https://projects.blender.org/blender/blender/pulls/141091
2025-08-07 14:46:34 +02:00
Habib Gahbiche
00f82920ef Tests: Compositor: update File Output Node tests
'exr multilayer passes' had an invalid input, so its output was updated

The rest of the tests had outdated output sockets after some 'Color'
sockets were converted into 'Vector' sockets

Pull Request: https://projects.blender.org/blender/blender/pulls/144004
2025-08-05 15:42:14 +02:00
Ian Yoo
f6523e619a Tests: Add group node test for missing output node
This adds a test case for #142944 where the compositor crashes when
there is a missing group output node inside a group node.

Pull Request: https://projects.blender.org/blender/blender/pulls/143150
2025-08-05 11:06:44 +02:00
Ian Yoo
62b532040d Tests: Reduce glare streaks threshold
The current glare streaks threshold for highlights is too high so the
 input is just a black image, and no effects are output.
The threshold was reduced from 2.0 to 0.2 to produce a visible change.

Pull Request: https://projects.blender.org/blender/blender/pulls/142320
2025-08-01 20:36:11 +02:00
Ian Yoo
903fefff48 Tests: Add pixelate test
`node_pixelate` sets the output pixel size to 1, meaning no
transformation occurs and it is essentially the same as a single value
input. This will add a new test that pixelates the image, and renames
the original test to better reflect that edge case

Coverage:
- Function: 62.50% -> 100%
- Line: 37.36% -> 100%
- Region: 45.83% -> 100%
- Branch: 20.00% -> 90.00%

Pull Request: https://projects.blender.org/blender/blender/pulls/142438
2025-08-01 19:49:57 +02:00
Habib Gahbiche
142d491064 Tests: Compositor: tests for Value Map node
Pull Request: https://projects.blender.org/blender/blender/pulls/143795
2025-08-01 16:42:21 +02:00
Ian Yoo
562020e0f0 Tests: Fix keying screen test
This PR adds more markers and re-tracks them correctly on the cube clip
The output should be a gradient color, which was tested with another
setup and should mask the clip if used in conjunction with the keying
node (this PR doesn't include that setup, just the keying screen fix).

Coverage remains the same.

Pull Request: https://projects.blender.org/blender/blender/pulls/142534
2025-08-01 15:27:34 +02:00
Ian Yoo
113df76ad0 Tests: Add mask node tests
This PR adds three tests relating to the mask node, which makes a new
mask data block for `node_mask`, creates an invalid input test,
and covers the `fixed/scene` case.

Coverage:
- Function: 88.89% -> 88.89%
- Line: 91.41% -> 94.53%
- Region: 83.33% -> 88.10%
- Branch: 62.50% -> 81.25%

Pull Request: https://projects.blender.org/blender/blender/pulls/142447
2025-07-30 21:28:36 +02:00
Sergey Sharybin
38f867814f Fix #143191: 10/12 bit videos import much too dark
Originally reported for ProRes codec, but it affects multiple
other codecs: any format which is read as >= 10bit had the issue.

A regression since 93be12fde0.

The cause of the issue is that movie clip and image data-blocks
did linearization on their side, which was quite hidden to find.
Now the color management is done on the movie reader level.

Additionally, added regression test to catch such issues early
on in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/143435
2025-07-28 15:14:23 +02:00
Mohamed Hassan
c1f52b8e91 Compositor: Improve Fog Glow glare realism
This patch improves the realism of the Fog Glow mode of the Glare node
based on the Photopic model described in:

  Physically-Based Glare Effects for Digital Images" by G. Spencer, P.
  Shirley, K. Zimmerman, and D. P. Greenberg.

This is a breaking change that can't be versioned, but it is worth it
for the superior realism of the new model.

Pull Request: https://projects.blender.org/blender/blender/pulls/140646
2025-07-25 10:09:32 +02:00
Ian Yoo
0c9aaaf25a Tests: Add extended boundary blur tests
These two tests cover the extended boundary option for the blur node.
One with single value input and another with variable input.
They mirror the non-extended gaussian tests.

Coverage:

- Function: 86.36% -> 90.91%
- Line: 91.95% -> 96.90%
- Region: 83.51% -> 96.63%
- Branch: 84.00% -> 95.65%

Pull Request: https://projects.blender.org/blender/blender/pulls/141528
2025-07-11 12:23:42 +02:00
Ian Yoo
477d44867f Tests: Add bilateral-blur single_value tests
`node_bilateralblur.blend` covered a specific case where the
determinator was a single value. This was renamed to
`node_bilateralblur_det_single_value.blend` and added a single value
 input test for the image, and a standard bilateral blur test for cpu/gpu

Coverage:
- Function: 66.67% -> 100%
- Line: 39.10% -> 100%
- Region: 45.71% -> 100%
- Branch: 22.22% -> 88.89%

Pull Request: https://projects.blender.org/blender/blender/pulls/141315
2025-07-02 12:33:05 +02:00
Ian Yoo
48cef1a0e2 Tests: Add convert-color-space tests
There previously were no `convert_color_space` node tests.
This adds 3 tests which cover the basic `image` case, `single_value`
input case, and the `is_identity` case.

Coverage improvement:
- Function: 18.18% -> 81.82%
- Line: 17.56% -> 82.44%
- Region: 11.11% -> 75.00%
- Branch: 0.00% -> 62.50%

Pull Request: https://projects.blender.org/blender/blender/pulls/141205
2025-07-01 11:17:05 +02:00
Ian Yoo
5957c14e7c Tests: Remove node_levels reference image
This PR deletes `node_levels.png` from `utilities/compositor_renders`.
It is unassociated with any test in the compositor.

Pull Request: https://projects.blender.org/blender/blender/pulls/141057
2025-07-01 11:16:30 +02:00
Ian Yoo
f25c5dc1d6 Tests: Add compositor z-combine anti-alias and single value tests
This improves the z-combine node coverage. The tests cover the
`anti_alias`, `anti_aliased_depth`, and `single_value` related
functions.

Coverage:
- Function: 52% -> 100%
- Line: 49.15% -> 98.86%
- Region: 48.91% -> 96.74%
- Branch: 38.46% -> 86.54%

Pull Request: https://projects.blender.org/blender/blender/pulls/141071
2025-06-30 12:14:25 +02:00
Ian Yoo
c189f2f3ce Compositor Tests: Reorganize folders to match node groupings
This addresses issue #120949 to move compositor tests to reflect the
grouping used when adding a new node.

This PR only moves the relevant single tests and their renders into
matching directories. Folders such as 'multi-node setups' and
'pixel nodes' were not changed.

Pull Request: https://projects.blender.org/blender/blender/pulls/139757
2025-06-26 17:26:59 +02:00
Habib Gahbiche
f2d95e758d Fix: Crash when opening files with animated compositor normal node
Saved files in 4.5 with a compositing node tree containing a Normal
Node with animated 'Dot' input crash in 5.0.

A test case with animated dot and normal inputs was added as well.

Pull Request: https://projects.blender.org/blender/blender/pulls/140908
2025-06-25 11:04:29 +02:00
Omar Emara
383c8860a2 Compositor: Remove Texture node
This patch removes the Texture node from the compositor, which was based
on the legacy Internal Textures system in Blender. The main motivation
for removing this node is as follows:

- Procedural texturing nodes that previously existed in shading and
  geometry nodes are now supported in the compositor, which cover 95% of
  what is previously possible using and even adds new possibilities like
  Gabor, Bricks, and various improvements to existing texture types.
- The old texture system did not support GPU evaluation, so it was
  always computed and cached on the CPU, which causes bad performance
  especially for interactive use in the viewport compositor. While the
  new nodes are fully GPU accelerated and do not require any caching.
- The Texture node didn't support Texture nodes, so it was not fully
  supported and we so far had a warning about that.
- The general direction in Blender is to remove the old texture system,
  and the compositor was one of the last main users of it. 5.0 is thus
  the ideal time to remove such use.
- The Texture node was always and still is a source of bugs, since it
  relies on proper tagging for cache invalidation and updates, which is
  so far not perfect. It also suffers from UI/UX issues, since it needs
  to be adjusted from the properties panel, which can break if there are
  other texture nodes in the context.

This is a breaking change and no versioning was attempted since:

1. It is impossible to get the same results as before due to the use of
different random number generators, so any versioning would just give us
the general look.
2. The Texture node supports a lot of possible configurations. For
instance, each general texture can have many options for the basis type,
and each basis type might have multiple options. So versioning all of
that will take a lot of time, code, and effort.

Pull Request: https://projects.blender.org/blender/blender/pulls/140545
2025-06-24 11:54:39 +02:00
Omar Emara
9bcb536c95 Fix #138009: Extend Bounds doesn't work with Fast Gaussian
The Extend Bounds input has no effect when the Fast Gaussian filter is
used. Similarly, it has no effect if the Bokeh Blur node is using
variable size. This is a known limitation and was just not implemented.

So to fix this, we implement a general solution that works globally
across the node by pre-padding the inputs of the blur. This uses more
memory but also speeds up the base case when Extend Bounds is disabled,
while also reducing the binary size due to fewer blur specializations.

The variable size Bokeh Blur test was updated since it Extend Bounds was
silently ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/140192
2025-06-11 11:41:00 +02:00
Mohamed Hassan
3883a88d4e Compositor: Maintain alpha in Lens Distortion node
The alpha channel value was previously hard codded to one in the lens
distortion node. This patch solves that by integrating the alpha as well
in the radial distortion mode and taking the average alpha in the
horizontal case.

This breaks backward compatibility, but is what users what in most
cases, so it is acceptable.

Fixes #134658.

Pull Request: https://projects.blender.org/blender/blender/pulls/137994
2025-06-10 07:42:35 +02:00
Omar Emara
6bf52d11f1 Fix #139327: Movie distortion result is cropped
The Movie distortion node crops its data if the movie size differs from
the input size. That's because boundary extensions do not take
calibration size into account. To fix this, we use the same coordinates
range as the distortion grid computation, which computes the distortion
in the space of the calibration size.

Pull Request: https://projects.blender.org/blender/blender/pulls/139822
2025-06-04 12:24:33 +02:00
Omar Emara
bab308bfa2 Compositor: Turn Blur node options to inputs
This patch turns the Blur node options to inputs.

Size is now a 2D vector and replaces the Size X and Y option. Bokeh was
renamed to Separable to reflect its actual function. Relative was
removed in favor of the newly added Relative To Pixel node workflow.

There is a slight difference in variable size blurring due to float vs
integer computations, so two tests were updated.

Reference #137223.

Pull Request: https://projects.blender.org/blender/blender/pulls/139329
2025-05-26 16:18:48 +02:00
Habib Gahbiche
289984d868 Tests: Compositor: add test with animated input
Pull Request: https://projects.blender.org/blender/blender/pulls/139227
2025-05-21 20:21:46 +02:00
Ian Yoo
e0dc538854 Tests: Add non-rotation regression test for glare_simple_star filter
The current regression tests for the Glare Node cover most but not all
of the code. In this case, the simple_star test only tested for 45
degree rotation offset of the glare highlight.
This will add a simple_star_no_rotation.blend regression test and its
corresponding output_render png to cover the no offset case.

The function, line, and region coverage have improved by about ~9-10%

Pull Request: https://projects.blender.org/blender/blender/pulls/138587
2025-05-11 15:34:24 +02:00
Sergey Sharybin
bbfc97ad6f Move tests/data and assets to the main repository
This change moves the tests data files and publish folder of assets
repository to the main blender.git repository as LFS files.

The goal of this change is to eliminate toil of modifying tests,
cherry-picking changes to LFS branches, adding tests as part of a
PR which brings new features or fixes.

More detailed explanation and conversation can be found in the
design task.

Ref #137215

Pull Request: https://projects.blender.org/blender/blender/pulls/137219
2025-05-05 15:10:22 +02:00