Package com.mojang.blaze3d.vertex
Class BufferBuilder
java.lang.Object
com.mojang.blaze3d.vertex.DefaultedVertexConsumer
com.mojang.blaze3d.vertex.BufferBuilder
- All Implemented Interfaces:
BufferVertexConsumer,VertexConsumer,IVertexConsumerExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordclassstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ByteBufferprivate booleanprivate booleanprivate VertexFormatElementprivate intprivate booleanprivate VertexFormatprivate booleanprivate booleanprivate static final org.slf4j.Loggerprivate static final intprivate VertexFormat.Modeprivate intprivate intprivate intprivate VertexSortingprivate org.joml.Vector3f[]private intFields inherited from class com.mojang.blaze3d.vertex.DefaultedVertexConsumer
defaultA, defaultB, defaultColorSet, defaultG, defaultR -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbegin(VertexFormat.Mode p_166780_, VertexFormat p_166781_) (package private) ByteBufferbufferSlice(int p_231170_, int p_231171_) booleanbuilding()private voidvoidclear()color(int p_85692_, int p_85693_, int p_85694_, int p_85695_) voiddiscard()end()voidprivate voidensureCapacity(int p_85723_) private voidprivate voidprivate it.unimi.dsi.fastutil.ints.IntConsumerintConsumer(int p_231159_, VertexFormat.IndexType p_231160_) booleanprivate org.joml.Vector3f[]voidvoidputBulkData(ByteBuffer buffer) voidputByte(int p_85686_, byte p_85687_) voidputFloat(int p_85689_, float p_85690_) voidputShort(int p_85700_, short p_85701_) private voidputSortedQuadIndices(VertexFormat.IndexType p_166787_) voidrelease()(package private) voidprivate voidreset()voidrestoreSortState(BufferBuilder.SortState p_166776_) voidsetQuadSorting(VertexSorting p_277454_) private BufferBuilder.RenderedBufferprivate voidswitchFormat(VertexFormat p_85705_) voidvertex(float p_85671_, float p_85672_, float p_85673_, float p_85674_, float p_85675_, float p_85676_, float p_85677_, float p_85678_, float p_85679_, int p_85680_, int p_85681_, float p_85682_, float p_85683_, float p_85684_) Methods inherited from class com.mojang.blaze3d.vertex.DefaultedVertexConsumer
defaultColor, unsetDefaultColorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.mojang.blaze3d.vertex.BufferVertexConsumer
normal, overlayCoords, uv, uv2, uvShort, vertexMethods inherited from interface net.neoforged.neoforge.client.extensions.IVertexConsumerExtension
applyBakedLighting, applyBakedNormals, misc, putBulkDataMethods inherited from interface com.mojang.blaze3d.vertex.VertexConsumer
color, color, defaultColor, normal, overlayCoords, putBulkData, putBulkData, unsetDefaultColor, uv2, vertex, vertex
-
Field Details
-
MAX_GROWTH_SIZE
private static final int MAX_GROWTH_SIZE- See Also:
-
LOGGER
private static final org.slf4j.Logger LOGGER -
buffer
-
closed
private boolean closed -
renderedBufferCount
private int renderedBufferCount -
renderedBufferPointer
private int renderedBufferPointer -
nextElementByte
private int nextElementByte -
vertices
private int vertices -
currentElement
-
elementIndex
private int elementIndex -
format
-
mode
-
fastFormat
private boolean fastFormat -
fullFormat
private boolean fullFormat -
building
private boolean building -
sortingPoints
@Nullable private org.joml.Vector3f[] sortingPoints -
sorting
-
indexOnly
private boolean indexOnly
-
-
Constructor Details
-
BufferBuilder
public BufferBuilder(int p_85664_)
-
-
Method Details
-
ensureVertexCapacity
private void ensureVertexCapacity() -
ensureCapacity
private void ensureCapacity(int p_85723_) -
setQuadSorting
-
getSortState
-
checkOpen
private void checkOpen() -
restoreSortState
-
begin
-
switchFormat
-
intConsumer
private it.unimi.dsi.fastutil.ints.IntConsumer intConsumer(int p_231159_, VertexFormat.IndexType p_231160_) -
makeQuadSortingPoints
private org.joml.Vector3f[] makeQuadSortingPoints() -
putSortedQuadIndices
-
isCurrentBatchEmpty
public boolean isCurrentBatchEmpty() -
endOrDiscardIfEmpty
-
end
-
ensureDrawing
private void ensureDrawing() -
storeRenderedBuffer
-
reset
private void reset() -
putByte
public void putByte(int p_85686_, byte p_85687_) - Specified by:
putBytein interfaceBufferVertexConsumer
-
putShort
public void putShort(int p_85700_, short p_85701_) - Specified by:
putShortin interfaceBufferVertexConsumer
-
putFloat
public void putFloat(int p_85689_, float p_85690_) - Specified by:
putFloatin interfaceBufferVertexConsumer
-
endVertex
public void endVertex()- Specified by:
endVertexin interfaceVertexConsumer
-
nextElement
public void nextElement()- Specified by:
nextElementin interfaceBufferVertexConsumer
-
color
- Specified by:
colorin interfaceBufferVertexConsumer- Specified by:
colorin interfaceVertexConsumer
-
vertex
public void vertex(float p_85671_, float p_85672_, float p_85673_, float p_85674_, float p_85675_, float p_85676_, float p_85677_, float p_85678_, float p_85679_, int p_85680_, int p_85681_, float p_85682_, float p_85683_, float p_85684_) - Specified by:
vertexin interfaceVertexConsumer
-
releaseRenderedBuffer
void releaseRenderedBuffer() -
clear
public void clear() -
discard
public void discard() -
release
public void release() -
currentElement
- Specified by:
currentElementin interfaceBufferVertexConsumer
-
building
public boolean building() -
bufferSlice
-
putBulkData
-