RenderMaterial

public interface RenderMaterial

All model quads have an associated render material governing how the quad will be rendered.

A material instance is always immutable and thread-safe. References to a material remain valid until the end of the current game session.

Materials can be registered and shared between mods using registerMaterial. The registering mod is responsible for creating each registered material at startup.

Materials are not required to know their registration identity, and two materials with the same attributes may or may not satisfy equality and identity tests. Model implementations should never attempt to analyze materials or implement control logic based on them. They are only tokens for communicating quad attributes to the ModelRenderer.

There are three classes of materials...

STANDARD MATERIALS

Standard materials have "normal" rendering with control over lighting, color, and texture blending. In the default renderer, "normal" rendering emulates unmodified Minecraft. Other renderers may offer a different aesthetic.

The number of standard materials is finite, but not necessarily small. To find a standard material, use materialFinder.

All renderer implementations should support standard materials.

SPECIAL MATERIALS

Special materials are implemented directly by the Renderer implementation, typically with the aim of providing advanced/extended features. Such materials may offer additional vertex attributes via extensions to MeshBuilder and MutableQuadView.

Special materials can be obtained using materialById with a known identifier. Renderers may provide other means of access. Popular special materials could be implemented by multiple renderers, however there is no requirement that special materials be cross-compatible.

Functions

spriteDepth
Link copied to clipboard
abstract int spriteDepth()
How many sprite color/uv coordinates are in the material.Behavior for values > 1 is currently undefined.

Sources

jvm source
Link copied to clipboard