use of net.minecraft.client.renderer.BufferBuilder in project Bewitchment by Um-Mitternacht.
the class GirdleOfTheWoodedHUD method renderTexture.
private static void renderTexture(double x, double y, double width, double height, double vMin, double vMax) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buff = tessellator.getBuffer();
buff.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buff.pos(x, y + height, 0).tex(0, vMax).endVertex();
buff.pos(x + width, y + height, 0).tex(1, vMax).endVertex();
buff.pos(x + width, y, 0).tex(1, vMin).endVertex();
buff.pos(x, y, 0).tex(0, vMin).endVertex();
tessellator.draw();
}
use of net.minecraft.client.renderer.BufferBuilder in project Bewitchment by Um-Mitternacht.
the class VampireBloodBarHUD method renderTextureAtTile.
private static void renderTextureAtTile(double x, double y, int filled, int available, double lasth, double lasta) {
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buff = tessellator.getBuffer();
for (int i = 0; i < filled; i++) {
buff.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buff.pos(x + i * 8, y + 9, 0).tex(0, 0.5).endVertex();
buff.pos(x + (i * 8) + 7, y + 9, 0).tex(1, 0.5).endVertex();
buff.pos(x + (i * 8) + 7, y, 0).tex(1, 0).endVertex();
buff.pos(x + i * 8, y, 0).tex(0, 0).endVertex();
tessellator.draw();
}
for (int i = filled; i < available; i++) {
buff.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buff.pos(x + i * 8, y + 9, 0).tex(0, 1).endVertex();
buff.pos(x + (i * 8) + 7, y + 9, 0).tex(1, 1).endVertex();
buff.pos(x + (i * 8) + 7, y, 0).tex(1, 0.5).endVertex();
buff.pos(x + i * 8, y, 0).tex(0, 0.5).endVertex();
tessellator.draw();
}
if (lasta > 0) {
buff.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buff.pos(x + filled * 8, y + 9, 0).tex(0, 1).endVertex();
buff.pos(x + (filled * 8) + (7 * lasta), y + 9, 0).tex(lasta, 1).endVertex();
buff.pos(x + (filled * 8) + (7 * lasta), y, 0).tex(lasta, 0.5).endVertex();
buff.pos(x + filled * 8, y, 0).tex(0, 0.5).endVertex();
tessellator.draw();
}
if (lasth > 0) {
buff.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buff.pos(x + filled * 8, y + 9, 0).tex(0, 0.5).endVertex();
buff.pos(x + (filled * 8) + (7 * lasth), y + 9, 0).tex(lasth, 0.5).endVertex();
buff.pos(x + (filled * 8) + (7 * lasth), y, 0).tex(lasth, 0).endVertex();
buff.pos(x + filled * 8, y, 0).tex(0, 0).endVertex();
tessellator.draw();
}
}
use of net.minecraft.client.renderer.BufferBuilder in project Fracture by HellFirePvP.
the class EffectLightning method renderFast.
public static void renderFast(float pTicks, java.util.List<EffectLightning> toBeRendered) {
GlStateManager.pushMatrix();
RenderingUtils.removeStandartTranslationFromTESRMatrix(pTicks);
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.enableBlend();
GlStateManager.disableCull();
GlStateManager.disableAlpha();
Blending.ADDITIVE_ALPHA.applyStateManager();
connection.bind();
Tessellator tes = Tessellator.getInstance();
BufferBuilder buf = tes.getBuffer();
buf.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
for (EffectLightning fl : new ArrayList<>(toBeRendered)) {
fl.renderF(pTicks, buf);
}
buf.sortVertexData((float) TileEntityRendererDispatcher.staticPlayerX, (float) TileEntityRendererDispatcher.staticPlayerY, (float) TileEntityRendererDispatcher.staticPlayerZ);
tes.draw();
TextureHelper.refreshTextureBindState();
Blending.DEFAULT.applyStateManager();
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.enableCull();
GlStateManager.popMatrix();
}
use of net.minecraft.client.renderer.BufferBuilder in project Fracture by HellFirePvP.
the class EntityFXFacingParticle method renderBatched.
public static void renderBatched(float parTicks, Collection<EntityFXFacingParticle> particles) {
GlStateManager.disableAlpha();
GlStateManager.enableBlend();
Blending.DEFAULT.apply();
Blending.DEFAULT.applyStateManager();
GlStateManager.disableCull();
GlStateManager.depthMask(false);
staticFlareTex.bind();
Tessellator t = Tessellator.getInstance();
BufferBuilder vb = t.getBuffer();
vb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX_COLOR);
for (EntityFXFacingParticle particle : new ArrayList<>(particles)) {
if (particle == null)
continue;
particle.renderBatched(parTicks, vb);
}
t.draw();
GlStateManager.enableAlpha();
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
GlStateManager.enableCull();
TextureHelper.refreshTextureBindState();
}
use of net.minecraft.client.renderer.BufferBuilder in project Fracture by HellFirePvP.
the class RenderingUtils method renderTexturedCubeCentral.
public static void renderTexturedCubeCentral(Vector3 offset, double size, double u, double v, double uLength, double vLength) {
Tessellator tes = Tessellator.getInstance();
BufferBuilder vb = tes.getBuffer();
double half = size / 2D;
vb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() - half).tex(u, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() - half).tex(u + uLength, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() + half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() + half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() + half).tex(u, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() + half).tex(u + uLength, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() - half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() - half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() + half).tex(u + uLength, v).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() + half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() - half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() - half).tex(u, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() - half).tex(u + uLength, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() - half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() + half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() + half).tex(u, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() - half).tex(u, v).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() - half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() - half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() - half).tex(u + uLength, v).endVertex();
vb.pos(offset.getX() - half, offset.getY() - half, offset.getZ() + half).tex(u, v).endVertex();
vb.pos(offset.getX() - half, offset.getY() + half, offset.getZ() + half).tex(u, v + vLength).endVertex();
vb.pos(offset.getX() + half, offset.getY() + half, offset.getZ() + half).tex(u + uLength, v + vLength).endVertex();
vb.pos(offset.getX() + half, offset.getY() - half, offset.getZ() + half).tex(u + uLength, v).endVertex();
tes.draw();
}
Aggregations