Java Code Examples for net.minecraft.client.renderer.Tessellator#startDrawingQuads()

The following examples show how to use net.minecraft.client.renderer.Tessellator#startDrawingQuads() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 6 votes vote down vote up
private void renderOverlay( ResourceLocation texture, float width, float height )
{
    Minecraft mc = Minecraft.getMinecraft();
    GL11.glDisable( GL11.GL_DEPTH_TEST );
    GL11.glDepthMask( false );
    GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA );
    GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
    GL11.glDisable( GL11.GL_ALPHA_TEST );
    mc.renderEngine.bindTexture( texture );
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV( 0.0D, (double) height, -90.0D, 0.0D, 1.0D );
    tessellator.addVertexWithUV( (double) width, (double) height, -90.0D, 1.0D, 1.0D );
    tessellator.addVertexWithUV( (double) width, 0.0D, -90.0D, 1.0D, 0.0D );
    tessellator.addVertexWithUV( 0.0D, 0.0D, -90.0D, 0.0D, 0.0D );
    tessellator.draw();
    GL11.glDepthMask( true );
    GL11.glEnable( GL11.GL_DEPTH_TEST );
    GL11.glEnable( GL11.GL_ALPHA_TEST );
    GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F );
}
 
Example 2
Source File: GuiTextField.java    From ehacks-pro with GNU General Public License v3.0 6 votes vote down vote up
private void drawCursorVertical(int par1, int par2, int par3, int par4) {
    int var5;
    if (par1 < par3) {
        var5 = par1;
        par1 = par3;
        par3 = var5;
    }
    if (par2 < par4) {
        var5 = par2;
        par2 = par4;
        par4 = var5;
    }
    Tessellator var6 = Tessellator.instance;
    GL11.glColor4f(0.0f, 0.0f, 255.0f, 255.0f);
    GL11.glDisable(3553);
    GL11.glEnable(3058);
    GL11.glLogicOp(5387);
    var6.startDrawingQuads();
    var6.addVertex(par1, par4, 0.0);
    var6.addVertex(par3, par4, 0.0);
    var6.addVertex(par3, par2, 0.0);
    var6.addVertex(par1, par2, 0.0);
    var6.draw();
    GL11.glDisable(3058);
    GL11.glEnable(3553);
}
 
Example 3
Source File: SemiBlockRendererLogistics.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
public static void renderOffsetAABB(AxisAlignedBB p_76978_0_, double p_76978_1_, double p_76978_3_, double p_76978_5_){
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.setTranslation(p_76978_1_, p_76978_3_, p_76978_5_);
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.minX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.minZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.maxY, p_76978_0_.maxZ);
    tessellator.addVertex(p_76978_0_.maxX, p_76978_0_.minY, p_76978_0_.maxZ);
    tessellator.setTranslation(0.0D, 0.0D, 0.0D);
    tessellator.draw();
}
 
Example 4
Source File: QCraftProxyClient.java    From qcraft-mod with Apache License 2.0 5 votes vote down vote up
private void renderInventoryQBlock( RenderBlocks renderblocks, BlockQBlock block, int type, BlockQBlock.Appearance appearance )
{
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 0, type ) );
    tessellator.setNormal( 0.0F, -1F, 0.0F );
    renderblocks.renderFaceYNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 0, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 1, type ) );
    tessellator.setNormal( 0.0F, 1.0F, 0.0F );
    renderblocks.renderFaceYPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 1, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 2, type ) );
    tessellator.setNormal( 0.0F, 0.0F, -1F );
    renderblocks.renderFaceZNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 2, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 3, type ) );
    tessellator.setNormal( 0.0F, 0.0F, 1.0F );
    renderblocks.renderFaceZPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 3, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 4, type ) );
    tessellator.setNormal( -1F, 0.0F, 0.0F );
    renderblocks.renderFaceXNeg( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 4, type, appearance ) );
    tessellator.draw();

    tessellator.startDrawingQuads();
    bindColor( block.getColorForType( 5, type ) );
    tessellator.setNormal( 1.0F, 0.0F, 0.0F );
    renderblocks.renderFaceXPos( block, 0.0D, 0.0D, 0.0D, block.getIconForType( 5, type, appearance ) );
    tessellator.draw();
}
 
Example 5
Source File: PotionCustomTexture.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void renderInventoryEffect(int x, int y, PotionEffect effect, Minecraft mc) {
    Tessellator tes = Tessellator.instance;
    mc.renderEngine.bindTexture(texture);
    tes.startDrawingQuads();
    Color c = new Color(getLiquidColor());
    tes.setColorRGBA(c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha());
    tes.addVertexWithUV(x + 6, y + 7, 0, 0, 0);
    tes.addVertexWithUV(x + 6,      y + 7 + 18, 0, 0, 1);
    tes.addVertexWithUV(x + 6 + 18, y + 7 + 18, 0, 1, 1);
    tes.addVertexWithUV(x + 6 + 18, y + 7, 0, 1, 0);
    tes.draw();
}
 
Example 6
Source File: BlockExtendedNodeJarRenderer.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
public static void drawFaces(RenderBlocks renderblocks, Block block, IIcon i1, IIcon i2, IIcon i3, IIcon i4, IIcon i5, IIcon i6, boolean solidtop) {
    Tessellator tessellator = Tessellator.instance;
    GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, -1.0F, 0.0F);
    renderblocks.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, i1);
    tessellator.draw();
    if (solidtop) {
        GL11.glDisable(3008);
    }
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 1.0F, 0.0F);
    renderblocks.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, i2);
    tessellator.draw();
    if (solidtop) {
        GL11.glEnable(3008);
    }
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, 1.0F);
    renderblocks.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, i3);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    renderblocks.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, i4);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(1.0F, 0.0F, 0.0F);
    renderblocks.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, i5);
    tessellator.draw();
    tessellator.startDrawingQuads();
    tessellator.setNormal(-1.0F, 0.0F, 0.0F);
    renderblocks.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, i6);
    tessellator.draw();
    GL11.glTranslatef(0.5F, 0.5F, 0.5F);
}
 
Example 7
Source File: BeefGuiInsertionProgressBar.java    From BigReactors with MIT License 5 votes vote down vote up
@Override
public void drawBackground(TextureManager renderEngine, int mouseX, int mouseY) {
	if(!this.visible) { return; }

	// Draw the background
	GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	renderEngine.bindTexture(controlResource);
	Tessellator tessellator = Tessellator.instance;
	tessellator.startDrawingQuads();
	tessellator.addVertexWithUV(this.absoluteX, this.absoluteY + this.height, 0, backgroundLeftU, 1.0);
	tessellator.addVertexWithUV(this.absoluteX + this.width, this.absoluteY + this.height, 0, backgroundRightU, 1.0);
	tessellator.addVertexWithUV(this.absoluteX + this.width, this.absoluteY, 0, backgroundRightU, 0);
	tessellator.addVertexWithUV(this.absoluteX, this.absoluteY, 0, backgroundLeftU, 0);
	tessellator.draw();
	
	// Draw the rod itself, on top of the background
	if(insertion > 0f) {
		int barHeight = Math.max(1, (int)Math.floor(insertion * barAbsoluteMaxHeight));
		int rodMaxY = this.absoluteY + barHeight;
		
		float rodTopV = 1f - insertion; // TODO
		
		tessellator.startDrawingQuads();
		tessellator.addVertexWithUV(this.absoluteX, rodMaxY, 2, rodLeftU, 1f);
		tessellator.addVertexWithUV(this.absoluteX + this.width, rodMaxY, 2, rodRightU, 1f);
		tessellator.addVertexWithUV(this.absoluteX + this.width, this.absoluteY, 2, rodRightU, rodTopV);
		tessellator.addVertexWithUV(this.absoluteX, this.absoluteY, 2, rodLeftU, rodTopV);
		tessellator.draw();
	}
}
 
Example 8
Source File: BeefGuiVerticalProgressBar.java    From BigReactors with MIT License 5 votes vote down vote up
@Override
public void drawBackground(TextureManager renderEngine, int mouseX, int mouseY) {
	if(!this.visible) { return; }

	// Draw the background
	GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
	renderEngine.bindTexture(controlResource);
	Tessellator tessellator = Tessellator.instance;
	tessellator.startDrawingQuads();
	tessellator.addVertexWithUV(this.absoluteX, this.absoluteY + this.height, 0, backgroundLeftU, 1.0);
	tessellator.addVertexWithUV(this.absoluteX + this.width, this.absoluteY + this.height, 0, backgroundRightU, 1.0);
	tessellator.addVertexWithUV(this.absoluteX + this.width, this.absoluteY, 0, backgroundRightU, 0);
	tessellator.addVertexWithUV(this.absoluteX, this.absoluteY, 0, backgroundLeftU, 0);
	tessellator.draw();
	
	float progress = getProgress();
	// Draw the bar itself, on top of the background
	if(progress > 0.0) {
		int barHeight = Math.max(1, (int)Math.floor(progress * barAbsoluteMaxHeight));
		int barMinX = this.absoluteX + 1;
		int barMaxX = this.absoluteX + this.width - 4;
		int barMinY = this.absoluteY + this.height - barHeight;
		int barMaxY = this.absoluteY + this.height - 1;
		
		this.drawProgressBar(tessellator, renderEngine, barMinX, barMaxX, barMinY, barMaxY, 1);
	}
	
	if(drawGradationMarks()) {
		GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f);
		renderEngine.bindTexture(controlResource);
		tessellator.startDrawingQuads();
		tessellator.addVertexWithUV(this.absoluteX, this.absoluteY + this.height, 2, gradationLeftU, 1.0);
		tessellator.addVertexWithUV(this.absoluteX + this.width - 4, this.absoluteY + this.height, 2, gradationRightU, 1.0);
		tessellator.addVertexWithUV(this.absoluteX + this.width - 4, this.absoluteY, 2, gradationRightU, 0);
		tessellator.addVertexWithUV(this.absoluteX, this.absoluteY, 2, gradationLeftU, 0);
		tessellator.draw();
	}
}
 
Example 9
Source File: RenderLaser.java    From PneumaticCraft with GNU General Public License v3.0 5 votes vote down vote up
private void renderQuad(int color){
    Tessellator t = Tessellator.instance;
    t.startDrawingQuads();
    t.setColorOpaque_I(color);
    t.addVertexWithUV(-0.5, 0, 0, 0, 0);
    t.addVertexWithUV(-0.5, 1, 0, 0, 1);
    t.addVertexWithUV(0.5, 1, 0, 1, 1);
    t.addVertexWithUV(0.5, 0, 0, 1, 0);
    t.draw();
}
 
Example 10
Source File: ShowArmor.java    From ehacks-pro with GNU General Public License v3.0 5 votes vote down vote up
private void drawTexturedModalRect(int p_73729_1_, int p_73729_2_, int p_73729_3_, int p_73729_4_, int p_73729_5_, int p_73729_6_) {
    float f = 0.00390625F;
    float f1 = 0.00390625F;
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    tessellator.addVertexWithUV((p_73729_1_), (p_73729_2_ + p_73729_6_), 300f, ((p_73729_3_) * f), ((p_73729_4_ + p_73729_6_) * f1));
    tessellator.addVertexWithUV((p_73729_1_ + p_73729_5_), (p_73729_2_ + p_73729_6_), 300f, ((p_73729_3_ + p_73729_5_) * f), ((p_73729_4_ + p_73729_6_) * f1));
    tessellator.addVertexWithUV((p_73729_1_ + p_73729_5_), (p_73729_2_), 300f, ((p_73729_3_ + p_73729_5_) * f), ((p_73729_4_) * f1));
    tessellator.addVertexWithUV((p_73729_1_), (p_73729_2_), 300f, ((p_73729_3_) * f), ((p_73729_4_) * f1));
    tessellator.draw();
}
 
Example 11
Source File: TileEntityEndRodRenderer.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
public static void renderRod(RenderBlocks renderer, Block block, int meta) {
	Tessellator tessellator = Tessellator.instance;

	double x = 7 / 16.0;
	double y = 0;
	double z = 7 / 16.0;
	renderer.setRenderBounds(0, 1 / 16F, 0, 2 / 16F, 1, 2 / 16F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();

	x = 4 / 16.0;
	y = 0;
	z = 4 / 16.0;
	renderer.setRenderBounds(2 / 16F, 0, 2 / 16F, 6 / 16F, 1 / 16F, 6 / 16F);
	tessellator.startDrawingQuads();
	tessellator.setNormal(0.0F, -1.0F, 0.0F);
	renderer.renderFaceYNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 0, meta));
	tessellator.setNormal(0.0F, 1.0F, 0.0F);
	renderer.renderFaceYPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 1, meta));
	y = -13 / 16.0;
	renderer.setRenderBounds(2 / 16F, 13 / 16F, 2 / 16F, 6 / 16F, 14 / 16F, 6 / 16F);
	tessellator.setNormal(0.0F, 0.0F, -1.0F);
	renderer.renderFaceZNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 2, meta));
	tessellator.setNormal(0.0F, 0.0F, 1.0F);
	renderer.renderFaceZPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 3, meta));
	tessellator.setNormal(-1.0F, 0.0F, 0.0F);
	renderer.renderFaceXNeg(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 4, meta));
	tessellator.setNormal(1.0F, 0.0F, 0.0F);
	renderer.renderFaceXPos(block, x, y, z, renderer.getBlockIconFromSideAndMetadata(block, 5, meta));
	tessellator.draw();
}
 
Example 12
Source File: MoCRenderShark.java    From mocreaturesdev with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void doRenderLiving(EntityLiving entityliving, double d, double d1, double d2, float f, float f1)
{
    MoCEntityShark entityshark = (MoCEntityShark) entityliving;
    super.doRenderLiving(entityshark, d, d1, d2, f, f1);
    boolean flag = MoCreatures.proxy.getDisplayPetName() && !(entityshark.getName()).isEmpty();
    boolean flag1 = MoCreatures.proxy.getDisplayPetHealth();
    boolean flag2 = MoCreatures.proxy.getDisplayPetIcons();
    if (entityshark.renderName())
    {
        float f2 = 1.6F;
        float f3 = 0.01666667F * f2;
        float f4 = entityshark.getDistanceToEntity(renderManager.livingPlayer);
        if (f4 < 16F)
        {
            String s = "";
            s = (new StringBuilder()).append(s).append(entityshark.getName()).toString();
            float f5 = 0.1F;
            FontRenderer fontrenderer = getFontRendererFromRenderManager();
            GL11.glPushMatrix();
            GL11.glTranslatef((float) d + 0.0F, (float) d1 + f5, (float) d2);
            GL11.glNormal3f(0.0F, 1.0F, 0.0F);
            GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
            GL11.glScalef(-f3, -f3, f3);
            GL11.glDisable(2896 /* GL_LIGHTING */);
            Tessellator tessellator = Tessellator.instance;
            byte byte0 = -50;
            if (flag1)
            {
                GL11.glDisable(3553 /* GL_TEXTURE_2D */);
                if (!flag)
                {
                    byte0 += 8;
                }
                tessellator.startDrawingQuads();
                // might break SSP
                float f6 = entityshark.getHealth();
                float f7 = entityshark.getMaxHealth();
                float f8 = f6 / f7;
                float f9 = 40F * f8;
                tessellator.setColorRGBA_F(0.7F, 0.0F, 0.0F, 1.0F);
                tessellator.addVertex(-20F + f9, -10 + byte0, 0.0D);
                tessellator.addVertex(-20F + f9, -6 + byte0, 0.0D);
                tessellator.addVertex(20D, -6 + byte0, 0.0D);
                tessellator.addVertex(20D, -10 + byte0, 0.0D);
                tessellator.setColorRGBA_F(0.0F, 0.7F, 0.0F, 1.0F);
                tessellator.addVertex(-20D, -10 + byte0, 0.0D);
                tessellator.addVertex(-20D, -6 + byte0, 0.0D);
                tessellator.addVertex(f9 - 20F, -6 + byte0, 0.0D);
                tessellator.addVertex(f9 - 20F, -10 + byte0, 0.0D);
                tessellator.draw();
                GL11.glEnable(3553 /* GL_TEXTURE_2D */);
            }
            if (flag)
            {
                GL11.glDepthMask(false);
                GL11.glDisable(2929 /* GL_DEPTH_TEST */);
                GL11.glEnable(3042 /* GL_BLEND */);
                GL11.glBlendFunc(770, 771);
                GL11.glDisable(3553 /* GL_TEXTURE_2D */);
                tessellator.startDrawingQuads();
                int i = fontrenderer.getStringWidth(s) / 2;
                tessellator.setColorRGBA_F(0.0F, 0.0F, 0.0F, 0.25F);
                tessellator.addVertex(-i - 1, -1 + byte0, 0.0D);
                tessellator.addVertex(-i - 1, 8 + byte0, 0.0D);
                tessellator.addVertex(i + 1, 8 + byte0, 0.0D);
                tessellator.addVertex(i + 1, -1 + byte0, 0.0D);
                tessellator.draw();
                GL11.glEnable(3553 /* GL_TEXTURE_2D */);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, byte0, 0x20ffffff);
                GL11.glEnable(2929 /* GL_DEPTH_TEST */);
                GL11.glDepthMask(true);
                fontrenderer.drawString(s, -fontrenderer.getStringWidth(s) / 2, byte0, -1);
                GL11.glDisable(3042 /* GL_BLEND */);
                GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
            }
            GL11.glEnable(2896 /* GL_LIGHTING */);
            GL11.glPopMatrix();
        }
    }
}
 
Example 13
Source File: GLUtils.java    From ehacks-pro with GNU General Public License v3.0 4 votes vote down vote up
public static void drawBoundingBox(AltAxisAlignedBB axisalignedbb) {

        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.draw();
        tessellator.startDrawingQuads();
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.minX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.minZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.maxY, axisalignedbb.maxZ);
        tessellator.addVertex(axisalignedbb.maxX, axisalignedbb.minY, axisalignedbb.maxZ);
        tessellator.draw();
    }
 
Example 14
Source File: FXVortex.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void render(Tessellator tessellator, float pTicks) {
    float arX = ActiveRenderInfo.rotationX;
    float arXZ = ActiveRenderInfo.rotationXZ;
    float arZ = ActiveRenderInfo.rotationZ;
    float arYZ = ActiveRenderInfo.rotationYZ;
    float arXY = ActiveRenderInfo.rotationXY;

    GL11.glPushMatrix();
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    float agescale = (float) (ClientHandler.ticks % 800) / 400F;
    if(agescale >= 1.0F) agescale = 2 - agescale;
    float size = 0.2F + 0.1F * agescale;
    if(parent != null) {
        size += size * (((float) parent.getSizeStage()) * 0.04F);
    }

    float anglePerc = (float) (ClientHandler.ticks % 300) / 300F;
    float angle = RAD - RAD * anglePerc;

    Vector3 iV = MiscUtils.interpolateEntityPosition(Minecraft.getMinecraft().renderViewEntity, pTicks);
    if(parent != null && parent.getSizeStage() > 4) {
        float mult = 0.001F * (parent.getSizeStage() - 4F);
        Vector3 shake = new Vector3(
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1));
        iV.add(shake);
    }

    GL11.glTranslated(-iV.getX(), -iV.getY(), -iV.getZ());

    UtilsFX.bindTexture(TC_VORTEX_TEXTURE);

    tessellator.startDrawingQuads();
    tessellator.setBrightness(220);
    tessellator.setColorRGBA_F(1F, 1F, 1F, 1F);

    Vec3 v1 = Vec3.createVectorHelper(-arX * size - arYZ * size, -arXZ * size, -arZ * size - arXY * size);
    Vec3 v2 = Vec3.createVectorHelper(-arX * size + arYZ * size, arXZ * size, -arZ * size + arXY * size);
    Vec3 v3 = Vec3.createVectorHelper(arX * size + arYZ * size, arXZ * size, arZ * size + arXY * size);
    Vec3 v4 = Vec3.createVectorHelper(arX * size - arYZ * size, -arXZ * size, arZ * size - arXY * size);
    if (angle != 0.0F) {
        Vec3 pvec = Vec3.createVectorHelper(iV.getX(), iV.getY(), iV.getZ());
        Vec3 tvec = Vec3.createVectorHelper(x, y, z);
        Vec3 qvec = pvec.subtract(tvec).normalize();
        QuadHelper.setAxis(qvec, angle).rotate(v1);
        QuadHelper.setAxis(qvec, angle).rotate(v2);
        QuadHelper.setAxis(qvec, angle).rotate(v3);
        QuadHelper.setAxis(qvec, angle).rotate(v4);
    }
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    tessellator.addVertexWithUV(x + v1.xCoord, y + v1.yCoord, z + v1.zCoord, 0, 1);
    tessellator.addVertexWithUV(x + v2.xCoord, y + v2.yCoord, z + v2.zCoord, 1, 1);
    tessellator.addVertexWithUV(x + v3.xCoord, y + v3.yCoord, z + v3.zCoord, 1, 0);
    tessellator.addVertexWithUV(x + v4.xCoord, y + v4.yCoord, z + v4.zCoord, 0, 0);
    tessellator.draw();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
    GL11.glPopMatrix();
}
 
Example 15
Source File: TileEntityNewBeaconRenderer.java    From Et-Futurum with The Unlicense 4 votes vote down vote up
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTickTime) {
	TileEntityNewBeacon beacon = (TileEntityNewBeacon) tile;

	float f1 = beacon.func_146002_i();
	OpenGLHelper.alphaFunc(GL11.GL_GREATER, 0.1F);

	if (f1 > 0.0F) {
		Tessellator tessellator = Tessellator.instance;
		List<BeamSegment> list = beacon.getSegments();
		int j = 0;

		for (int i = 0; i < list.size(); i++) {
			BeamSegment beamsegment = list.get(i);
			int l = j + beamsegment.func_177264_c();
			bindTexture(BEAM_TEXTURE);
			GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_S, 10497.0F);
			GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_WRAP_T, 10497.0F);
			OpenGLHelper.disableLighting();
			OpenGLHelper.disableCull();
			OpenGLHelper.disableBlend();
			OpenGLHelper.depthMask(true);
			OpenGlHelper.glBlendFunc(770, 1, 1, 0);
			float f2 = tile.getWorldObj().getTotalWorldTime() + partialTickTime;
			float f3 = -f2 * 0.2F - MathHelper.floor_float(-f2 * 0.1F);
			double d3 = f2 * 0.025D * -1.5D;
			tessellator.startDrawingQuads();
			double d4 = 0.2D;
			double d5 = 0.5D + Math.cos(d3 + 2.356194490192345D) * d4;
			double d6 = 0.5D + Math.sin(d3 + 2.356194490192345D) * d4;
			double d7 = 0.5D + Math.cos(d3 + Math.PI / 4D) * d4;
			double d8 = 0.5D + Math.sin(d3 + Math.PI / 4D) * d4;
			double d9 = 0.5D + Math.cos(d3 + 3.9269908169872414D) * d4;
			double d10 = 0.5D + Math.sin(d3 + 3.9269908169872414D) * d4;
			double d11 = 0.5D + Math.cos(d3 + 5.497787143782138D) * d4;
			double d12 = 0.5D + Math.sin(d3 + 5.497787143782138D) * d4;
			double d13 = 0.0D;
			double d14 = 1.0D;
			double d15 = -1.0F + f3;
			double d16 = beamsegment.func_177264_c() * f1 * (0.5D / d4) + d15;
			tessellator.setColorRGBA_F(beamsegment.func_177263_b()[0], beamsegment.func_177263_b()[1], beamsegment.func_177263_b()[2], 0.125F);
			tessellator.addVertexWithUV(x + d5, y + l, z + d6, d14, d16);
			tessellator.addVertexWithUV(x + d5, y + j, z + d6, d14, d15);
			tessellator.addVertexWithUV(x + d7, y + j, z + d8, d13, d15);
			tessellator.addVertexWithUV(x + d7, y + l, z + d8, d13, d16);
			tessellator.addVertexWithUV(x + d11, y + l, z + d12, d14, d16);
			tessellator.addVertexWithUV(x + d11, y + j, z + d12, d14, d15);
			tessellator.addVertexWithUV(x + d9, y + j, z + d10, d13, d15);
			tessellator.addVertexWithUV(x + d9, y + l, z + d10, d13, d16);
			tessellator.addVertexWithUV(x + d7, y + l, z + d8, d14, d16);
			tessellator.addVertexWithUV(x + d7, y + j, z + d8, d14, d15);
			tessellator.addVertexWithUV(x + d11, y + j, z + d12, d13, d15);
			tessellator.addVertexWithUV(x + d11, y + l, z + d12, d13, d16);
			tessellator.addVertexWithUV(x + d9, y + l, z + d10, d14, d16);
			tessellator.addVertexWithUV(x + d9, y + j, z + d10, d14, d15);
			tessellator.addVertexWithUV(x + d5, y + j, z + d6, d13, d15);
			tessellator.addVertexWithUV(x + d5, y + l, z + d6, d13, d16);
			tessellator.draw();
			OpenGLHelper.enableBlend();
			OpenGlHelper.glBlendFunc(770, 771, 1, 0);
			OpenGLHelper.depthMask(false);
			tessellator.startDrawingQuads();
			tessellator.setColorRGBA_F(beamsegment.func_177263_b()[0], beamsegment.func_177263_b()[1], beamsegment.func_177263_b()[2], 0.125F);
			d3 = 0.2D;
			d4 = 0.2D;
			d5 = 0.8D;
			d6 = 0.2D;
			d7 = 0.2D;
			d8 = 0.8D;
			d9 = 0.8D;
			d10 = 0.8D;
			d11 = 0.0D;
			d12 = 1.0D;
			d13 = -1.0F + f3;
			d14 = beamsegment.func_177264_c() * f1 + d13;
			tessellator.addVertexWithUV(x + d3, y + l, z + d4, d12, d14);
			tessellator.addVertexWithUV(x + d3, y + j, z + d4, d12, d13);
			tessellator.addVertexWithUV(x + d5, y + j, z + d6, d11, d13);
			tessellator.addVertexWithUV(x + d5, y + l, z + d6, d11, d14);
			tessellator.addVertexWithUV(x + d9, y + l, z + d10, d12, d14);
			tessellator.addVertexWithUV(x + d9, y + j, z + d10, d12, d13);
			tessellator.addVertexWithUV(x + d7, y + j, z + d8, d11, d13);
			tessellator.addVertexWithUV(x + d7, y + l, z + d8, d11, d14);
			tessellator.addVertexWithUV(x + d5, y + l, z + d6, d12, d14);
			tessellator.addVertexWithUV(x + d5, y + j, z + d6, d12, d13);
			tessellator.addVertexWithUV(x + d9, y + j, z + d10, d11, d13);
			tessellator.addVertexWithUV(x + d9, y + l, z + d10, d11, d14);
			tessellator.addVertexWithUV(x + d7, y + l, z + d8, d12, d14);
			tessellator.addVertexWithUV(x + d7, y + j, z + d8, d12, d13);
			tessellator.addVertexWithUV(x + d3, y + j, z + d4, d11, d13);
			tessellator.addVertexWithUV(x + d3, y + l, z + d4, d11, d14);
			tessellator.draw();
			OpenGLHelper.enableLighting();
			OpenGLHelper.enableTexture2D();
			OpenGLHelper.depthMask(true);
			j = l;
		}
	}
}
 
Example 16
Source File: AntibuilderParticle.java    From Artifacts with MIT License 4 votes vote down vote up
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
	par1Tessellator.draw();
	GL11.glPushMatrix();

	ParticleUtils.bindTexture("textures/items/radarparticle.png");

	//GL11.glDepthMask(false);
	GL11.glDepthFunc(GL11.GL_ALWAYS);
	//GL11.glEnable(3042);
	//GL11.glBlendFunc(770, 1);
	GL11.glEnable(GL11.GL_BLEND);
	GL11.glBlendFunc(GL11.GL_ONE_MINUS_SRC_ALPHA, GL11.GL_SRC_ALPHA);
	GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
	//GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
	par1Tessellator.startDrawingQuads();
	/*int bright = -1;
	try {
		bright = ReflectionHelper.getPrivateValue(Tessellator.class, par1Tessellator, new String[] { "brightness", "b", "field_78401_l" });
	}
	catch (Exception e) {
		System.out.println("Bad reflection");
	}*/
	
	par1Tessellator.setBrightness(255);
	
	float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F;

	if (var8 < 0.0F)
	{
		var8 = 0.0F;
	}

	if (var8 > 1.0F)
	{
		var8 = 1.0F;
	}

	this.particleScale = this.reddustParticleScale;// * var8;
	//replace this
	//super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
	
	//Minecraft.getMinecraft().renderEngine.bindTexture(rl);

	float f6 = (float)this.particleTextureIndexX / 32.0F;
	float f7 = f6 + 0.029375F;
	//              0.0624375
	//              0.0625
	float f8 = (float)this.particleTextureIndexY / 32.0F;
	float f9 = f8 + 0.029375F;
	float f10 = 0.15F;// * this.particleScale;

	float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
	float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
	float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
	float f14 = 1.0F;
	//par1Tessellator.draw();
	//GL11.glDepthFunc(GL11.GL_ALWAYS);
	//par1Tessellator.startDrawingQuads();
	//par1Tessellator.setBrightness(255);
	//GL11.glDisable(GL11.GL_DEPTH_TEST);
	float al = 0.0F;
	EntityPlayer player = (EntityPlayer) this.worldObj.findNearestEntityWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(this.posX - 16, this.posY-16, this.posZ-16, this.posX+16, this.posY+16, this.posZ+16), this);
	if(player != null) {
		double d = player.getDistanceToEntity(this);
		if(d < 6 && d > 1) {
			al = (float)(d / 8D);
		}
		else if(d > 1)
			al = 6F / 8F;
	}/**/
	par1Tessellator.setColorRGBA_F(this.particleRed * f14 - al/2, this.particleGreen * f14, this.particleBlue * f14 + al, 0.05F);
	par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
	par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
	par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
	par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
	par1Tessellator.draw();
	//GL11.glDepthFunc(GL11.GL_LEQUAL);
	//par1Tessellator.startDrawingQuads();
	//rl = new ResourceLocation("textures/particle/particles.png");
	//Minecraft.getMinecraft().renderEngine.bindTexture(rl2);
	//GL11.glEnable(GL11.GL_DEPTH_TEST);

	GL11.glDepthFunc(GL11.GL_LEQUAL);
	GL11.glDisable(GL11.GL_BLEND);
	GL11.glPopMatrix();
	Minecraft.getMinecraft().renderEngine.bindTexture(ParticleUtils.getParticleTexture());
	
	par1Tessellator.startDrawingQuads();
	par1Tessellator.setBrightness(0);
}
 
Example 17
Source File: RotorSpecialRenderer.java    From BigReactors with MIT License 4 votes vote down vote up
int generateRotor(RotorInfo rotorInfo) {
	int list = GLAllocation.generateDisplayLists(1);
	GL11.glNewList(list,  GL11.GL_COMPILE);

	ForgeDirection rotorDir = rotorInfo.rotorDirection;
	int rotorLen = rotorInfo.rotorLength;
	CoordTriplet currentRotorCoord = new CoordTriplet(0,0,0);

	Tessellator tessellator = Tessellator.instance;
	if(rotorDir.offsetX != 0) {
		tessellator.setTranslation(0, -0.5, -0.5);
	}
	else if(rotorDir.offsetY != 0) {
		tessellator.setTranslation(-0.5, 0, -0.5);
	}
	else {
		tessellator.setTranslation(-0.5, -0.5, 0);
	}

	tessellator.startDrawingQuads();
	tessellator.setBrightness(256);
	tessellator.setColorOpaque(255, 255, 255);
	
	CoordTriplet bladeCoord = new CoordTriplet(0,0,0);
	int rotorIdx = 0;
	boolean[] hasBlades = new boolean[4];
	ForgeDirection[] bladeDirs = StaticUtils.neighborsBySide[rotorInfo.rotorDirection.ordinal()];

	while(rotorIdx < rotorInfo.rotorLength) {
		
		for(int i = 0; i < hasBlades.length; i++) {
			hasBlades[i] = rotorInfo.bladeLengths[rotorIdx][i] > 0;
		}

		RotorSimpleRenderer.renderRotorShaft(BigReactors.blockTurbineRotorPart, renderBlocks, BlockTurbineRotorPart.METADATA_SHAFT, rotorDir, hasBlades, currentRotorCoord.x, currentRotorCoord.y, currentRotorCoord.z, false);
		for(int bladeIdx = 0; bladeIdx < bladeDirs.length; bladeIdx++) {
			bladeCoord.copy(currentRotorCoord);
			int bladeLen = 0;
			bladeCoord.translate(bladeDirs[bladeIdx]);
			while(bladeLen < rotorInfo.bladeLengths[rotorIdx][bladeIdx]) {
				RotorSimpleRenderer.renderBlade(renderBlocks, bladeCoord.x, bladeCoord.y, bladeCoord.z, BigReactors.blockTurbineRotorPart, BlockTurbineRotorPart.METADATA_BLADE, rotorInfo.rotorDirection);
				bladeLen++;
				bladeCoord.translate(bladeDirs[bladeIdx]);
			}
		}
		rotorIdx++;
		currentRotorCoord.translate(rotorDir);
	}
	tessellator.setTranslation(0, 0, 0);
	tessellator.draw();
	
	GL11.glEndList();
	return list;
}
 
Example 18
Source File: RenderCustomEndPortal.java    From EnderStorage with MIT License 4 votes vote down vote up
public void render(double posX, double posY, double posZ, float frame, double playerX, double playerY, double playerZ, TextureManager r)
{
    if(r == null)return;
    GL11.glDisable(GL11.GL_LIGHTING);
    Random random = new Random(31100L);
    for(int i = 0; i < 16; i++)
    {
        GL11.glPushMatrix();
        float f5 = 16 - i;
        float f6 = 0.0625F;
        float f7 = 1.0F / (f5 + 1.0F);
        if(i == 0)
        {
            r.bindTexture(end_skyTex);
            f7 = 0.1F;
            f5 = 65F;
            f6 = 0.125F;
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(770, 771);
        }
        if(i == 1)
        {
            r.bindTexture(end_portalTex);
            GL11.glEnable(GL11.GL_BLEND);
            GL11.glBlendFunc(1, 1);
            f6 = 0.5F;
        }
        float f8 = (float)(-(posY + surfaceY));
        float f9 = f8 + ActiveRenderInfo.objectY;
        float f10 = f8 + f5 + ActiveRenderInfo.objectY;
        float f11 = f9 / f10;
        f11 = (float)(posY + surfaceY) + f11;
        GL11.glTranslated(playerX, f11, playerZ);
        GL11.glTexGeni(GL11.GL_S, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
        GL11.glTexGeni(GL11.GL_T, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
        GL11.glTexGeni(GL11.GL_R, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_OBJECT_LINEAR);
        GL11.glTexGeni(GL11.GL_Q, GL11.GL_TEXTURE_GEN_MODE, GL11.GL_EYE_LINEAR);
        GL11.glTexGen(GL11.GL_S, GL11.GL_OBJECT_PLANE, func_40447_a(1.0F, 0.0F, 0.0F, 0.0F));
        GL11.glTexGen(GL11.GL_T, GL11.GL_OBJECT_PLANE, func_40447_a(0.0F, 0.0F, 1.0F, 0.0F));
        GL11.glTexGen(GL11.GL_R, GL11.GL_OBJECT_PLANE, func_40447_a(0.0F, 0.0F, 0.0F, 1.0F));
        GL11.glTexGen(GL11.GL_Q, GL11.GL_EYE_PLANE, func_40447_a(0.0F, 1.0F, 0.0F, 0.0F));
        GL11.glEnable(GL11.GL_TEXTURE_GEN_S);
        GL11.glEnable(GL11.GL_TEXTURE_GEN_T);
        GL11.glEnable(GL11.GL_TEXTURE_GEN_R);
        GL11.glEnable(GL11.GL_TEXTURE_GEN_Q);
        GL11.glPopMatrix();
        GL11.glMatrixMode(GL11.GL_TEXTURE);
        GL11.glPushMatrix();
        GL11.glLoadIdentity();
        GL11.glTranslatef(0.0F, System.currentTimeMillis() % 0xaae60L / 700000F, 0.0F);
        GL11.glScalef(f6, f6, f6);
        GL11.glTranslatef(0.5F, 0.5F, 0.0F);
        GL11.glRotatef((i * i * 4321 + i * 9) * 2.0F, 0.0F, 0.0F, 1.0F);
        GL11.glTranslatef(-0.5F, -0.5F, 0.0F);
        GL11.glTranslated(-playerX, -playerZ, -playerY);
        f9 = f8 + ActiveRenderInfo.objectY;
        GL11.glTranslated((ActiveRenderInfo.objectX * f5) / f9, (ActiveRenderInfo.objectZ * f5) / f9, -playerY + 20);
        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();
        f11 = random.nextFloat() * 0.5F + 0.1F;
        float f12 = random.nextFloat() * 0.5F + 0.4F;
        float f13 = random.nextFloat() * 0.5F + 0.5F;
        if(i == 0)
        {
            f11 = f12 = f13 = 1.0F;
        }
        tessellator.setColorRGBA_F(f11 * f7, f12 * f7, f13 * f7, 1.0F);
        
        tessellator.addVertex(posX + surfaceX1, posY + surfaceY, posZ + surfaceZ1);
        tessellator.addVertex(posX + surfaceX1, posY + surfaceY, posZ + surfaceZ2);
        tessellator.addVertex(posX + surfaceX2, posY + surfaceY, posZ + surfaceZ2);
        tessellator.addVertex(posX + surfaceX2, posY + surfaceY, posZ + surfaceZ1);
        
        tessellator.draw();
        GL11.glPopMatrix();
        GL11.glMatrixMode(ARBVertexBlend.GL_MODELVIEW0_ARB);
    }

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_S);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_T);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_R);
    GL11.glDisable(GL11.GL_TEXTURE_GEN_Q);
    GL11.glEnable(GL11.GL_LIGHTING);
}
 
Example 19
Source File: RadarParticle.java    From Artifacts with MIT License 4 votes vote down vote up
public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
{
	par1Tessellator.draw();
	GL11.glPushMatrix();

	ParticleUtils.bindTexture("textures/items/radarparticle.png");

	//GL11.glDepthMask(false);
	GL11.glDepthFunc(GL11.GL_ALWAYS);
	//GL11.glEnable(3042);
	//GL11.glBlendFunc(770, 1);

	GL11.glColor4f(1.0F, 1.0F, 1.0F, this.particleAlpha);
	par1Tessellator.startDrawingQuads();
	/*int bright = -1;
	try {
		bright = ReflectionHelper.getPrivateValue(Tessellator.class, par1Tessellator, new String[] { "brightness", "b", "field_78401_l" });
	}
	catch (Exception e) {
		System.out.println("Bad reflection");
	}*/
	
	par1Tessellator.setBrightness(255);
	
	float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F;

	if (var8 < 0.0F)
	{
		var8 = 0.0F;
	}

	if (var8 > 1.0F)
	{
		var8 = 1.0F;
	}

	this.particleScale = this.reddustParticleScale;// * var8;
	//replace this
	//super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
	
	//Minecraft.getMinecraft().renderEngine.bindTexture(rl);

	float f6 = (float)this.particleTextureIndexX / 16.0F;
	float f7 = f6 + 0.0624375F;
	float f8 = (float)this.particleTextureIndexY / 16.0F;
	float f9 = f8 + 0.0624375F;
	float f10 = 0.3F;// * this.particleScale;

	float f11 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
	float f12 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
	float f13 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
	float f14 = 1.0F;
	//par1Tessellator.draw();
	//GL11.glDepthFunc(GL11.GL_ALWAYS);
	//par1Tessellator.startDrawingQuads();
	//par1Tessellator.setBrightness(255);
	//GL11.glDisable(GL11.GL_DEPTH_TEST);
	par1Tessellator.setColorRGBA_F(this.particleRed * f14, this.particleGreen * f14, this.particleBlue * f14, this.particleAlpha);
	par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 - par5 * f10 - par7 * f10), (double)f7, (double)f9);
	par1Tessellator.addVertexWithUV((double)(f11 - par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 - par5 * f10 + par7 * f10), (double)f7, (double)f8);
	par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 + par6 * f10), (double)(f12 + par4 * f10), (double)(f13 + par5 * f10 + par7 * f10), (double)f6, (double)f8);
	par1Tessellator.addVertexWithUV((double)(f11 + par3 * f10 - par6 * f10), (double)(f12 - par4 * f10), (double)(f13 + par5 * f10 - par7 * f10), (double)f6, (double)f9);
	par1Tessellator.draw();
	//GL11.glDepthFunc(GL11.GL_LEQUAL);
	//par1Tessellator.startDrawingQuads();
	//rl = new ResourceLocation("textures/particle/particles.png");
	//Minecraft.getMinecraft().renderEngine.bindTexture(rl2);
	//GL11.glEnable(GL11.GL_DEPTH_TEST);

	GL11.glDepthFunc(GL11.GL_LEQUAL);
	GL11.glPopMatrix();
	Minecraft.getMinecraft().renderEngine.bindTexture(ParticleUtils.getParticleTexture());
	
	par1Tessellator.startDrawingQuads();
	par1Tessellator.setBrightness(0);
}
 
Example 20
Source File: RenderMotor.java    From Framez with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

    Tessellator t = Tessellator.instance;

    boolean blend = GL11.glGetBoolean(GL11.GL_BLEND);
    boolean alpha = GL11.glGetBoolean(GL11.GL_ALPHA_TEST);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_ALPHA_TEST);

    GL11.glPushMatrix();
    {
        if (type == ItemRenderType.INVENTORY)
            GL11.glTranslated(0, -0.0625, 0);
        if (type == ItemRenderType.ENTITY)
            GL11.glTranslated(-0.5, -0.45, -0.5);

        t.startDrawingQuads();

        RenderHelper renderer = RenderHelper.instance;
        renderer.fullReset();

        IIcon border = IconSupplier.motor_border;
        IIcon center = IconSupplier.motor_center;

        renderer.renderBox(new Vec3dCube(0, 0, 0, 1, 1, 1), border);

        renderer.setRenderFromInside(true);
        {
            renderer.renderBox(new Vec3dCube(0, 2 / 16D, 2 / 16D, 1, 14 / 16D, 14 / 16D), border);
            renderer.renderBox(new Vec3dCube(2 / 16D, 0, 2 / 16D, 14 / 16D, 1, 14 / 16D), border);
            renderer.renderBox(new Vec3dCube(2 / 16D, 2 / 16D, 0, 14 / 16D, 14 / 16D, 1), border);
        }
        renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), center);
        renderer.setRenderFromInside(false);
        renderer.renderBox(new Vec3dCube(1 / 16D, 1 / 16D, 1 / 16D, 15 / 16D, 15 / 16D, 15 / 16D), center);

        t.draw();
    }
    GL11.glPopMatrix();

    if (!blend)
        GL11.glDisable(GL11.GL_BLEND);
    if (!alpha)
        GL11.glDisable(GL11.GL_ALPHA_TEST);
}