Search in sources :

Example 6 with WorldRenderer

use of net.minecraft.client.render.WorldRenderer in project meteor-client by MeteorDevelopment.

the class EntityShaders method endRender.

public static void endRender() {
    WorldRenderer worldRenderer = mc.worldRenderer;
    WorldRendererAccessor wra = (WorldRendererAccessor) worldRenderer;
    Framebuffer fbo = worldRenderer.getEntityOutlinesFramebuffer();
    // Overlay
    if (chams != null && chams.isShader()) {
        wra.setEntityOutlinesFramebuffer(overlayFramebuffer);
        overlayVertexConsumerProvider.draw();
        wra.setEntityOutlinesFramebuffer(fbo);
        mc.getFramebuffer().beginWrite(false);
        GL.bindTexture(overlayFramebuffer.getColorAttachment());
        overlayShader.bind();
        overlayShader.set("u_Size", mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
        overlayShader.set("u_Texture", 0);
        overlayShader.set("u_Time", timer++ / 20.0);
        PostProcessRenderer.render();
    }
    // Outline
    if (esp != null && esp.isShader())
        renderOutlines(outlinesVertexConsumerProvider::draw, true, esp.outlineWidth.get(), esp.fillOpacity.get().floatValue(), esp.shapeMode.get());
}
Also used : WorldRendererAccessor(meteordevelopment.meteorclient.mixin.WorldRendererAccessor) SimpleFramebuffer(net.minecraft.client.gl.SimpleFramebuffer) Framebuffer(net.minecraft.client.gl.Framebuffer) WorldRenderer(net.minecraft.client.render.WorldRenderer)

Example 7 with WorldRenderer

use of net.minecraft.client.render.WorldRenderer in project Client by MatHax.

the class EntityShaders method endRender.

public static void endRender() {
    WorldRenderer worldRenderer = mc.worldRenderer;
    WorldRendererAccessor wra = (WorldRendererAccessor) worldRenderer;
    Framebuffer fbo = worldRenderer.getEntityOutlinesFramebuffer();
    // Overlay
    if (chams != null && chams.isShader()) {
        wra.setEntityOutlinesFramebuffer(overlayFramebuffer);
        overlayVertexConsumerProvider.draw();
        wra.setEntityOutlinesFramebuffer(fbo);
        mc.getFramebuffer().beginWrite(false);
        GL.bindTexture(overlayFramebuffer.getColorAttachment());
        overlayShader.bind();
        overlayShader.set("u_Size", mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
        overlayShader.set("u_Texture", 0);
        overlayShader.set("u_Time", timer++ / 20.0);
        PostProcessRenderer.render();
    }
    // Outline
    if (esp != null && esp.isShader())
        renderOutlines(outlinesVertexConsumerProvider::draw, true, esp.outlineWidth.get(), esp.fillOpacity.get().floatValue(), esp.shapeMode.get());
}
Also used : WorldRendererAccessor(mathax.client.mixin.WorldRendererAccessor) SimpleFramebuffer(net.minecraft.client.gl.SimpleFramebuffer) Framebuffer(net.minecraft.client.gl.Framebuffer) WorldRenderer(net.minecraft.client.render.WorldRenderer)

Aggregations

WorldRenderer (net.minecraft.client.render.WorldRenderer)7 Framebuffer (net.minecraft.client.gl.Framebuffer)4 SimpleFramebuffer (net.minecraft.client.gl.SimpleFramebuffer)4 WorldRendererAccessor (mathax.client.mixin.WorldRendererAccessor)2 WorldRendererAccessor (meteordevelopment.meteorclient.mixin.WorldRendererAccessor)2 ClientWorld (net.minecraft.client.world.ClientWorld)2 GameProfile (com.mojang.authlib.GameProfile)1 IEClientPlayNetworkHandler (com.qouteall.immersive_portals.ducks.IEClientPlayNetworkHandler)1 IEClientWorld (com.qouteall.immersive_portals.ducks.IEClientWorld)1 ChatScreen (net.minecraft.client.gui.screen.ChatScreen)1 ClientPlayNetworkHandler (net.minecraft.client.network.ClientPlayNetworkHandler)1 ClientConnection (net.minecraft.network.ClientConnection)1 LevelInfo (net.minecraft.world.level.LevelInfo)1