Interface MaterialFinder
- All Superinterfaces:
MaterialView
RenderMaterial
instances used to communicate
quad rendering characteristics to the renderer.
Must be obtained via Renderer.materialFinder()
.
-
Method Summary
Modifier and TypeMethodDescriptionambientOcclusion
(TriState mode) Controls whether vertex colors should be modified for ambient occlusion.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.disableDiffuse
(boolean disable) Controls whether vertex colors should be modified for diffuse shading.emissive
(boolean isEmissive) When true, sprite texture and color will be rendered at full brightness.find()
Returns the standard material encoding all the current settings in this finder.Controls how 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.Methods inherited from interface net.fabricmc.fabric.api.renderer.v1.material.MaterialView
ambientOcclusion, blendMode, disableDiffuse, emissive, glintMode, shadeMode
-
Method Details
-
blendMode
Controls how sprite pixels should be blended with the scene.The default value is
BlendMode.DEFAULT
.- See Also:
-
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.
-
glintMode
Controls how glint should be applied.If set to
GlintMode.DEFAULT
, glint will be applied in item contexts based on the glint type of the layer. Set to another value to override this behavior.The default value is
GlintMode.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 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.
-