Transparency

There are many methods of rendering transparent objects in real time. Transparency is often expensive in terms of processing and rendering performance. Among the different methods, there are trade-offs between image quality and viewer performance. This article describes the transparency modes on Sketchfab and suggests when each option is most suitable.

This article was adapted from the blog tutorial.

Why order matters

Rendering transparent objects is done by blending colors. Objects are drawn one by one on top of each other and depending on the blend mode and the order they are rendered, the result differs.

Sketchfab 3d model transparency why order matters

  • Left: Blue square is in front of the orange one.
  • Right: Orange square is in front of the blue one.

Offline renderers like raytracers and modeling tools favor quality over performance. They can afford to sort each triangle before rendering a frame, so blending is not an issue.

When achieving realtime performance level there is a limitation due to raster algorithms; polygons are drawn by batches, and per batch the order in which polygons are drawn can't always be predicted.

Sketchfab makes a compromise between transparency quality and speed by sorting transparent objects and not transparent polygons.

Blending

Blending is the slowest method of rendering transparency. All visible objects in the scene must be rendered, sorted, and merged into the final image. This is an "expensive" calculation. It is usually a grayscale (Luminance channel) or RGBA (Alpha channel) texture, or a solid gray value. Blending mode is useful for translucent materials like glass.

Sorting each individual polygons in an model would be very slow, so we sort transparency by meshes. This can cause "popping" or "flickering" in complex or intersecting shapes. If you experience problems, try splitting up the transparent object into more separate meshes.
Blending and Additive materials are excluded from casting shadows.

Sketchfab 3D settings transparency alpha blending

Additive

Additive mode is almost as slow as Blending. It works by adding the transparent colors of objects together, so order does not matter in this case. Black will be rendered as transparent. It is similar to the Linear Dodge (Add) blend mode in Photoshop. Additive transparency is useful for special effects and emissive materials like fire, sparkles, and holograms.

Blending and Additive materials are excluded from casting shadows.

Sketchfab 3D settings transparency additive blending

If only additive materials are used in a scene, objects do not need to be sorted, so there can be no flickering issues.

Sketchfab 3d model Physically based rendering PBR settings alpha additive blending transparency

Dithered

Dithered mode is a faster method to achieve Blending, but it produces "noise" during navigation. The image quality improves when the camera is static. It is usually a grayscale (Luminance channel) or RGBA (Alpha channel) texture, or a solid gray value. The Dithered mode is useful for complex geometries with partial transparency, like fur and hair.

Sketchfab 3D settings transparency dithered

Mask

Alpha Masking is the fastest transparency method. It works by setting visibility in a binary (on / off) way. It is usually a grayscale (Luminance channel) or RGBA (Alpha channel) texture. You can use the slider to set an Alpha "Threshold". Masking is useful for materials that require a "cutout" effect like leaves and logos.

Sketchfab 3d model transparency alpha masking

Texture format

The texture format option enables you to set how colors are encoded: RGB for color texture only, RGBA for color + alpha transparency, and LUMINANCE for alpha transparency only. Opacity in textures can be defined by the alpha channel or grayscale levels.

Sketchfab 3d model transparency rgba abd luminance

b

Have more questions? Submit a request

Comments