← Back to Blog 3d-modeling

Alpha Masking and Transparency in Game Assets: Unity, Unreal Engine 5, and Godot 4

By BitSoul Team5/11/2026Updated 8/1/20266 min read134 views
Alpha Masking and Transparency in Game Assets: Unity, Unreal Engine 5, and Godot 4

Transparent materials are everywhere in games — foliage, chain-link fences, stained glass, bullet-hole decals, particle sprites. And they're responsible for a disproportionate share of rendering bugs: z-fighting, sorting glitches, unexpected depth write failures, and frame-rate tanks. Getting transparency right isn't just an art problem; it's an engine-pipeline problem. This guide covers the full workflow from Blender texture setup through engine-side material configuration across Unity, Unreal Engine 5, and Godot 4.

Understanding Alpha: Cutout vs. Blend vs. Dither

Before touching an engine, you need to decide which transparency mode fits your asset. Choosing wrong costs you either visual quality or GPU budget — sometimes both.

Alpha Cutout (Clip/Masked): The shader discards any pixel whose alpha falls below a threshold — typically 0.5. The result is fully opaque or fully transparent at any given pixel. This is the correct mode for foliage, chain-link fences, roof shingles, and most game-environment transparency. It's cheap, writes to the depth buffer normally, and plays well with shadow maps.

Alpha Blend: The shader blends pixel color with what's behind it using the full 0–1 alpha range. Required for glass, smoke, fire, and particles. The catch: blended objects don't write to the depth buffer, which means they must be sorted back-to-front relative to the camera every frame, or you get sorting artifacts. Always minimize the number of blended materials in a scene.

Dithered/Temporal Alpha: A screen-space dither pattern simulates smooth alpha without actual blending. Used in Unreal Engine 5's Dithered LOD transitions and for foliage fade distances. It writes depth correctly and is free of sorting issues, but looks noisy at low screen resolutions or on mobile.

| Mode | Depth Write | Sorting Required | Cost | Best For |
|------|-------------|-----------------|------|----------|
| Cutout | Yes | No | Low | Foliage, fences, decals |
| Alpha Blend | No | Yes | Medium–High | Glass, smoke, particles |
| Dither | Yes | No | Low | LOD transitions, foliage fade |
| Opaque | Yes | No | Lowest | Everything else |

Understanding Alpha: Cutout vs. Blend vs. Dither — illustrated

Preparing Alpha Textures in Blender

Most alpha issues start in the texture, not the engine. Here's the correct Blender-to-engine pipeline.

Step 1: Use a dedicated alpha channel. In Blender's Shader Editor, plug your grayscale mask into the Alpha socket of a Principled BSDF node. In the Image Texture node, set Color Space to Non-Color for the mask texture — never sRGB, which will corrupt your edge anti-aliasing.

Step 2: Choose the right export channel packing. When exporting for Unity (URP/HDRP) or Unreal Engine 5, pack the alpha mask into the alpha channel of your base color PNG. This saves a texture slot and avoids sampler overhead. In Substance Painter, set the base color export channel to RGBA and paint your opacity mask in the Opacity channel.

Step 3: Mind your alpha dilation. Color bleed at transparent edges causes dark halos at runtime. Run an alpha dilation pass before flattening. Most modern DCCs support this natively:

```python
# Blender Python: dilate alpha in a packed texture
import bpy

img = bpy.data.images['foliage_color_alpha.png']
px = list(img.pixels)
w, h = img.size

for y in range(h):
for x in range(w):
idx = (y * w + x) * 4
if px[idx + 3] < 0.05:
for dx, dy in [(-1,0),(1,0),(0,-1),(0,1)]:
nx, ny = x+dx, y+dy
if 0 <= nx < w and 0 <= ny < h:
nidx = (ny * w + nx) * 4
if px[nidx + 3] > 0.5:
px[idx:idx+3] = px[nidx:nidx+3]
break

img.pixels = px
img.save()
```

Step 4: Set the correct alpha threshold in-engine. Don't leave the clip threshold at its default. For foliage, 0.333 reduces aliasing on leaf edges while still hiding the polygon boundary cleanly.

Engine Setup: Unity URP

In Unity's Universal Render Pipeline, alpha masking is controlled by the material's Surface Type and Alpha Clipping settings.

  1. Select your material → set Surface Type to Transparent (for blend) or leave Opaque and enable Alpha Clipping (for cutout).
  2. With Alpha Clipping enabled, set Threshold to 0.333–0.5 for foliage.
  3. Enable Two Sided under the Lit Shader's advanced options for foliage planes — single-sided polygons look wrong from behind without it.
  4. For shadows: in the mesh renderer, set Cast Shadows to Two-Sided and ensure your URP Asset has Additional Lights Shadow Atlas large enough for your scene.

URP Alpha Clipping materials write to the depth prepass correctly, so they won't cause overdraw on opaque geometry behind them.

Engine Setup: Unreal Engine 5

In UE5, open your material in the Material Editor:

  1. Set Blend Mode to Masked (cutout) or Translucent (blend).
  2. Connect your packed alpha channel to the Opacity Mask input (for Masked) or Opacity input (for Translucent).
  3. Set Opacity Mask Clip Value to 0.333 in the Material Details panel.
  4. Enable Two Sided in the material if used on flat planes.
  5. For Translucent mode, set Lighting Mode to Surface ForwardShading — the default Volumetric NonDirectional looks flat on hard surfaces like glass.

Nanite does not support Masked or Translucent materials. If you're using Nanite geometry with foliage, you must disable Nanite on that mesh or use opaque geometry with pre-baked silhouettes.

Engine Setup: Unreal Engine 5 — illustrated

Engine Setup: Godot 4

Godot 4's StandardMaterial3D and ORMMaterial3D expose transparency control under the Transparency section:

  1. Set Transparency to Alpha Cut (cutout) or Alpha (blend).
  2. Set Alpha Cut Threshold to 0.333.
  3. Enable Double Sided for foliage planes.
  4. For decals, use a Decal node instead of a mesh plane — Godot 4's Decal system handles depth correctly and projects onto underlying geometry without sorting issues.

For custom shaders in Godot 4:

```glsl
shader_type spatial;
render_mode cull_disabled, depth_prepass_alpha_scissor;

uniform sampler2D albedo_tex : source_color;
uniform float alpha_scissor_threshold : hint_range(0.0, 1.0) = 0.333;

void fragment() {
vec4 col = texture(albedo_tex, UV);
ALBEDO = col.rgb;
ALPHA = col.a;
ALPHA_SCISSOR_THRESHOLD = alpha_scissor_threshold;
}
```

The `depth_prepass_alpha_scissor` render mode ensures your cutout geometry writes to the depth prepass, preventing incorrect overdraw on opaque meshes behind it.

Common Pitfalls and How to Fix Them

Z-fighting on decals: Use Polygon Offset in Unity or Godot's Decal node. In UE5, enable Allow Translucency to Sort Per Object in Project Settings for stacked decals.

Shadow casting broken on cutout foliage: In Unity, set Cast Shadows → Two Sided. In UE5, ensure the material has Cast Shadow as Masked enabled under the mesh component. In Godot 4, this is automatic for Alpha Cut materials.

Transparent objects sorting incorrectly: Never layer alpha blend materials without a depth sort strategy. In Unity URP, use the Transparent Sort Mode under Camera settings. In UE5, adjust Translucency Sort Priority per material instance. In Godot 4, set the Render Priority property on the material.

Performance on mobile: Avoid alpha blend entirely on mobile if possible — use alpha cutout or dithered alpha. Each overdraw layer from blended transparent objects is a full fragment shader pass. On tile-based mobile GPUs, overdraw from transparency is particularly expensive because tile memory can't be reused between blend passes.

Source Your Alpha-Ready Game Assets from BitSoul

Building well-optimized foliage, glass, and decal assets from scratch takes time. The BitSoul marketplace hosts a growing library of game-ready assets with correctly configured alpha channels, pre-baked normal maps, and engine-specific export presets for Unity URP, UE5, and Godot 4. Every asset on the BitSoul marketplace ships with a documented export manifest so you know exactly which texture slots carry packed alpha data — no guesswork on import.

Alpha transparency is one of those technical areas where a clean asset foundation saves hours of engine-side debugging. Use the mode table above to classify your assets, prep your alpha channels correctly in Blender, and configure your engine material to match — and your foliage, glass, and decals will render cleanly across all three major engines.

Tags: alpha masking transparency game assets Unity Unreal Engine 5 Godot 4 shaders PBR materials

Skip the modelling — download it instead

A free BitSoul account gets you 2 game-ready models every month plus 25 AI Engine credits to generate one of your own, no card required. Clean topology, PBR textures, and GLB downloads that drop straight into Unreal, Unity, Godot or Blender — plus OBJ and 3D-printable STL export.

Create a free account → Browse 846 models