Skip to content

Commit

Permalink
Fix index values
Browse files Browse the repository at this point in the history
  • Loading branch information
IMS212 committed Oct 12, 2024
1 parent 3657a12 commit 9b36b1a
Showing 1 changed file with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,20 @@ public class IrisVertexFormats {
public static final VertexFormat CLOUDS;

static {
ENTITY_ELEMENT = VertexFormatElement.register(10, 10, VertexFormatElement.Type.SHORT, VertexFormatElement.Usage.GENERIC, 2);
ENTITY_ID_ELEMENT = VertexFormatElement.register(11, 11, VertexFormatElement.Type.USHORT, VertexFormatElement.Usage.UV, 3);
MID_TEXTURE_ELEMENT = VertexFormatElement.register(12, 12, VertexFormatElement.Type.FLOAT, VertexFormatElement.Usage.GENERIC, 2);
TANGENT_ELEMENT = VertexFormatElement.register(13, 13, VertexFormatElement.Type.BYTE, VertexFormatElement.Usage.GENERIC, 4);
MID_BLOCK_ELEMENT = VertexFormatElement.register(14, 14, VertexFormatElement.Type.BYTE, VertexFormatElement.Usage.GENERIC, 3);
int LAST_UV = 0;

for (int i = 0; i < VertexFormatElement.MAX_COUNT; i++) {
VertexFormatElement element = VertexFormatElement.byId(i);
if (element != null && element.usage() == VertexFormatElement.Usage.UV) {
LAST_UV = Math.max(LAST_UV, element.index());
}
}

ENTITY_ELEMENT = VertexFormatElement.register(10, 0, VertexFormatElement.Type.SHORT, VertexFormatElement.Usage.GENERIC, 2);
ENTITY_ID_ELEMENT = VertexFormatElement.register(11, LAST_UV + 1, VertexFormatElement.Type.USHORT, VertexFormatElement.Usage.UV, 3);
MID_TEXTURE_ELEMENT = VertexFormatElement.register(12, 0, VertexFormatElement.Type.FLOAT, VertexFormatElement.Usage.GENERIC, 2);
TANGENT_ELEMENT = VertexFormatElement.register(13, 0, VertexFormatElement.Type.BYTE, VertexFormatElement.Usage.GENERIC, 4);
MID_BLOCK_ELEMENT = VertexFormatElement.register(14, 0, VertexFormatElement.Type.BYTE, VertexFormatElement.Usage.GENERIC, 3);

TERRAIN = VertexFormat.builder()
.add("Position", VertexFormatElement.POSITION)
Expand Down

0 comments on commit 9b36b1a

Please sign in to comment.