View Full Version : Color Alpha (with Transparency) on Surface shader
I doing some "color alpha" passes to control a paintFX flower's leaves in post. (paintFX has been converted to polys).
The leaves are planes with alpha clippings.
I'm using a surface shader to get my key color established, but I not having success with trying to get the plane to 'clip' with the alpha of the leaf image alpha.
Can anyone advise on the network to have the surface shader respect transparency via alpha?
07-20-2009, 07:52 PM
It doesn't look like you have anything plugged into your Transparency slot. This is where your image's alpha should go. The "matte opacity" slot is for compositing (your render's alpha layer), not for determining transparency of an object via shader.
It would also appear that "file1" has no alpha, at a glance. Perhaps make one really quick in Photoshop? Unless it's a .tif or .tga or something, but I can't tell from your screenshot.
07-21-2009, 01:36 PM
Those leaf images from pfx do have alpha, they just aren't premultiplied.
surfaceShader is a bit different from what you'd expect (it could seem somewhat weird at first, but that pays off in a lot of situations). You need three things to make it work:
outColor: you need to premult your texture first - create multiplyDivide node and multiply your blue '0 0 1' color by file1.outAlpha (same for all three components), plug the result into surfaceShader (in general situation you would multiply file1.outColor by file1.outAlpha)
outTransparency: just plug it from file1 into surfaceShader
These two make your RGB render proper.
outMatteOpacity: that's for the correct alpha - invert file1.outTransparency with 'reverse' or just plug file1.outAlpha in all three components
It should look like the image below
Yeah, I guess that post wasn't tool clear regarding what I wanted to achieve. Sorry about that.
I'm weak in the shader/utility structure area Sagroth, really appreciate your detailed explanation of this network. It will help me with the "color Alpha" pass and will allow me to do a "ambient occl" pass as well.
07-21-2009, 03:50 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2015, Jelsoft Enterprises Ltd.