use of net.coderbot.iris.shaderpack.texture.TextureStage in project Iris by IrisShaders.
the class DeferredWorldRenderingPipeline method createPassInner.
private Pass createPassInner(ProgramBuilder builder, IdMap map, ProgramDirectives programDirectives, PackDirectives packDirectives) {
CommonUniforms.addCommonUniforms(builder, map, packDirectives, updateNotifier);
Supplier<ImmutableSet<Integer>> flipped = () -> isBeforeTranslucent ? flippedAfterPrepare : flippedAfterTranslucent;
TextureStage textureStage = TextureStage.GBUFFERS_AND_SHADOW;
ProgramSamplers.CustomTextureSamplerInterceptor customTextureSamplerInterceptor = ProgramSamplers.customTextureSamplerInterceptor(builder, customTextureManager.getCustomTextureIdMap().getOrDefault(textureStage, Object2ObjectMaps.emptyMap()));
IrisSamplers.addRenderTargetSamplers(customTextureSamplerInterceptor, flipped, renderTargets, false);
IrisImages.addRenderTargetImages(builder, flipped, renderTargets);
IrisSamplers.addLevelSamplers(customTextureSamplerInterceptor, customTextureManager.getNormals(), customTextureManager.getSpecular());
IrisSamplers.addWorldDepthSamplers(customTextureSamplerInterceptor, renderTargets);
IrisSamplers.addNoiseSampler(customTextureSamplerInterceptor, customTextureManager.getNoiseTexture());
if (IrisSamplers.hasShadowSamplers(customTextureSamplerInterceptor)) {
createShadowMapRenderer.run();
IrisSamplers.addShadowSamplers(customTextureSamplerInterceptor, shadowMapRenderer);
IrisImages.addShadowColorImages(builder, shadowMapRenderer);
}
GlFramebuffer framebufferBeforeTranslucents = renderTargets.createGbufferFramebuffer(flippedAfterPrepare, programDirectives.getDrawBuffers());
GlFramebuffer framebufferAfterTranslucents = renderTargets.createGbufferFramebuffer(flippedAfterTranslucent, programDirectives.getDrawBuffers());
builder.bindAttributeLocation(11, "mc_Entity");
builder.bindAttributeLocation(12, "mc_midTexCoord");
builder.bindAttributeLocation(13, "at_tangent");
AlphaTestOverride alphaTestOverride = programDirectives.getAlphaTestOverride().orElse(null);
Pass pass = new Pass(builder.build(), framebufferBeforeTranslucents, framebufferAfterTranslucents, alphaTestOverride, programDirectives.getBlendModeOverride());
allPasses.add(pass);
return pass;
}
Aggregations