# `MaterialSpec.alphaMode`

> Contract 2.0.0 · package sha256 `a857eca95b35921109faf997094bb4192f12527d9d0fcd4be7e97f06425bad6e` · generated from `configurator-runtime.d.ts` by `services/onsite-scripter/scripts/build-contract-docs.mjs`; edit the source, not this file.

Property of [`MaterialSpec`](MaterialSpec.md) · inherited by [`MaterialInput`](MaterialInput.md) · stable · since 2.0.0

```ts
alphaMode?: 'opaque' | 'mask' | 'blend';
```

'mask' cuts holes (also in the shadow) below [`alphaCutoff`](MaterialSpec.alphaCutoff.md). 'blend' writes no depth, as glTF
loaders treat BLEND, also at [`alpha`](MaterialSpec.alpha.md) 1: `labs.drawOrder` orders it among transparent parts, and
`labs.depthPrepass` gives it depth without self-overlap.
Over a part, an omitted `alphaMode` keeps the underlying one, as every field does, so a ghost
over an opaque GLB material sets both,
[`find(q).set({ material: { alpha: 0.35, alphaMode: 'blend' } })`](PartActions.set.md); `{ alpha: 0.35 }` alone
draws it solid. A stored MaterialNode's alpha map with `alphaMapTextureEnabled: true` brings
'blend' (spec section 8.2, rule 1).

**Default:** on a new mesh, 'blend' when alpha < 1 or an alpha map is set, else 'opaque'

## Generic-API test (spec 3.1)

| Rule | Result |
| --- | --- |
| 1. Neutral name | pass: `alphaMode` names no product |
| 2. A precedent | pass: [Unity Material.renderQueue](https://docs.unity3d.com/ScriptReference/Material-renderQueue.html) (row `K13`); [Babylon.js AbstractMesh.renderingGroupId](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Meshes/abstractMesh.ts) (row `K13`); [glTF 2.0 alpha coverage (MASK)](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#alpha-coverage) (row `K14`) |
| 3. Two apps, or labs | pass: 8 apps (ledger: app-4f16d2f6da, app-b362a81c85, app-b4ae2fce25, app-bcb7ef21da, app-ceb4eccc72, app-ddfb017681, app-fc07850558, app-fc306ec3dc; fleet cross-check: app-fc07850558) |
| 4. The cheaper fix first | decided per need in Appendix B: rows `K13`, `K14` at tier labs, stable (a member only where no rule, data, asset or app code serves the need) |
