use of net.minecraft.client.render.GameRenderer in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method renderPrepare.
public static BufferBuilder renderPrepare(Color color) {
float red = color.getRed() / 255f;
float green = color.getGreen() / 255f;
float blue = color.getBlue() / 255f;
float alpha = color.getAlpha() / 255f;
RenderSystem.setShader(GameRenderer::getPositionShader);
GL11.glDepthFunc(GL11.GL_ALWAYS);
RenderSystem.setShaderColor(red, green, blue, alpha);
RenderSystem.lineWidth(2f);
BufferBuilder buffer = Tessellator.getInstance().getBuffer();
buffer.begin(VertexFormat.DrawMode.DEBUG_LINES, VertexFormats.POSITION);
return buffer;
}
use of net.minecraft.client.render.GameRenderer in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method renderRoundedQuad.
// Taken from Coffee client (https://github.com/business-goose/Coffee/tree/master)
// My rounded stuff looked retarded
public static void renderRoundedQuad(MatrixStack matrices, Color c, double fromX, double fromY, double toX, double toY, double rad, double samples) {
int color = c.getRGB();
Matrix4f matrix = matrices.peek().getPositionMatrix();
float f = (float) (color >> 24 & 255) / 255.0F;
float g = (float) (color >> 16 & 255) / 255.0F;
float h = (float) (color >> 8 & 255) / 255.0F;
float k = (float) (color & 255) / 255.0F;
RenderSystem.enableBlend();
RenderSystem.disableTexture();
RenderSystem.setShader(GameRenderer::getPositionColorShader);
renderRoundedQuadInternal(matrix, g, h, k, f, fromX, fromY, toX, toY, rad, samples);
RenderSystem.enableTexture();
RenderSystem.disableBlend();
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);
}
use of net.minecraft.client.render.GameRenderer in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawGradientFilledCircle.
public static void drawGradientFilledCircle(MatrixStack matrices, final int xx, final int yy, final float radius, int sides, Color color1, Color color2) {
int sections = sides;
double dAngle = 2 * Math.PI / sections;
float x, y, lastX = 0, lastY = 0;
for (int i = -1; i < sections; i++) {
x = (float) (radius * Math.sin((i * dAngle)));
y = (float) (radius * Math.cos((i * dAngle)));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
RenderSystem.enableBlend();
RenderSystem.disableDepthTest();
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(1);
buffer.begin(VertexFormat.DrawMode.TRIANGLE_FAN, VertexFormats.POSITION_COLOR);
Vertexer.vertexTri(matrices, buffer, xx, yy, 0f, xx + x, yy + y, 0f, xx + lastX, yy + lastY, 0f, color1, color2);
tessellator.draw();
RenderSystem.enableCull();
RenderSystem.enableDepthTest();
lastX = x;
lastY = y;
}
}
use of net.minecraft.client.render.GameRenderer in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawFilledCircle.
// took me too long to do this
public static void drawFilledCircle(MatrixStack matrices, float xx, float yy, float radius, int sides, Color color) {
int sections = sides;
double dAngle = 2 * Math.PI / sections;
float x, y, lastX = 0, lastY = 0;
for (int i = -1; i < sections; i++) {
x = (float) (radius * Math.sin((i * dAngle)));
y = (float) (radius * Math.cos((i * dAngle)));
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
RenderSystem.enableBlend();
RenderSystem.disableDepthTest();
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(1);
buffer.begin(VertexFormat.DrawMode.TRIANGLE_FAN, VertexFormats.POSITION_COLOR);
Vertexer.vertexTri(matrices, buffer, xx, yy, 0f, xx + x, yy + y, 0f, xx + lastX, yy + lastY, 0f, color);
tessellator.draw();
RenderSystem.enableCull();
RenderSystem.enableDepthTest();
lastX = x;
lastY = y;
}
}
use of net.minecraft.client.render.GameRenderer in project Hypnotic-Client by Hypnotic-Development.
the class RenderUtils method drawBoxOutline.
public static void drawBoxOutline(Box box, QuadColor color, float lineWidth, Direction... excludeDirs) {
if (!getFrustum().isVisible(box)) {
return;
}
setup3DRender(true);
MatrixStack matrices = matrixFrom(box.minX, box.minY, box.minZ);
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();
// Outline
RenderSystem.disableCull();
RenderSystem.setShader(GameRenderer::getRenderTypeLinesShader);
RenderSystem.lineWidth(lineWidth);
buffer.begin(VertexFormat.DrawMode.LINES, VertexFormats.LINES);
Vertexer.vertexBoxLines(matrices, buffer, Boxes.moveToZero(box), color, excludeDirs);
tessellator.draw();
RenderSystem.enableCull();
end3DRender();
}
Aggregations