[Bf-committers] Alpha clamping in render layers node

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Jan 17 15:02:48 CET 2012


Hi,

On Tue, Jan 17, 2012 at 10:09 AM, Lukas Tönne
<lukas.toenne at googlemail.com> wrote:
> Troy Sobotka has asked me in IRC if it would be feasible to clamp
> alpha values output in the render layers node.
>
> The problem is that AA filtering leads to alpha values with both a<0
> and a>1, which usually requires the artist to add additional math
> nodes to clamp those values to 0..1 range. While Brecht's alleged
> opinion (correct me if i'm wrong) is that this is not a problem since
> compositing should be done with full samples, it is apparently a nasty
> workflow.

My opinion is not that's a not a problem, but that it's not a bug so
should not be in the bug tracker.

> So here's a patch that adds a "clamp alpha" option to render layers
> node. The button for this setting is located in the node editor side
> bar, instead of the node itself to avoid clutter (case of "set once,
> don't touch again"). It is enabled by default for new nodes, but
> disabled for old files (backward & forward compatible).

I think clamping alpha to a valid range way can always be done, no
option is needed. However, it needs to be done on any render output,
not in a compositing node. For example saving directly to EXR without
nodes enabled or doing full sample re-compositing also needs this, so
the clamping code should elsewhere. Also note that both the combined
and color passes have an alpha channel, so ideally both would be
clamped.

Brecht.


More information about the Bf-committers mailing list