Flywheel/src/main/java/com/jozufozu/flywheel/backend/InternalVertex.java
Jozufozu c79e94cd18 Layout on me, dev
- Move gl-coupled BufferLayout and co. to lib.
- Add new Layout record to API.
  - List of Elements, a sealed interface of type safe records
    representing most possible vertex attributes.
- Deprecate InstanceType#getLayout.
- Add LayoutBuilder in lib for convenience.
- TODO: use new Layouts in backends.
2023-12-13 13:40:53 -08:00

30 lines
954 B
Java

package com.jozufozu.flywheel.backend;
import com.jozufozu.flywheel.Flywheel;
import com.jozufozu.flywheel.api.vertex.VertexView;
import com.jozufozu.flywheel.lib.layout.BufferLayout;
import com.jozufozu.flywheel.lib.layout.CommonItems;
import com.jozufozu.flywheel.lib.vertex.FullVertexView;
import net.minecraft.resources.ResourceLocation;
public final class InternalVertex {
public static final BufferLayout LAYOUT = BufferLayout.builder()
.addItem(CommonItems.VEC3, "position")
.addItem(CommonItems.UNORM_4x8, "color")
.addItem(CommonItems.VEC2, "tex")
.addItem(CommonItems.LIGHT_COORD, "overlay")
.addItem(CommonItems.LIGHT_COORD, "light")
.addItem(CommonItems.NORM_3x8, "normal")
.withPadding(1)
.build();
public static final ResourceLocation LAYOUT_SHADER = Flywheel.rl("internal/vertex_input.vert");
private InternalVertex() {
}
public static VertexView createVertexView() {
return new FullVertexView();
}
}