diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java index 9b6c53813..c3ea55c65 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/render/FlwContraptionManager.java @@ -9,11 +9,12 @@ import com.jozufozu.flywheel.backend.gl.GlStateTracker; import com.jozufozu.flywheel.backend.gl.GlTextureUnit; import com.jozufozu.flywheel.backend.gl.GlVertexArray; import com.jozufozu.flywheel.core.Formats; +import com.jozufozu.flywheel.core.Materials; +import com.jozufozu.flywheel.core.compile.ProgramContext; import com.jozufozu.flywheel.core.virtual.VirtualRenderWorld; import com.jozufozu.flywheel.event.RenderLayerEvent; import com.jozufozu.flywheel.util.Textures; import com.simibubi.create.content.contraptions.components.structureMovement.Contraption; -import com.simibubi.create.foundation.render.AllProgramSpecs; import com.simibubi.create.foundation.render.CreateContexts; import net.minecraft.client.renderer.RenderType; @@ -49,7 +50,7 @@ public class FlwContraptionManager extends ContraptionRenderingWorld CWORLD; - public static WorldContext STRUCTURE; + public static ProgramCompiler CWORLD; + public static ProgramCompiler STRUCTURE; public static void flwInit(GatherContextEvent event) { - Backend backend = event.getBackend(); - GameStateRegistry.register(RainbowDebugStateProvider.INSTANCE); - FileResolution header = Resolver.INSTANCE.findShader(ResourceUtil.subPath(CONTRAPTION, ".glsl")); + FileResolution header = Resolver.INSTANCE.get(ResourceUtil.subPath(CONTRAPTION, ".glsl")); - PipelineCompiler instancing = new WorldCompiler<>(ContraptionProgram::new, Templates.INSTANCING, header); - PipelineCompiler structure = new WorldCompiler<>(ContraptionProgram::new, Templates.ONE_SHOT, header); - - CWORLD = backend.register(WorldContext.builder(backend, CONTRAPTION) - .build(instancing)); - - STRUCTURE = backend.register(WorldContext.builder(backend, CONTRAPTION) - .setSpecStream(() -> Stream.of(AllProgramSpecs.PASSTHRU)) - .build(structure)); + CWORLD = Templates.INSTANCING.programCompiler(ContraptionProgram::new, header); + STRUCTURE = Templates.ONE_SHOT.programCompiler(ContraptionProgram::new, header); } } diff --git a/src/main/resources/assets/create/flywheel/programs/passthru.json b/src/main/resources/assets/create/flywheel/programs/passthru.json deleted file mode 100644 index 129d94950..000000000 --- a/src/main/resources/assets/create/flywheel/programs/passthru.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "source": "create:passthru.vert", - "states": [ - { - "when": "flywheel:normal_debug", - "define": "DEBUG_NORMAL" - } - ] -} diff --git a/src/main/resources/assets/create/flywheel/shaders/passthru.vert b/src/main/resources/assets/create/flywheel/shaders/passthru.vert deleted file mode 100644 index a598d8ebd..000000000 --- a/src/main/resources/assets/create/flywheel/shaders/passthru.vert +++ /dev/null @@ -1,7 +0,0 @@ -#use "flywheel:block.frag" - -#if defined(VERTEX_SHADER) -void vertex(inout Vertex v) { - -} -#endif