Transparency

Transparent materials allow you to see through a mesh. Transparency can be partial (e.g. glass) or binary (fully visible or fully invisible per pixel). Choosing the correct method is important for both visual quality and performance.

There are two main approaches:

Transparent Blending

Enable transparency by setting the material’s Transparent toggle to Yes. The final pixel color is blended with what has already been rendered behind it, using a blend mode (e.g. alpha blending).

Pros

  • Supports partial transparency (smooth transitions between opaque and transparent)

  • Ideal for materials like glass, water, smoke, and UI elements

Cons

  • Requires correct rendering order (back-to-front sorting). Incorrect order can cause visible artifacts

  • Performance cost: Objects behind must still be rendered even if fully covered

  • Can produce visual errors when transparent objects overlap or intersect

Use when

  • You need smooth, semi-transparent effects

  • Visual accuracy is more important than performance

Alpha Testing (Cutout)

Alpha testing uses a threshold to decide whether a pixel is rendered or discarded.

Example: If the alpha threshold is 0.1, pixels with alpha < 0.1 are discarded; others are fully opaque.

Pros

  • No sorting issues (renders like opaque objects)

  • Better performance than blending in many cases

  • Works well with depth testing and shadows

Cons

  • No partial transparency (hard cut between visible/invisible)

  • Can produce jagged or pixelated edges

Tips

  • Adjust the threshold to minimize harsh edges

  • Use higher-resolution textures or dithering techniques to improve appearance

Use when

  • You need sharp cutouts (foliage, fences, grates)

  • Performance and stability are important

Quick Comparison

Feature
Transparent Blending
Alpha Test

Partial transparency

✅ Yes

❌ No

Sorting required

⚠️ Yes

❌ No

Performance

❌ Higher cost

✅ Lower cost

Edge quality

✅ Smooth

⚠️ Hard edges

Rule of Thumb

  • Use Transparent Blending for glass, liquids, effects

  • Use Alpha Test for foliage, cutout textures, thin geometry

Last updated