Named models

This commit is contained in:
Jozufozu 2021-11-08 20:48:02 -08:00
parent 302b15551a
commit 8261be3d80
2 changed files with 8 additions and 1 deletions

View file

@ -96,6 +96,12 @@ public class GlueInstance extends EntityInstance<SuperGlueEntity> implements ITi
} }
public static class GlueModel implements IModel { public static class GlueModel implements IModel {
@Override
public String name() {
return "glue";
}
@Override @Override
public void buffer(VecBuffer buffer) { public void buffer(VecBuffer buffer) {
Vec3 diff = Vec3.atLowerCornerOf(Direction.SOUTH.getNormal()); Vec3 diff = Vec3.atLowerCornerOf(Direction.SOUTH.getNormal());

View file

@ -41,6 +41,7 @@ public class RenderedContraption extends ContraptionRenderInfo {
private final Matrix4f modelViewPartial = new Matrix4f(); private final Matrix4f modelViewPartial = new Matrix4f();
private boolean modelViewPartialReady; private boolean modelViewPartialReady;
// floats because we're uploading this to the gpu
private AABB lightBox; private AABB lightBox;
public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) { public RenderedContraption(Contraption contraption, PlacementSimulationWorld renderWorld) {
@ -125,7 +126,7 @@ public class RenderedContraption extends ContraptionRenderInfo {
List<RenderType> blockLayers = RenderType.chunkBufferLayers(); List<RenderType> blockLayers = RenderType.chunkBufferLayers();
for (RenderType layer : blockLayers) { for (RenderType layer : blockLayers) {
Supplier<IModel> layerModel = () -> new WorldModel(renderWorld, layer, contraption.getBlocks().values()); Supplier<IModel> layerModel = () -> new WorldModel(renderWorld, layer, contraption.getBlocks().values(), layer + "_" + contraption.entity.getId());
ModelRenderer renderer; ModelRenderer renderer;
if (Backend.getInstance().compat.vertexArrayObjectsSupported()) if (Backend.getInstance().compat.vertexArrayObjectsSupported())