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 Renderer
get()
Access to the currentRenderer
for creating and retrieving mesh builders and materials.@Nullable RenderMaterial
Return a material previously registered viaregisterMaterial(Identifier, RenderMaterial)
.Obtain a newMaterialFinder
instance to retrieve standardRenderMaterial
instances.Obtain a newMutableMesh
instance to build optimized meshes and create baked models with enhanced features.static void
Rendering extension mods must implementRenderer
and call this method during initialization.boolean
registerMaterial
(Identifier id, RenderMaterial material) Register a material for re-use by other mods or models within a mod.
-
Method Details
-
get
Access to the currentRenderer
for creating and retrieving mesh builders and materials. -
register
-
mutableMesh
MutableMesh mutableMesh()Obtain a newMutableMesh
instance 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 newMaterialFinder
instance to retrieve standardRenderMaterial
instances.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.
-