Log In
New Account
Home My Page Projects Blender 2.x BF release
Summary Activity Tracker SCM Files

Blender 2.6 Bug Tracker: Browse

[#24335] Z-Combine node ignores alpha values (including patch)

Date:
2010-10-20 09:55
Priority:
3
State:
Closed
Submitted by:
Martin Lubich (loramel)
Assigned to:
Ton Roosendaal (ton)
Category:
Compositor
Status:
Fixed / Closed
Relates to:
Duplicates:
Patches:
 
Summary:
Z-Combine node ignores alpha values (including patch)
Detailed description
Seen with blender 2.54 svn r32610, 64bit linux
running and built under kubuntu 10.04 64bit
geforce gtx 460 with nvidia driver 256.53

The z-combine node in the compositor does not take any alpha values into account, thus making this node unusable when dealing with transparent objects.
It can be worked around by using the zmask ( or All-Z) feature and using alpha over, but i think this should also be handled by the z-combine node.

Since the source code doesn't seem to have changed since 2.49, this is also true for the current stable branch.

It may be a deliberate decision to ignore the alpha values, but nonetheless I have included a patch which corrects the problem (at least with the examples done by me so far)

See the attached blend file for an example. It has 3 planes. The top-front and far-back plane are rendered on one layer with the front plane having an alpha mapped texture applied. On a second layer the middle plane is rendered, also with an alpha mapped texture applied.
In the compositor these two layers are composited using the z-combine node. The behaviour with the current svn shows that the alpha values are ignored.

Followup

Message
  • Date: 2010-11-04 01:27
  • Sender: Campbell Barton
  • Hi, thanks for including a patch, I looked over this and it seems straightforward enough but this isn't my area so assigning to Ton.
  • Date: 2010-11-09 18:34
  • Sender: Ton Roosendaal
  • One issue to solve is that this option is new, and might break previous zcombine setups. An option "Use Alpha" would be nice then.
  • Date: 2010-11-09 18:43
  • Sender: Martin Lubich
  • Thats certainly true. And the option should of course have the default to not using alpha.

    Do you want me to revisit the changes and submit a patch including this option ?
  • Date: 2010-11-09 18:50
  • Sender: Ton Roosendaal
  • That would rock! And make it work for 2.55 trunk :) UI works different now...
  • Date: 2010-11-09 18:55
  • Sender: Martin Lubich
  • ok, I'll see what I can do. Is it ok to submit it here through the bug tracker ?
  • Date: 2010-11-10 11:39
  • Sender: Martin Lubich
  • I have implemented the 'use alpha' option in the zcombine node. I hope I have everything covered, I am not really sure if the changes to rna_properties.txt are needed and/or correct.

    Anyway my tests look fine and compatibility with old files should be preserved.

    The patch is built against svn 32975.
  • Date: 2010-11-12 15:55
  • Sender: Ton Roosendaal
  • Thanks a lot Martin! Will apply in code now with credits.
  • Date: 2010-11-13 00:18
  • Sender: Martin Lubich
  • As far as I see it 2 of the points were already present in the code (output of combined z, antialiasing). This fix adds the support for transparency.

    The last point mentioned (z data of premul images) is not handled, but I do not understand enough what is meant exactly by this point to give a definitive answer on that.
 

Attached Files:

Name Date Download
zcomb_test.blend 2010-10-20 09:55 Download
zcombine_alpha.patch 2010-10-20 09:55 Download
zcombine_alpha_toggle.patch 2010-11-10 11:39 Download

Changes:

Field Old Value Date By
close_date2010-11-12 18:582010-11-12 18:58gsrb3d
ResolutionInvestigate2010-11-12 15:55ton
close_date2010-11-12 15:552010-11-12 15:55ton
status_idOpen2010-11-12 15:55ton
File Added13497: zcombine_alpha_toggle.patch2010-11-10 11:39loramel
ResolutionNone2010-11-04 01:27campbellbarton
assigned_tonone2010-11-04 01:27campbellbarton
File Added13195: zcombine_alpha.patch2010-10-20 09:55loramel
File Added13194: zcomb_test.blend2010-10-20 09:55loramel