diff --git a/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java b/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java index c17329ee9..930834782 100644 --- a/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java +++ b/src/main/java/com/simibubi/create/foundation/render/CreateContexts.java @@ -2,14 +2,11 @@ package com.simibubi.create.foundation.render; import java.util.stream.Stream; -import org.lwjgl.opengl.GL46; - import com.jozufozu.flywheel.backend.Backend; -import com.jozufozu.flywheel.backend.FileResolution; +import com.jozufozu.flywheel.backend.source.FileResolution; import com.jozufozu.flywheel.backend.ResourceUtil; import com.jozufozu.flywheel.backend.SpecMetaRegistry; import com.jozufozu.flywheel.backend.pipeline.IShaderPipeline; -import com.jozufozu.flywheel.backend.pipeline.ITemplate; import com.jozufozu.flywheel.backend.pipeline.InstancingTemplate; import com.jozufozu.flywheel.backend.pipeline.OneShotTemplate; import com.jozufozu.flywheel.backend.pipeline.WorldShaderPipeline; @@ -32,19 +29,17 @@ public class CreateContexts { Backend backend = event.getBackend(); SpecMetaRegistry.register(RainbowDebugStateProvider.INSTANCE); - - CWORLD = backend.register(contraptionContext(backend, InstancingTemplate.INSTANCE)); - STRUCTURE = backend.register(contraptionContext(backend, OneShotTemplate.INSTANCE) - .withSpecStream(() -> Stream.of(AllProgramSpecs.STRUCTURE))); - } - - private static WorldContext contraptionContext(Backend backend, ITemplate template) { - FileResolution header = backend.sources.resolveFile(ResourceUtil.subPath(CONTRAPTION, ".glsl")); - IShaderPipeline worldPipeline = new WorldShaderPipeline<>(backend.sources, ContraptionProgram::new, template, header); + IShaderPipeline instancing = new WorldShaderPipeline<>(backend.sources, ContraptionProgram::new, InstancingTemplate.INSTANCE, header); + IShaderPipeline structure = new WorldShaderPipeline<>(backend.sources, ContraptionProgram::new, OneShotTemplate.INSTANCE, header); - return new WorldContext<>(backend, worldPipeline) - .withName(CONTRAPTION); + CWORLD = backend.register(WorldContext.builder(backend, CONTRAPTION) + .build(instancing)); + + STRUCTURE = backend.register(WorldContext.builder(backend, CONTRAPTION) + .setSpecStream(() -> Stream.of(AllProgramSpecs.STRUCTURE)) + .build(structure)); } + } diff --git a/src/main/resources/assets/create/flywheel/programs/belt.json b/src/main/resources/assets/create/flywheel/programs/belt.json index e6b53432e..52ec5d623 100644 --- a/src/main/resources/assets/create/flywheel/programs/belt.json +++ b/src/main/resources/assets/create/flywheel/programs/belt.json @@ -1,6 +1,5 @@ { - "vert": "create:belt.vert", - "frag": "flywheel:block.frag", + "source": "create:belt.vert", "states": [ { "when": "create:rainbow_debug", diff --git a/src/main/resources/assets/create/flywheel/programs/contraption_actor.json b/src/main/resources/assets/create/flywheel/programs/contraption_actor.json index e9acf9d1e..e26eddc54 100644 --- a/src/main/resources/assets/create/flywheel/programs/contraption_actor.json +++ b/src/main/resources/assets/create/flywheel/programs/contraption_actor.json @@ -1,6 +1,5 @@ { - "vert": "create:contraption_actor.vert", - "frag": "flywheel:block.frag", + "source": "create:contraption_actor.vert", "states": [ { "when": { diff --git a/src/main/resources/assets/create/flywheel/programs/contraption_structure.json b/src/main/resources/assets/create/flywheel/programs/contraption_structure.json index 9440ca25a..5aa9344d3 100644 --- a/src/main/resources/assets/create/flywheel/programs/contraption_structure.json +++ b/src/main/resources/assets/create/flywheel/programs/contraption_structure.json @@ -1,6 +1,5 @@ { - "vert": "create:contraption_structure.vert", - "frag": "flywheel:block.frag", + "source": "create:contraption_structure.vert", "states": [ { "when": { diff --git a/src/main/resources/assets/create/flywheel/programs/flap.json b/src/main/resources/assets/create/flywheel/programs/flap.json index f7de4c45e..c2b32cb6b 100644 --- a/src/main/resources/assets/create/flywheel/programs/flap.json +++ b/src/main/resources/assets/create/flywheel/programs/flap.json @@ -1,6 +1,5 @@ { - "vert": "create:flap.vert", - "frag": "flywheel:block.frag", + "source": "create:flap.vert", "states": [ { "when": { diff --git a/src/main/resources/assets/create/flywheel/programs/rotating.json b/src/main/resources/assets/create/flywheel/programs/rotating.json index 58d80d445..62bdb8207 100644 --- a/src/main/resources/assets/create/flywheel/programs/rotating.json +++ b/src/main/resources/assets/create/flywheel/programs/rotating.json @@ -1,6 +1,5 @@ { - "vert": "create:rotating.vert", - "frag": "flywheel:block.frag", + "source": "create:rotating.vert", "states": [ { "when": "create:rainbow_debug",