Compositor: Re-write Pixelate node for CPU compositor #117223

Merged
Sergey Sharybin merged 3 commits from Sergey/blender:compositor_pixelate into main 2024-01-18 11:31:06 +01:00

3 Commits

Author SHA1 Message Date
Sergey Sharybin f7775b798d Add limits and default value on the RNA property 2024-01-17 17:58:21 +01:00
Sergey Sharybin ce2fa90c7f Fix crash when Pixelate is applied on Depth pass
The node tried to be smart w.r.t the socket type.

While with the previous simple pass-through of rounded coordinate
did not require any special code for such flexibility, now it will
be more tricky to support it.

There are likely to be other sources of slowdown and memory usage,
and the node is likely to be used on a color anyway, so choose simpler
way of dealing with the data type.
2024-01-17 12:41:01 +01:00
Sergey Sharybin dd5848b56c Compositor: Re-write Pixelate node for CPU compositor
The old implementation was a simple rounding operation and was not
implemented for full-frame compositor.

The issue with the old implementation is that it will not give
satisfactory results for images with high frequency details,
including cases when is used for a preview on Cycles render with
low number of samples. Additionally, when applied on animated
footage it produces very noisy result.

The new algorithm uses an explicit pixel size setting, which allows
the node to be used on its own, without need to have scale-down and
scale-up nodes. It also uses neighbour averaging, which produces
better looking result during animation and noisy input images.

The old tiled compositor setup will render without changes with
this change. This commit does not include modifications in the GPU
compositor implementation.
2024-01-17 12:05:29 +01:00