| 1 | package net.minecraft.client.renderer;
|
| 2 |
|
| 3 | import com.mojang.blaze3d.vertex.DefaultVertexFormat;
|
| 4 | import com.mojang.renderpearl.api.GpuFormat;
|
| 5 | import com.mojang.renderpearl.api.pipeline.BlendFactor;
|
| 6 | import com.mojang.renderpearl.api.pipeline.BlendFunction;
|
| 7 | import com.mojang.renderpearl.api.pipeline.ColorTargetState;
|
| 8 | import com.mojang.renderpearl.api.pipeline.CompareOp;
|
| 9 | import com.mojang.renderpearl.api.pipeline.DepthStencilState;
|
| 10 | import com.mojang.renderpearl.api.pipeline.PolygonMode;
|
| 11 | import com.mojang.renderpearl.api.pipeline.PrimitiveTopology;
|
| 12 | import com.mojang.renderpearl.api.pipeline.RenderPipeline;
|
| 13 | import java.util.HashMap;
|
| 14 | import java.util.List;
|
| 15 | import java.util.Map;
|
| 16 | import java.util.Optional;
|
| 17 | import net.fabricmc.api.EnvType;
|
| 18 | import net.fabricmc.api.Environment;
|
| 19 | import net.minecraft.client.renderer.oit.OitPipelineSet;
|
| 20 | import net.minecraft.resources.Identifier;
|
| 21 |
|
| 22 | /**
|
| 23 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 24 | */
|
| 25 | @Environment(EnvType.CLIENT)
|
| 26 | public class RenderPipelines {
|
| 27 | private static final Map<Identifier, RenderPipeline> PIPELINES_BY_LOCATION = new HashMap<>();
|
| 28 | private static final Map<Identifier, RenderPipeline> OPTIONAL_PIPELINES_BY_LOCATION = new HashMap<>();
|
| 29 | private static final float ALPHA_CUTOUT_THRESHOLD_DEFAULT = 0.1F;
|
| 30 | private static final float ALPHA_CUTOUT_THRESHOLD_CUTOUT_TERRAIN = 0.5F;
|
| 31 | /**
|
| 32 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 33 | */
|
| 34 | public static final RenderPipeline.Snippet GLOBALS_SNIPPET = RenderPipeline.builder().withBindGroupLayout(BindGroupLayouts.GLOBALS).buildSnippet();
|
| 35 | /**
|
| 36 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 37 | */
|
| 38 | public static final RenderPipeline.Snippet MATRICES_FOG_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 39 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 40 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 41 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 42 | .buildSnippet();
|
| 43 | /**
|
| 44 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 45 | */
|
| 46 | public static final RenderPipeline.Snippet MATRICES_FOG_LIGHT_DIR_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 47 | .withBindGroupLayout(BindGroupLayouts.LIGHTING)
|
| 48 | .buildSnippet();
|
| 49 | /**
|
| 50 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 51 | */
|
| 52 | public static final RenderPipeline.Snippet OIT_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 53 | .withShaderDefine("OIT")
|
| 54 | .withShaderDefine("OIT_WAVELET_RANK", 2)
|
| 55 | .withShaderDefine("OIT_COEFF_COUNT", LevelRenderer.OIT_COEFFICIENT_COUNT)
|
| 56 | .withShaderDefine("OIT_COEFF_ATTACHMENT_COUNT", LevelRenderer.OIT_TRANSMITTANCE_TARGET_COUNT)
|
| 57 | .buildSnippet();
|
| 58 | public static final RenderPipeline.Snippet OIT_DEPTH_BOUNDS_SNIPPET = RenderPipeline.builder(OIT_SNIPPET)
|
| 59 | .withBindGroupLayout(BindGroupLayouts.GLOBALS)
|
| 60 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 61 | .withColorTargetState(new ColorTargetState(Optional.of(BlendFunction.MAX), GpuFormat.RGBA32_FLOAT, 15))
|
| 62 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 63 | .withShaderDefine("OIT_ALPHA_ONLY")
|
| 64 | .withShaderDefine("OIT_DEPTH_BOUNDS")
|
| 65 | .buildSnippet();
|
| 66 | public static final RenderPipeline.Snippet OIT_TRANSMITTANCE_SNIPPET = RenderPipeline.builder(OIT_SNIPPET)
|
| 67 | .withBindGroupLayout(BindGroupLayouts.GLOBALS)
|
| 68 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 69 | .withBindGroupLayout(BindGroupLayouts.DEPTH_BOUNDS_SAMPLER)
|
| 70 | .withShaderDefine("OIT_ALPHA_ONLY")
|
| 71 | .withShaderDefine("OIT_TRANSMITTANCE")
|
| 72 | .withColorTargetStates(
|
| 73 | 0, LevelRenderer.OIT_TRANSMITTANCE_TARGET_COUNT - 1, () -> new ColorTargetState(Optional.of(BlendFunction.ADDITIVE), GpuFormat.RGBA16_FLOAT, 15)
|
| 74 | )
|
| 75 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 76 | .buildSnippet();
|
| 77 | public static final RenderPipeline.Snippet OIT_ACCUMULATE_SNIPPET = RenderPipeline.builder(OIT_SNIPPET)
|
| 78 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 79 | .withBindGroupLayout(BindGroupLayouts.OIT_COEFFS_DEPTH_BOUNDS_SAMPLER)
|
| 80 | .withShaderDefine("OIT_ACCUMULATE")
|
| 81 | .withColorTargetState(new ColorTargetState(Optional.of(BlendFunction.ADDITIVE), GpuFormat.RGBA16_FLOAT, 15))
|
| 82 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 83 | .buildSnippet();
|
| 84 | /**
|
| 85 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 86 | */
|
| 87 | public static final RenderPipeline.Snippet GENERIC_BLOCKS_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 88 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 89 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 90 | .withVertexBinding(0, DefaultVertexFormat.BLOCK)
|
| 91 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 92 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 93 | .buildSnippet();
|
| 94 | /**
|
| 95 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 96 | */
|
| 97 | public static final RenderPipeline.Snippet LIT_BLOCKS_SNIPPET = RenderPipeline.builder(GENERIC_BLOCKS_SNIPPET)
|
| 98 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 99 | .buildSnippet();
|
| 100 | /**
|
| 101 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 102 | */
|
| 103 | public static final RenderPipeline.Snippet TERRAIN_SNIPPET = RenderPipeline.builder(LIT_BLOCKS_SNIPPET)
|
| 104 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 105 | .withBindGroupLayout(BindGroupLayouts.CHUNK_SECTION)
|
| 106 | .withBindGroupLayout(BindGroupLayouts.TERRAIN_INFO)
|
| 107 | .withVertexShader("core/terrain")
|
| 108 | .withFragmentShader("core/terrain")
|
| 109 | .buildSnippet();
|
| 110 | /**
|
| 111 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 112 | */
|
| 113 | public static final RenderPipeline.Snippet MULTIDRAW_TERRAIN_SNIPPET = RenderPipeline.builder(LIT_BLOCKS_SNIPPET)
|
| 114 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 115 | .withBindGroupLayout(BindGroupLayouts.TERRAIN_INFO)
|
| 116 | .withVertexBinding(1, DefaultVertexFormat.CHUNK_DATA_INSTANCED)
|
| 117 | .withVertexShader("core/terrain")
|
| 118 | .withFragmentShader("core/terrain")
|
| 119 | .withShaderDefine("MULTIDRAW_TERRAIN")
|
| 120 | .buildSnippet();
|
| 121 | /**
|
| 122 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 123 | */
|
| 124 | public static final RenderPipeline.Snippet BLOCK_SNIPPET = RenderPipeline.builder(LIT_BLOCKS_SNIPPET)
|
| 125 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 126 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 127 | .withVertexShader("core/block")
|
| 128 | .withFragmentShader("core/block")
|
| 129 | .buildSnippet();
|
| 130 | /**
|
| 131 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 132 | */
|
| 133 | public static final RenderPipeline.Snippet WATER_MASK_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 134 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 135 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 136 | .withVertexShader("core/rendertype_water_mask")
|
| 137 | .withFragmentShader("core/rendertype_water_mask")
|
| 138 | .withVertexBinding(0, DefaultVertexFormat.POSITION)
|
| 139 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 140 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 141 | .buildSnippet();
|
| 142 | /**
|
| 143 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 144 | */
|
| 145 | public static final RenderPipeline.Snippet LIGHTNING_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 146 | .withVertexShader("core/rendertype_lightning")
|
| 147 | .withFragmentShader("core/rendertype_lightning")
|
| 148 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 149 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 150 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 151 | .buildSnippet();
|
| 152 | /**
|
| 153 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 154 | */
|
| 155 | public static final RenderPipeline.Snippet DRAGON_RAYS_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 156 | .withVertexShader("core/rendertype_lightning")
|
| 157 | .withFragmentShader("core/rendertype_lightning")
|
| 158 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 159 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 160 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 161 | .buildSnippet();
|
| 162 | /**
|
| 163 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 164 | */
|
| 165 | public static final RenderPipeline.Snippet ENTITY_NO_LIGHTMAP_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 166 | .withVertexShader("core/entity")
|
| 167 | .withFragmentShader("core/entity")
|
| 168 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 169 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 170 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 171 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 172 | .buildSnippet();
|
| 173 | /**
|
| 174 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 175 | */
|
| 176 | public static final RenderPipeline.Snippet ENTITY_SNIPPET = RenderPipeline.builder(ENTITY_NO_LIGHTMAP_SNIPPET)
|
| 177 | .withBindGroupLayout(BindGroupLayouts.LIGHTING)
|
| 178 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 179 | .buildSnippet();
|
| 180 | /**
|
| 181 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 182 | */
|
| 183 | public static final RenderPipeline.Snippet OIT_ENTITY_SNIPPET = RenderPipeline.builder()
|
| 184 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 185 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 186 | .withBindGroupLayout(BindGroupLayouts.LIGHTING)
|
| 187 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 188 | .withVertexShader("core/entity")
|
| 189 | .withFragmentShader("core/entity")
|
| 190 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 191 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 192 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 193 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 194 | .buildSnippet();
|
| 195 | /**
|
| 196 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 197 | */
|
| 198 | public static final RenderPipeline.Snippet ENTITY_EMISSIVE_SNIPPET = RenderPipeline.builder(MATRICES_FOG_LIGHT_DIR_SNIPPET)
|
| 199 | .withVertexShader("core/entity")
|
| 200 | .withFragmentShader("core/entity")
|
| 201 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 202 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 203 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 204 | .withShaderDefine("EMISSIVE")
|
| 205 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 206 | .buildSnippet();
|
| 207 | /**
|
| 208 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 209 | */
|
| 210 | public static final RenderPipeline.Snippet EYES_SNIPPET = RenderPipeline.builder()
|
| 211 | .withShaderDefine("EMISSIVE")
|
| 212 | .withShaderDefine("NO_OVERLAY")
|
| 213 | .withShaderDefine("NO_CARDINAL_LIGHTING")
|
| 214 | .buildSnippet();
|
| 215 | /**
|
| 216 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 217 | */
|
| 218 | public static final RenderPipeline.Snippet BEACON_BEAM_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 219 | .withVertexShader("core/rendertype_beacon_beam")
|
| 220 | .withFragmentShader("core/rendertype_beacon_beam")
|
| 221 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 222 | .withVertexBinding(0, DefaultVertexFormat.BLOCK)
|
| 223 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 224 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 225 | .buildSnippet();
|
| 226 | /**
|
| 227 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 228 | */
|
| 229 | public static final RenderPipeline.Snippet ITEM_SNIPPET = RenderPipeline.builder(MATRICES_FOG_LIGHT_DIR_SNIPPET)
|
| 230 | .withVertexShader("core/item")
|
| 231 | .withFragmentShader("core/item")
|
| 232 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0_SAMPLER1_SAMPLER2)
|
| 233 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 234 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 235 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 236 | .buildSnippet();
|
| 237 | /**
|
| 238 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 239 | */
|
| 240 | public static final RenderPipeline.Snippet OIT_ITEM_SNIPPET = RenderPipeline.builder()
|
| 241 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 242 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 243 | .withBindGroupLayout(BindGroupLayouts.LIGHTING)
|
| 244 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 245 | .withVertexShader("core/item")
|
| 246 | .withFragmentShader("core/item")
|
| 247 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 248 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 249 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 250 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 251 | .buildSnippet();
|
| 252 | /**
|
| 253 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 254 | */
|
| 255 | public static final RenderPipeline.Snippet TEXT_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 256 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 257 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 258 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 259 | .withVertexShader("core/text")
|
| 260 | .withFragmentShader("core/text")
|
| 261 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 262 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
|
| 263 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 264 | .buildSnippet();
|
| 265 | /**
|
| 266 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 267 | */
|
| 268 | public static final RenderPipeline.Snippet WORLD_TEXT_SNIPPET = RenderPipeline.builder(TEXT_SNIPPET)
|
| 269 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 270 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 271 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_LIGHTMAP_COLOR)
|
| 272 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 273 | .buildSnippet();
|
| 274 | /**
|
| 275 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 276 | */
|
| 277 | public static final RenderPipeline.Snippet END_PORTAL_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 278 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 279 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 280 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 281 | .withVertexShader("core/rendertype_end_portal")
|
| 282 | .withFragmentShader("core/rendertype_end_portal")
|
| 283 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0_SAMPLER1)
|
| 284 | .withVertexBinding(0, DefaultVertexFormat.POSITION)
|
| 285 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 286 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 287 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 288 | .buildSnippet();
|
| 289 | /**
|
| 290 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 291 | */
|
| 292 | public static final RenderPipeline.Snippet CLOUDS_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 293 | .withVertexShader("core/clouds")
|
| 294 | .withFragmentShader("core/clouds")
|
| 295 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 296 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 297 | .withBindGroupLayout(BindGroupLayouts.CLOUD_INFO)
|
| 298 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 299 | .buildSnippet();
|
| 300 | /**
|
| 301 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 302 | */
|
| 303 | public static final RenderPipeline.Snippet OIT_CLOUDS_SNIPPET = RenderPipeline.builder()
|
| 304 | .withVertexShader("core/clouds")
|
| 305 | .withFragmentShader("core/clouds")
|
| 306 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 307 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 308 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 309 | .withBindGroupLayout(BindGroupLayouts.CLOUD_INFO)
|
| 310 | .buildSnippet();
|
| 311 | /**
|
| 312 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 313 | */
|
| 314 | public static final RenderPipeline.Snippet LINES_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 315 | .withVertexShader("core/rendertype_lines")
|
| 316 | .withFragmentShader("core/rendertype_lines")
|
| 317 | .withCull(false)
|
| 318 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR_NORMAL_LINE_WIDTH)
|
| 319 | .withPrimitiveTopology(PrimitiveTopology.LINES)
|
| 320 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 321 | .buildSnippet();
|
| 322 | /**
|
| 323 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 324 | */
|
| 325 | public static final RenderPipeline.Snippet OIT_LINES_SNIPPET = RenderPipeline.builder()
|
| 326 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 327 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 328 | .withVertexShader("core/rendertype_lines")
|
| 329 | .withFragmentShader("core/rendertype_lines")
|
| 330 | .withCull(false)
|
| 331 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR_NORMAL_LINE_WIDTH)
|
| 332 | .withPrimitiveTopology(PrimitiveTopology.LINES)
|
| 333 | .buildSnippet();
|
| 334 | /**
|
| 335 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 336 | */
|
| 337 | public static final RenderPipeline.Snippet DEBUG_FILLED_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 338 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 339 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 340 | .withVertexShader("core/position_color")
|
| 341 | .withFragmentShader("core/position_color")
|
| 342 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 343 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 344 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 345 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 346 | .withCull(false)
|
| 347 | .buildSnippet();
|
| 348 | /**
|
| 349 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 350 | */
|
| 351 | public static final RenderPipeline.Snippet OIT_DEBUG_FILLED_SNIPPET = RenderPipeline.builder()
|
| 352 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 353 | .withVertexShader("core/position_color")
|
| 354 | .withFragmentShader("core/position_color")
|
| 355 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 356 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 357 | .withCull(false)
|
| 358 | .buildSnippet();
|
| 359 | /**
|
| 360 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 361 | */
|
| 362 | public static final RenderPipeline.Snippet DEBUG_POINTS_SNIPPET = RenderPipeline.builder()
|
| 363 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 364 | .withVertexShader("core/debug_point")
|
| 365 | .withFragmentShader("core/position_color")
|
| 366 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR_LINE_WIDTH)
|
| 367 | .withPrimitiveTopology(PrimitiveTopology.POINTS)
|
| 368 | .withCull(false)
|
| 369 | .buildSnippet();
|
| 370 | /**
|
| 371 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 372 | */
|
| 373 | public static final RenderPipeline.Snippet PARTICLE_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 374 | .withVertexShader("core/particle")
|
| 375 | .withFragmentShader("core/particle")
|
| 376 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0_SAMPLER2)
|
| 377 | .withVertexBinding(0, DefaultVertexFormat.PARTICLE)
|
| 378 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 379 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 380 | .buildSnippet();
|
| 381 | /**
|
| 382 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 383 | */
|
| 384 | public static final RenderPipeline.Snippet OIT_PARTICLE_SNIPPET = RenderPipeline.builder()
|
| 385 | .withVertexShader("core/particle")
|
| 386 | .withFragmentShader("core/particle")
|
| 387 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0_SAMPLER2)
|
| 388 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 389 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 390 | .withVertexBinding(0, DefaultVertexFormat.PARTICLE)
|
| 391 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 392 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 393 | .buildSnippet();
|
| 394 | /**
|
| 395 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 396 | */
|
| 397 | public static final RenderPipeline.Snippet WEATHER_SNIPPET = RenderPipeline.builder(PARTICLE_SNIPPET)
|
| 398 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 399 | .withCull(false)
|
| 400 | .buildSnippet();
|
| 401 | /**
|
| 402 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 403 | */
|
| 404 | public static final RenderPipeline.Snippet CRUMBLING_SNIPPET = RenderPipeline.builder()
|
| 405 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 406 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 407 | .withVertexShader("core/rendertype_crumbling")
|
| 408 | .withFragmentShader("core/rendertype_crumbling")
|
| 409 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 410 | .withVertexBinding(0, DefaultVertexFormat.BLOCK)
|
| 411 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 412 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false, 1.0F, 10.0F))
|
| 413 | .buildSnippet();
|
| 414 | /**
|
| 415 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 416 | */
|
| 417 | public static final RenderPipeline.Snippet GUI_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 418 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 419 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 420 | .withVertexShader("core/gui")
|
| 421 | .withFragmentShader("core/gui")
|
| 422 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 423 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 424 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 425 | .buildSnippet();
|
| 426 | /**
|
| 427 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 428 | */
|
| 429 | public static final RenderPipeline.Snippet GUI_TEXTURED_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 430 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 431 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 432 | .withVertexShader("core/position_tex_color")
|
| 433 | .withFragmentShader("core/position_tex_color")
|
| 434 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 435 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 436 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
|
| 437 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 438 | .buildSnippet();
|
| 439 | /**
|
| 440 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 441 | */
|
| 442 | public static final RenderPipeline.Snippet GUI_TEXT_SNIPPET = RenderPipeline.builder(TEXT_SNIPPET)
|
| 443 | .withShaderDefine("IS_GUI")
|
| 444 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 445 | .withDepthStencilState(Optional.empty())
|
| 446 | .buildSnippet();
|
| 447 | /**
|
| 448 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 449 | */
|
| 450 | public static final RenderPipeline.Snippet OUTLINE_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 451 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 452 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 453 | .withVertexShader("core/rendertype_outline")
|
| 454 | .withFragmentShader("core/rendertype_outline")
|
| 455 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 456 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
|
| 457 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 458 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 459 | .buildSnippet();
|
| 460 | public static final RenderPipeline.Snippet POST_PROCESSING_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 461 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 462 | .buildSnippet();
|
| 463 | public static final RenderPipeline SOLID_BLOCK = register(
|
| 464 | RenderPipeline.builder(BLOCK_SNIPPET).withLocation("pipeline/solid_block").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 465 | );
|
| 466 | public static final RenderPipeline SOLID_TERRAIN = register(
|
| 467 | RenderPipeline.builder(TERRAIN_SNIPPET).withLocation("pipeline/solid_terrain").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 468 | );
|
| 469 | public static final RenderPipeline SOLID_TERRAIN_MULTIDRAW = register(
|
| 470 | RenderPipeline.builder(MULTIDRAW_TERRAIN_SNIPPET).withLocation("pipeline/solid_terrain_multidraw").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 471 | );
|
| 472 | public static final RenderPipeline WIREFRAME = registerOptional(
|
| 473 | RenderPipeline.builder(TERRAIN_SNIPPET)
|
| 474 | .withLocation("pipeline/wireframe")
|
| 475 | .withPolygonMode(PolygonMode.WIREFRAME)
|
| 476 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 477 | .build()
|
| 478 | );
|
| 479 | public static final RenderPipeline WIREFRAME_MULTIDRAW = registerOptional(
|
| 480 | RenderPipeline.builder(MULTIDRAW_TERRAIN_SNIPPET)
|
| 481 | .withLocation("pipeline/wireframe_multidraw")
|
| 482 | .withPolygonMode(PolygonMode.WIREFRAME)
|
| 483 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 484 | .build()
|
| 485 | );
|
| 486 | public static final RenderPipeline CUTOUT_BLOCK = register(
|
| 487 | RenderPipeline.builder(BLOCK_SNIPPET)
|
| 488 | .withLocation("pipeline/cutout_block")
|
| 489 | .withShaderDefine("ALPHA_CUTOUT", 0.5F)
|
| 490 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 491 | .build()
|
| 492 | );
|
| 493 | public static final RenderPipeline CUTOUT_TERRAIN = register(
|
| 494 | RenderPipeline.builder(TERRAIN_SNIPPET)
|
| 495 | .withLocation("pipeline/cutout_terrain")
|
| 496 | .withShaderDefine("ALPHA_CUTOUT", 0.5F)
|
| 497 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 498 | .build()
|
| 499 | );
|
| 500 | public static final RenderPipeline CUTOUT_TERRAIN_MULTIDRAW = register(
|
| 501 | RenderPipeline.builder(MULTIDRAW_TERRAIN_SNIPPET)
|
| 502 | .withLocation("pipeline/cutout_terrain_multidraw")
|
| 503 | .withShaderDefine("ALPHA_CUTOUT", 0.5F)
|
| 504 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 505 | .build()
|
| 506 | );
|
| 507 | public static final RenderPipeline TRANSLUCENT_TERRAIN = register(
|
| 508 | RenderPipeline.builder(TERRAIN_SNIPPET)
|
| 509 | .withLocation("pipeline/translucent_terrain")
|
| 510 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 511 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 512 | .build()
|
| 513 | );
|
| 514 | public static final RenderPipeline TRANSLUCENT_TERRAIN_MULTIDRAW = register(
|
| 515 | RenderPipeline.builder(MULTIDRAW_TERRAIN_SNIPPET)
|
| 516 | .withLocation("pipeline/translucent_terrain_multidraw")
|
| 517 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 518 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 519 | .build()
|
| 520 | );
|
| 521 | public static final OitPipelineSet OIT_TERRAIN = register(
|
| 522 | OitPipelineSet.builder(
|
| 523 | "terrain",
|
| 524 | RenderPipeline.builder(GENERIC_BLOCKS_SNIPPET)
|
| 525 | .withVertexShader("core/terrain")
|
| 526 | .withFragmentShader("core/terrain")
|
| 527 | .withBindGroupLayout(BindGroupLayouts.CHUNK_SECTION)
|
| 528 | .withBindGroupLayout(BindGroupLayouts.TERRAIN_INFO)
|
| 529 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 530 | )
|
| 531 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 532 | .build()
|
| 533 | );
|
| 534 | public static final OitPipelineSet OIT_TERRAIN_MULTIDRAW = register(
|
| 535 | OitPipelineSet.builder(
|
| 536 | "terrain_multidraw",
|
| 537 | RenderPipeline.builder(GENERIC_BLOCKS_SNIPPET)
|
| 538 | .withVertexShader("core/terrain")
|
| 539 | .withFragmentShader("core/terrain")
|
| 540 | .withBindGroupLayout(BindGroupLayouts.TERRAIN_INFO)
|
| 541 | .withVertexBinding(1, DefaultVertexFormat.CHUNK_DATA_INSTANCED)
|
| 542 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 543 | .withShaderDefine("MULTIDRAW_TERRAIN")
|
| 544 | )
|
| 545 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 546 | .build()
|
| 547 | );
|
| 548 | public static final RenderPipeline TRANSLUCENT_BLOCK = register(
|
| 549 | RenderPipeline.builder(BLOCK_SNIPPET)
|
| 550 | .withLocation("pipeline/translucent_block")
|
| 551 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 552 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 553 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 554 | .build()
|
| 555 | );
|
| 556 | public static final OitPipelineSet OIT_TRANSLUCENT_BLOCK = register(
|
| 557 | OitPipelineSet.builder(
|
| 558 | "translucent_block",
|
| 559 | RenderPipeline.builder(GENERIC_BLOCKS_SNIPPET)
|
| 560 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 561 | .withVertexShader("core/block")
|
| 562 | .withFragmentShader("core/block")
|
| 563 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 564 | )
|
| 565 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 566 | .build()
|
| 567 | );
|
| 568 | public static final RenderPipeline ARMOR_CUTOUT_NO_CULL = register(
|
| 569 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 570 | .withLocation("pipeline/armor_cutout_no_cull")
|
| 571 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 572 | .withShaderDefine("NO_OVERLAY")
|
| 573 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 574 | .withCull(false)
|
| 575 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 576 | .build()
|
| 577 | );
|
| 578 | public static final RenderPipeline ARMOR_DECAL_CUTOUT_NO_CULL = register(
|
| 579 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 580 | .withLocation("pipeline/armor_decal_cutout_no_cull")
|
| 581 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 582 | .withShaderDefine("NO_OVERLAY")
|
| 583 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 584 | .withCull(false)
|
| 585 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 586 | .withDepthStencilState(new DepthStencilState(CompareOp.EQUAL, false))
|
| 587 | .build()
|
| 588 | );
|
| 589 | public static final RenderPipeline WOLF_ARMOR_CRACKS = register(
|
| 590 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 591 | .withLocation("pipeline/armor_translucent")
|
| 592 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 593 | .withShaderDefine("NO_OVERLAY")
|
| 594 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 595 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 596 | .withCull(false)
|
| 597 | .build()
|
| 598 | );
|
| 599 | public static final RenderPipeline ENTITY_SOLID = register(
|
| 600 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 601 | .withLocation("pipeline/entity_solid")
|
| 602 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 603 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 604 | .build()
|
| 605 | );
|
| 606 | public static final RenderPipeline ENTITY_SOLID_Z_OFFSET_FORWARD = register(
|
| 607 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 608 | .withLocation("pipeline/entity_solid_offset_forward")
|
| 609 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 610 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 611 | .build()
|
| 612 | );
|
| 613 | public static final RenderPipeline ENTITY_CUTOUT_CULL = register(
|
| 614 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 615 | .withLocation("pipeline/entity_cutout_cull")
|
| 616 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 617 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 618 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 619 | .build()
|
| 620 | );
|
| 621 | public static final RenderPipeline ENTITY_CUTOUT = register(
|
| 622 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 623 | .withLocation("pipeline/entity_cutout")
|
| 624 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 625 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 626 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 627 | .withCull(false)
|
| 628 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 629 | .build()
|
| 630 | );
|
| 631 | public static final RenderPipeline ENTITY_CUTOUT_Z_OFFSET = register(
|
| 632 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 633 | .withLocation("pipeline/entity_cutout_z_offset")
|
| 634 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 635 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 636 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 637 | .withCull(false)
|
| 638 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 639 | .build()
|
| 640 | );
|
| 641 | public static final RenderPipeline ENTITY_CUTOUT_DISSOLVE = register(
|
| 642 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 643 | .withLocation("pipeline/entity_cutout_dissolve")
|
| 644 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 645 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 646 | .withShaderDefine("DISSOLVE")
|
| 647 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 648 | .withBindGroupLayout(BindGroupLayouts.DISSOLVE_MASK_SAMPLER)
|
| 649 | .withCull(false)
|
| 650 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 651 | .build()
|
| 652 | );
|
| 653 | public static final RenderPipeline ENTITY_TRANSLUCENT = register(
|
| 654 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 655 | .withLocation("pipeline/entity_translucent")
|
| 656 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 657 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 658 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 659 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 660 | .withCull(false)
|
| 661 | .build()
|
| 662 | );
|
| 663 | public static final OitPipelineSet OIT_ENTITY = register(
|
| 664 | OitPipelineSet.builder("entity", RenderPipeline.builder(OIT_ENTITY_SNIPPET).withCull(false))
|
| 665 | .withAccumulateModifier(
|
| 666 | accumulate -> accumulate.withShaderDefine("PER_FACE_LIGHTING")
|
| 667 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 668 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 669 | )
|
| 670 | .build()
|
| 671 | );
|
| 672 | public static final RenderPipeline ENTITY_TRANSLUCENT_EMISSIVE = register(
|
| 673 | RenderPipeline.builder(ENTITY_EMISSIVE_SNIPPET)
|
| 674 | .withLocation("pipeline/entity_translucent_emissive")
|
| 675 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 676 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 677 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 678 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 679 | .withCull(false)
|
| 680 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 681 | .build()
|
| 682 | );
|
| 683 | public static final OitPipelineSet OIT_ENTITY_EMISSIVE = register(
|
| 684 | OitPipelineSet.builder("entity_emissive", RenderPipeline.builder(OIT_ENTITY_SNIPPET).withCull(false))
|
| 685 | .withAccumulateModifier(
|
| 686 | accumulate -> accumulate.withShaderDefine("PER_FACE_LIGHTING").withShaderDefine("EMISSIVE").withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 687 | )
|
| 688 | .build()
|
| 689 | );
|
| 690 | public static final RenderPipeline ENTITY_TRANSLUCENT_CULL = register(
|
| 691 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 692 | .withLocation("pipeline/entity_translucent_cull")
|
| 693 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 694 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 695 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 696 | .build()
|
| 697 | );
|
| 698 | public static final OitPipelineSet OIT_ENTITY_CULL = register(
|
| 699 | OitPipelineSet.builder("entity_cull", RenderPipeline.builder(OIT_ENTITY_SNIPPET))
|
| 700 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER1).withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 701 | .build()
|
| 702 | );
|
| 703 | public static final RenderPipeline END_CRYSTAL_BEAM = register(
|
| 704 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 705 | .withLocation("pipeline/end_crystal_beam")
|
| 706 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 707 | .withShaderDefine("NO_OVERLAY")
|
| 708 | .withCull(false)
|
| 709 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 710 | .build()
|
| 711 | );
|
| 712 | public static final RenderPipeline BANNER_PATTERN = register(
|
| 713 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 714 | .withLocation("pipeline/banner_pattern")
|
| 715 | .withShaderDefine("NO_OVERLAY")
|
| 716 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 717 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 718 | .build()
|
| 719 | );
|
| 720 | public static final RenderPipeline BREEZE_WIND = register(
|
| 721 | RenderPipeline.builder(ENTITY_SNIPPET)
|
| 722 | .withLocation("pipeline/breeze_wind")
|
| 723 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 724 | .withShaderDefine("APPLY_TEXTURE_MATRIX")
|
| 725 | .withShaderDefine("NO_OVERLAY")
|
| 726 | .withShaderDefine("NO_CARDINAL_LIGHTING")
|
| 727 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 728 | .withCull(false)
|
| 729 | .build()
|
| 730 | );
|
| 731 | public static final OitPipelineSet OIT_BREEZE_WIND = register(
|
| 732 | OitPipelineSet.builder(
|
| 733 | "breeze_wind",
|
| 734 | RenderPipeline.builder(OIT_ENTITY_SNIPPET)
|
| 735 | .withShaderDefine("APPLY_TEXTURE_MATRIX")
|
| 736 | .withShaderDefine("NO_OVERLAY")
|
| 737 | .withShaderDefine("NO_CARDINAL_LIGHTING")
|
| 738 | .withCull(false)
|
| 739 | )
|
| 740 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 741 | .build()
|
| 742 | );
|
| 743 | /**
|
| 744 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 745 | */
|
| 746 | public static final RenderPipeline.Snippet ENERGY_SWIRL_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 747 | .withVertexShader("core/entity")
|
| 748 | .withFragmentShader("core/entity")
|
| 749 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 750 | .withShaderDefine("EMISSIVE")
|
| 751 | .withShaderDefine("NO_OVERLAY")
|
| 752 | .withShaderDefine("NO_CARDINAL_LIGHTING")
|
| 753 | .withShaderDefine("APPLY_TEXTURE_MATRIX")
|
| 754 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 755 | .withCull(false)
|
| 756 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 757 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 758 | .buildSnippet();
|
| 759 | public static final RenderPipeline ENERGY_SWIRL = register(
|
| 760 | RenderPipeline.builder(ENERGY_SWIRL_SNIPPET)
|
| 761 | .withLocation("pipeline/energy_swirl")
|
| 762 | .withColorTargetState(new ColorTargetState(BlendFunction.ADDITIVE))
|
| 763 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 764 | .build()
|
| 765 | );
|
| 766 | public static final OitPipelineSet OIT_ENERGY_SWIRL = register(
|
| 767 | OitPipelineSet.builder("energy_swirl", RenderPipeline.builder(ENERGY_SWIRL_SNIPPET).withShaderDefine("OIT_ADDITIVE")).build()
|
| 768 | );
|
| 769 | public static final RenderPipeline EYES = register(
|
| 770 | RenderPipeline.builder(ENTITY_NO_LIGHTMAP_SNIPPET, EYES_SNIPPET)
|
| 771 | .withLocation("pipeline/eyes")
|
| 772 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 773 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 774 | .build()
|
| 775 | );
|
| 776 | public static final OitPipelineSet OIT_EYES = register(OitPipelineSet.builder("eyes", RenderPipeline.builder(OIT_ENTITY_SNIPPET, EYES_SNIPPET)).build());
|
| 777 | /**
|
| 778 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 779 | */
|
| 780 | public static final RenderPipeline.Snippet ENTITY_SHADOW_SNIPPET = RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 781 | .withVertexShader("core/rendertype_entity_shadow")
|
| 782 | .withFragmentShader("core/rendertype_entity_shadow")
|
| 783 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 784 | .withVertexBinding(0, DefaultVertexFormat.ENTITY)
|
| 785 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 786 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 787 | .buildSnippet();
|
| 788 | public static final RenderPipeline ENTITY_SHADOW = register(
|
| 789 | RenderPipeline.builder(ENTITY_SHADOW_SNIPPET)
|
| 790 | .withLocation("pipeline/entity_shadow")
|
| 791 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 792 | .build()
|
| 793 | );
|
| 794 | public static final OitPipelineSet OIT_ENTITY_SHADOW = register(OitPipelineSet.builder("entity_shadow", RenderPipeline.builder(ENTITY_SHADOW_SNIPPET)).build());
|
| 795 | public static final RenderPipeline.Snippet GLINT_SNIPPET = RenderPipeline.builder()
|
| 796 | .withShaderDefine("GLINT")
|
| 797 | .withBindGroupLayout(BindGroupLayouts.GLINT_SAMPLER)
|
| 798 | .buildSnippet();
|
| 799 | public static final RenderPipeline.Snippet GLINT_SPECIAL_SNIPPET = RenderPipeline.builder(GLINT_SNIPPET).withShaderDefine("GLINT_SPECIAL").buildSnippet();
|
| 800 | public static final RenderPipeline ARMOR_CUTOUT_NO_CULL_GLINT = register(
|
| 801 | RenderPipeline.builder(ENTITY_SNIPPET, GLINT_SNIPPET)
|
| 802 | .withLocation("pipeline/armor_cutout_no_cull_glint")
|
| 803 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 804 | .withShaderDefine("NO_OVERLAY")
|
| 805 | .withShaderDefine("PER_FACE_LIGHTING")
|
| 806 | .withCull(false)
|
| 807 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 808 | .build()
|
| 809 | );
|
| 810 | public static final RenderPipeline ENTITY_SOLID_GLINT = register(
|
| 811 | RenderPipeline.builder(ENTITY_SNIPPET, GLINT_SNIPPET)
|
| 812 | .withLocation("pipeline/entity_solid_glint")
|
| 813 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 814 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 815 | .build()
|
| 816 | );
|
| 817 | public static final RenderPipeline ITEM_CUTOUT = register(
|
| 818 | RenderPipeline.builder(ITEM_SNIPPET)
|
| 819 | .withLocation("pipeline/item_cutout")
|
| 820 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 821 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 822 | .build()
|
| 823 | );
|
| 824 | public static final RenderPipeline ITEM_CUTOUT_GLINT = register(
|
| 825 | RenderPipeline.builder(ITEM_SNIPPET, GLINT_SNIPPET)
|
| 826 | .withLocation("pipeline/item_cutout")
|
| 827 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 828 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 829 | .build()
|
| 830 | );
|
| 831 | public static final RenderPipeline ITEM_CUTOUT_GLINT_SPECIAL = register(
|
| 832 | RenderPipeline.builder(ITEM_SNIPPET, GLINT_SPECIAL_SNIPPET)
|
| 833 | .withLocation("pipeline/item_cutout")
|
| 834 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 835 | .withVertexBinding(0, DefaultVertexFormat.ENTITY_GLINT_SPECIAL)
|
| 836 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 837 | .build()
|
| 838 | );
|
| 839 | public static final RenderPipeline ITEM_TRANSLUCENT = register(
|
| 840 | RenderPipeline.builder(ITEM_SNIPPET)
|
| 841 | .withLocation("pipeline/item_translucent")
|
| 842 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 843 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 844 | .build()
|
| 845 | );
|
| 846 | public static final OitPipelineSet OIT_ITEM = register(
|
| 847 | OitPipelineSet.builder("item", RenderPipeline.builder(OIT_ITEM_SNIPPET))
|
| 848 | .withAccumulateModifier(accumulate -> accumulate.withBindGroupLayout(BindGroupLayouts.SAMPLER1).withBindGroupLayout(BindGroupLayouts.SAMPLER2))
|
| 849 | .build()
|
| 850 | );
|
| 851 | public static final RenderPipeline ITEM_TRANSLUCENT_GLINT = register(
|
| 852 | RenderPipeline.builder(ITEM_SNIPPET, GLINT_SNIPPET)
|
| 853 | .withLocation("pipeline/item_translucent_glint")
|
| 854 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 855 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 856 | .build()
|
| 857 | );
|
| 858 | public static final RenderPipeline ITEM_TRANSLUCENT_GLINT_SPECIAL = register(
|
| 859 | RenderPipeline.builder(ITEM_SNIPPET, GLINT_SPECIAL_SNIPPET)
|
| 860 | .withLocation("pipeline/item_translucent_glint")
|
| 861 | .withShaderDefine("ALPHA_CUTOUT", 0.1F)
|
| 862 | .withVertexBinding(0, DefaultVertexFormat.ENTITY_GLINT_SPECIAL)
|
| 863 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 864 | .build()
|
| 865 | );
|
| 866 | public static final OitPipelineSet OIT_ITEM_GLINT = register(
|
| 867 | OitPipelineSet.builder("item_glint", RenderPipeline.builder(OIT_ITEM_SNIPPET))
|
| 868 | .withAccumulateModifier(
|
| 869 | accumulate -> accumulate.withSnippet(GLINT_SNIPPET)
|
| 870 | .withBindGroupLayout(BindGroupLayouts.GLOBALS)
|
| 871 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 872 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 873 | )
|
| 874 | .build()
|
| 875 | );
|
| 876 | public static final OitPipelineSet OIT_ITEM_GLINT_SPECIAL = register(
|
| 877 | OitPipelineSet.builder("item_glint_special", RenderPipeline.builder(OIT_ITEM_SNIPPET).withVertexBinding(0, DefaultVertexFormat.ENTITY_GLINT_SPECIAL))
|
| 878 | .withAccumulateModifier(
|
| 879 | accumulate -> accumulate.withSnippet(GLINT_SPECIAL_SNIPPET)
|
| 880 | .withBindGroupLayout(BindGroupLayouts.GLOBALS)
|
| 881 | .withBindGroupLayout(BindGroupLayouts.SAMPLER1)
|
| 882 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 883 | )
|
| 884 | .build()
|
| 885 | );
|
| 886 | public static final RenderPipeline BEACON_BEAM_OPAQUE = register(
|
| 887 | RenderPipeline.builder(BEACON_BEAM_SNIPPET).withLocation("pipeline/beacon_beam_opaque").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 888 | );
|
| 889 | public static final RenderPipeline BEACON_BEAM_TRANSLUCENT = register(
|
| 890 | RenderPipeline.builder(BEACON_BEAM_SNIPPET)
|
| 891 | .withLocation("pipeline/beacon_beam_translucent")
|
| 892 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 893 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 894 | .build()
|
| 895 | );
|
| 896 | public static final OitPipelineSet OIT_BEACON_BEAM = register(OitPipelineSet.builder("beacon_beam", RenderPipeline.builder(BEACON_BEAM_SNIPPET)).build());
|
| 897 | public static final RenderPipeline LEASH = register(
|
| 898 | RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 899 | .withLocation("pipeline/leash")
|
| 900 | .withVertexShader("core/rendertype_leash")
|
| 901 | .withFragmentShader("core/rendertype_leash")
|
| 902 | .withBindGroupLayout(BindGroupLayouts.SAMPLER2)
|
| 903 | .withCull(false)
|
| 904 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR_LIGHTMAP)
|
| 905 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_STRIP)
|
| 906 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 907 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 908 | .build()
|
| 909 | );
|
| 910 | public static final RenderPipeline WATER_MASK = register(
|
| 911 | RenderPipeline.builder(WATER_MASK_SNIPPET)
|
| 912 | .withLocation("pipeline/water_mask")
|
| 913 | .withColorTargetState(new ColorTargetState(Optional.of(BlendFunction.TRANSLUCENT), GpuFormat.RGBA8_UNORM, 0))
|
| 914 | .build()
|
| 915 | );
|
| 916 | public static final RenderPipeline OIT_WATER_MASK = register(RenderPipeline.builder(WATER_MASK_SNIPPET).withLocation("pipeline/oit_water_mask").build());
|
| 917 | public static final RenderPipeline GLINT = register(
|
| 918 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 919 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 920 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 921 | .withBindGroupLayout(BindGroupLayouts.FOG)
|
| 922 | .withLocation("pipeline/glint")
|
| 923 | .withVertexShader("core/glint")
|
| 924 | .withFragmentShader("core/glint")
|
| 925 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 926 | .withCull(false)
|
| 927 | .withColorTargetState(new ColorTargetState(BlendFunction.GLINT))
|
| 928 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX)
|
| 929 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 930 | .withDepthStencilState(new DepthStencilState(CompareOp.EQUAL, false))
|
| 931 | .build()
|
| 932 | );
|
| 933 | public static final RenderPipeline CRUMBLING = register(
|
| 934 | RenderPipeline.builder(CRUMBLING_SNIPPET, GLOBALS_SNIPPET)
|
| 935 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 936 | .withLocation("pipeline/crumbling")
|
| 937 | .withColorTargetState(new ColorTargetState(new BlendFunction(BlendFactor.DST_COLOR, BlendFactor.SRC_COLOR, BlendFactor.ONE, BlendFactor.ZERO)))
|
| 938 | .build()
|
| 939 | );
|
| 940 | public static final OitPipelineSet OIT_CRUMBLING = register(OitPipelineSet.builder("crumbling", RenderPipeline.builder(CRUMBLING_SNIPPET)).build());
|
| 941 | public static final RenderPipeline TEXT = register(
|
| 942 | RenderPipeline.builder(WORLD_TEXT_SNIPPET).withLocation("pipeline/text").withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT)).build()
|
| 943 | );
|
| 944 | public static final OitPipelineSet OIT_TEXT = register(OitPipelineSet.builder("text", RenderPipeline.builder(WORLD_TEXT_SNIPPET)).build());
|
| 945 | public static final RenderPipeline GUI_TEXT = register(RenderPipeline.builder(GUI_TEXT_SNIPPET).withLocation("pipeline/gui_text").build());
|
| 946 | public static final RenderPipeline TEXT_GRAYSCALE = register(
|
| 947 | RenderPipeline.builder(WORLD_TEXT_SNIPPET)
|
| 948 | .withLocation("pipeline/text_grayscale")
|
| 949 | .withShaderDefine("IS_GRAYSCALE")
|
| 950 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 951 | .build()
|
| 952 | );
|
| 953 | public static final OitPipelineSet OIT_TEXT_GRAYSCALE = register(
|
| 954 | OitPipelineSet.builder("text_grayscale", RenderPipeline.builder(WORLD_TEXT_SNIPPET).withShaderDefine("IS_GRAYSCALE")).build()
|
| 955 | );
|
| 956 | public static final RenderPipeline GUI_TEXT_GRAYSCALE = register(
|
| 957 | RenderPipeline.builder(GUI_TEXT_SNIPPET).withLocation("pipeline/gui_text_grayscale").withShaderDefine("IS_GRAYSCALE").build()
|
| 958 | );
|
| 959 | public static final RenderPipeline TEXT_POLYGON_OFFSET = register(
|
| 960 | RenderPipeline.builder(WORLD_TEXT_SNIPPET)
|
| 961 | .withLocation("pipeline/text_polygon_offset")
|
| 962 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 963 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, true, 1.0F, 10.0F))
|
| 964 | .build()
|
| 965 | );
|
| 966 | public static final OitPipelineSet OIT_TEXT_POLYGON_OFFSET = register(
|
| 967 | OitPipelineSet.builder("text_polygon_offset", RenderPipeline.builder(WORLD_TEXT_SNIPPET)).build()
|
| 968 | );
|
| 969 | public static final RenderPipeline TEXT_GRAYSCALE_POLYGON_OFFSET = register(
|
| 970 | RenderPipeline.builder(WORLD_TEXT_SNIPPET)
|
| 971 | .withLocation("pipeline/text_grayscale_polygon_offset")
|
| 972 | .withShaderDefine("IS_GRAYSCALE")
|
| 973 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 974 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, true, 1.0F, 10.0F))
|
| 975 | .build()
|
| 976 | );
|
| 977 | public static final OitPipelineSet OIT_TEXT_GRAYSCALE_POLYGON_OFFSET = register(
|
| 978 | OitPipelineSet.builder("text_grayscale_polygon_offset", RenderPipeline.builder(WORLD_TEXT_SNIPPET).withShaderDefine("IS_GRAYSCALE")).build()
|
| 979 | );
|
| 980 | public static final RenderPipeline TEXT_SEE_THROUGH = register(
|
| 981 | RenderPipeline.builder(TEXT_SNIPPET)
|
| 982 | .withLocation("pipeline/text_see_through")
|
| 983 | .withShaderDefine("IS_SEE_THROUGH")
|
| 984 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 985 | .withDepthStencilState(Optional.empty())
|
| 986 | .build()
|
| 987 | );
|
| 988 | public static final RenderPipeline TEXT_GRAYSCALE_SEE_THROUGH = register(
|
| 989 | RenderPipeline.builder(TEXT_SNIPPET)
|
| 990 | .withLocation("pipeline/text_grayscale_see_through")
|
| 991 | .withShaderDefine("IS_GRAYSCALE")
|
| 992 | .withShaderDefine("IS_SEE_THROUGH")
|
| 993 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 994 | .withDepthStencilState(Optional.empty())
|
| 995 | .build()
|
| 996 | );
|
| 997 | public static final RenderPipeline LIGHTNING = register(
|
| 998 | RenderPipeline.builder(LIGHTNING_SNIPPET).withLocation("pipeline/lightning").withColorTargetState(new ColorTargetState(BlendFunction.LIGHTNING)).build()
|
| 999 | );
|
| 1000 | public static final OitPipelineSet OIT_LIGHTNING = register(
|
| 1001 | OitPipelineSet.builder("lightning", RenderPipeline.builder(LIGHTNING_SNIPPET).withShaderDefine("OIT_ADDITIVE")).build()
|
| 1002 | );
|
| 1003 | public static final RenderPipeline DRAGON_RAYS = register(
|
| 1004 | RenderPipeline.builder(DRAGON_RAYS_SNIPPET).withLocation("pipeline/dragon_rays").withColorTargetState(new ColorTargetState(BlendFunction.LIGHTNING)).build()
|
| 1005 | );
|
| 1006 | public static final OitPipelineSet OIT_DRAGON_RAYS = register(
|
| 1007 | OitPipelineSet.builder("dragon_rays", RenderPipeline.builder(DRAGON_RAYS_SNIPPET).withShaderDefine("OIT_ADDITIVE")).build()
|
| 1008 | );
|
| 1009 | public static final RenderPipeline END_PORTAL = register(
|
| 1010 | RenderPipeline.builder(END_PORTAL_SNIPPET).withLocation("pipeline/end_portal").withShaderDefine("PORTAL_LAYERS", 15).build()
|
| 1011 | );
|
| 1012 | public static final RenderPipeline END_GATEWAY = register(
|
| 1013 | RenderPipeline.builder(END_PORTAL_SNIPPET).withLocation("pipeline/end_gateway").withShaderDefine("PORTAL_LAYERS", 16).build()
|
| 1014 | );
|
| 1015 | public static final RenderPipeline FLAT_CLOUDS = register(RenderPipeline.builder(CLOUDS_SNIPPET).withLocation("pipeline/flat_clouds").withCull(false).build());
|
| 1016 | public static final RenderPipeline CLOUDS = register(RenderPipeline.builder(CLOUDS_SNIPPET).withLocation("pipeline/clouds").build());
|
| 1017 | public static final OitPipelineSet OIT_CLOUDS = register(
|
| 1018 | OitPipelineSet.builder("clouds", RenderPipeline.builder(OIT_CLOUDS_SNIPPET))
|
| 1019 | .withDepthBoundsModifier(depthBounds -> depthBounds.withDepthStencilState(DepthStencilState.DEFAULT))
|
| 1020 | .build()
|
| 1021 | );
|
| 1022 | public static final OitPipelineSet OIT_FLAT_CLOUDS = register(
|
| 1023 | OitPipelineSet.builder("flat_clouds", RenderPipeline.builder(OIT_CLOUDS_SNIPPET).withCull(false)).build()
|
| 1024 | );
|
| 1025 | public static final RenderPipeline LINES = register(
|
| 1026 | RenderPipeline.builder(LINES_SNIPPET).withLocation("pipeline/lines").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 1027 | );
|
| 1028 | public static final RenderPipeline LINES_TRANSLUCENT = register(
|
| 1029 | RenderPipeline.builder(LINES_SNIPPET)
|
| 1030 | .withLocation("pipeline/lines_translucent")
|
| 1031 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1032 | .build()
|
| 1033 | );
|
| 1034 | public static final RenderPipeline LINES_TRANSLUCENT_NO_DEPTH_WRITE = register(
|
| 1035 | RenderPipeline.builder(LINES_SNIPPET)
|
| 1036 | .withLocation("pipeline/lines_translucent_no_depth_write")
|
| 1037 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1038 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 1039 | .build()
|
| 1040 | );
|
| 1041 | public static final OitPipelineSet OIT_LINES_TRANSLUCENT = register(
|
| 1042 | OitPipelineSet.builder("lines_translucent", RenderPipeline.builder(OIT_LINES_SNIPPET)).build()
|
| 1043 | );
|
| 1044 | public static final RenderPipeline LINES_DEPTH_BIAS = register(
|
| 1045 | RenderPipeline.builder(LINES_SNIPPET)
|
| 1046 | .withLocation("pipeline/lines_depth_bias")
|
| 1047 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1048 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, true, 1.0F, 1.0F))
|
| 1049 | .build()
|
| 1050 | );
|
| 1051 | public static final RenderPipeline SECONDARY_BLOCK_OUTLINE = register(
|
| 1052 | RenderPipeline.builder(LINES_SNIPPET)
|
| 1053 | .withLocation("pipeline/secondary_block_outline")
|
| 1054 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1055 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 1056 | .build()
|
| 1057 | );
|
| 1058 | public static final RenderPipeline DEBUG_POINTS = register(
|
| 1059 | RenderPipeline.builder(DEBUG_POINTS_SNIPPET)
|
| 1060 | .withLocation("pipeline/debug_points")
|
| 1061 | .withBindGroupLayout(BindGroupLayouts.GLOBALS)
|
| 1062 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1063 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1064 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 1065 | .build()
|
| 1066 | );
|
| 1067 | public static final OitPipelineSet OIT_DEBUG_POINTS = register(OitPipelineSet.builder("debug_points", RenderPipeline.builder(DEBUG_POINTS_SNIPPET)).build());
|
| 1068 | public static final RenderPipeline DEBUG_FILLED_BOX = register(RenderPipeline.builder(DEBUG_FILLED_SNIPPET).withLocation("pipeline/debug_filled_box").build());
|
| 1069 | public static final OitPipelineSet OIT_DEBUG_FILLED_BOX = register(
|
| 1070 | OitPipelineSet.builder("debug_filled_box", RenderPipeline.builder(OIT_DEBUG_FILLED_SNIPPET)).build()
|
| 1071 | );
|
| 1072 | public static final RenderPipeline DEBUG_QUADS = register(
|
| 1073 | RenderPipeline.builder(DEBUG_FILLED_SNIPPET).withLocation("pipeline/debug_quads").withCull(false).build()
|
| 1074 | );
|
| 1075 | public static final OitPipelineSet OIT_DEBUG_QUADS = register(OitPipelineSet.builder("debug_quads", RenderPipeline.builder(OIT_DEBUG_FILLED_SNIPPET)).build());
|
| 1076 | public static final RenderPipeline DEBUG_TRIANGLE_FAN = register(
|
| 1077 | RenderPipeline.builder(DEBUG_FILLED_SNIPPET)
|
| 1078 | .withLocation("pipeline/debug_triangle_fan")
|
| 1079 | .withCull(false)
|
| 1080 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 1081 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
|
| 1082 | .build()
|
| 1083 | );
|
| 1084 | public static final OitPipelineSet OIT_DEBUG_TRIANGLE_FAN = register(
|
| 1085 | OitPipelineSet.builder(
|
| 1086 | "debug_triangle_fan",
|
| 1087 | RenderPipeline.builder(OIT_DEBUG_FILLED_SNIPPET)
|
| 1088 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 1089 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
|
| 1090 | )
|
| 1091 | .build()
|
| 1092 | );
|
| 1093 | public static final RenderPipeline WORLD_BORDER = register(
|
| 1094 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1095 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1096 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1097 | .withLocation("pipeline/world_border")
|
| 1098 | .withVertexShader("core/world_border")
|
| 1099 | .withFragmentShader("core/world_border")
|
| 1100 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 1101 | .withColorTargetState(new ColorTargetState(BlendFunction.OVERLAY))
|
| 1102 | .withCull(false)
|
| 1103 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX)
|
| 1104 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1105 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, true, 3.0F, 3.0F))
|
| 1106 | .build()
|
| 1107 | );
|
| 1108 | public static final OitPipelineSet OIT_WORLD_BORDER = register(
|
| 1109 | OitPipelineSet.builder(
|
| 1110 | "world_border",
|
| 1111 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1112 | .withVertexShader("core/world_border")
|
| 1113 | .withFragmentShader("core/world_border")
|
| 1114 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 1115 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1116 | .withCull(false)
|
| 1117 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1118 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX)
|
| 1119 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false, 3.0F, 3.0F))
|
| 1120 | .withShaderDefine("OIT_ADDITIVE")
|
| 1121 | )
|
| 1122 | .build()
|
| 1123 | );
|
| 1124 | public static final RenderPipeline OPAQUE_PARTICLE = register(
|
| 1125 | RenderPipeline.builder(PARTICLE_SNIPPET).withLocation("pipeline/opaque_particle").withColorTargetState(ColorTargetState.DEFAULT).build()
|
| 1126 | );
|
| 1127 | public static final RenderPipeline TRANSLUCENT_PARTICLE = register(
|
| 1128 | RenderPipeline.builder(PARTICLE_SNIPPET)
|
| 1129 | .withLocation("pipeline/translucent_particle")
|
| 1130 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1131 | .build()
|
| 1132 | );
|
| 1133 | public static final OitPipelineSet OIT_PARTICLE = register(OitPipelineSet.builder("particle", RenderPipeline.builder(OIT_PARTICLE_SNIPPET)).build());
|
| 1134 | public static final RenderPipeline WEATHER = register(
|
| 1135 | RenderPipeline.builder(WEATHER_SNIPPET)
|
| 1136 | .withLocation("pipeline/weather")
|
| 1137 | .withDepthStencilState(new DepthStencilState(CompareOp.GREATER_THAN_OR_EQUAL, false))
|
| 1138 | .build()
|
| 1139 | );
|
| 1140 | public static final OitPipelineSet OIT_WEATHER = register(
|
| 1141 | OitPipelineSet.builder("weather", RenderPipeline.builder(OIT_PARTICLE_SNIPPET).withCull(false)).build()
|
| 1142 | );
|
| 1143 | public static final RenderPipeline SKY = register(
|
| 1144 | RenderPipeline.builder(MATRICES_FOG_SNIPPET)
|
| 1145 | .withLocation("pipeline/sky")
|
| 1146 | .withVertexShader("core/sky")
|
| 1147 | .withFragmentShader("core/sky")
|
| 1148 | .withVertexBinding(0, DefaultVertexFormat.POSITION)
|
| 1149 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
|
| 1150 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1151 | .build()
|
| 1152 | );
|
| 1153 | public static final RenderPipeline END_SKY = register(
|
| 1154 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1155 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1156 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1157 | .withLocation("pipeline/end_sky")
|
| 1158 | .withVertexShader("core/position_tex_color")
|
| 1159 | .withFragmentShader("core/position_tex_color")
|
| 1160 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 1161 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1162 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX_COLOR)
|
| 1163 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1164 | .build()
|
| 1165 | );
|
| 1166 | public static final RenderPipeline SUNRISE_SUNSET = register(
|
| 1167 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1168 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1169 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1170 | .withLocation("pipeline/sunrise_sunset")
|
| 1171 | .withVertexShader("core/position_color")
|
| 1172 | .withFragmentShader("core/position_color")
|
| 1173 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT))
|
| 1174 | .withVertexBinding(0, DefaultVertexFormat.POSITION_COLOR)
|
| 1175 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLE_FAN)
|
| 1176 | .build()
|
| 1177 | );
|
| 1178 | public static final RenderPipeline STARS = register(
|
| 1179 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1180 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1181 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1182 | .withLocation("pipeline/stars")
|
| 1183 | .withVertexShader("core/stars")
|
| 1184 | .withFragmentShader("core/stars")
|
| 1185 | .withColorTargetState(new ColorTargetState(BlendFunction.OVERLAY))
|
| 1186 | .withVertexBinding(0, DefaultVertexFormat.POSITION)
|
| 1187 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1188 | .build()
|
| 1189 | );
|
| 1190 | public static final RenderPipeline CELESTIAL = register(
|
| 1191 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1192 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1193 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1194 | .withLocation("pipeline/celestial")
|
| 1195 | .withVertexShader("core/position_tex")
|
| 1196 | .withFragmentShader("core/position_tex")
|
| 1197 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 1198 | .withColorTargetState(new ColorTargetState(BlendFunction.OVERLAY))
|
| 1199 | .withVertexBinding(0, DefaultVertexFormat.POSITION_TEX)
|
| 1200 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1201 | .build()
|
| 1202 | );
|
| 1203 | public static final RenderPipeline GUI = register(RenderPipeline.builder(GUI_SNIPPET).withLocation("pipeline/gui").build());
|
| 1204 | public static final RenderPipeline GUI_INVERT = register(
|
| 1205 | RenderPipeline.builder(GUI_SNIPPET).withLocation("pipeline/gui_invert").withColorTargetState(new ColorTargetState(BlendFunction.INVERT)).build()
|
| 1206 | );
|
| 1207 | public static final RenderPipeline GUI_TEXT_HIGHLIGHT = register(
|
| 1208 | RenderPipeline.builder(GUI_SNIPPET).withLocation("pipeline/gui_text_highlight").withColorTargetState(new ColorTargetState(BlendFunction.ADDITIVE)).build()
|
| 1209 | );
|
| 1210 | public static final RenderPipeline GUI_TEXTURED = register(RenderPipeline.builder(GUI_TEXTURED_SNIPPET).withLocation("pipeline/gui_textured").build());
|
| 1211 | public static final RenderPipeline GUI_TEXTURED_PREMULTIPLIED_ALPHA = register(
|
| 1212 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET)
|
| 1213 | .withLocation("pipeline/gui_textured_premultiplied_alpha")
|
| 1214 | .withColorTargetState(new ColorTargetState(BlendFunction.TRANSLUCENT_PREMULTIPLIED_ALPHA))
|
| 1215 | .build()
|
| 1216 | );
|
| 1217 | public static final RenderPipeline BLOCK_SCREEN_EFFECT = register(
|
| 1218 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET).withLocation("pipeline/block_screen_effect").build()
|
| 1219 | );
|
| 1220 | public static final RenderPipeline FIRE_SCREEN_EFFECT = register(
|
| 1221 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET).withLocation("pipeline/fire_screen_effect").build()
|
| 1222 | );
|
| 1223 | public static final RenderPipeline GUI_OPAQUE_TEXTURED_BACKGROUND = register(
|
| 1224 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET)
|
| 1225 | .withLocation("pipeline/gui_opaque_textured_background")
|
| 1226 | .withColorTargetState(new ColorTargetState(Optional.empty(), GpuFormat.RGBA8_UNORM, 15))
|
| 1227 | .build()
|
| 1228 | );
|
| 1229 | public static final RenderPipeline GUI_NAUSEA_OVERLAY = register(
|
| 1230 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET)
|
| 1231 | .withLocation("pipeline/gui_nausea_overlay")
|
| 1232 | .withColorTargetState(new ColorTargetState(BlendFunction.ADDITIVE))
|
| 1233 | .build()
|
| 1234 | );
|
| 1235 | public static final RenderPipeline VIGNETTE = register(
|
| 1236 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET)
|
| 1237 | .withLocation("pipeline/vignette")
|
| 1238 | .withColorTargetState(new ColorTargetState(new BlendFunction(BlendFactor.ZERO, BlendFactor.ONE_MINUS_SRC_COLOR, BlendFactor.ZERO, BlendFactor.ONE)))
|
| 1239 | .build()
|
| 1240 | );
|
| 1241 | public static final RenderPipeline CROSSHAIR = register(
|
| 1242 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET).withLocation("pipeline/crosshair").withColorTargetState(new ColorTargetState(BlendFunction.INVERT)).build()
|
| 1243 | );
|
| 1244 | public static final RenderPipeline MOJANG_LOGO = register(
|
| 1245 | RenderPipeline.builder(GUI_TEXTURED_SNIPPET)
|
| 1246 | .withLocation("pipeline/mojang_logo")
|
| 1247 | .withColorTargetState(new ColorTargetState(new BlendFunction(BlendFactor.SRC_ALPHA, BlendFactor.ONE)))
|
| 1248 | .build()
|
| 1249 | );
|
| 1250 | public static final RenderPipeline ENTITY_OUTLINE_BLIT = register(
|
| 1251 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1252 | .withLocation("pipeline/entity_outline_blit")
|
| 1253 | .withVertexShader("core/screenquad")
|
| 1254 | .withFragmentShader("core/blit_screen")
|
| 1255 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1256 | .withColorTargetState(new ColorTargetState(Optional.of(BlendFunction.ENTITY_OUTLINE_BLIT), GpuFormat.RGBA8_UNORM, 7))
|
| 1257 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1258 | .build()
|
| 1259 | );
|
| 1260 | public static final RenderPipeline TRACY_BLIT = register(
|
| 1261 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1262 | .withLocation("pipeline/tracy_blit")
|
| 1263 | .withVertexShader("core/screenquad")
|
| 1264 | .withFragmentShader("core/blit_screen")
|
| 1265 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1266 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1267 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1268 | .build()
|
| 1269 | );
|
| 1270 | public static final RenderPipeline PANORAMA = register(
|
| 1271 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1272 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1273 | .withBindGroupLayout(BindGroupLayouts.DYNAMIC_TRANSFORMS)
|
| 1274 | .withLocation("pipeline/panorama")
|
| 1275 | .withVertexShader("core/panorama")
|
| 1276 | .withFragmentShader("core/panorama")
|
| 1277 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0)
|
| 1278 | .withVertexBinding(0, DefaultVertexFormat.POSITION)
|
| 1279 | .withPrimitiveTopology(PrimitiveTopology.QUADS)
|
| 1280 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1281 | .build()
|
| 1282 | );
|
| 1283 | public static final RenderPipeline OUTLINE_CULL = register(RenderPipeline.builder(OUTLINE_SNIPPET).withLocation("pipeline/outline_cull").build());
|
| 1284 | public static final RenderPipeline OUTLINE_NO_CULL = register(
|
| 1285 | RenderPipeline.builder(OUTLINE_SNIPPET).withLocation("pipeline/outline_no_cull").withCull(false).build()
|
| 1286 | );
|
| 1287 | public static final RenderPipeline LIGHTMAP = register(
|
| 1288 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1289 | .withLocation("pipeline/lightmap")
|
| 1290 | .withVertexShader("core/screenquad")
|
| 1291 | .withFragmentShader("core/lightmap")
|
| 1292 | .withBindGroupLayout(BindGroupLayouts.LIGHTMAP_INFO)
|
| 1293 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1294 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1295 | .build()
|
| 1296 | );
|
| 1297 | public static final RenderPipeline.Snippet ANIMATE_SPRITE_SNIPPET = RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1298 | .withVertexShader("core/animate_sprite")
|
| 1299 | .withBindGroupLayout(BindGroupLayouts.SPRITE_ANIMATION_INFO)
|
| 1300 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1301 | .withColorTargetState(ColorTargetState.DEFAULT)
|
| 1302 | .buildSnippet();
|
| 1303 | public static final RenderPipeline ANIMATE_SPRITE_BLIT = register(
|
| 1304 | RenderPipeline.builder(ANIMATE_SPRITE_SNIPPET)
|
| 1305 | .withFragmentShader("core/animate_sprite_blit")
|
| 1306 | .withLocation("pipeline/animate_sprite_blit")
|
| 1307 | .withBindGroupLayout(BindGroupLayouts.SPRITE)
|
| 1308 | .build()
|
| 1309 | );
|
| 1310 | public static final RenderPipeline ANIMATE_SPRITE_INTERPOLATE = register(
|
| 1311 | RenderPipeline.builder(ANIMATE_SPRITE_SNIPPET)
|
| 1312 | .withFragmentShader("core/animate_sprite_interpolate")
|
| 1313 | .withLocation("pipeline/animate_sprite_interpolate")
|
| 1314 | .withBindGroupLayout(BindGroupLayouts.CURRENT_SPRITE_NEXT_SPRITE)
|
| 1315 | .build()
|
| 1316 | );
|
| 1317 | public static final RenderPipeline BLIT_DEPTH_BOUNDS = register(
|
| 1318 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1319 | .withLocation("pipeline/blit_depth_bounds")
|
| 1320 | .withVertexShader("core/screenquad")
|
| 1321 | .withFragmentShader("core/blit_screen")
|
| 1322 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1323 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1324 | .withColorTargetState(new ColorTargetState(Optional.empty(), GpuFormat.RGBA32_FLOAT, 15))
|
| 1325 | .build()
|
| 1326 | );
|
| 1327 | public static final RenderPipeline OIT_DEPTH_BOUNDS_CULL = register(
|
| 1328 | RenderPipeline.builder(OIT_SNIPPET)
|
| 1329 | .withVertexShader("core/screenquad")
|
| 1330 | .withFragmentShader("core/oit_depth_bounds_cull")
|
| 1331 | .withLocation("pipeline/oit_depth_bounds_cull")
|
| 1332 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1333 | .withBindGroupLayout(BindGroupLayouts.DEPTH_BOUNDS_SAMPLER)
|
| 1334 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1335 | .withColorTargetState(new ColorTargetState(Optional.empty(), GpuFormat.RGBA32_FLOAT, 15))
|
| 1336 | .withDepthStencilState(DepthStencilState.DEFAULT)
|
| 1337 | .build()
|
| 1338 | );
|
| 1339 | public static final RenderPipeline BLIT_DEPTH_DURING_DEPTH_BOUNDS = register(
|
| 1340 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1341 | .withLocation("pipeline/blit_depth_during_depth_bounds")
|
| 1342 | .withVertexShader("core/screenquad")
|
| 1343 | .withFragmentShader("core/blit_depth")
|
| 1344 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1345 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1346 | .withDepthStencilState(new DepthStencilState(CompareOp.ALWAYS_PASS, true))
|
| 1347 | .withColorTargetState(new ColorTargetState(Optional.empty(), GpuFormat.RGBA32_FLOAT, 0))
|
| 1348 | .build()
|
| 1349 | );
|
| 1350 | public static final RenderPipeline BLIT_DEPTH = register(
|
| 1351 | RenderPipeline.builder(GLOBALS_SNIPPET)
|
| 1352 | .withLocation("pipeline/blit_depth")
|
| 1353 | .withVertexShader("core/screenquad")
|
| 1354 | .withFragmentShader("core/blit_depth")
|
| 1355 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1356 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1357 | .withDepthStencilState(new DepthStencilState(CompareOp.ALWAYS_PASS, true))
|
| 1358 | .build()
|
| 1359 | );
|
| 1360 | public static final RenderPipeline OIT_COMPOSITE = register(
|
| 1361 | RenderPipeline.builder(OIT_SNIPPET)
|
| 1362 | .withBindGroupLayout(BindGroupLayouts.PROJECTION)
|
| 1363 | .withVertexShader("core/screenquad")
|
| 1364 | .withFragmentShader("core/oit_composite")
|
| 1365 | .withLocation("pipeline/oit_composite")
|
| 1366 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1367 | .withBindGroupLayout(BindGroupLayouts.SAMPLER0_OIT_COEFFS_DEPTH_BOUNDS_SAMPLER)
|
| 1368 | .withColorTargetState(new ColorTargetState(Optional.of(BlendFunction.TRANSLUCENT_PREMULTIPLIED_ALPHA), GpuFormat.RGBA8_UNORM, 15))
|
| 1369 | .withDepthStencilState(new DepthStencilState(CompareOp.ALWAYS_PASS, true))
|
| 1370 | .build()
|
| 1371 | );
|
| 1372 | public static final RenderPipeline INTEGRATE_DEPTH = register(
|
| 1373 | RenderPipeline.builder()
|
| 1374 | .withVertexShader("core/screenquad")
|
| 1375 | .withFragmentShader("core/integrate_depth")
|
| 1376 | .withLocation("pipeline/integrate_depth")
|
| 1377 | .withPrimitiveTopology(PrimitiveTopology.TRIANGLES)
|
| 1378 | .withBindGroupLayout(BindGroupLayouts.IN_SAMPLER)
|
| 1379 | .withDepthStencilState(new DepthStencilState(CompareOp.ALWAYS_PASS, true))
|
| 1380 | .build()
|
| 1381 | );
|
| 1382 |
|
| 1383 | /**
|
| 1384 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 1385 | */
|
| 1386 | public static RenderPipeline register(final RenderPipeline pipeline) {
|
| 1387 | PIPELINES_BY_LOCATION.put(pipeline.getLocation(), pipeline);
|
| 1388 | return pipeline;
|
| 1389 | }
|
| 1390 |
|
| 1391 | /**
|
| 1392 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 1393 | */
|
| 1394 | public static OitPipelineSet register(final OitPipelineSet oitPipelineSet) {
|
| 1395 | PIPELINES_BY_LOCATION.put(oitPipelineSet.depthBoundsPipeline().getLocation(), oitPipelineSet.depthBoundsPipeline());
|
| 1396 | PIPELINES_BY_LOCATION.put(oitPipelineSet.transmittancePipeline().getLocation(), oitPipelineSet.transmittancePipeline());
|
| 1397 | PIPELINES_BY_LOCATION.put(oitPipelineSet.accumulatePipeline().getLocation(), oitPipelineSet.accumulatePipeline());
|
| 1398 | return oitPipelineSet;
|
| 1399 | }
|
| 1400 |
|
| 1401 | /**
|
| 1402 | * Access widened by fabric-transitive-access-wideners-v1 to accessible
|
| 1403 | */
|
| 1404 | public static RenderPipeline registerOptional(final RenderPipeline pipeline) {
|
| 1405 | OPTIONAL_PIPELINES_BY_LOCATION.put(pipeline.getLocation(), pipeline);
|
| 1406 | return pipeline;
|
| 1407 | }
|
| 1408 |
|
| 1409 | public static List<RenderPipeline> requiredPipelines() {
|
| 1410 | return PIPELINES_BY_LOCATION.values().stream().toList();
|
| 1411 | }
|
| 1412 |
|
| 1413 | public static List<RenderPipeline> optionalPipelines() {
|
| 1414 | return OPTIONAL_PIPELINES_BY_LOCATION.values().stream().toList();
|
| 1415 | }
|
| 1416 | }
|
| 1417 |
|