Transparency / Maya
Here we show how to enable transparency for Standard Surface, Lambert, and glTF-compliant PBR materials in Maya.
For usage example, check out the following demo from the asset store: Transparency.
- Blended vs Masked
- Additive Composing (aka No Depth Writes)
- Transparency for Standard Surface Materials
- Transparency for glTF-compliant PBR Materials
Blended vs Masked
Being a real-time 3D engine, Verge3D offers two main methods to handle transparent objects: alpha blending and alpha clipping (usually with an image mask). Blending enables combining a translucent foreground color with a background color, using the foreground color's alpha as blending factor. Clipping, on the other hand, simply discards all pixels with alpha less than some predefined threshold (always equal to 0.5 in Verge3D for Maya).
Blending enables for smooth transitions, generally looks nicer but computationally more expensive than clipping. It may also produce z-sorting artifacts when polygons appear to be rendered in wrong order. Clipping works best for visualizing numerous small objects (such as grass or tree leaves). It also produces hard edges without any transitions which may be aliased.
Use Alpha Mode dropdown in material settings to choose between blending and masking.
Additive Composing (aka No Depth Writes)
Verge3D also offers a special mode for disabling writing to the depth buffer while rendering. This results in polygons being excluded from pixel depth comparison. Such polygons are composited in additive manner, which sometimes can help get rid of blending artifacts.
Select Blend in the Alpha Mode dropdown and uncheck the Depth Write option in material settings to enable this mode. In addition, you'll need to increase the Rendering Order value in object settings to make you transparent object rendered above all.
Transparency for Standard Surface Materials
Transparency of Standard Surface (or aiStandardSurface) materials can be tweaked using the following material settings:
- Transmission Weight
- transmission factor of thin-walled and refractive materials.
- Transmission Color
- color of refractive (Thin Walled off) material.
- Thin Walled
- use generic thin-walled or refraction-based transparency.
- opacity factor for thin-walled materials.
- Alpha Mode
- material transparency mode.
- Depth Write
- disable for additive transparency composing (see above).
By default in Maya, the Thin Walled parameter is unchecked, which disables the most typical transparency rendering you expected to see in your interactive app. Always keep an eye on this setting when you're dealing with the transparent Standard Surface materials.
Transparency for glTF-compliant PBR Materials
In order to enable transparency for such materials, one should bake transparency map as 4 (alpha) component of the base color texture and connect Alpha output of that texture to the Opacity input of the Standard Surface material.
When no base color texture available, simply use unconnected Opacity parameter.
Use the Alpha Mode dropdown to choose between transparency modes.
Feel free to ask on the forums!