Particle materials
A particle effect names one material (basic_render_parameters.material) and one texture; every quad of the effect
draws with them. Sourced · bridge. (vanilla resource pack copy) Materials are declared in materials/particles.material
as name:parent entries that add defines (+defines), render states (+states), sampler states (+samplerStates) and
blend factors (blendSrc, blendDst) over their parent’s, in the same format as
entity materials. Sourced · bridge. (vanilla resource pack copy)
Vanilla materials
Section titled “Vanilla materials”| Material | Defines and states | Confidence |
|---|---|---|
particles_base |
The texture sampled with Point filtering (samplerIndex 0); no defines or states |
Sourced · bridge. (vanilla resource pack copy) |
particles_opaque |
ENABLE_FOG, DisableAlphaWrite |
Sourced · bridge. (vanilla resource pack copy) |
particles_alpha |
ALPHA_TEST, ENABLE_FOG, DisableAlphaWrite |
Sourced · bridge. (vanilla resource pack copy) |
particles_blend |
ENABLE_FOG, Blending, DisableCulling, DisableDepthWrite |
Sourced · bridge. (vanilla resource pack copy) |
particles_effects |
particles_alpha + EFFECTS_OFFSET |
Sourced · bridge. (vanilla resource pack copy) |
The fragment shader
Section titled “The fragment shader”The fragment shader samples the texture, then multiplies the texel by the vertex colour (the effect’s
particle_appearance_tinting colour) and applies fog to the colour channels. Sourced · RenderDragonSourceCodeInv
With ALPHA_TEST it discards a fragment whose texel alpha is below 0.5, tested before the tint, and after the tint
and fog it writes an alpha of 1.0. Sourced · RenderDragonSourceCodeInv Without ALPHA_TEST it discards nothing.
Sourced · RenderDragonSourceCodeInv
Two consequences follow from that order. Inferred An alpha-tested material ignores the tint’s alpha: a
particles_alpha effect whose tint gradient fades the alpha to 0 stays fully drawn until it expires, and only a
texture’s own cut-out shapes it. Inferred An alpha-tested material that also blends (a pack’s ALPHA_TEST material with
Blending and blendSrc: SourceAlpha, blendDst: One) adds each surviving texel’s colour at full weight, and draws
nothing at all from a texture whose alpha stays below 0.5 everywhere, such as a soft glow. Inferred
The shader above is reconstructed from the 1.20.20 renderer; later renderers’ particle shaders are not published.