Class BatchedMaterial<D extends InstanceData>

java.lang.Object
com.jozufozu.flywheel.backend.instancing.batching.BatchedMaterial<D>
All Implemented Interfaces:
Material<D>

public class BatchedMaterial<D extends InstanceData> extends Object implements Material<D>
  • Field Details

  • Constructor Details

    • BatchedMaterial

      public BatchedMaterial(Batched<D> type)
  • Method Details

    • model

      public Instancer<D> model(Object key, Supplier<Model> modelSupplier)
      Description copied from interface: Material
      Get an instancer for the given model. Calling this method twice with the same key will return the same instancer.
      Specified by:
      model in interface Material<D extends InstanceData>
      Parameters:
      key - An object that uniquely identifies the model.
      modelSupplier - A factory that creates the Model that you want to render. Each time Supplier.get() is called, a new Model must be created.
      Returns:
      An instancer for the given model, capable of rendering many copies for little cost.
    • setupAndRenderInto

      public void setupAndRenderInto(com.mojang.blaze3d.vertex.PoseStack stack, com.mojang.blaze3d.vertex.VertexConsumer buffer)
    • clear

      public void clear()
      Clear all instance data without freeing resources.
    • delete

      public void delete()