Global Material Override that factors in Alpha

Hey all!

So we’re doing a big project that requires some specialized passes for comp. The easiest solution is to use Blender’s global material override found in the Render Layers - Layer tab. This works great for creating a custom render output (like, for example, a fresnel pass, an object-specific illumination pass, or a global coordinates mist pass) with one major exception – this material doesn’t take into account the original shader’s alpha.

So, for example, say we’re using 2D cards of a pine needle texture to populate a tree branch. Now, with the global material override, all those planes now fill in so that they’re solid, giving our trees a blocky look. Same thing if we had a bush sprite on the ground, it now renders solid. The transparency of the original material is ignored.

I know that this would be pretty complicated to implement, but I was wondering if any of you had any idea to utilize a global material override that would take into account the original material’s transparency/Alpha channel and apply it to the new material. This way the objects will still look correct.

Aside from going in to each and every material and overriding it, the only other solution we’ve discovered is to create a custom node group with an alpha channel in and then the ability to bypass or override the original material, but this requires that custom node group to be embedded inside of each material which, when done, is helpful, but otherwise still requires all the upfront work.

So–is there any way to create a global override material that will take into account the original material’s alpha or is this absolutely impossible to implement easily?

Thanks all!

Make a duplicate scene. Set it to only render alpha via the compositor. Go back to first scene. Add a new renderlayer and select the scene that you just cerated. Now use a Set Alpha node to combine the two scenes. Viola.

1 Like