|
14 | 14 | import com.mojang.blaze3d.vertex.DefaultVertexFormat; |
15 | 15 | import com.mojang.blaze3d.vertex.VertexFormat; |
16 | 16 | import net.minecraft.client.renderer.RenderPipelines; |
17 | | -import net.minecraft.client.renderer.RenderType; |
| 17 | +import net.minecraft.client.renderer.rendertype.RenderSetup; |
| 18 | +import net.minecraft.client.renderer.rendertype.RenderType; |
| 19 | +import net.minecraft.client.renderer.rendertype.RenderTypes; |
18 | 20 |
|
19 | 21 | public final class VanillaPipelineProvider implements PipelineProvider { |
20 | 22 |
|
21 | 23 | public static class DefaultTypeFactory implements BufferBuilderRenderSink.TypeFactory { |
22 | 24 | public static final DefaultTypeFactory INSTANCE = new DefaultTypeFactory(); |
| 25 | + private static final RenderSetup QUADS_SETUP = RenderSetup.builder( |
| 26 | + RenderPipeline.builder(RenderPipeline.builder(RenderPipelines.MATRICES_PROJECTION_SNIPPET) |
| 27 | + .withVertexShader("core/position_color") |
| 28 | + .withFragmentShader("core/position_color") |
| 29 | + .withBlend(BlendFunction.TRANSLUCENT) |
| 30 | + .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS) |
| 31 | + .buildSnippet()) |
| 32 | + .withLocation("pipeline/wecui_quads").withCull(false).build() |
| 33 | + ).bufferSize(1536).sortOnUpload().createRenderSetup(); |
23 | 34 | private static final BufferBuilderRenderSink.RenderType QUADS = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_COLOR, |
24 | | - RenderType.create("quads", 1536, false, true, |
25 | | - RenderPipeline.builder(RenderPipeline.builder(RenderPipelines.MATRICES_PROJECTION_SNIPPET) |
26 | | - .withVertexShader("core/position_color") |
27 | | - .withFragmentShader("core/position_color") |
28 | | - .withBlend(BlendFunction.TRANSLUCENT) |
29 | | - .withVertexFormat(DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS) |
30 | | - .buildSnippet()) |
31 | | - .withLocation("pipeline/wecui_quads").withCull(false).build(), |
32 | | - RenderType.CompositeState.builder().createCompositeState(false) |
33 | | - )); |
34 | | - private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderType.LINES); |
35 | | - private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderType.LINES); |
| 35 | + RenderType.create("quads", QUADS_SETUP) |
| 36 | + ); |
| 37 | + private static final BufferBuilderRenderSink.RenderType LINES = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderTypes.LINES); |
| 38 | + private static final BufferBuilderRenderSink.RenderType LINES_LOOP = new BufferBuilderRenderSink.RenderType(VertexFormat.Mode.LINES, DefaultVertexFormat.POSITION_COLOR_NORMAL, RenderTypes.LINES); |
36 | 39 |
|
37 | 40 | private DefaultTypeFactory() {} |
38 | 41 |
|
|
0 commit comments