Saturday, August 23, 2014

Blender - Cycles rendering textures with alpha mask

The problem was to get Cycles to render a texture with its alpha as transparent.
Acting within the "compositing" nodes and checking "use nodes" on. Output to Viewer Node.
Some difficulty in activating the viewer node is fixed by clicking material /compositing buttons repeatedly. This refreshes and shows the output through the node network.

In compositing, simply load the "image texture" which contains the alpha, as a node.
Connect its alpha output to the factor of a "converter/Color Ramp". This goes out to a Viewer node. Now the output can be saved within the image viewer as an Alpha Mask!

Finally, back in material nodes, both Image Textures can be loaded. Forked from their UV node to Image Vector, the "Alpha Mask" color goes into the Factor of a Mix Shader.
A Transparent Shader connects into the Top Mix Shader input.
The Image Texture color, maps through an Emission Shader, to the Bottom Mix Shader input.
Finally the Mix is output to Material Surface.

Of course the Emission shader could be substituted for diffuse or whatever surface quality is needed.

Easier as a diagram.
Step 1: Compositing View

Step 2: Material View

No comments:

Post a Comment