diff --git a/src/main/java/com/simibubi/create/AllBlockPartials.java b/src/main/java/com/simibubi/create/AllBlockPartials.java index cee881770..7c1e46b0e 100644 --- a/src/main/java/com/simibubi/create/AllBlockPartials.java +++ b/src/main/java/com/simibubi/create/AllBlockPartials.java @@ -1,11 +1,14 @@ package com.simibubi.create; import com.mojang.blaze3d.matrix.MatrixStack; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.content.contraptions.fluids.FluidTransportBehaviour.AttachmentTypes; import com.simibubi.create.content.contraptions.processing.burner.BlazeBurnerBlock.HeatLevel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; +import com.simibubi.create.content.contraptions.relays.belt.BeltData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; import com.simibubi.create.foundation.render.SuperByteBuffer; -import com.simibubi.create.foundation.render.instancing.*; +import com.simibubi.create.foundation.render.backend.instancing.*; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.Lang; diff --git a/src/main/java/com/simibubi/create/CreateClient.java b/src/main/java/com/simibubi/create/CreateClient.java index ddab555eb..18c3f054d 100644 --- a/src/main/java/com/simibubi/create/CreateClient.java +++ b/src/main/java/com/simibubi/create/CreateClient.java @@ -12,10 +12,10 @@ import com.simibubi.create.foundation.block.render.SpriteShifter; import com.simibubi.create.foundation.item.CustomItemModels; import com.simibubi.create.foundation.item.CustomRenderedItems; import com.simibubi.create.foundation.render.KineticRenderer; -import com.simibubi.create.foundation.render.gl.backend.OptifineHandler; +import com.simibubi.create.foundation.render.backend.OptifineHandler; import com.simibubi.create.foundation.render.SuperByteBufferCache; -import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; +import com.simibubi.create.foundation.render.backend.Backend; import com.simibubi.create.foundation.utility.outliner.Outliner; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java index 0ec0cda06..4a1875d28 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/BackHalfShaftInstance.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/HalfShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/HalfShaftInstance.java index fc85c9193..0547b25fc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/HalfShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/HalfShaftInstance.java @@ -1,11 +1,9 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; -import net.minecraft.block.BlockState; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalHalfShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalHalfShaftInstance.java index 7c20f6959..a42524118 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalHalfShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/HorizontalHalfShaftInstance.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/KineticData.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticData.java similarity index 87% rename from src/main/java/com/simibubi/create/foundation/render/instancing/KineticData.java rename to src/main/java/com/simibubi/create/content/contraptions/base/KineticData.java index 0c7adb5c7..bf543f563 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/KineticData.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticData.java @@ -1,16 +1,12 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.content.contraptions.base.KineticTileEntity; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +import com.simibubi.create.foundation.render.backend.instancing.InstanceData; import com.simibubi.create.foundation.utility.ColorHelper; import net.minecraft.client.renderer.Vector3f; import net.minecraft.util.math.BlockPos; import java.nio.ByteBuffer; -import static com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec.*; - public class KineticData> extends InstanceData { private float x; private float y; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java new file mode 100644 index 000000000..77a14eabb --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticRenderMaterials.java @@ -0,0 +1,13 @@ +package com.simibubi.create.content.contraptions.base; + +import com.simibubi.create.content.contraptions.relays.belt.BeltData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.MaterialType; +import com.simibubi.create.content.contraptions.components.actors.ContraptionActorData; + +public class KineticRenderMaterials { + public static final MaterialType> ROTATING = new MaterialType<>(); + public static final MaterialType> BELTS = new MaterialType<>(); + + public static final MaterialType> ACTORS = new MaterialType<>(); +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index 7ed35759a..044cc2520 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -11,8 +11,8 @@ import com.simibubi.create.content.contraptions.goggles.IHaveHoveringInformation import com.simibubi.create.foundation.advancement.AllTriggers; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.item.TooltipHelper; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.instancing.IInstanceRendered; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered; import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.Lang; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java index 7b8c3f092..836d63c66 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntityRenderer.java @@ -6,9 +6,7 @@ import com.simibubi.create.AllBlocks; import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.KineticDebugger; import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock; -import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.config.ConfigBase; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.ColorHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java index 5b79e2e06..f94f5b959 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileInstance.java @@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.relays.elementary.CogWheelBlock; import com.simibubi.create.content.contraptions.relays.elementary.ShaftBlock; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.*; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.*; import net.minecraft.block.BlockState; import net.minecraft.util.Direction; import net.minecraft.world.LightType; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/KineticVertexAttributes.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticVertexAttributes.java similarity index 73% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/KineticVertexAttributes.java rename to src/main/java/com/simibubi/create/content/contraptions/base/KineticVertexAttributes.java index ce5ddb9f3..46f8740f4 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/KineticVertexAttributes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticVertexAttributes.java @@ -1,8 +1,8 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; +package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; public enum KineticVertexAttributes implements IVertexAttrib { INSTANCE_POSITION("aInstancePos", CommonAttributes.VEC3), diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/RotatingData.java b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingData.java similarity index 79% rename from src/main/java/com/simibubi/create/foundation/render/instancing/RotatingData.java rename to src/main/java/com/simibubi/create/content/contraptions/base/RotatingData.java index dfbb7429f..c8afa2c35 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/RotatingData.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingData.java @@ -1,15 +1,11 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.attrib.impl.KineticVertexAttributes; -import com.simibubi.create.foundation.render.gl.attrib.impl.RotatingVertexAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; import net.minecraft.client.renderer.Vector3f; import net.minecraft.util.Direction; import java.nio.ByteBuffer; -import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.NORMAL; - public class RotatingData extends KineticData { public static VertexFormat FORMAT = VertexFormat.builder() .addAttributes(KineticVertexAttributes.class) diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/RotatingInstancedModel.java b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingInstancedModel.java new file mode 100644 index 000000000..420121124 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingInstancedModel.java @@ -0,0 +1,22 @@ +package com.simibubi.create.content.contraptions.base; + +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import net.minecraft.client.renderer.BufferBuilder; + +public class RotatingInstancedModel extends InstancedModel { + public RotatingInstancedModel(BufferBuilder buf) { + super(buf); + } + + @Override + protected RotatingData newInstance() { + return new RotatingData(); + } + + @Override + protected VertexFormat getInstanceFormat() { + return RotatingData.FORMAT; + } + +} diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/RotatingVertexAttributes.java b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingVertexAttributes.java similarity index 67% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/RotatingVertexAttributes.java rename to src/main/java/com/simibubi/create/content/contraptions/base/RotatingVertexAttributes.java index 12ff1afe1..677b18190 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/RotatingVertexAttributes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/RotatingVertexAttributes.java @@ -1,8 +1,8 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; +package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; public enum RotatingVertexAttributes implements IVertexAttrib { AXIS("aAxis", CommonAttributes.NORMAL), diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/ShaftlessCogInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/ShaftlessCogInstance.java index 0cec9d237..a64b049bd 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/ShaftlessCogInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/ShaftlessCogInstance.java @@ -1,10 +1,9 @@ package com.simibubi.create.content.contraptions.base; import com.simibubi.create.AllBlockPartials; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/SingleRotatingInstance.java b/src/main/java/com/simibubi/create/content/contraptions/base/SingleRotatingInstance.java index fb951f8d5..3a717e5a7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/SingleRotatingInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/SingleRotatingInstance.java @@ -1,10 +1,9 @@ package com.simibubi.create.content.contraptions.base; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstanceKey; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstanceKey; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ActorVertexAttributes.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/ActorVertexAttributes.java similarity index 74% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ActorVertexAttributes.java rename to src/main/java/com/simibubi/create/content/contraptions/components/actors/ActorVertexAttributes.java index 6434f2106..fdeae0d94 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ActorVertexAttributes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/ActorVertexAttributes.java @@ -1,8 +1,8 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; +package com.simibubi.create.content.contraptions.components.actors; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; public enum ActorVertexAttributes implements IVertexAttrib { INSTANCE_POSITION("aInstancePos", CommonAttributes.VEC3), diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/actors/StaticRotatingActorData.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/ContraptionActorData.java similarity index 65% rename from src/main/java/com/simibubi/create/foundation/render/instancing/actors/StaticRotatingActorData.java rename to src/main/java/com/simibubi/create/content/contraptions/components/actors/ContraptionActorData.java index 79494b22c..5f6494a62 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/actors/StaticRotatingActorData.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/ContraptionActorData.java @@ -1,15 +1,13 @@ -package com.simibubi.create.foundation.render.instancing.actors; +package com.simibubi.create.content.contraptions.components.actors; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.attrib.impl.ActorVertexAttributes; -import com.simibubi.create.foundation.render.instancing.InstanceData; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.instancing.InstanceData; import net.minecraft.client.renderer.Vector3f; import net.minecraft.util.math.BlockPos; import java.nio.ByteBuffer; -public class StaticRotatingActorData extends InstanceData { +public class ContraptionActorData extends InstanceData { public static VertexFormat FORMAT = VertexFormat.builder() .addAttributes(ActorVertexAttributes.class) .build(); @@ -30,58 +28,58 @@ public class StaticRotatingActorData extends InstanceData { private byte rotationCenterY = 64; private byte rotationCenterZ = 64; - public StaticRotatingActorData setPosition(BlockPos pos) { + public ContraptionActorData setPosition(BlockPos pos) { this.x = pos.getX(); this.y = pos.getY(); this.z = pos.getZ(); return this; } - public StaticRotatingActorData setBlockLight(int blockLight) { + public ContraptionActorData setBlockLight(int blockLight) { this.blockLight = (byte) ((blockLight & 0xF) << 4); return this; } - public StaticRotatingActorData setSkyLight(int skyLight) { + public ContraptionActorData setSkyLight(int skyLight) { this.skyLight = (byte) ((skyLight & 0xF) << 4); return this; } - public StaticRotatingActorData setRotationOffset(float rotationOffset) { + public ContraptionActorData setRotationOffset(float rotationOffset) { this.rotationOffset = rotationOffset; return this; } - public StaticRotatingActorData setRotationAxis(Vector3f axis) { + public ContraptionActorData setRotationAxis(Vector3f axis) { setRotationAxis(axis.getX(), axis.getY(), axis.getZ()); return this; } - public StaticRotatingActorData setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) { + public ContraptionActorData setRotationAxis(float rotationAxisX, float rotationAxisY, float rotationAxisZ) { this.rotationAxisX = (byte) (rotationAxisX * 127); this.rotationAxisY = (byte) (rotationAxisY * 127); this.rotationAxisZ = (byte) (rotationAxisZ * 127); return this; } - public StaticRotatingActorData setRotationCenter(Vector3f axis) { + public ContraptionActorData setRotationCenter(Vector3f axis) { setRotationCenter(axis.getX(), axis.getY(), axis.getZ()); return this; } - public StaticRotatingActorData setRotationCenter(float rotationCenterX, float rotationCenterY, float rotationCenterZ) { + public ContraptionActorData setRotationCenter(float rotationCenterX, float rotationCenterY, float rotationCenterZ) { this.rotationCenterX = (byte) (rotationCenterX * 127); this.rotationCenterY = (byte) (rotationCenterY * 127); this.rotationCenterZ = (byte) (rotationCenterZ * 127); return this; } - public StaticRotatingActorData setLocalRotation(Vector3f axis) { + public ContraptionActorData setLocalRotation(Vector3f axis) { setLocalRotation(axis.getX(), axis.getY(), axis.getZ()); return this; } - public StaticRotatingActorData setLocalRotation(float localRotationX, float localRotationY, float localRotationZ) { + public ContraptionActorData setLocalRotation(float localRotationX, float localRotationY, float localRotationZ) { this.localRotationX = localRotationX; this.localRotationY = localRotationY; this.localRotationZ = localRotationZ; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillInstance.java index e10201ae2..16fd9b7d4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillInstance.java @@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.components.actors; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; -import com.simibubi.create.foundation.render.instancing.*; -import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; +import com.simibubi.create.foundation.render.backend.instancing.*; import com.simibubi.create.foundation.utility.AngleHelper; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntityType; @@ -25,10 +25,10 @@ public class DrillInstance extends SingleRotatingInstance { } public static void addInstanceForContraption(RenderedContraption contraption, MovementContext context) { - RenderMaterial> renderMaterial = contraption.getActorMaterial(); + RenderMaterial> renderMaterial = contraption.getActorMaterial(); BlockState state = context.state; - InstancedModel model = renderMaterial.getModel(AllBlockPartials.DRILL_HEAD, state); + InstancedModel model = renderMaterial.getModel(AllBlockPartials.DRILL_HEAD, state); model.setupInstance(data -> { Direction facing = state.get(DrillBlock.FACING); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java index b472cb9e8..a600cf9da 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/DrillMovementBehaviour.java @@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java index 5ee132c9a..c2d2b7880 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterMovementBehaviour.java @@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.components.actors; import static net.minecraft.block.HorizontalBlock.HORIZONTAL_FACING; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; import org.apache.commons.lang3.mutable.MutableBoolean; import com.mojang.blaze3d.matrix.MatrixStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java index 7311e30c7..22b5fd9a4 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/HarvesterRenderer.java @@ -5,10 +5,9 @@ import static net.minecraft.state.properties.BlockStateProperties.HORIZONTAL_FAC import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.RenderMaterial; -import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.RenderMaterial; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.AnimationTickHolder; @@ -41,10 +40,10 @@ public class HarvesterRenderer extends SafeTileEntityRenderer> renderMaterial = contraption.getActorMaterial(); + RenderMaterial> renderMaterial = contraption.getActorMaterial(); BlockState state = context.state; - InstancedModel model = renderMaterial.getModel(AllBlockPartials.HARVESTER_BLADE, state); + InstancedModel model = renderMaterial.getModel(AllBlockPartials.HARVESTER_BLADE, state); model.setupInstance(data -> { Direction facing = state.get(HORIZONTAL_FACING); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/RotatingActorModel.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/RotatingActorModel.java new file mode 100644 index 000000000..481df3061 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/RotatingActorModel.java @@ -0,0 +1,21 @@ +package com.simibubi.create.content.contraptions.components.actors; + +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import net.minecraft.client.renderer.BufferBuilder; + +public class RotatingActorModel extends InstancedModel { + public RotatingActorModel(BufferBuilder buf) { + super(buf); + } + + @Override + protected VertexFormat getInstanceFormat() { + return ContraptionActorData.FORMAT; + } + + @Override + protected ContraptionActorData newInstance() { + return new ContraptionActorData(); + } +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterInstance.java index 6e1fc2203..8b7a327ec 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterInstance.java @@ -4,10 +4,10 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.foundation.utility.AngleHelper; import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.tileentity.TileEntityType; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java index bfe19d3ed..d94e5c35c 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterRenderer.java @@ -6,7 +6,7 @@ import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllSpriteShifts; import com.simibubi.create.content.contraptions.components.crafter.MechanicalCrafterTileEntity.Phase; import com.simibubi.create.content.contraptions.components.crafter.RecipeGridHandler.GroupedItems; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java index d7d214cae..01faa80b3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerRenderer.java @@ -11,8 +11,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity.Mode; import com.simibubi.create.content.contraptions.components.deployer.DeployerTileEntity.State; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java index dfb054de6..870aebca3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanRenderer.java @@ -7,8 +7,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.render.SuperByteBuffer; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/FanInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/FanInstance.java index e7dfcb8b5..88a702f56 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/FanInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/FanInstance.java @@ -3,11 +3,11 @@ package com.simibubi.create.content.contraptions.components.fan; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.KineticTileInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstanceKey; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstanceKey; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java index d98cd513e..f1f9cda0d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlyWheelInstance.java @@ -3,8 +3,8 @@ package com.simibubi.create.content.contraptions.components.flywheel; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.KineticTileInstance; -import com.simibubi.create.foundation.render.SuperByteBuffer; -import com.simibubi.create.foundation.render.instancing.*; +import com.simibubi.create.content.contraptions.base.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.*; import net.minecraft.block.BlockState; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillStoneCogInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillStoneCogInstance.java index 7e198b68d..bcaddb716 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillStoneCogInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillStoneCogInstance.java @@ -3,10 +3,10 @@ package com.simibubi.create.content.contraptions.components.millstone; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java index 1b76603b8..4d4477d9f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerRenderer.java @@ -5,8 +5,7 @@ import com.mojang.blaze3d.vertex.IVertexBuilder; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.render.SuperByteBuffer; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawInstance.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawInstance.java index 6769cedc9..0a04d43bb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawInstance.java @@ -4,10 +4,10 @@ import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Rotation; import net.minecraftforge.api.distmarker.Dist; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java index 84564ddfb..03043241b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawRenderer.java @@ -8,8 +8,7 @@ import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; import com.simibubi.create.foundation.utility.AngleHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntityRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntityRenderer.java index 399741243..cbb614bbb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntityRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/AbstractContraptionEntityRenderer.java @@ -1,8 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.culling.ClippingHelperImpl; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java index fba52fdd9..c475b620f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/Contraption.java @@ -24,8 +24,7 @@ import com.simibubi.create.content.logistics.block.inventories.AdjustableCrateBl import com.simibubi.create.content.logistics.block.redstone.RedstoneContactBlock; import com.simibubi.create.foundation.config.AllConfigs; import com.simibubi.create.foundation.fluid.CombinedTankWrapper; -import com.simibubi.create.foundation.render.light.ContraptionLighter; -import com.simibubi.create.foundation.render.light.EmptyLighter; +import com.simibubi.create.foundation.render.backend.light.EmptyLighter; import com.simibubi.create.foundation.utility.BlockFace; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.NBTHelper; diff --git a/src/main/java/com/simibubi/create/foundation/render/light/ContraptionLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java similarity index 81% rename from src/main/java/com/simibubi/create/foundation/render/light/ContraptionLighter.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java index 403fecee2..7708c5488 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/ContraptionLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionLighter.java @@ -1,7 +1,8 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.content.contraptions.components.structureMovement; -import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; +import com.simibubi.create.foundation.render.backend.light.LightVolume; public abstract class ContraptionLighter { protected final C contraption; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java index 251d2d559..af13ab7b1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/ContraptionRenderer.java @@ -4,7 +4,7 @@ import java.util.List; import java.util.Random; import com.simibubi.create.foundation.render.*; -import net.minecraft.world.lighting.WorldLightManager; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java index 82ae42088..72ede2acb 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/MovementBehaviour.java @@ -2,7 +2,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.ItemStack; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java index 54691d76c..141746638 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/NonStationaryLighter.java @@ -1,8 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement; -import com.simibubi.create.foundation.render.contraption.RenderedContraption; -import com.simibubi.create.foundation.render.light.ContraptionLighter; -import com.simibubi.create.foundation.render.light.GridAlignedBB; +import com.simibubi.create.content.contraptions.components.structureMovement.render.RenderedContraption; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; public class NonStationaryLighter extends ContraptionLighter { public NonStationaryLighter(C contraption) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java index 37ea55934..b035bf445 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingContraption.java @@ -1,6 +1,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.bearing; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; import org.apache.commons.lang3.tuple.Pair; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java index 31f3c79b8..6584cb2d2 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/BearingLighter.java @@ -1,7 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.bearing; -import com.simibubi.create.foundation.render.light.ContraptionLighter; -import com.simibubi.create.foundation.render.light.GridAlignedBB; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java index fc1dd4420..508691fa3 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/StabilizedContraption.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.be import com.simibubi.create.content.contraptions.components.structureMovement.AllContraptionTypes; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java index f13e6cb39..f4279d816 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/MountedContraption.java @@ -5,7 +5,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.All import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.NonStationaryLighter; import com.simibubi.create.content.contraptions.components.structureMovement.mounted.CartAssemblerTileEntity.CartMovementMode; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java index 7ed8ab535..57246a299 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonContraption.java @@ -5,7 +5,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.Blo import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; import com.simibubi.create.content.contraptions.components.structureMovement.piston.MechanicalPistonBlock.*; import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.block.BlockState; import net.minecraft.block.CarpetBlock; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java index 28d86c6dc..94d4e25d1 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/PistonLighter.java @@ -1,8 +1,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.piston; -import com.simibubi.create.foundation.render.light.ContraptionLighter; -import com.simibubi.create.foundation.render.light.GridAlignedBB; -import net.minecraft.util.Direction; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; import net.minecraft.util.math.Vec3i; public class PistonLighter extends ContraptionLighter { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java index 55bb14c93..13551c9e8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyContraption.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pu import com.simibubi.create.content.contraptions.components.structureMovement.AllContraptionTypes; import com.simibubi.create.content.contraptions.components.structureMovement.TranslatingContraption; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import net.minecraft.nbt.CompoundNBT; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java index fc60b3e84..1541eb941 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyLighter.java @@ -1,9 +1,8 @@ package com.simibubi.create.content.contraptions.components.structureMovement.pulley; import com.simibubi.create.AllBlocks; -import com.simibubi.create.foundation.render.light.ContraptionLighter; -import com.simibubi.create.foundation.render.light.GridAlignedBB; -import net.minecraft.util.math.AxisAlignedBB; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java new file mode 100644 index 000000000..c35a87c18 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionKineticRenderer.java @@ -0,0 +1,19 @@ +package com.simibubi.create.content.contraptions.components.structureMovement.render; + +import com.simibubi.create.foundation.render.AllProgramSpecs; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; +import com.simibubi.create.foundation.render.backend.instancing.RenderMaterial; +import com.simibubi.create.content.contraptions.base.RotatingInstancedModel; +import com.simibubi.create.content.contraptions.components.actors.RotatingActorModel; + +public class ContraptionKineticRenderer extends InstancedTileRenderer { + + @Override + public void registerMaterials() { + materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_BELT, BeltInstancedModel::new)); + materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ROTATING, RotatingInstancedModel::new)); + materials.put(KineticRenderMaterials.ACTORS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ACTOR, RotatingActorModel::new)); + } +} diff --git a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionModel.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java similarity index 73% rename from src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionModel.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java index 9e8f80b38..a332474a4 100644 --- a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionModel.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionModel.java @@ -1,17 +1,12 @@ -package com.simibubi.create.foundation.render.contraption; +package com.simibubi.create.content.contraptions.components.structureMovement.render; -import com.simibubi.create.foundation.render.BufferedModel; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.attrib.impl.ContraptionVertexAttributes; -import com.simibubi.create.foundation.render.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.BufferedModel; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.LightTexture; import java.nio.ByteBuffer; -import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.LIGHT; -import static com.simibubi.create.foundation.render.gl.attrib.CommonAttributes.RGBA; - public class ContraptionModel extends BufferedModel { public static final VertexFormat FORMAT = VertexFormat.builder() .addAttributes(ContraptionVertexAttributes.class) diff --git a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionProgram.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionProgram.java similarity index 82% rename from src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionProgram.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionProgram.java index 62137177c..6a2ee017e 100644 --- a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionProgram.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionProgram.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.contraption; +package com.simibubi.create.content.contraptions.components.structureMovement.render; -import com.simibubi.create.foundation.render.gl.BasicProgram; -import com.simibubi.create.foundation.render.light.GridAlignedBB; +import com.simibubi.create.foundation.render.backend.gl.BasicProgram; +import com.simibubi.create.foundation.render.backend.light.GridAlignedBB; import net.minecraft.client.renderer.Matrix4f; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionRenderDispatcher.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java similarity index 95% rename from src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionRenderDispatcher.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java index 4e5b28149..0c7441cbd 100644 --- a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionRenderDispatcher.java @@ -1,14 +1,13 @@ -package com.simibubi.create.foundation.render.contraption; +package com.simibubi.create.content.contraptions.components.structureMovement.render; import com.mojang.blaze3d.matrix.MatrixStack; -import com.mojang.blaze3d.platform.GlStateManager; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntity; import com.simibubi.create.content.contraptions.components.structureMovement.AbstractContraptionEntityRenderer; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionHandler; import com.simibubi.create.foundation.render.AllProgramSpecs; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.Backend; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Matrix4f; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ContraptionVertexAttributes.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionVertexAttributes.java similarity index 71% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ContraptionVertexAttributes.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionVertexAttributes.java index 8109408ed..6bfbf8af7 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ContraptionVertexAttributes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/ContraptionVertexAttributes.java @@ -1,8 +1,8 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; +package com.simibubi.create.content.contraptions.components.structureMovement.render; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; public enum ContraptionVertexAttributes implements IVertexAttrib { VERTEX_POSITION("aPos", CommonAttributes.VEC3), diff --git a/src/main/java/com/simibubi/create/foundation/render/contraption/RenderedContraption.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/render/contraption/RenderedContraption.java rename to src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java index 93c174ff6..bc0f33e48 100644 --- a/src/main/java/com/simibubi/create/foundation/render/contraption/RenderedContraption.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/RenderedContraption.java @@ -1,13 +1,14 @@ -package com.simibubi.create.foundation.render.contraption; +package com.simibubi.create.content.contraptions.components.structureMovement.render; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllMovementBehaviours; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; import com.simibubi.create.content.contraptions.components.structureMovement.MovementBehaviour; import com.simibubi.create.content.contraptions.components.structureMovement.MovementContext; -import com.simibubi.create.foundation.render.instancing.*; -import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData; -import com.simibubi.create.foundation.render.light.ContraptionLighter; +import com.simibubi.create.foundation.render.backend.instancing.*; +import com.simibubi.create.content.contraptions.components.actors.ContraptionActorData; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; import com.simibubi.create.foundation.utility.worldWrappers.PlacementSimulationWorld; import net.minecraft.block.BlockRenderType; import net.minecraft.block.BlockState; @@ -67,7 +68,7 @@ public class RenderedContraption { return lighter; } - public RenderMaterial> getActorMaterial() { + public RenderMaterial> getActorMaterial() { return kinetics.getMaterial(KineticRenderMaterials.ACTORS); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpCogInstance.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpCogInstance.java index 6c2a88a70..a8e7f6c61 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpCogInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpCogInstance.java @@ -3,10 +3,10 @@ package com.simibubi.create.content.contraptions.fluids; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java index 5b4bc7f8f..b2a1ca26d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/SpeedControllerRenderer.java @@ -3,7 +3,7 @@ package com.simibubi.create.content.contraptions.relays.advanced; import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.tileEntity.renderer.SmartTileEntityRenderer; import com.simibubi.create.foundation.render.SuperByteBuffer; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/BeltData.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltData.java similarity index 75% rename from src/main/java/com/simibubi/create/foundation/render/instancing/BeltData.java rename to src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltData.java index 6e63fc8fb..02fa03770 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/BeltData.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltData.java @@ -1,18 +1,13 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.content.contraptions.relays.belt; import com.simibubi.create.foundation.block.render.SpriteShiftEntry; -import com.simibubi.create.foundation.render.gl.GlPrimitiveType; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.attrib.impl.BeltVertexAttributes; -import com.simibubi.create.foundation.render.gl.attrib.impl.KineticVertexAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.content.contraptions.base.KineticVertexAttributes; +import com.simibubi.create.content.contraptions.base.KineticData; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import java.nio.ByteBuffer; -import static com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec.*; - public class BeltData extends KineticData { public static VertexFormat FORMAT = VertexFormat.builder() .addAttributes(KineticVertexAttributes.class) diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstance.java index 145e44920..654847972 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstance.java @@ -4,9 +4,10 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.base.KineticTileInstance; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.foundation.block.render.SpriteShiftEntry; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.*; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.*; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.utility.MatrixStacker; import net.minecraft.tileentity.TileEntityType; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstancedModel.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstancedModel.java new file mode 100644 index 000000000..b2e805d25 --- /dev/null +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltInstancedModel.java @@ -0,0 +1,22 @@ +package com.simibubi.create.content.contraptions.relays.belt; + +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import net.minecraft.client.renderer.BufferBuilder; + +public class BeltInstancedModel extends InstancedModel { + public BeltInstancedModel(BufferBuilder buf) { + super(buf); + } + + @Override + protected BeltData newInstance() { + return new BeltData(); + } + + @Override + protected VertexFormat getInstanceFormat() { + return BeltData.FORMAT; + } + +} diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java index 9bd63b022..9c3311b0f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltRenderer.java @@ -9,7 +9,7 @@ import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.content.contraptions.relays.belt.transport.TransportedItemStack; import com.simibubi.create.foundation.block.render.SpriteShiftEntry; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.render.ShadowRenderHelper; import com.simibubi.create.foundation.render.SuperByteBuffer; import com.simibubi.create.foundation.tileEntity.renderer.SafeTileEntityRenderer; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/BeltVertexAttributes.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltVertexAttributes.java similarity index 70% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/BeltVertexAttributes.java rename to src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltVertexAttributes.java index e8c8ab9cd..ca2125848 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/BeltVertexAttributes.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltVertexAttributes.java @@ -1,9 +1,8 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; +package com.simibubi.create.content.contraptions.relays.belt; -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; -import com.simibubi.create.foundation.render.instancing.BeltData; +import com.simibubi.create.foundation.render.backend.gl.attrib.CommonAttributes; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexAttribSpec; public enum BeltVertexAttributes implements IVertexAttrib { INSTANCE_ROTATION("aInstanceRot", CommonAttributes.VEC3), diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ShaftInstance.java index bb45e1c85..bebfb5763 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/ShaftInstance.java @@ -2,8 +2,8 @@ package com.simibubi.create.content.contraptions.relays.encased; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.api.distmarker.Dist; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java index dce5bac1c..860d267ba 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftInstance.java @@ -3,11 +3,11 @@ package com.simibubi.create.content.contraptions.relays.encased; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.KineticTileInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstanceKey; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstanceKey; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntityType; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java index a4ccdffc4..2620aa018 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/SplitShaftRenderer.java @@ -5,7 +5,7 @@ import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.IRotate; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.render.SuperByteBuffer; @@ -17,7 +17,6 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.util.Direction; import net.minecraft.util.Direction.Axis; import net.minecraft.util.math.BlockPos; -import sun.nio.cs.FastCharsetProvider; public class SplitShaftRenderer extends KineticTileEntityRenderer { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java index 2644bf25c..36e2a7b79 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxInstance.java @@ -2,11 +2,11 @@ package com.simibubi.create.content.contraptions.relays.gearbox; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstanceKey; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstanceKey; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java index d97110116..c0f3599c9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gearbox/GearboxRenderer.java @@ -4,7 +4,7 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.Iterate; import com.simibubi.create.foundation.render.SuperByteBuffer; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInstance.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInstance.java index a34cff992..53a8853d5 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInstance.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmInstance.java @@ -3,10 +3,10 @@ package com.simibubi.create.content.logistics.block.mechanicalArm; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.base.SingleRotatingInstance; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderRegistry; -import com.simibubi.create.foundation.render.instancing.RotatingData; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderer; +import com.simibubi.create.foundation.render.backend.instancing.InstancedModel; +import com.simibubi.create.foundation.render.backend.instancing.InstancedTileRenderRegistry; +import com.simibubi.create.content.contraptions.base.RotatingData; import net.minecraft.tileentity.TileEntityType; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; diff --git a/src/main/java/com/simibubi/create/content/schematics/client/SchematicRendererWithInstancing.java b/src/main/java/com/simibubi/create/content/schematics/client/SchematicRendererWithInstancing.java index 504940a03..afbefca53 100644 --- a/src/main/java/com/simibubi/create/content/schematics/client/SchematicRendererWithInstancing.java +++ b/src/main/java/com/simibubi/create/content/schematics/client/SchematicRendererWithInstancing.java @@ -1,15 +1,9 @@ package com.simibubi.create.content.schematics.client; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.contraption.ContraptionKineticRenderer; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionKineticRenderer; import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderType; -import net.minecraftforge.client.ForgeHooksClient; -import net.minecraftforge.client.MinecraftForgeClient; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.fml.loading.FMLClientLaunchProvider; public class SchematicRendererWithInstancing extends SchematicRenderer { public final ContraptionKineticRenderer tiles; diff --git a/src/main/java/com/simibubi/create/events/ClientEvents.java b/src/main/java/com/simibubi/create/events/ClientEvents.java index 229f4431e..580cedf9e 100644 --- a/src/main/java/com/simibubi/create/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/events/ClientEvents.java @@ -24,9 +24,9 @@ import com.simibubi.create.foundation.gui.ScreenOpener; import com.simibubi.create.foundation.item.TooltipHelper; import com.simibubi.create.foundation.networking.AllPackets; import com.simibubi.create.foundation.networking.LeftClickPacket; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.render.RenderWork; -import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import com.simibubi.create.foundation.tileEntity.behaviour.edgeInteraction.EdgeInteractionRenderer; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringRenderer; diff --git a/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java index 945166a97..75f97dcce 100644 --- a/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java +++ b/src/main/java/com/simibubi/create/foundation/command/ConfigureConfigPacket.java @@ -3,8 +3,7 @@ package com.simibubi.create.foundation.command; import java.util.function.Consumer; import java.util.function.Supplier; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import org.apache.logging.log4j.LogManager; import com.simibubi.create.content.contraptions.goggles.GoggleConfigScreen; diff --git a/src/main/java/com/simibubi/create/foundation/config/CClient.java b/src/main/java/com/simibubi/create/foundation/config/CClient.java index e1043bca0..a7a0cb259 100644 --- a/src/main/java/com/simibubi/create/foundation/config/CClient.java +++ b/src/main/java/com/simibubi/create/foundation/config/CClient.java @@ -1,6 +1,6 @@ package com.simibubi.create.foundation.config; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.Backend; public class CClient extends ConfigBase { diff --git a/src/main/java/com/simibubi/create/foundation/mixin/CancelTileEntityRenderMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/CancelTileEntityRenderMixin.java index 2bdc39f96..ba76ddb6d 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/CancelTileEntityRenderMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/CancelTileEntityRenderMixin.java @@ -1,7 +1,7 @@ package com.simibubi.create.foundation.mixin; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.instancing.IInstanceRendered; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.instancing.IInstanceRendered; import net.minecraft.client.renderer.chunk.ChunkRenderDispatcher; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.api.distmarker.Dist; @@ -11,7 +11,6 @@ import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import java.util.ArrayList; import java.util.List; @OnlyIn(Dist.CLIENT) diff --git a/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java index 38e2053d2..779c8e6d0 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/LightUpdateMixin.java @@ -1,6 +1,6 @@ package com.simibubi.create.foundation.mixin; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import net.minecraft.client.multiplayer.ClientChunkProvider; import net.minecraft.util.math.SectionPos; import net.minecraft.world.LightType; diff --git a/src/main/java/com/simibubi/create/foundation/mixin/OnRemoveTileMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/OnRemoveTileMixin.java index 9c57a7551..1e9e13139 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/OnRemoveTileMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/OnRemoveTileMixin.java @@ -1,7 +1,6 @@ package com.simibubi.create.foundation.mixin; import com.simibubi.create.CreateClient; -import com.simibubi.create.foundation.render.FastRenderDispatcher; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java index 9073923dc..a52cbe181 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/RenderInLayerMixin.java @@ -1,7 +1,7 @@ package com.simibubi.create.foundation.mixin; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import net.minecraft.client.renderer.RenderType; import net.minecraft.client.renderer.WorldRenderer; import net.minecraftforge.api.distmarker.Dist; diff --git a/src/main/java/com/simibubi/create/foundation/mixin/ShaderCloseMixin.java b/src/main/java/com/simibubi/create/foundation/mixin/ShaderCloseMixin.java index e65a9774c..c82406e20 100644 --- a/src/main/java/com/simibubi/create/foundation/mixin/ShaderCloseMixin.java +++ b/src/main/java/com/simibubi/create/foundation/mixin/ShaderCloseMixin.java @@ -1,6 +1,6 @@ package com.simibubi.create.foundation.mixin; -import com.simibubi.create.foundation.render.gl.backend.OptifineHandler; +import com.simibubi.create.foundation.render.backend.OptifineHandler; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.screen.VideoSettingsScreen; diff --git a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java index 0ba20c5f1..f447a156f 100644 --- a/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java +++ b/src/main/java/com/simibubi/create/foundation/render/AllProgramSpecs.java @@ -1,14 +1,19 @@ package com.simibubi.create.foundation.render; import com.simibubi.create.Create; -import com.simibubi.create.foundation.render.contraption.ContraptionProgram; -import com.simibubi.create.foundation.render.gl.BasicProgram; -import com.simibubi.create.foundation.render.gl.attrib.impl.*; -import com.simibubi.create.foundation.render.gl.shader.ProgramSpec; -import com.simibubi.create.foundation.render.gl.shader.ShaderConstants; +import com.simibubi.create.content.contraptions.base.KineticVertexAttributes; +import com.simibubi.create.content.contraptions.base.RotatingVertexAttributes; +import com.simibubi.create.content.contraptions.components.actors.ActorVertexAttributes; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionVertexAttributes; +import com.simibubi.create.content.contraptions.relays.belt.BeltVertexAttributes; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionProgram; +import com.simibubi.create.foundation.render.backend.gl.BasicProgram; +import com.simibubi.create.foundation.render.backend.gl.attrib.ModelVertexAttributes; +import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec; +import com.simibubi.create.foundation.render.backend.gl.shader.ShaderConstants; import net.minecraft.util.ResourceLocation; -import static com.simibubi.create.foundation.render.gl.backend.Backend.register; +import static com.simibubi.create.foundation.render.backend.Backend.register; public class AllProgramSpecs { public static final ProgramSpec ROTATING = register(ProgramSpec.builder("rotating", BasicProgram::new) diff --git a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java index 1cbfac59f..2e75eeeca 100644 --- a/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/render/KineticRenderer.java @@ -1,12 +1,15 @@ package com.simibubi.create.foundation.render; -import com.simibubi.create.foundation.render.gl.BasicProgram; -import com.simibubi.create.foundation.render.instancing.*; +import com.simibubi.create.content.contraptions.base.KineticRenderMaterials; +import com.simibubi.create.content.contraptions.base.RotatingInstancedModel; +import com.simibubi.create.content.contraptions.relays.belt.BeltInstancedModel; +import com.simibubi.create.foundation.render.backend.gl.BasicProgram; +import com.simibubi.create.foundation.render.backend.instancing.*; public class KineticRenderer extends InstancedTileRenderer { @Override public void registerMaterials() { - materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.BELT, BeltModel::new)); - materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.ROTATING, RotatingModel::new)); + materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.BELT, BeltInstancedModel::new)); + materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.ROTATING, RotatingInstancedModel::new)); } } diff --git a/src/main/java/com/simibubi/create/foundation/render/TemplateBuffer.java b/src/main/java/com/simibubi/create/foundation/render/TemplateBuffer.java index 3b31227b3..d16702d08 100644 --- a/src/main/java/com/simibubi/create/foundation/render/TemplateBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/render/TemplateBuffer.java @@ -1,11 +1,7 @@ package com.simibubi.create.foundation.render; import com.mojang.datafixers.util.Pair; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.GlBuffer; import net.minecraft.client.renderer.BufferBuilder; -import net.minecraft.client.renderer.vertex.VertexFormatElement; -import org.lwjgl.opengl.GL15; import java.nio.Buffer; import java.nio.ByteBuffer; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/backend/Backend.java b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java similarity index 92% rename from src/main/java/com/simibubi/create/foundation/render/gl/backend/Backend.java rename to src/main/java/com/simibubi/create/foundation/render/backend/Backend.java index eb5fed9fb..d60f6dfc2 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/backend/Backend.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/Backend.java @@ -1,11 +1,12 @@ -package com.simibubi.create.foundation.render.gl.backend; +package com.simibubi.create.foundation.render.backend; import com.simibubi.create.foundation.config.AllConfigs; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.shader.GlProgram; -import com.simibubi.create.foundation.render.gl.shader.GlShader; -import com.simibubi.create.foundation.render.gl.shader.ProgramSpec; -import com.simibubi.create.foundation.render.gl.shader.ShaderType; +import com.simibubi.create.foundation.render.backend.gl.shader.GlProgram; +import com.simibubi.create.foundation.render.backend.gl.shader.GlShader; +import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec; +import com.simibubi.create.foundation.render.backend.gl.shader.ShaderType; +import com.simibubi.create.foundation.render.backend.gl.versioned.GlVersioned; +import com.simibubi.create.foundation.render.backend.gl.versioned.MapBuffer; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.resources.IReloadableResourceManager; @@ -16,6 +17,7 @@ import net.minecraftforge.resource.ISelectiveResourceReloadListener; import net.minecraftforge.resource.VanillaResourceType; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import org.lwjgl.opengl.ARBVertexProgram; import org.lwjgl.opengl.GL; import org.lwjgl.opengl.GLCapabilities; import org.lwjgl.system.MemoryUtil; @@ -54,10 +56,6 @@ public class Backend { mapBuffer.mapBuffer(target, offset, length, upload); } - public static void mapBuffer(int target, int size, Consumer upload) { - mapBuffer.mapBuffer(target, 0, size, upload); - } - /** * Register a shader program. TODO: replace with forge registry? */ diff --git a/src/main/java/com/simibubi/create/foundation/render/BufferedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java similarity index 84% rename from src/main/java/com/simibubi/create/foundation/render/BufferedModel.java rename to src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java index c5bfe5509..2e8c90e72 100644 --- a/src/main/java/com/simibubi/create/foundation/render/BufferedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/BufferedModel.java @@ -1,9 +1,10 @@ -package com.simibubi.create.foundation.render; +package com.simibubi.create.foundation.render.backend; -import com.simibubi.create.foundation.render.gl.GlPrimitiveType; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.GlBuffer; +import com.simibubi.create.foundation.render.RenderWork; +import com.simibubi.create.foundation.render.TemplateBuffer; +import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.gl.GlBuffer; import net.minecraft.client.renderer.BufferBuilder; import org.lwjgl.opengl.GL15; import org.lwjgl.opengl.GL20; @@ -38,7 +39,7 @@ public abstract class BufferedModel extends TemplateBuffer { GL15.glBufferData(GL15.GL_ARRAY_BUFFER, invariantSize, GL15.GL_STATIC_DRAW); // mirror it in system memory so we can write to it - Backend.mapBuffer(GL15.GL_ARRAY_BUFFER, invariantSize, buffer -> { + modelVBO.map(invariantSize, buffer -> { for (int i = 0; i < vertexCount; i++) { copyVertex(buffer, i); } @@ -53,7 +54,7 @@ public abstract class BufferedModel extends TemplateBuffer { ebo.bind(); GL15.glBufferData(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, GL15.GL_STATIC_DRAW); - Backend.mapBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, indicesSize, indices -> { + ebo.map(indicesSize, indices -> { for (int i = 0; i < vertexCount; i++) { indices.putShort((short) i); } @@ -106,7 +107,7 @@ public abstract class BufferedModel extends TemplateBuffer { GL20.glEnableVertexAttribArray(i); } - getModelFormat().informAttributes(0); + getModelFormat().vertexAttribPointers(0); } public void delete() { diff --git a/src/main/java/com/simibubi/create/foundation/render/FastRenderDispatcher.java b/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java similarity index 94% rename from src/main/java/com/simibubi/create/foundation/render/FastRenderDispatcher.java rename to src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java index f763c74b9..3f268de7f 100644 --- a/src/main/java/com/simibubi/create/foundation/render/FastRenderDispatcher.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/FastRenderDispatcher.java @@ -1,14 +1,15 @@ -package com.simibubi.create.foundation.render; +package com.simibubi.create.foundation.render.backend; import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.CreateClient; import com.simibubi.create.content.contraptions.KineticDebugger; import com.simibubi.create.content.schematics.SchematicWorld; -import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.backend.OptifineHandler; -import com.simibubi.create.foundation.render.light.ILightListener; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; +import com.simibubi.create.foundation.render.RenderWork; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.OptifineHandler; +import com.simibubi.create.foundation.render.backend.light.ILightListener; import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.WorldAttached; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/backend/OptifineHandler.java b/src/main/java/com/simibubi/create/foundation/render/backend/OptifineHandler.java similarity index 97% rename from src/main/java/com/simibubi/create/foundation/render/gl/backend/OptifineHandler.java rename to src/main/java/com/simibubi/create/foundation/render/backend/OptifineHandler.java index 5143ba134..8e35a2016 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/backend/OptifineHandler.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/OptifineHandler.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.backend; +package com.simibubi.create.foundation.render.backend; import net.minecraft.client.Minecraft; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/backend/SystemCapability.java b/src/main/java/com/simibubi/create/foundation/render/backend/SystemCapability.java similarity index 84% rename from src/main/java/com/simibubi/create/foundation/render/gl/backend/SystemCapability.java rename to src/main/java/com/simibubi/create/foundation/render/backend/SystemCapability.java index 4dcb5d9a4..9a4678e6f 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/backend/SystemCapability.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/SystemCapability.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.backend; +package com.simibubi.create.foundation.render.backend; public enum SystemCapability { /** diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/BasicProgram.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java similarity index 91% rename from src/main/java/com/simibubi/create/foundation/render/gl/BasicProgram.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java index ebe001bb5..c471945c2 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/BasicProgram.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/BasicProgram.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.shader.GlProgram; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.shader.GlProgram; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.Matrix4f; import net.minecraft.util.ResourceLocation; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlBuffer.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java similarity index 78% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlBuffer.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java index 064862d8b..c94c38828 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlBuffer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlBuffer.java @@ -1,6 +1,6 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.Backend; import org.lwjgl.opengl.GL20; import java.nio.ByteBuffer; @@ -33,6 +33,10 @@ public class GlBuffer extends GlObject { unbind(); } + public void map(int length, Consumer upload) { + Backend.mapBuffer(bufferType, 0, length, upload); + } + public void map(int offset, int length, Consumer upload) { Backend.mapBuffer(bufferType, offset, length, upload); } diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlFog.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlFog.java similarity index 80% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlFog.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlFog.java index d13ae540c..29ed4432f 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlFog.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlFog.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlObject.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlObject.java similarity index 94% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlObject.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlObject.java index 3921657bb..ef34e5ebe 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlObject.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlObject.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; // Utility class for safely dealing with gl object handles. public abstract class GlObject { diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlPrimitiveType.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlPrimitiveType.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java index 623164c08..5e069fabf 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlPrimitiveType.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlPrimitiveType.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlTexture.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlTexture.java similarity index 89% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlTexture.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlTexture.java index 7c28e99c3..30b5d3f0f 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlTexture.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlTexture.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/GlVertexArray.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java similarity index 90% rename from src/main/java/com/simibubi/create/foundation/render/gl/GlVertexArray.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java index 8c6320447..2d024c6d2 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/GlVertexArray.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/GlVertexArray.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl; +package com.simibubi.create.foundation.render.backend.gl; import org.lwjgl.opengl.GL30; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/CommonAttributes.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/CommonAttributes.java similarity index 89% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/CommonAttributes.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/CommonAttributes.java index b83bb9ad5..d3fd9d48e 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/CommonAttributes.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/CommonAttributes.java @@ -1,6 +1,6 @@ -package com.simibubi.create.foundation.render.gl.attrib; +package com.simibubi.create.foundation.render.backend.gl.attrib; -import com.simibubi.create.foundation.render.gl.GlPrimitiveType; +import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType; public class CommonAttributes { diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/IVertexAttrib.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/IVertexAttrib.java similarity index 69% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/IVertexAttrib.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/IVertexAttrib.java index 8996f14ac..5c77620f9 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/IVertexAttrib.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/IVertexAttrib.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.attrib; +package com.simibubi.create.foundation.render.backend.gl.attrib; public interface IVertexAttrib { diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ModelVertexAttributes.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/ModelVertexAttributes.java similarity index 72% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ModelVertexAttributes.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/ModelVertexAttributes.java index cd4b70d82..960289fd6 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/impl/ModelVertexAttributes.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/ModelVertexAttributes.java @@ -1,8 +1,4 @@ -package com.simibubi.create.foundation.render.gl.attrib.impl; - -import com.simibubi.create.foundation.render.gl.attrib.CommonAttributes; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.attrib.VertexAttribSpec; +package com.simibubi.create.foundation.render.backend.gl.attrib; public enum ModelVertexAttributes implements IVertexAttrib { VERTEX_POSITION("aPos", CommonAttributes.VEC3), diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexAttribSpec.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexAttribSpec.java similarity index 72% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexAttribSpec.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexAttribSpec.java index 5b50e9971..709508c90 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexAttribSpec.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexAttribSpec.java @@ -1,6 +1,6 @@ -package com.simibubi.create.foundation.render.gl.attrib; +package com.simibubi.create.foundation.render.backend.gl.attrib; -import com.simibubi.create.foundation.render.gl.GlPrimitiveType; +import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType; import org.lwjgl.opengl.GL20; public class VertexAttribSpec { @@ -23,8 +23,8 @@ public class VertexAttribSpec { this.normalized = normalized; } - public void registerForBuffer(int stride, int indexAcc, int offsetAcc) { - GL20.glVertexAttribPointer(indexAcc, count, type.getGlConstant(), normalized, stride, offsetAcc); + public void vertexAttribPointer(int stride, int index, int pointer) { + GL20.glVertexAttribPointer(index, count, type.getGlConstant(), normalized, stride, pointer); } public int getSize() { diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexFormat.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexFormat.java similarity index 90% rename from src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexFormat.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexFormat.java index 676ec7e13..3929e3354 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/attrib/VertexFormat.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/attrib/VertexFormat.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.attrib; +package com.simibubi.create.foundation.render.backend.gl.attrib; import java.util.ArrayList; import java.util.Arrays; @@ -31,11 +31,11 @@ public class VertexFormat { return stride; } - public void informAttributes(int index) { + public void vertexAttribPointers(int index) { int offset = 0; for (IVertexAttrib attrib : this.allAttributes) { VertexAttribSpec spec = attrib.attribSpec(); - spec.registerForBuffer(stride, index, offset); + spec.vertexAttribPointer(stride, index, offset); index += spec.getAttributeCount(); offset += spec.getSize(); } diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GLSLType.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GLSLType.java similarity index 90% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/GLSLType.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GLSLType.java index 4cd2d8d56..80dc2fa16 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GLSLType.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GLSLType.java @@ -1,6 +1,6 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; -import com.simibubi.create.foundation.render.gl.GlPrimitiveType; +import com.simibubi.create.foundation.render.backend.gl.GlPrimitiveType; public class GLSLType { public static final GLSLType FLOAT = new GLSLType("mat4", GlPrimitiveType.FLOAT, 16); diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GlProgram.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlProgram.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/GlProgram.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlProgram.java index d766ca730..790bb4c5a 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GlProgram.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlProgram.java @@ -1,8 +1,8 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; -import com.simibubi.create.foundation.render.gl.GlObject; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.GlObject; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.Backend; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GlShader.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlShader.java similarity index 87% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/GlShader.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlShader.java index 210878419..fa0fa48f2 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/GlShader.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/GlShader.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; -import com.simibubi.create.foundation.render.gl.GlObject; -import com.simibubi.create.foundation.render.gl.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.GlObject; +import com.simibubi.create.foundation.render.backend.Backend; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ProgramSpec.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ProgramSpec.java similarity index 94% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/ProgramSpec.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ProgramSpec.java index 894131652..3e98a70df 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ProgramSpec.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ProgramSpec.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; import com.simibubi.create.Create; -import com.simibubi.create.foundation.render.gl.attrib.IVertexAttrib; +import com.simibubi.create.foundation.render.backend.gl.attrib.IVertexAttrib; import net.minecraft.util.ResourceLocation; import java.util.ArrayList; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderCallback.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderCallback.java similarity index 84% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderCallback.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderCallback.java index 793e02e85..b410d91ff 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderCallback.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderCallback.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; /** * A Callback for when a shader is called. Used to define shader uniforms. diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderConstants.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderConstants.java similarity index 92% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderConstants.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderConstants.java index 87986a2e3..3f1ed6c09 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderConstants.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderConstants.java @@ -1,9 +1,8 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; import java.io.BufferedReader; import java.io.StringReader; import java.util.ArrayList; -import java.util.Spliterator; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderType.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderType.java similarity index 78% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderType.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderType.java index ff186f819..b90f15cca 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderType.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderType.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; import org.lwjgl.opengl.GL20; diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderUniforms.java b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderUniforms.java similarity index 71% rename from src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderUniforms.java rename to src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderUniforms.java index 8baa6e1c6..8a85d1c24 100644 --- a/src/main/java/com/simibubi/create/foundation/render/gl/shader/ShaderUniforms.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/gl/shader/ShaderUniforms.java @@ -1,6 +1,5 @@ -package com.simibubi.create.foundation.render.gl.shader; +package com.simibubi.create.foundation.render.backend.gl.shader; -import java.util.ArrayList; import java.util.HashMap; import java.util.Map; diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/IInstanceRendered.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/IInstanceRendered.java new file mode 100644 index 000000000..a1558446f --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/IInstanceRendered.java @@ -0,0 +1,9 @@ +package com.simibubi.create.foundation.render.backend.instancing; + +import com.simibubi.create.foundation.render.backend.light.ILightListener; + +public interface IInstanceRendered extends ILightListener { + default boolean shouldRenderAsTE() { + return false; + } +} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/IRendererFactory.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/IRendererFactory.java similarity index 75% rename from src/main/java/com/simibubi/create/foundation/render/instancing/IRendererFactory.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/IRendererFactory.java index aceff9855..196e029d8 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/IRendererFactory.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/IRendererFactory.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstanceData.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceData.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/render/instancing/InstanceData.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceData.java index d656ba948..f713b04c1 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstanceData.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceData.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import java.nio.ByteBuffer; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstanceKey.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceKey.java similarity index 90% rename from src/main/java/com/simibubi/create/foundation/render/instancing/InstanceKey.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceKey.java index 9ba7f1141..166bf8e56 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstanceKey.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstanceKey.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import java.util.function.Consumer; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java similarity index 92% rename from src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java index 7311562b9..42c7e2acf 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedModel.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedModel.java @@ -1,12 +1,12 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; -import com.simibubi.create.foundation.render.BufferedModel; +import com.simibubi.create.foundation.render.backend.BufferedModel; import com.simibubi.create.foundation.render.RenderMath; -import com.simibubi.create.foundation.render.gl.GlVertexArray; -import com.simibubi.create.foundation.render.gl.GlBuffer; -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.gl.attrib.impl.ModelVertexAttributes; +import com.simibubi.create.foundation.render.backend.gl.GlVertexArray; +import com.simibubi.create.foundation.render.backend.gl.GlBuffer; +import com.simibubi.create.foundation.render.backend.gl.attrib.VertexFormat; +import com.simibubi.create.foundation.render.backend.gl.attrib.ModelVertexAttributes; import net.minecraft.client.renderer.BufferBuilder; import org.lwjgl.opengl.*; @@ -151,7 +151,7 @@ public abstract class InstancedModel extends BufferedMod glInstanceCount = newInstanceCount; int staticAttributes = getModelFormat().getShaderAttributeCount(); - instanceFormat.informAttributes(staticAttributes); + instanceFormat.vertexAttribPointers(staticAttributes); for (int i = 0; i < instanceFormat.getShaderAttributeCount(); i++) { GL33.glVertexAttribDivisor(i + staticAttributes, 1); diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderRegistry.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderRegistry.java similarity index 93% rename from src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderRegistry.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderRegistry.java index a454828f6..fd731a8e2 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderRegistry.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderRegistry.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import com.google.common.collect.Maps; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderer.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java similarity index 91% rename from src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderer.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java index a5e84af0c..4e9bd2fee 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/InstancedTileRenderer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/InstancedTileRenderer.java @@ -1,14 +1,13 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; -import com.simibubi.create.foundation.render.FastRenderDispatcher; -import com.simibubi.create.foundation.render.gl.BasicProgram; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.shader.ShaderCallback; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.gl.BasicProgram; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.shader.ShaderCallback; import com.simibubi.create.foundation.utility.AnimationTickHolder; import net.minecraft.client.renderer.Matrix4f; import net.minecraft.client.renderer.RenderType; import net.minecraft.tileentity.TileEntity; -import org.lwjgl.opengl.GL20; import javax.annotation.Nullable; import java.util.HashMap; diff --git a/src/main/java/com/simibubi/create/foundation/render/backend/instancing/MaterialType.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/MaterialType.java new file mode 100644 index 000000000..48ade4b2a --- /dev/null +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/MaterialType.java @@ -0,0 +1,3 @@ +package com.simibubi.create.foundation.render.backend.instancing; + +public class MaterialType { } diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/ModelFactory.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/ModelFactory.java similarity index 72% rename from src/main/java/com/simibubi/create/foundation/render/instancing/ModelFactory.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/ModelFactory.java index 3024abcf5..bc358f799 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/ModelFactory.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/ModelFactory.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import net.minecraft.client.renderer.BufferBuilder; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/RenderMaterial.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/RenderMaterial.java similarity index 92% rename from src/main/java/com/simibubi/create/foundation/render/instancing/RenderMaterial.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/RenderMaterial.java index d20e61d4e..64e5eac46 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/RenderMaterial.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/RenderMaterial.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; @@ -6,12 +6,12 @@ import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.content.contraptions.base.KineticTileEntityRenderer; import com.simibubi.create.foundation.render.Compartment; -import com.simibubi.create.foundation.render.FastRenderDispatcher; +import com.simibubi.create.foundation.render.backend.FastRenderDispatcher; import com.simibubi.create.foundation.render.SuperByteBufferCache; -import com.simibubi.create.foundation.render.gl.BasicProgram; -import com.simibubi.create.foundation.render.gl.backend.Backend; -import com.simibubi.create.foundation.render.gl.shader.ProgramSpec; -import com.simibubi.create.foundation.render.gl.shader.ShaderCallback; +import com.simibubi.create.foundation.render.backend.gl.BasicProgram; +import com.simibubi.create.foundation.render.backend.Backend; +import com.simibubi.create.foundation.render.backend.gl.shader.ProgramSpec; +import com.simibubi.create.foundation.render.backend.gl.shader.ShaderCallback; import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.BlockRendererDispatcher; diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/TileEntityInstance.java b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java similarity index 94% rename from src/main/java/com/simibubi/create/foundation/render/instancing/TileEntityInstance.java rename to src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java index b4e9db47c..a2c4ca8fb 100644 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/TileEntityInstance.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/instancing/TileEntityInstance.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.instancing; +package com.simibubi.create.foundation.render.backend.instancing; import net.minecraft.block.BlockState; import net.minecraft.tileentity.TileEntity; diff --git a/src/main/java/com/simibubi/create/foundation/render/light/CoordinateConsumer.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/CoordinateConsumer.java similarity index 62% rename from src/main/java/com/simibubi/create/foundation/render/light/CoordinateConsumer.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/CoordinateConsumer.java index ff9ee492b..4011c19e0 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/CoordinateConsumer.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/CoordinateConsumer.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; @FunctionalInterface public interface CoordinateConsumer { diff --git a/src/main/java/com/simibubi/create/foundation/render/light/EmptyLighter.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/EmptyLighter.java similarity index 73% rename from src/main/java/com/simibubi/create/foundation/render/light/EmptyLighter.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/EmptyLighter.java index e942664c7..b58653899 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/EmptyLighter.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/EmptyLighter.java @@ -1,6 +1,7 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; +import com.simibubi.create.content.contraptions.components.structureMovement.ContraptionLighter; // so other contraptions don't crash before they have a lighter public class EmptyLighter extends ContraptionLighter { diff --git a/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java similarity index 98% rename from src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java index fd54986f4..e9bf8b6ee 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/GridAlignedBB.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/GridAlignedBB.java @@ -1,11 +1,9 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; import com.simibubi.create.foundation.render.RenderMath; -import com.simibubi.create.foundation.utility.VecHelper; import net.minecraft.util.Direction; import net.minecraft.util.math.AxisAlignedBB; import net.minecraft.util.math.SectionPos; -import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import static com.simibubi.create.foundation.render.RenderMath.isPowerOf2; diff --git a/src/main/java/com/simibubi/create/foundation/render/light/ILightListener.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/ILightListener.java similarity index 52% rename from src/main/java/com/simibubi/create/foundation/render/light/ILightListener.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/ILightListener.java index 8b4a571f0..5fd2ff8bd 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/ILightListener.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/ILightListener.java @@ -1,4 +1,4 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; public interface ILightListener { void onChunkLightUpdate(); diff --git a/src/main/java/com/simibubi/create/foundation/render/light/LightVolume.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java similarity index 98% rename from src/main/java/com/simibubi/create/foundation/render/light/LightVolume.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java index 4109f49e6..8dd0bc5ab 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/LightVolume.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolume.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; import com.simibubi.create.foundation.render.RenderWork; -import com.simibubi.create.foundation.render.gl.GlTexture; +import com.simibubi.create.foundation.render.backend.gl.GlTexture; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.SectionPos; import net.minecraft.world.ILightReader; diff --git a/src/main/java/com/simibubi/create/foundation/render/light/LightVolumeDebugger.java b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolumeDebugger.java similarity index 90% rename from src/main/java/com/simibubi/create/foundation/render/light/LightVolumeDebugger.java rename to src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolumeDebugger.java index 651d0c5eb..63395a69a 100644 --- a/src/main/java/com/simibubi/create/foundation/render/light/LightVolumeDebugger.java +++ b/src/main/java/com/simibubi/create/foundation/render/backend/light/LightVolumeDebugger.java @@ -1,7 +1,7 @@ -package com.simibubi.create.foundation.render.light; +package com.simibubi.create.foundation.render.backend.light; import com.mojang.blaze3d.matrix.MatrixStack; -import com.simibubi.create.foundation.render.contraption.ContraptionRenderDispatcher; +import com.simibubi.create.content.contraptions.components.structureMovement.render.ContraptionRenderDispatcher; import com.simibubi.create.foundation.renderState.SuperRenderTypeBuffer; import com.simibubi.create.foundation.utility.Pair; import com.simibubi.create.foundation.utility.outliner.AABBOutline; diff --git a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionKineticRenderer.java b/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionKineticRenderer.java deleted file mode 100644 index 6569046e5..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/contraption/ContraptionKineticRenderer.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.simibubi.create.foundation.render.contraption; - -import com.simibubi.create.foundation.render.AllProgramSpecs; -import com.simibubi.create.foundation.render.instancing.InstancedTileRenderer; -import com.simibubi.create.foundation.render.instancing.BeltModel; -import com.simibubi.create.foundation.render.instancing.KineticRenderMaterials; -import com.simibubi.create.foundation.render.instancing.RenderMaterial; -import com.simibubi.create.foundation.render.instancing.RotatingModel; -import com.simibubi.create.foundation.render.instancing.actors.RotatingActorModel; - -public class ContraptionKineticRenderer extends InstancedTileRenderer { - - @Override - public void registerMaterials() { - materials.put(KineticRenderMaterials.BELTS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_BELT, BeltModel::new)); - materials.put(KineticRenderMaterials.ROTATING, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ROTATING, RotatingModel::new)); - materials.put(KineticRenderMaterials.ACTORS, new RenderMaterial<>(AllProgramSpecs.CONTRAPTION_ACTOR, RotatingActorModel::new)); - } -} diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/SamplerBinding.java b/src/main/java/com/simibubi/create/foundation/render/gl/SamplerBinding.java deleted file mode 100644 index 70eddad0b..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/gl/SamplerBinding.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.simibubi.create.foundation.render.gl; - -public class SamplerBinding { - - private final SamplerType type; - private final String variableName; - private final int binding; - - public SamplerBinding(SamplerType type, String variableName, int binding) { - this.type = type; - this.variableName = variableName; - this.binding = binding; - } - - public SamplerType getType() { - return type; - } - - public String getVariableName() { - return variableName; - } - - public int getBinding() { - return binding; - } -} diff --git a/src/main/java/com/simibubi/create/foundation/render/gl/SamplerType.java b/src/main/java/com/simibubi/create/foundation/render/gl/SamplerType.java deleted file mode 100644 index cb57c5a28..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/gl/SamplerType.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.simibubi.create.foundation.render.gl; - -import org.lwjgl.opengl.GL20; - -public enum SamplerType { - SAMPLER2D(GL20.GL_TEXTURE_2D, "sampler2D"), - SAMPLER3D(GL20.GL_TEXTURE_3D, "sampler3D"), - ; - - private final int glEnum; - private final String shaderToken; - - SamplerType(int glEnum, String shaderToken) { - this.glEnum = glEnum; - this.shaderToken = shaderToken; - } - - public int getGlEnum() { - return glEnum; - } - - public String getShaderToken() { - return shaderToken; - } -} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/BeltModel.java b/src/main/java/com/simibubi/create/foundation/render/instancing/BeltModel.java deleted file mode 100644 index 19430743d..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/BeltModel.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.simibubi.create.foundation.render.instancing; - -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import net.minecraft.client.renderer.BufferBuilder; - -public class BeltModel extends InstancedModel { - public BeltModel(BufferBuilder buf) { - super(buf); - } - - @Override - protected BeltData newInstance() { - return new BeltData(); - } - - @Override - protected VertexFormat getInstanceFormat() { - return BeltData.FORMAT; - } - -} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/IInstanceRendered.java b/src/main/java/com/simibubi/create/foundation/render/instancing/IInstanceRendered.java deleted file mode 100644 index f83e47001..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/IInstanceRendered.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.simibubi.create.foundation.render.instancing; - -import com.simibubi.create.foundation.render.light.ILightListener; - -public interface IInstanceRendered extends ILightListener { - default boolean shouldRenderAsTE() { - return false; - } -} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/KineticRenderMaterials.java b/src/main/java/com/simibubi/create/foundation/render/instancing/KineticRenderMaterials.java deleted file mode 100644 index 37ac5b379..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/KineticRenderMaterials.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.simibubi.create.foundation.render.instancing; - -import com.simibubi.create.foundation.render.instancing.actors.StaticRotatingActorData; - -public class KineticRenderMaterials { - public static final MaterialType> ROTATING = new MaterialType<>(); - public static final MaterialType> BELTS = new MaterialType<>(); - - public static final MaterialType> ACTORS = new MaterialType<>(); -} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/MaterialType.java b/src/main/java/com/simibubi/create/foundation/render/instancing/MaterialType.java deleted file mode 100644 index d3ef03f94..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/MaterialType.java +++ /dev/null @@ -1,3 +0,0 @@ -package com.simibubi.create.foundation.render.instancing; - -public class MaterialType { } diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/RotatingModel.java b/src/main/java/com/simibubi/create/foundation/render/instancing/RotatingModel.java deleted file mode 100644 index 8c1d2de81..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/RotatingModel.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.simibubi.create.foundation.render.instancing; - -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import net.minecraft.client.renderer.BufferBuilder; - -public class RotatingModel extends InstancedModel { - public RotatingModel(BufferBuilder buf) { - super(buf); - } - - @Override - protected RotatingData newInstance() { - return new RotatingData(); - } - - @Override - protected VertexFormat getInstanceFormat() { - return RotatingData.FORMAT; - } - -} diff --git a/src/main/java/com/simibubi/create/foundation/render/instancing/actors/RotatingActorModel.java b/src/main/java/com/simibubi/create/foundation/render/instancing/actors/RotatingActorModel.java deleted file mode 100644 index 56dc282f6..000000000 --- a/src/main/java/com/simibubi/create/foundation/render/instancing/actors/RotatingActorModel.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.simibubi.create.foundation.render.instancing.actors; - -import com.simibubi.create.foundation.render.gl.attrib.VertexFormat; -import com.simibubi.create.foundation.render.instancing.InstancedModel; -import net.minecraft.client.renderer.BufferBuilder; - -public class RotatingActorModel extends InstancedModel { - public RotatingActorModel(BufferBuilder buf) { - super(buf); - } - - @Override - protected VertexFormat getInstanceFormat() { - return StaticRotatingActorData.FORMAT; - } - - @Override - protected StaticRotatingActorData newInstance() { - return new StaticRotatingActorData(); - } -} diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java index affececcf..e7f740ebe 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/PlacementSimulationWorld.java @@ -5,18 +5,12 @@ import java.util.HashMap; import java.util.HashSet; import java.util.function.Predicate; -import com.simibubi.create.foundation.render.light.GridAlignedBB; -import com.simibubi.create.foundation.utility.Iterate; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.Direction; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.ChunkPos; import net.minecraft.util.math.SectionPos; -import net.minecraft.world.LightType; import net.minecraft.world.World; -import net.minecraft.world.chunk.NibbleArray; import net.minecraft.world.lighting.WorldLightManager; public class PlacementSimulationWorld extends WrappedWorld {