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 TypeMethodDescriptionambientOcclusion
(TriState mode) Controls whether vertex colors should be modified for ambient occlusion.default MaterialFinder
Deprecated.default MaterialFinder
blendMode
(int spriteIndex, RenderLayer renderLayer) Deprecated.UseblendMode(BlendMode)
instead.Controls how sprite pixels should be blended with the scene.clear()
Resets this instance to default values.copyFrom
(MaterialView material) Copies all properties from the givenMaterialView
to this material finder.default MaterialFinder
disableAo
(int spriteIndex, boolean disable) Deprecated.UseambientOcclusion(TriState)
instead.disableColorIndex
(boolean disable) Controls whether vertex colors should be modified for quad coloring.default MaterialFinder
disableColorIndex
(int spriteIndex, boolean disable) Deprecated.UsedisableColorIndex(boolean)
instead.disableDiffuse
(boolean disable) Controls whether vertex colors should be modified for diffuse shading.default MaterialFinder
disableDiffuse
(int spriteIndex, boolean disable) Deprecated.UsedisableDiffuse(boolean)
instead.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.Controls whether glint should be applied.A hint to the renderer about how the quad is intended to be shaded, for example through ambient occlusion and diffuse shading.default MaterialFinder
spriteDepth
(int depth) Deprecated.Methods inherited from interface net.fabricmc.fabric.api.renderer.v1.material.MaterialView
ambientOcclusion, blendMode, disableColorIndex, disableDiffuse, emissive, glint, shadeMode
-
Method Details
-
blendMode
Controls how sprite pixels should be blended with the scene.The default value is
BlendMode.DEFAULT
.- See Also:
-
disableColorIndex
Controls whether vertex colors should be modified for quad coloring. This property is inverted, so a value offalse
means that quad coloring will be applied.The default value is
false
. -
emissive
When true, sprite texture and color will be rendered at full brightness. Lightmap values provided viaQuadView.lightmap(int)
will be ignored.This is the preferred method for emissive lighting effects. Some renderers with advanced lighting pipelines 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)
.The default value is
false
. -
disableDiffuse
Controls whether vertex colors should be modified for diffuse shading. This property is inverted, so a value offalse
means that diffuse shading will be applied.The default value is
false
.This property is guaranteed to be respected in block contexts. Some renderers may also respect it in item contexts, but this is not guaranteed.
-
ambientOcclusion
Controls whether vertex colors should be modified for ambient occlusion.If set to
TriState.DEFAULT
, ambient occlusion will be used if the model uses ambient occlusion and the block state has a luminance of 0. Set toTriState.TRUE
orTriState.FALSE
to override this behavior.TriState.TRUE
will not have an effect if ambient occlusion is disabled globally.The default value is
TriState.DEFAULT
.This property is respected only in block contexts. It will not have an effect in other contexts.
-
glint
Controls whether glint should be applied.If set to
TriState.DEFAULT
, glint will be applied in item contexts if the item stack has glint. Set toTriState.TRUE
orTriState.FALSE
to override this behavior.The default value is
TriState.DEFAULT
.This property is guaranteed to be respected in item contexts. Some renderers may also respect it in block contexts, but this is not guaranteed.
-
shadeMode
A hint to the renderer about how the quad is intended to be shaded, for example through ambient occlusion and diffuse shading. The renderer is free to ignore this hint.The default value is
ShadeMode.ENHANCED
.This property is respected only in block contexts. It will not have an effect in other contexts.
- See Also:
-
copyFrom
Copies all properties from the givenMaterialView
to this material finder. -
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.