Referencing Elements in Your Material
In your material, you can create a standard texture parameter and have it auto-plumbed with a child Element’s render result. Just name the texture parameter the same as the sub-Element’s name in the compositing tree panel.
Since you only need to output a single color, we use Post Process materials for our compositing materials. You can enable Output Alpha for Post Process materials if that’s needed.
Plug this material into your material Pass and you’re all set. It should just start working.
Are you not seeing the child Element come through? Make sure the names match exactly - typos can cause frustration here.
If the sub-Element is disabled and not rendering, then the texture parameter will be filled in with a transparent black texture. If the named Element cannot be found, the texture will use the default texture from the material.
Making your material more portable
Referencing your Element by name in the material is easy, but it makes your material very specialized – it will only work with Elements having specific names. An alternative is to give your material texture param a generic name and set it to reference the sub-Element in the Pass’s details.
Once a material is set on the Pass, it will have a property section titled Input Elements. The Input Elements section lists all of the texture params in the material, and let’s you set them to reference a specific child Element.