Interface Renderer
public interface Renderer
Interface for rendering plug-ins that provide enhanced capabilities
for model lighting, buffering and rendering. Such plug-ins implement the
enhanced model rendering interfaces specified by the Fabric API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic Rendererget()Access to the currentRendererfor creating and retrieving mesh builders and materials.@Nullable RenderMaterialReturn a material previously registered viaregisterMaterial(Identifier, RenderMaterial).Obtain a newMaterialFinderinstance to retrieve standardRenderMaterialinstances.Obtain a newMutableMeshinstance to build optimized meshes and create baked models with enhanced features.static voidRendering extension mods must implementRendererand call this method during initialization.booleanregisterMaterial(Identifier id, RenderMaterial material) Register a material for re-use by other mods or models within a mod.
-
Method Details
-
get
Access to the currentRendererfor creating and retrieving mesh builders and materials. -
register
-
mutableMesh
MutableMesh mutableMesh()Obtain a newMutableMeshinstance to build optimized meshes and create baked models with enhanced features.Renderer does not retain a reference to returned instances, so they should be re-used when possible to avoid memory allocation overhead.
-
materialFinder
MaterialFinder materialFinder()Obtain a newMaterialFinderinstance to retrieve standardRenderMaterialinstances.Renderer does not retain a reference to returned instances, so they should be re-used for multiple materials when possible to avoid memory allocation overhead.
-
materialById
Return a material previously registered viaregisterMaterial(Identifier, RenderMaterial). Will return null if no material was found matching the given identifier. -
registerMaterial
Register a material for re-use by other mods or models within a mod. The registry does not persist registrations - mods must create and register all materials at game initialization.Returns false if a material with the given identifier is already present, leaving the existing material intact.
-