Class QuadBakingVertexConsumer
java.lang.Object
net.neoforged.neoforge.client.model.pipeline.QuadBakingVertexConsumer
- All Implemented Interfaces:
VertexConsumer
,IVertexConsumerExtension
Vertex consumer that outputs baked quads.
This consumer accepts data in DefaultVertexFormat.BLOCK
and is not picky about
ordering or missing elements, but will not automatically populate missing data (color will be black, for example).
Built quads must be retrieved after building four vertices
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private Direction
private final Map
<VertexFormatElement, Integer> private boolean
private static final int
private final int[]
private boolean
private TextureAtlasSprite
private int
private int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddVertex
(float x, float y, float z) bakeQuad()
misc
(VertexFormatElement element, int... rawData) Consumes an unknownVertexFormatElement
as a raw int data array.setColor
(int r, int g, int b, int a) void
setDirection
(Direction direction) void
setHasAmbientOcclusion
(boolean hasAmbientOcclusion) setNormal
(float x, float y, float z) void
setShade
(boolean shade) void
setSprite
(TextureAtlasSprite sprite) void
setTintIndex
(int tintIndex) setUv
(float u, float v) setUv1
(int u, int v) setUv2
(int u, int v) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.neoforge.client.extensions.IVertexConsumerExtension
applyBakedLighting, applyBakedNormals, putBulkData
Methods inherited from interface com.mojang.blaze3d.vertex.VertexConsumer
addVertex, addVertex, addVertex, addVertex, addVertex, putBulkData, putBulkData, setColor, setColor, setLight, setNormal, setOverlay, setWhiteAlpha
-
Field Details
-
ELEMENT_OFFSETS
-
QUAD_DATA_SIZE
private static final int QUAD_DATA_SIZE -
quadData
private final int[] quadData -
vertexIndex
private int vertexIndex -
building
private boolean building -
tintIndex
private int tintIndex -
direction
-
sprite
-
shade
private boolean shade -
hasAmbientOcclusion
private boolean hasAmbientOcclusion
-
-
Constructor Details
-
QuadBakingVertexConsumer
public QuadBakingVertexConsumer()
-
-
Method Details
-
addVertex
- Specified by:
addVertex
in interfaceVertexConsumer
-
setNormal
- Specified by:
setNormal
in interfaceVertexConsumer
-
setColor
- Specified by:
setColor
in interfaceVertexConsumer
-
setUv
- Specified by:
setUv
in interfaceVertexConsumer
-
setUv1
- Specified by:
setUv1
in interfaceVertexConsumer
-
setUv2
- Specified by:
setUv2
in interfaceVertexConsumer
-
misc
Description copied from interface:IVertexConsumerExtension
Consumes an unknownVertexFormatElement
as a raw int data array.If the consumer needs to store the data for later use, it must copy it. There are no guarantees on immutability.
- Specified by:
misc
in interfaceIVertexConsumerExtension
-
setTintIndex
public void setTintIndex(int tintIndex) -
setDirection
-
setSprite
-
setShade
public void setShade(boolean shade) -
setHasAmbientOcclusion
public void setHasAmbientOcclusion(boolean hasAmbientOcclusion) -
bakeQuad
-