Interface MaterialFinder
- All Superinterfaces:
MaterialView
RenderMaterial
instances used to communicate
quad rendering characteristics to a RenderContext
.
Must be obtained via Renderer.materialFinder()
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault MaterialFinder
ambientOcclusion
(TriState mode) Controls whether vertex color(s) will be modified for ambient occlusion.default MaterialFinder
Deprecated.default MaterialFinder
blendMode
(int spriteIndex, RenderLayer renderLayer) Deprecated.UseblendMode(BlendMode)
instead.default MaterialFinder
Defines how sprite pixels will be blended with the scene.clear()
Resets this instance to default values.default MaterialFinder
copyFrom
(MaterialView material) Copies all properties from the givenMaterialView
to this material finder.default MaterialFinder
disableAo
(int spriteIndex, boolean disable) Deprecated.UseambientOcclusion(TriState)
instead.default MaterialFinder
disableColorIndex
(boolean disable) Vertex color(s) will be modified for quad color index unless disabled.default MaterialFinder
disableColorIndex
(int spriteIndex, boolean disable) Deprecated.UsedisableColorIndex(boolean)
instead.default MaterialFinder
disableDiffuse
(boolean disable) Vertex color(s) will be modified for diffuse shading unless disabled.default MaterialFinder
disableDiffuse
(int spriteIndex, boolean disable) Deprecated.UsedisableDiffuse(boolean)
instead.default MaterialFinder
emissive
(boolean isEmissive) When true, sprite texture and color will be rendered at full brightness.default MaterialFinder
emissive
(int spriteIndex, boolean isEmissive) Deprecated.Useemissive(boolean)
instead.find()
Returns the standard material encoding all of the current settings in this finder.default MaterialFinder
Controls whether glint should be applied.default MaterialFinder
spriteDepth
(int depth) Deprecated.Methods inherited from interface net.fabricmc.fabric.api.renderer.v1.material.MaterialView
ambientOcclusion, blendMode, disableColorIndex, disableDiffuse, emissive, glint
-
Method Details
-
blendMode
Defines how sprite pixels will be blended with the scene.See
BlendMode
for more information.- API Note:
- The default implementation will be removed in the next breaking release.
-
disableColorIndex
Vertex color(s) will be modified for quad color index unless disabled.- API Note:
- The default implementation will be removed in the next breaking release.
-
emissive
When true, sprite texture and color will be rendered at full brightness. Lightmap values provided viaQuadView.lightmap(int)
will be ignored. False by defaultThis 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
disableDiffuse(boolean)
andambientOcclusion(TriState)
.- API Note:
- The default implementation will be removed in the next breaking release.
-
disableDiffuse
Vertex color(s) will be modified for diffuse shading unless disabled.This property is guaranteed to be respected in block contexts. Some renderers may also respect it in item contexts, but this is not guaranteed.
- API Note:
- The default implementation will be removed in the next breaking release.
-
ambientOcclusion
Controls whether vertex color(s) will be modified for ambient occlusion.By default, ambient occlusion will be used if
the model uses ambient occlusion
and the block state hasa luminance
of 0. Set toTriState.TRUE
orTriState.FALSE
to override this behavior.This property is respected only in block contexts. It will not have an effect in other contexts.
- API Note:
- The default implementation will be removed in the next breaking release.
-
glint
Controls whether glint should be applied.By default, glint will be applied in item contexts if
the item stack has glint
. Set toTriState.TRUE
orTriState.FALSE
to override this behavior.This property is guaranteed to be respected in item contexts. Some renderers may also respect it in block contexts, but this is not guaranteed.
- API Note:
- The default implementation will be removed in the next breaking release.
-
copyFrom
Copies all properties from the givenMaterialView
to this material finder.- API Note:
- The default implementation will be removed in the next breaking release.
-
clear
MaterialFinder clear()Resets this instance to default values. Values will match those in effect when an instance is newly obtained viaRenderer.materialFinder()
. -
find
RenderMaterial 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. -
blendMode
Deprecated.UseblendMode(BlendMode)
instead. -
blendMode
Deprecated.UseblendMode(BlendMode)
instead. -
disableColorIndex
Deprecated.UsedisableColorIndex(boolean)
instead. -
emissive
Deprecated.Useemissive(boolean)
instead. -
disableDiffuse
Deprecated.UsedisableDiffuse(boolean)
instead. -
disableAo
Deprecated.UseambientOcclusion(TriState)
instead. -
spriteDepth
Deprecated.Do not use. Does nothing.
-
blendMode(BlendMode)
instead.