Interface MaterialFinder


public interface MaterialFinder
Finds standard RenderMaterial instances used to communicate quad rendering characteristics to a RenderContext.

Must be obtained via Renderer.materialFinder().

  • Method Summary

    Modifier and Type Method Description
    MaterialFinder blendMode​(int spriteIndex, BlendMode blendMode)
    Defines how sprite pixels will be blended with the scene.
    default MaterialFinder blendMode​(int spriteIndex, net.minecraft.client.render.RenderLayer renderLayer)
    Deprecated.
    Use BlendMode version instead.
    MaterialFinder clear()
    Resets this instance to default values.
    MaterialFinder disableAo​(int spriteIndex, boolean disable)
    Vertex color(s) will be modified for ambient occlusion unless disabled.
    MaterialFinder disableColorIndex​(int spriteIndex, boolean disable)
    Vertex color(s) will be modified for quad color index unless disabled.
    MaterialFinder disableDiffuse​(int spriteIndex, boolean disable)
    Vertex color(s) will be modified for diffuse shading unless disabled.
    MaterialFinder emissive​(int spriteIndex, boolean isEmissive)
    When true, sprite texture and color will be rendered at full brightness.
    RenderMaterial find()
    Returns the standard material encoding all of the current settings in this finder.
    MaterialFinder spriteDepth​(int depth)
    Reserved for future use.
  • Method Details

    • find

      Returns the standard material encoding all of the current settings in this finder. The settings in this finder are not changed.

      Resulting instances can and should be re-used to prevent needless memory allocation. Renderer implementations may or may not cache standard material instances.

    • clear

      Resets this instance to default values. Values will match those in effect when an instance is newly obtained via Renderer.materialFinder().
    • spriteDepth

      MaterialFinder spriteDepth​(int depth)
      Reserved for future use. Behavior for values > 1 is currently undefined.
    • blendMode

      @Deprecated default MaterialFinder blendMode​(int spriteIndex, net.minecraft.client.render.RenderLayer renderLayer)
      Deprecated.
      Use BlendMode version instead.
      Defines how sprite pixels will be blended with the scene. Accepts {link @BlockRenderLayer} values and blending behavior will emulate the way that Minecraft renders those instances. This does NOT mean the sprite will be rendered in a specific render pass - some implementations may not use the standard vanilla render passes.

      CAN be null and is null by default. A null value means the renderer will use the value normally associated with the block being rendered, or TRANSLUCENT for item renders. (Normal Minecraft rendering)

    • blendMode

      MaterialFinder blendMode​(int spriteIndex, BlendMode blendMode)
      Defines how sprite pixels will be blended with the scene.

      See BlendMode for more information.

    • disableColorIndex

      MaterialFinder disableColorIndex​(int spriteIndex, boolean disable)
      Vertex color(s) will be modified for quad color index unless disabled.
    • disableDiffuse

      MaterialFinder disableDiffuse​(int spriteIndex, boolean disable)
      Vertex color(s) will be modified for diffuse shading unless disabled.
    • disableAo

      MaterialFinder disableAo​(int spriteIndex, boolean disable)
      Vertex color(s) will be modified for ambient occlusion unless disabled.
    • emissive

      MaterialFinder emissive​(int spriteIndex, boolean isEmissive)
      When true, sprite texture and color will be rendered at full brightness. Lightmap values provided via QuadView.lightmap(int) will be ignored. False by default

      This is the preferred method for emissive lighting effects. Some renderers with advanced lighting models may not use block lightmaps and this method will allow per-sprite emissive lighting in future extensions that support overlay sprites.

      Note that color will still be modified by diffuse shading and ambient occlusion, unless disabled via disableAo(int, boolean) and disableDiffuse(int, boolean).