[Bf-committers] Alpha clamping in render layers node

Lukas Tönne lukas.toenne at googlemail.com
Tue Jan 17 10:09:23 CET 2012


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.

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).

Here is a .blend and an image to show the difference (top render layer
node has no clamping, bottom node has clamping enabled):

http://www.pasteall.org/pic/24540

http://www.pasteall.org/blend/11000

And here is the actual patch:

http://www.pasteall.org/28276/diff

Please let me know what you think.


More information about the Bf-committers mailing list