Skip to content

Material System ​

Material resources loaded by the current Photon project

The browser mixes built-in and project providers; selecting a material exposes its shader, textures, and settings in the Inspector.

Materials contain shader inputs, and some also bring their own render state. Assign one under an emitter's Renderer > Material; the emitter geometry and material must be compatible.

Material options in Photon

Material Types ​

MaterialBest forMain inputs
TextureA full texture or arbitrary resourcetexture, discard threshold, HDR color/mode, pixel art, Soft Particles, Lit by Dynamic Lights
SpriteA Minecraft sprite/atlas regionsprite id, interpolation and pixel-art filtering, Soft Particles, Lit by Dynamic Lights
KilaCommon VFX looks without a graphswitchable modules, presets, particle-data drivers, its own render state
Shader GraphNew custom particle shadinggraph resource, exposed parameters, optional Own Render State
Custom ShaderExisting Core Shader filesshader id, uniforms, texture/curve/gradient samplers
UI ResourceReusing an LDLib UI texture resourceUI resource path and color
Block AtlasMinecraft block/item atlas renderingatlas sprite and Block Atlas UV rules

Texture, Sprite and Block Atlas materials hold no blend, depth or cull settings: those belong to the renderer's material slot (see Render State). Kila Material has its own page. For Lit by Dynamic Lights, see Lit Particles and Shaders.

Soft Particles ​

Since 2.2.7

Texture and Sprite materials have a Soft Particles toggle group, off by default. It fades the particle where it nears the scene behind it, hiding the hard line where a quad cuts through blocks.

OptionDefaultDescription
Fade Distance1Distance in blocks over which the particle fades, 0.001–64.
Fade Power1Shape of the fade, 0.01–16.
Fade TargetBOTHBOTH fades colour and alpha: right for Additive and Soft additive blends. ALPHA_ONLY fades alpha only: right for a classic alpha blend. The UI shows the raw enum names.

Soft particles use the pipeline's scene-depth copy, which is taken only when an enabled material asks for it. The fade is applied after fog and does not show in the material thumbnail. Shader Graph and Custom Shader materials have no toggle: use the Depth Fade node or the SamplerSceneDepth sampler.

Render State ​

Blend, culling and depth are set on the renderer's material slot.

  • Blend controls how source color/alpha combines with the framebuffer. Additive works well for fire and energy; alpha blend works for smoke and decals.
  • Depth test hides fragments behind world geometry. Depth write decides whether the effect hides later geometry. Transparent effects normally test depth but do not write it.
  • Cull removes back or front faces. Disable it for two-sided sheets; keep it for closed meshes.
  • Color/HDR multiplier tints the shader result. HDR color can exceed 1 and therefore feed bloom when HDR is enabled.
  • Pixel art uses sampling appropriate for sharp texels. Do not enable it for smooth noise or gradients.
HDR material inputs 2.2.3

Render State from the Material ​

Since 2.2.8

Some materials bring their own blend, culling and depth: a Kila Material (unless its Use Slot State is on), and a Shader Graph Material with Own Render State on. For these, the slot shows a Render State row:

ValueEffect
From MaterialDefault. The slot uses the material's state. Its own blend, cull and depth rows are hidden and replaced by "Render state from the material: …".
CustomThe slot's own rows apply.

Materials that bring no state, such as Texture, Sprite and Custom Shader, always use the slot's rows; the Render State row is hidden for them.

The slot's Blend dropdown picks a blend by name: Alpha, Additive, Soft additive, Multiply or Opaque. Custom means the factors match no preset. Blend Mode below it still holds the raw factors.

A material's render state can also turn on Back First: a double-sided mesh is drawn twice, back faces first and then front faces, so a closed transparent shield or orb sorts itself.

Geometry Compatibility ​

Texture, Sprite, Kila, Shader Graph, and Custom Shader materials work on ordinary tile particles. Model rendering also requires a model-compatible vertex path. Trail, Beam, and AraTrail provide length/point UV and normals instead of billboard UV semantics. A graph that uses only Particle Data is portable; one that reads a kind-specific Additional Data channel must be checked against the channel matrix. Kila Material draws on every geometry; see Geometry.

Since 2.2.8
Material readsParticle EmitterTrail, Beam, AraTrail
Particle Data onlywith or without GPU instancingwith or without GPU instancing
Additional Data, Custom Data, or a Kila particle-data driverwith or without GPU instancingGPU instancing only

When an emitter cannot provide what one of its materials reads, its inspector shows a Material needs data row at the top. Fix turns GPU instancing on, or adds the Custom Data stream a Kila driver reads.

WARNING

A material can compile while a selected data channel is unsupported by its emitter. Unsupported Additional Data deliberately reads zero, so the symptom is usually a static or invisible effect—not a shader compile error.

Project and Global Resources ​

Project materials travel with the .fxproj and are collected when exporting an FX Pack. Global resources are reusable while authoring but must be present under the exported namespace at runtime. Prefer project resources for effects intended for distribution, and use stable lower-case resource paths.

Released under the MIT License.