use of com.mojang.blaze3d.pipeline.RenderTarget in project Iris by IrisShaders.
the class DeferredWorldRenderingPipeline method prepareRenderTargets.
private void prepareRenderTargets() {
// Make sure we're using texture unit 0 for this.
RenderSystem.activeTexture(GL15C.GL_TEXTURE0);
RenderTarget main = Minecraft.getInstance().getMainRenderTarget();
renderTargets.resizeIfNeeded(main.width, main.height);
final ImmutableList<ClearPass> passes;
if (renderTargets.isFullClearRequired()) {
renderTargets.onFullClear();
passes = clearPassesFull;
} else {
passes = clearPasses;
}
Vector3d fogColor3 = CapturedRenderingState.INSTANCE.getFogColor();
// NB: The alpha value must be 1.0 here, or else you will get a bunch of bugs. Sildur's Vibrant Shaders
// will give you pink reflections and other weirdness if this is zero.
Vector4f fogColor = new Vector4f((float) fogColor3.x, (float) fogColor3.y, (float) fogColor3.z, 1.0F);
for (ClearPass clearPass : passes) {
clearPass.execute(fogColor);
}
}
use of com.mojang.blaze3d.pipeline.RenderTarget in project Iris by IrisShaders.
the class CompositeRenderer method renderAll.
public void renderAll() {
RenderSystem.disableBlend();
RenderSystem.disableAlphaTest();
final RenderTarget main = Minecraft.getInstance().getMainRenderTarget();
final int baseWidth = main.width;
final int baseHeight = main.height;
FullScreenQuadRenderer.INSTANCE.begin();
for (Pass renderPass : passes) {
if (!renderPass.mipmappedBuffers.isEmpty()) {
RenderSystem.activeTexture(GL15C.GL_TEXTURE0);
for (int index : renderPass.mipmappedBuffers) {
setupMipmapping(renderTargets.get(index), renderPass.stageReadsFromAlt.contains(index));
}
}
float scaledWidth = baseWidth * renderPass.viewportScale;
float scaledHeight = baseHeight * renderPass.viewportScale;
RenderSystem.viewport(0, 0, (int) scaledWidth, (int) scaledHeight);
renderPass.framebuffer.bind();
renderPass.program.use();
FullScreenQuadRenderer.INSTANCE.renderQuad();
}
FullScreenQuadRenderer.end();
// Make sure to reset the viewport to how it was before... Otherwise weird issues could occur.
// Also bind the "main" framebuffer if it isn't already bound.
main.bindWrite(true);
GlStateManager._glUseProgram(0);
// NB: Unbinding all of these textures is necessary for proper shaderpack reloading.
for (int i = 0; i < SamplerLimits.get().getMaxTextureUnits(); i++) {
// Unbind all textures that we may have used.
// NB: This is necessary for shader pack reloading to work propely
RenderSystem.activeTexture(GL15C.GL_TEXTURE0 + i);
RenderSystem.bindTexture(0);
}
RenderSystem.activeTexture(GL15C.GL_TEXTURE0);
}
Aggregations