Search in sources :

Example 1 with GlVertexBuffer

use of me.jellysquid.mods.sodium.client.render.gl.GlVertexBuffer in project sodium-fabric by CaffeineMC.

the class ChunkRendererVBO method render.

@Override
public void render(MatrixStack matrixStack, RenderLayer layer, ChunkRenderDataVBO chunk) {
    GlVertexBuffer vertexBuffer = chunk.getVertexBufferForLayer(layer);
    vertexBuffer.bind();
    VertexFormats.POSITION_COLOR_TEXTURE_LIGHT_NORMAL.startDrawing(0L);
    vertexBuffer.draw(matrixStack.peek().getModel(), GL11.GL_QUADS);
}
Also used : GlVertexBuffer(me.jellysquid.mods.sodium.client.render.gl.GlVertexBuffer)

Example 2 with GlVertexBuffer

use of me.jellysquid.mods.sodium.client.render.gl.GlVertexBuffer in project sodium-fabric by CaffeineMC.

the class ChunkRenderDataVBO method uploadMeshes.

@Override
public void uploadMeshes(Object2ObjectMap<RenderLayer, BufferUploadData> layers) {
    for (Map.Entry<RenderLayer, BufferUploadData> entry : layers.entrySet()) {
        GlVertexBuffer array = this.vbos.get(entry.getKey());
        if (array == null) {
            throw new NullPointerException("No graphics state container for layer " + entry.getKey());
        }
        array.upload(entry.getValue());
    }
}
Also used : GlVertexBuffer(me.jellysquid.mods.sodium.client.render.gl.GlVertexBuffer) RenderLayer(net.minecraft.client.render.RenderLayer) BufferUploadData(me.jellysquid.mods.sodium.client.render.vertex.BufferUploadData) Object2ObjectMap(it.unimi.dsi.fastutil.objects.Object2ObjectMap) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

GlVertexBuffer (me.jellysquid.mods.sodium.client.render.gl.GlVertexBuffer)2 Object2ObjectMap (it.unimi.dsi.fastutil.objects.Object2ObjectMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 BufferUploadData (me.jellysquid.mods.sodium.client.render.vertex.BufferUploadData)1 RenderLayer (net.minecraft.client.render.RenderLayer)1