Package net.minecraft.client.gl
Class VertexBuffer
java.lang.Object
net.minecraft.client.gl.VertexBuffer
- All Implemented Interfaces:
- AutoCloseable
Stores vertex data on GPU.
 
If you don't need to change the geometry, you can upload data once
 and reuse it every frame. For example, 
 uses this technique to save bandwidth.invalid reference
star rendering
- Implementation Note:
- This is mostly a wrapper around vertex buffer object (VBO), element buffer object (EBO), and vertex array object (VAO).
- Mappings:
- Namespace - Name - named - net/minecraft/client/gl/VertexBuffer- intermediary - net/minecraft/class_291- official - ffy
- 
Field SummaryFieldsModifier and TypeFieldDescriptionprivate VertexFormat.DrawModeprivate intprivate VertexFormat.IndexTypeprivate RenderSystem.ShapeIndexBufferprivate final GlUsageprivate intprivate final GpuBufferprivate @Nullable VertexFormat
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidbind()Sets this vertex buffer as the current one.voidclose()static VertexBuffercreateAndUpload(VertexFormat.DrawMode drawMode, VertexFormat format, Consumer<VertexConsumer> callback) voiddraw()Draws the contents in this vertex buffer.voiddraw(RenderLayer layer) voiddraw(Matrix4f viewMatrix, Matrix4f projectionMatrix, @Nullable ShaderProgram program) Draws the contents in this vertex buffer withprogram.private VertexFormat.IndexTypebooleanisClosed()static voidunbind()voidupload(BuiltBuffer data) Uploads the contents ofbufferto GPU, discarding previously uploaded data.private RenderSystem.ShapeIndexBufferuploadIndexBuffer(BuiltBuffer.DrawParameters parameters, @Nullable ByteBuffer buf) voidprivate VertexFormatuploadVertexBuffer(BuiltBuffer.DrawParameters parameters, @Nullable ByteBuffer vertexBuffer) 
- 
Field Details- 
usage- Mappings:
- Namespace - Name - Mixin selector - named - usage- Lnet/minecraft/client/gl/VertexBuffer;usage:Lnet/minecraft/client/gl/GlUsage;- intermediary - field_44792- Lnet/minecraft/class_291;field_44792:Lnet/minecraft/class_8555;- official - a- Lffy;a:Lfdp;
 
- 
vertexBuffer- Mappings:
- Namespace - Name - Mixin selector - named - vertexBuffer- Lnet/minecraft/client/gl/VertexBuffer;vertexBuffer:Lnet/minecraft/client/gl/GpuBuffer;- intermediary - field_1594- Lnet/minecraft/class_291;field_1594:Lnet/minecraft/class_10227;- official - b- Lffy;b:Lfdq;
 
- 
indexBuffer- Mappings:
- Namespace - Name - Mixin selector - named - indexBuffer- Lnet/minecraft/client/gl/VertexBuffer;indexBuffer:Lnet/minecraft/client/gl/GpuBuffer;- intermediary - field_27366- Lnet/minecraft/class_291;field_27366:Lnet/minecraft/class_10227;- official - c- Lffy;c:Lfdq;
 
- 
vertexArrayIdprivate int vertexArrayId- Mappings:
- Namespace - Name - Mixin selector - named - vertexArrayId- Lnet/minecraft/client/gl/VertexBuffer;vertexArrayId:I- intermediary - field_29338- Lnet/minecraft/class_291;field_29338:I- official - d- Lffy;d:I
 
- 
vertexFormat- Mappings:
- Namespace - Name - Mixin selector - named - vertexFormat- Lnet/minecraft/client/gl/VertexBuffer;vertexFormat:Lnet/minecraft/client/render/VertexFormat;- intermediary - field_29339- Lnet/minecraft/class_291;field_29339:Lnet/minecraft/class_293;- official - e- Lffy;e:Lfga;
 
- 
indexType- Mappings:
- Namespace - Name - Mixin selector - named - indexType- Lnet/minecraft/client/gl/VertexBuffer;indexType:Lnet/minecraft/client/render/VertexFormat$IndexType;- intermediary - field_27367- Lnet/minecraft/class_291;field_27367:Lnet/minecraft/class_293$class_5595;- official - g- Lffy;g:Lfga$b;
 
- 
indexCountprivate int indexCount- Mappings:
- Namespace - Name - Mixin selector - named - indexCount- Lnet/minecraft/client/gl/VertexBuffer;indexCount:I- intermediary - field_1593- Lnet/minecraft/class_291;field_1593:I- official - h- Lffy;h:I
 
- 
drawMode- Mappings:
- Namespace - Name - Mixin selector - named - drawMode- Lnet/minecraft/client/gl/VertexBuffer;drawMode:Lnet/minecraft/client/render/VertexFormat$DrawMode;- intermediary - field_27368- Lnet/minecraft/class_291;field_27368:Lnet/minecraft/class_293$class_5596;- official - i- Lffy;i:Lfga$c;
 
 
- 
- 
Constructor Details- 
VertexBuffer- Mappings:
- Namespace - Name - Mixin selector - named - <init>- Lnet/minecraft/client/gl/VertexBuffer;<init>(Lnet/minecraft/client/gl/GlUsage;)V- intermediary - <init>- Lnet/minecraft/class_291;<init>(Lnet/minecraft/class_8555;)V- official - <init>- Lffy;<init>(Lfdp;)V
 
 
- 
- 
Method Details- 
createAndUploadpublic static VertexBuffer createAndUpload(VertexFormat.DrawMode drawMode, VertexFormat format, Consumer<VertexConsumer> callback) - Mappings:
- Namespace - Name - Mixin selector - named - createAndUpload- Lnet/minecraft/client/gl/VertexBuffer;createAndUpload(Lnet/minecraft/client/render/VertexFormat$DrawMode;Lnet/minecraft/client/render/VertexFormat;Ljava/util/function/Consumer;)Lnet/minecraft/client/gl/VertexBuffer;- intermediary - method_65175- Lnet/minecraft/class_291;method_65175(Lnet/minecraft/class_293$class_5596;Lnet/minecraft/class_293;Ljava/util/function/Consumer;)Lnet/minecraft/class_291;- official - a- Lffy;a(Lfga$c;Lfga;Ljava/util/function/Consumer;)Lffy;
 
- 
uploadUploads the contents ofbufferto GPU, discarding previously uploaded data.The caller of this method must bind this vertex buffer before calling this method. - Mappings:
- Namespace - Name - Mixin selector - named - upload- Lnet/minecraft/client/gl/VertexBuffer;upload(Lnet/minecraft/client/render/BuiltBuffer;)V- intermediary - method_1352- Lnet/minecraft/class_291;method_1352(Lnet/minecraft/class_9801;)V- official - a- Lffy;a(Lffu;)V
 
- 
uploadIndexBuffer- Mappings:
- Namespace - Name - Mixin selector - named - uploadIndexBuffer- Lnet/minecraft/client/gl/VertexBuffer;uploadIndexBuffer(Lnet/minecraft/client/util/BufferAllocator$CloseableBuffer;)V- intermediary - method_60829- Lnet/minecraft/class_291;method_60829(Lnet/minecraft/class_9799$class_9800;)V- official - a- Lffy;a(Lffs$a;)V
 
- 
uploadVertexBufferprivate VertexFormat uploadVertexBuffer(BuiltBuffer.DrawParameters parameters, @Nullable @Nullable ByteBuffer vertexBuffer) - Mappings:
- Namespace - Name - Mixin selector - named - uploadVertexBuffer- Lnet/minecraft/client/gl/VertexBuffer;uploadVertexBuffer(Lnet/minecraft/client/render/BuiltBuffer$DrawParameters;Ljava/nio/ByteBuffer;)Lnet/minecraft/client/render/VertexFormat;- intermediary - method_43442- Lnet/minecraft/class_291;method_43442(Lnet/minecraft/class_9801$class_4574;Ljava/nio/ByteBuffer;)Lnet/minecraft/class_293;- official - a- Lffy;a(Lffu$a;Ljava/nio/ByteBuffer;)Lfga;
 
- 
uploadIndexBuffer@Nullable private RenderSystem.ShapeIndexBuffer uploadIndexBuffer(BuiltBuffer.DrawParameters parameters, @Nullable @Nullable ByteBuffer buf) - Mappings:
- Namespace - Name - Mixin selector - named - uploadIndexBuffer- Lnet/minecraft/client/gl/VertexBuffer;uploadIndexBuffer(Lnet/minecraft/client/render/BuiltBuffer$DrawParameters;Ljava/nio/ByteBuffer;)Lcom/mojang/blaze3d/systems/RenderSystem$ShapeIndexBuffer;- intermediary - method_43443- Lnet/minecraft/class_291;method_43443(Lnet/minecraft/class_9801$class_4574;Ljava/nio/ByteBuffer;)Lcom/mojang/blaze3d/systems/RenderSystem$class_5590;- official - b- Lffy;b(Lffu$a;Ljava/nio/ByteBuffer;)Lcom/mojang/blaze3d/systems/RenderSystem$a;
 
- 
bindpublic void bind()Sets this vertex buffer as the current one.This method must be called before uploading or drawing data. - Mappings:
- Namespace - Name - Mixin selector - named - bind- Lnet/minecraft/client/gl/VertexBuffer;bind()V- intermediary - method_1353- Lnet/minecraft/class_291;method_1353()V- official - a- Lffy;a()V
 
- 
unbindpublic static void unbind()- Mappings:
- Namespace - Name - Mixin selector - named - unbind- Lnet/minecraft/client/gl/VertexBuffer;unbind()V- intermediary - method_1354- Lnet/minecraft/class_291;method_1354()V- official - b- Lffy;b()V
 
- 
drawpublic void draw()Draws the contents in this vertex buffer.The caller of this method must bind this vertex buffer before calling this method. Unlike draw(Matrix4f, Matrix4f, ShaderProgram), the caller of this method must manually bind a shader program before calling this method.- Mappings:
- Namespace - Name - Mixin selector - named - draw- Lnet/minecraft/client/gl/VertexBuffer;draw()V- intermediary - method_35665- Lnet/minecraft/class_291;method_35665()V- official - c- Lffy;c()V
 
- 
getIndexType- Mappings:
- Namespace - Name - Mixin selector - named - getIndexType- Lnet/minecraft/client/gl/VertexBuffer;getIndexType()Lnet/minecraft/client/render/VertexFormat$IndexType;- intermediary - method_43445- Lnet/minecraft/class_291;method_43445()Lnet/minecraft/class_293$class_5595;- official - f- Lffy;f()Lfga$b;
 
- 
drawpublic void draw(Matrix4f viewMatrix, Matrix4f projectionMatrix, @Nullable @Nullable ShaderProgram program) Draws the contents in this vertex buffer withprogram.The caller of this method must bind this vertex buffer before calling this method. - Mappings:
- Namespace - Name - Mixin selector - named - draw- Lnet/minecraft/client/gl/VertexBuffer;draw(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/client/gl/ShaderProgram;)V- intermediary - method_34427- Lnet/minecraft/class_291;method_34427(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lnet/minecraft/class_5944;)V- official - a- Lffy;a(Lorg/joml/Matrix4f;Lorg/joml/Matrix4f;Lglj;)V
 
- 
draw- Mappings:
- Namespace - Name - Mixin selector - named - draw- Lnet/minecraft/client/gl/VertexBuffer;draw(Lnet/minecraft/client/render/RenderLayer;)V- intermediary - method_65176- Lnet/minecraft/class_291;method_65176(Lnet/minecraft/class_1921;)V- official - a- Lffy;a(Lgmj;)V
 
- 
closepublic void close()- Specified by:
- closein interface- AutoCloseable
 
- 
getVertexFormat- Mappings:
- Namespace - Name - Mixin selector - named - getVertexFormat- Lnet/minecraft/client/gl/VertexBuffer;getVertexFormat()Lnet/minecraft/client/render/VertexFormat;- intermediary - method_34435- Lnet/minecraft/class_291;method_34435()Lnet/minecraft/class_293;- official - d- Lffy;d()Lfga;
 
- 
isClosedpublic boolean isClosed()- Mappings:
- Namespace - Name - Mixin selector - named - isClosed- Lnet/minecraft/client/gl/VertexBuffer;isClosed()Z- intermediary - method_43444- Lnet/minecraft/class_291;method_43444()Z- official - e- Lffy;e()Z
 
 
-