package net.vulkanmod.render.vertex;

import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.blaze3d.vertex.VertexFormatElement;
import com.mojang.blaze3d.vertex.VertexFormatElement.Type;
import com.mojang.blaze3d.vertex.VertexFormatElement.Usage;

public abstract class CustomVertexFormat {
   public static final VertexFormatElement ELEMENT_POSITION;
   public static final VertexFormatElement ELEMENT_COLOR;
   public static final VertexFormatElement ELEMENT_UV0;
   private static float POSITION_OFFSET;
   public static final VertexFormat COMPRESSED_TERRAIN;
   public static final VertexFormat NONE;

   public static void setPositionOffset(float positionOffset) {
      POSITION_OFFSET = positionOffset;
   }

   public static float getPositionOffset() {
      return POSITION_OFFSET;
   }

   static {
      ELEMENT_POSITION = new VertexFormatElement(0, 0, Type.SHORT, Usage.POSITION, 4);
      ELEMENT_COLOR = new VertexFormatElement(1, 0, Type.UINT, Usage.COLOR, 1);
      ELEMENT_UV0 = new VertexFormatElement(2, 0, Type.USHORT, Usage.UV, 2);
      POSITION_OFFSET = 4.0F;
      COMPRESSED_TERRAIN = VertexFormat.builder().add("Position", ELEMENT_POSITION).add("UV0", ELEMENT_UV0).add("Color", ELEMENT_COLOR).build();
      NONE = VertexFormat.builder().build();
   }
}
