use of net.minecraft.client.gl.Framebuffer in project meteor-client by MeteorDevelopment.
the class WorldRendererMixin method renderEntity.
@Inject(method = "renderEntity", at = @At("HEAD"))
private void renderEntity(Entity entity, double cameraX, double cameraY, double cameraZ, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo info) {
if (EntityShaders.shouldDrawOverlay(entity) && vertexConsumers != EntityShaders.overlayVertexConsumerProvider && vertexConsumers != EntityShaders.outlinesVertexConsumerProvider) {
Framebuffer prevBuffer = this.entityOutlinesFramebuffer;
this.entityOutlinesFramebuffer = EntityShaders.overlayFramebuffer;
EntityShaders.overlayVertexConsumerProvider.setColor(0, 0, 0, 100);
GlStateManager._disableDepthTest();
renderEntity(entity, cameraX, cameraY, cameraZ, tickDelta, matrices, EntityShaders.overlayVertexConsumerProvider);
GlStateManager._enableDepthTest();
this.entityOutlinesFramebuffer = prevBuffer;
}
if (EntityShaders.shouldDrawOutline(entity) && vertexConsumers != EntityShaders.outlinesVertexConsumerProvider && vertexConsumers != EntityShaders.overlayVertexConsumerProvider) {
Framebuffer prevBuffer = this.entityOutlinesFramebuffer;
this.entityOutlinesFramebuffer = EntityShaders.outlinesFramebuffer;
Utils.renderingEntityOutline = true;
Color color = Modules.get().get(ESP.class).getOutlineColor(entity);
EntityShaders.outlinesVertexConsumerProvider.setColor(color.r, color.g, color.b, color.a);
GlStateManager._disableDepthTest();
renderEntity(entity, cameraX, cameraY, cameraZ, tickDelta, matrices, EntityShaders.outlinesVertexConsumerProvider);
GlStateManager._enableDepthTest();
Utils.renderingEntityOutline = false;
this.entityOutlinesFramebuffer = prevBuffer;
}
}
use of net.minecraft.client.gl.Framebuffer in project meteor-client by MeteorDevelopment.
the class EntityShaders method renderOutlines.
public static void renderOutlines(Runnable draw, boolean entities, int width, float fillOpacity, ShapeMode shapeMode) {
WorldRenderer worldRenderer = mc.worldRenderer;
WorldRendererAccessor wra = (WorldRendererAccessor) worldRenderer;
Framebuffer fbo = worldRenderer.getEntityOutlinesFramebuffer();
if (entities)
wra.setEntityOutlinesFramebuffer(outlinesFramebuffer);
else {
outlinesFramebuffer.clear(false);
outlinesFramebuffer.beginWrite(false);
}
draw.run();
if (entities)
wra.setEntityOutlinesFramebuffer(fbo);
mc.getFramebuffer().beginWrite(false);
GL.bindTexture(outlinesFramebuffer.getColorAttachment());
outlinesShader.bind();
outlinesShader.set("u_Size", mc.getWindow().getFramebufferWidth(), mc.getWindow().getFramebufferHeight());
outlinesShader.set("u_Texture", 0);
outlinesShader.set("u_Width", width);
outlinesShader.set("u_FillOpacity", fillOpacity / 255.0);
outlinesShader.set("u_ShapeMode", shapeMode.ordinal());
PostProcessRenderer.render();
}
use of net.minecraft.client.gl.Framebuffer 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());
}
use of net.minecraft.client.gl.Framebuffer 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());
}
Aggregations