Entity materials
An entity material is a named set of shader defines and render states. A client entity maps its own material names to
these ("default": "cat"), and a render controller assigns them to bones; each define switches on one stage of the
entity shader. Sourced · bridge. (vanilla resource pack copy) Materials are declared in materials/entity.material as
name:parent entries that add or remove defines (+defines, -defines) and states (+states, such as Blending,
DisableCulling, DisableDepthWrite, DisableAlphaWrite) over their parent’s. Sourced · bridge. (vanilla resource pack copy)
None of the 226 tagged bedrock-samples releases carries a resource_pack/materials folder. Observed · every bedrock-samples tag
Materials newer than the 1.16 file (warden_bioluminescent_layer, player_spectator, copper_golem, allay) are
named by the vanilla client entities but defined neither in the 1.16 file nor in any samples release; a code search of GitHub for
warden_bioluminescent_layer finds only client entity and texture files. Observed · GitHub code search for warden_bioluminescent_layer
What the defines do
Section titled “What the defines do”The stages below are those of the 1.16-era GLSL entity shader, in the order the fragment shader runs them: texture,
alpha test, vertex colour, colour mask, multi-texture, overlay, light, fog, glint. Sourced · SlimeChunkDisplay (shader pack)
MASKED_MULTITEXTURE runs between the texture read and the alpha test, so the alpha test sees the masked result.
Sourced · SlimeChunkDisplay (shader pack)
| Define | Effect | Confidence |
|---|---|---|
ALPHA_TEST |
Discards a texel with alpha below 0.5; with USE_COLOR_MASK, only a texel with alpha 0; with USE_EMISSIVE, only a texel whose r + g + b + a is 0 (with USE_ONLY_EMISSIVE, alpha 0 or 1) |
Sourced · SlimeChunkDisplay (shader pack) |
USE_COLOR_MASK |
rgb = mix(rgb, rgb * CHANGE_COLOR.rgb, a), then a *= CHANGE_COLOR.a: the texel’s own alpha is how far the change colour tints it |
Sourced · SlimeChunkDisplay (shader pack) |
MULTI_COLOR_TINT |
The texture is a mask: rgb = mask.r * CHANGE_COLOR.rgb, replaced by mask.g * MULTIPLICATIVE_TINT_CHANGE_COLOR wherever mask.g is above 0 |
Sourced · SlimeChunkDisplay (shader pack) |
MASKED_MULTITEXTURE |
Reads the second texture (TEXTURE_1) at the same coordinates and keeps it, except where it is coloured but not opaque (r + g + b above 0 and alpha below 1), where the first texture shows through: color = mix(tex1, color, float(dot(tex1.rgb, vec3(1)) * (1 - tex1.a) > 0)) |
Sourced · SlimeChunkDisplay (shader pack) |
USE_OVERLAY |
rgb = mix(rgb, OVERLAY_COLOR.rgb, OVERLAY_COLOR.a), before the light |
Sourced · SlimeChunkDisplay (shader pack) |
USE_EMISSIVE |
color *= mix(1, light, a) instead of color *= light: a texel takes the light by its alpha, so a transparent texel draws at full brightness |
Sourced · SlimeChunkDisplay (shader pack) |
TINTED_ALPHA_TEST |
The alpha test runs on a * OVERLAY_COLOR.a |
Sourced · SlimeChunkDisplay (shader pack) |
USE_UV_ANIM |
In the vertex shader, uv = UV_ANIM.xy + uv * UV_ANIM.zw |
Sourced · SlimeChunkDisplay (shader pack) |
The base entity material defines USE_OVERLAY, so nearly every entity material inherits it. Sourced · bridge. (vanilla resource pack copy)
Vanilla materials that read these colours
Section titled “Vanilla materials that read these colours”| Material | Parent and additions | Confidence |
|---|---|---|
entity |
entity_static + USE_OVERLAY; culled, opaque. chicken and fox are plain entity |
Sourced · bridge. (vanilla resource pack copy) |
entity_alphatest |
entity_nocull + ALPHA_TEST |
Sourced · bridge. (vanilla resource pack copy) |
entity_alphablend |
entity + state Blending, with a vertex colour; culled |
Sourced · bridge. (vanilla resource pack copy) |
entity_emissive_alpha |
entity_nocull + ALPHA_TEST, USE_EMISSIVE |
Sourced · bridge. (vanilla resource pack copy) |
villager_v2 |
entity_alphatest with depthFunc LessEqual |
Sourced · bridge. (vanilla resource pack copy) |
entity_multitexture_masked |
entity_alphatest + MASKED_MULTITEXTURE, both samplers clamped |
Sourced · bridge. (vanilla resource pack copy) |
villager_v2_masked, zombie_villager_v2_masked |
entity_multitexture_masked with depthFunc LessEqual |
Sourced · bridge. (vanilla resource pack copy) |
entity_change_color |
entity_nocull + USE_OVERLAY, USE_COLOR_MASK |
Sourced · bridge. (vanilla resource pack copy) |
entity_alphatest_change_color |
entity_change_color + ALPHA_TEST, USE_COLOR_MASK, state DisableAlphaWrite |
Sourced · bridge. (vanilla resource pack copy) |
cat |
entity_alphatest_change_color |
Sourced · bridge. (vanilla resource pack copy) |
wolf, sheep |
entity_change_color |
Sourced · bridge. (vanilla resource pack copy) |
experience_orb |
entity + the defines USE_UV_ANIM, ALPHA_TEST, Blending, USE_OVERLAY, USE_MASK (Blending listed as a define, not a state) |
Sourced · bridge. (vanilla resource pack copy) |
charged_creeper |
entity_static + USE_UV_ANIM, ALPHA_TEST, additive blending (One, One) |
Sourced · bridge. (vanilla resource pack copy) |
Where the colours come from
Section titled “Where the colours come from”CHANGE_COLORis the render controller’scolorwhen it has one, and otherwise the entity’s own colour, its behaviour componentminecraft:color(a tame cat’s or wolf’s collar, a sheep’s wool; see behaviour components). Inferred This fits the vanilla data: the cat, wolf and sheep materials mask by it while their render controllers set nocolor, and the horse’s controller givesthisas the fallback of its armour-dyecolor. InferredOVERLAY_COLORis the render controller’soverlay_color. InferredUV_ANIMis the render controller’suv_anim(offsetinxy,scaleinzw). Inferred
Villager clothes
Section titled “Villager clothes”The villager’s middle render controller draws the biome clothes (array.biomes[query.mark_variant]) as the first
texture and the profession (array.professions[variable.profession_index]) as the second, with Material.masked
except for a baby or an unskilled villager (profession 0), which get Material.default and so show the biome clothes
alone. Observed · the villager_v2 render controllers of bedrock-samples v1.26.60.5 With villager_v2_masked, the
profession outfit covers the biome clothes wherever it is opaque or empty-black, and lets them through only at its
coloured, translucent texels. Inferred · from the define’s shader line The numbers these arrays are indexed by come
from behaviour components.
Tame cat textures
Section titled “Tame cat textures”The tame cat textures mark the collar for the colour mask: in 24 of the 25 vanilla *_tame*.tga cat textures, the
16 collar texels have alpha 255 and the rest of the body alpha 4 (adults) or 1 (babies), so the body is drawn (alpha
above 0 passes the colour-mask alpha test) and barely tinted while the collar takes the collar colour in full.
Observed · the 25 tame cat textures of bedrock-samples v1.26.60.5 graytabby_tame.tga holds only the 16 collar texels.
Observed · the 25 tame cat textures of bedrock-samples v1.26.60.5 Drawn with a plain alpha test (below 0.5 discarded),
a tame cat would show only its collar. Inferred
The game has since moved to a renderer that compiles its materials, and no material file of it is published. Whether
the newer materials (warden_bioluminescent_layer, whose controllers pulse color.a, and player_spectator, drawn
with a color alpha of 0.3) use USE_COLOR_MASK or another stage to apply that alpha is not known.