use of net.minecraft.client.render.Tessellator in project BleachHack by BleachDrinker420.
the class Window method horizontalGradient.
public static void horizontalGradient(MatrixStack matrices, int x1, int y1, int x2, int y2, int color1, int color2) {
float alpha1 = (color1 >> 24 & 255) / 255.0F;
float red1 = (color1 >> 16 & 255) / 255.0F;
float green1 = (color1 >> 8 & 255) / 255.0F;
float blue1 = (color1 & 255) / 255.0F;
float alpha2 = (color2 >> 24 & 255) / 255.0F;
float red2 = (color2 >> 16 & 255) / 255.0F;
float green2 = (color2 >> 8 & 255) / 255.0F;
float blue2 = (color2 & 255) / 255.0F;
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
bufferBuilder.vertex(x1, y1, 0).color(red1, green1, blue1, alpha1).next();
bufferBuilder.vertex(x1, y2, 0).color(red1, green1, blue1, alpha1).next();
bufferBuilder.vertex(x2, y2, 0).color(red2, green2, blue2, alpha2).next();
bufferBuilder.vertex(x2, y1, 0).color(red2, green2, blue2, alpha2).next();
tessellator.draw();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
}
use of net.minecraft.client.render.Tessellator in project BleachHack by BleachDrinker420.
the class Window method verticalGradient.
public static void verticalGradient(MatrixStack matrices, int x1, int y1, int x2, int y2, int color1, int color2) {
float alpha1 = (color1 >> 24 & 255) / 255.0F;
float red1 = (color1 >> 16 & 255) / 255.0F;
float green1 = (color1 >> 8 & 255) / 255.0F;
float blue1 = (color1 & 255) / 255.0F;
float alpha2 = (color2 >> 24 & 255) / 255.0F;
float red2 = (color2 >> 16 & 255) / 255.0F;
float green2 = (color2 >> 8 & 255) / 255.0F;
float blue2 = (color2 & 255) / 255.0F;
RenderSystem.disableTexture();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferBuilder = tessellator.getBuffer();
bufferBuilder.begin(VertexFormat.DrawMode.QUADS, VertexFormats.POSITION_COLOR);
bufferBuilder.vertex(x2, y1, 0).color(red1, green1, blue1, alpha1).next();
bufferBuilder.vertex(x1, y1, 0).color(red1, green1, blue1, alpha1).next();
bufferBuilder.vertex(x1, y2, 0).color(red2, green2, blue2, alpha2).next();
bufferBuilder.vertex(x2, y2, 0).color(red2, green2, blue2, alpha2).next();
tessellator.draw();
RenderSystem.disableBlend();
RenderSystem.enableTexture();
}
Aggregations