@Override protected void renderModel( EntityDragonMinion par1EntityDragonMinion, float par2, float par3, float par4, float par5, float par6, float par7) { bindEntityTexture(par1EntityDragonMinion); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7); GL11.glDisable(GL11.GL_BLEND); if (par1EntityDragonMinion.hurtTime > 0) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); mainModel.render(par1EntityDragonMinion, par2, par3, par4, par5, par6, par7); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthFunc(GL11.GL_LEQUAL); } }
private void renderVignette(float f, int i, int j) { f = 1.0F - f; if (f < 0.0F) { f = 0.0F; } if (f > 1.0F) { f = 1.0F; } prevVignetteBrightness += (double) (f - prevVignetteBrightness) * 0.01D; GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(false); GL11.glBlendFunc(0, 769); GL11.glColor4f(prevVignetteBrightness, prevVignetteBrightness, prevVignetteBrightness, 1.0F); GL11.glBindTexture( 3553 /*GL_TEXTURE_2D*/, mc.renderEngine.getTexture("%blur%/misc/vignette.png")); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0.0D, j, -90D, 0.0D, 1.0D); tessellator.addVertexWithUV(i, j, -90D, 1.0D, 1.0D); tessellator.addVertexWithUV(i, 0.0D, -90D, 1.0D, 0.0D); tessellator.addVertexWithUV(0.0D, 0.0D, -90D, 0.0D, 0.0D); tessellator.draw(); GL11.glDepthMask(true); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glBlendFunc(770, 771); }
private void renderGlint(int par1, int par2, int par3, int par4, int par5) { for (int j1 = 0; j1 < 2; ++j1) { if (j1 == 0) { GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); } if (j1 == 1) { GL11.glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE); } float f = 0.00390625F; float f1 = 0.00390625F; float f2 = (float) (Minecraft.getSystemTime() % (long) (3000 + j1 * 1873)) / (3000.0F + (float) (j1 * 1873)) * 256.0F; float f3 = 0.0F; Tessellator tessellator = Tessellator.instance; float f4 = 4.0F; if (j1 == 1) { f4 = -1.0F; } tessellator.startDrawingQuads(); tessellator.addVertexWithUV( (double) (par2 + 0), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); tessellator.addVertexWithUV( (double) (par2 + par4), (double) (par3 + par5), (double) this.zLevel, (double) ((f2 + (float) par4 + (float) par5 * f4) * f), (double) ((f3 + (float) par5) * f1)); tessellator.addVertexWithUV( (double) (par2 + par4), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + (float) par4) * f), (double) ((f3 + 0.0F) * f1)); tessellator.addVertexWithUV( (double) (par2 + 0), (double) (par3 + 0), (double) this.zLevel, (double) ((f2 + 0.0F) * f), (double) ((f3 + 0.0F) * f1)); tessellator.draw(); } }
public void doRender( EntityTimeDisruption entity, double par2, double par3, double par4, float par5, float par6) { float f = -0.125F; float f1 = 0.025F; GL11.glPushMatrix(); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glTranslatef((float) par2, (float) par3 + f, (float) par4); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.85F, 0.85F, 0.85F); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); this.bindTexture(this.getEntityTexture(entity)); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glLoadIdentity(); float f2 = MathHelper.cos(f1 * 0.15F) * 0.56F; float f3 = f1 * 0.02F; GL11.glTranslatef(f2, f3, 0.0F); GL11.glEnable(GL11.GL_BLEND); GL11.glColor4f(1.1F, 1.6F, 1.1F, 0.35F); GL11.glDisable(GL11.GL_LIGHTING); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glTranslatef(0.0F, 0.0F, 0.0F); GL11.glMatrixMode(GL11.GL_TEXTURE); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_BLEND); this.model.render(entity, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, f1); GL11.glDepthMask(true); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL12.GL_RESCALE_NORMAL); OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit); GL11.glEnable(GL11.GL_TEXTURE_2D); OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glPopMatrix(); }
/** Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. */ protected int renderGlow(EntityDragon par1EntityDragon, int par2, float par3) { if (par2 == 1) { GL11.glDepthFunc(GL11.GL_LEQUAL); } if (par2 != 0) { return -1; } else { loadTexture("/mob/enderdragon/ender_eyes.png"); float f = 1.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthFunc(GL11.GL_EQUAL); int i = 61680; int j = i % 0x10000; int k = i / 0x10000; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_LIGHTING); GL11.glColor4f(1.0F, 1.0F, 1.0F, f); return 1; } }
public static void drawFace( double x, double y, double z, double x2, double y2, double z2, float red, float green, float blue, float lineWidth) { Tessellator var12 = Tessellator.instance; GL11.glPushMatrix(); GL11.glLineWidth(lineWidth); GL11.glDisable(3553); var12.startDrawing(3); var12.setColorRGBA_F(red, green, blue, 1); var12.addVertex(x, y, z); var12.addVertex(x2, y, z2); var12.addVertex(x2, y2, z2); var12.addVertex(x, y2, z2); // var12.addVertex(x2, y2, z2); var12.draw(); GL11.glBlendFunc(770, 771); GL11.glDisable(32826); GL11.glEnable(3553); GL11.glPopMatrix(); }
/** Renders the dragon model. Called by renderModel. */ protected void renderDragonModel( EntityDragonBoss par1EntityDragonBoss, float par2, float par3, float par4, float par5, float par6, float par7) { if (par1EntityDragonBoss.deathTicks > 0) { float f6 = par1EntityDragonBoss.deathTicks / 200.0F; GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, f6); bindTexture(field_110842_f); mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDepthFunc(GL11.GL_EQUAL); } bindEntityTexture(par1EntityDragonBoss); mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7); if (par1EntityDragonBoss.hurtTime > 0) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); mainModel.render(par1EntityDragonBoss, par2, par3, par4, par5, par6, par7); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthFunc(GL11.GL_LEQUAL); } }
private void initGL() { try { Display.setDisplayMode(new DisplayMode(GS.FRAMEWIDTH, GS.FRAMEHEIGHT)); Display.setFullscreen(true); Display.create(); Display.setVSyncEnabled(true); } catch (LWJGLException e) { e.printStackTrace(); Display.destroy(); System.exit(1); } GL11.glEnable(GL11.GL_TEXTURE_2D); // GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); GL11.glClearDepth(1.0f); // GL11.glEnable(GL11.GL_DEPTH_TEST); // GL11.glDepthFunc(GL11.GL_ADD); //Wenn nicht auskommentiert führt es zu Exception GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glViewport(0, 0, GS.FRAMEWIDTH, GS.FRAMEHEIGHT); GL11.glOrtho(0, GS.FRAMEWIDTH, GS.FRAMEHEIGHT, 0, 0, 128); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // GL11.glBlendEquation( BLENDING_EQUATIONS[blendingEquationIndex]); GL11.glShadeModel(GL11.GL_FLAT); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0); GL11.glCullFace(GL11.GL_BACK); glEnable(GL_CULL_FACE); glCullFace(GL_BACK); GL11.glLoadIdentity(); }
public void func_73863_a(int p_73863_1_, int p_73863_2_, float p_73863_3_) { this.func_73986_b(p_73863_1_, p_73863_2_, p_73863_3_); Tessellator var4 = Tessellator.field_78398_a; short var5 = 274; int var6 = this.field_73880_f / 2 - var5 / 2; int var7 = this.field_73881_g + 50; float var8 = -((float) this.field_73990_a + p_73863_3_) * this.field_73987_d; GL11.glPushMatrix(); GL11.glTranslatef(0.0F, var8, 0.0F); this.field_73882_e.func_110434_K().func_110577_a(field_110362_a); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.func_73729_b(var6, var7, 0, 0, 155, 44); this.func_73729_b(var6 + 155, var7, 0, 45, 155, 44); var4.func_78378_d(16777215); int var9 = var7 + 200; int var10; for (var10 = 0; var10 < this.field_73988_b.size(); ++var10) { if (var10 == this.field_73988_b.size() - 1) { float var11 = (float) var9 + var8 - (float) (this.field_73881_g / 2 - 6); if (var11 < 0.0F) { GL11.glTranslatef(0.0F, -var11, 0.0F); } } if ((float) var9 + var8 + 12.0F + 8.0F > 0.0F && (float) var9 + var8 < (float) this.field_73881_g) { String var12 = (String) this.field_73988_b.get(var10); if (var12.startsWith("[C]")) { this.field_73886_k.func_78261_a( var12.substring(3), var6 + (var5 - this.field_73886_k.func_78256_a(var12.substring(3))) / 2, var9, 16777215); } else { this.field_73886_k.field_78289_c.setSeed( (long) var10 * 4238972211L + (long) (this.field_73990_a / 4)); this.field_73886_k.func_78261_a(var12, var6, var9, 16777215); } } var9 += 12; } GL11.glPopMatrix(); this.field_73882_e.func_110434_K().func_110577_a(field_110361_b); GL11.glEnable(3042); GL11.glBlendFunc(0, 769); var4.func_78382_b(); var4.func_78369_a(1.0F, 1.0F, 1.0F, 1.0F); var10 = this.field_73880_f; int var13 = this.field_73881_g; var4.func_78374_a(0.0D, (double) var13, (double) this.field_73735_i, 0.0D, 1.0D); var4.func_78374_a((double) var10, (double) var13, (double) this.field_73735_i, 1.0D, 1.0D); var4.func_78374_a((double) var10, 0.0D, (double) this.field_73735_i, 1.0D, 0.0D); var4.func_78374_a(0.0D, 0.0D, (double) this.field_73735_i, 0.0D, 0.0D); var4.func_78381_a(); GL11.glDisable(3042); super.func_73863_a(p_73863_1_, p_73863_2_, p_73863_3_); }
/** Sets the spider's glowing eyes */ protected int setSpiderEyeBrightness(EntitySpider par1EntitySpider, int par2, float par3) { if (par2 != 0) { return -1; } else { this.loadTexture("/mob/spider_eyes.png"); float f1 = 1.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); if (par1EntitySpider.isInvisible()) { GL11.glDepthMask(false); } else { GL11.glDepthMask(true); } char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, (float) j / 1.0F, (float) k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, f1); return 1; } }
public static void renderLiquidOverlays(float partialTicks) { Minecraft minecraft = FMLClientHandler.instance().getClient(); if (ClientProxyCore.isInsideOfFluid(minecraft.thePlayer, GalacticraftCore.fluidOil)) { minecraft.getTextureManager().bindTexture(ClientProxyCore.underOilTexture); } else { return; } Tessellator tessellator = Tessellator.instance; float f1 = minecraft.thePlayer.getBrightness(partialTicks) / 3.0F; GL11.glColor4f(f1, f1, f1, 1.0F); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); float f2 = 4.0F; float f3 = -1.0F; float f4 = 1.0F; float f5 = -1.0F; float f6 = 1.0F; float f7 = -0.5F; float f8 = -minecraft.thePlayer.rotationYaw / 64.0F; float f9 = minecraft.thePlayer.rotationPitch / 64.0F; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(f3, f5, f7, f2 + f8, f2 + f9); tessellator.addVertexWithUV(f4, f5, f7, 0.0F + f8, f2 + f9); tessellator.addVertexWithUV(f4, f6, f7, 0.0F + f8, 0.0F + f9); tessellator.addVertexWithUV(f3, f6, f7, f2 + f8, 0.0F + f9); tessellator.draw(); GL11.glPopMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); }
@Override public void drawButton(Minecraft mc, int mx, int my) { if (this.visible) { ManualUtils.bindTexture(gui.texture); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.field_146123_n = mx >= this.xPosition && mx < (this.xPosition + this.width) && my >= this.yPosition && my < (this.yPosition + this.height); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); int u = type == 5 ? 46 : type == 4 || type == 6 ? 36 : (type < 2 ? 0 : type < 3 ? 16 : 26) + (type > 1 ? (10 - width) : type == 1 ? (16 - width) : 0); int v = 216 + (type == 0 ? 0 : type == 1 ? 10 : type == 2 ? (16 - height) : type == 3 ? 0 : type == 4 || type == 5 ? 10 : 0); if (field_146123_n) v += 20; this.drawTexturedModalRect(this.xPosition, this.yPosition, u, v, width, height); this.mouseDragged(mc, mx, my); } }
public static void initOrtho(int width, int height) { glEnable(GL_TEXTURE_2D); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); glEnable(GL_BLEND); // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); // glBlendFunc(GL11.GL_SRC_COLOR, GL11.GL_ONE_MINUS_CONSTANT_COLOR); // GL11.glDisable(GL_BLEND); // GL11.glDepthMask(true); glEnable(GL_ALPHA_TEST); glAlphaFunc(GL_GREATER, 0.1f); glEnable(GL_DEPTH_TEST); glDepthFunc(GL_LEQUAL); // The Type Of Depth Testing To Do glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); // Select The Projection Matrix glLoadIdentity(); // Reset The Projection Matrix // Calculate The Aspect Ratio Of The Window glOrtho(0, width, 0, height, -99999, 99999); glMatrixMode(GL_MODELVIEW); // Select The Modelview Matrix glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); }
protected int func_77074_a(EntityEnderman p_77074_1_, int p_77074_2_, float p_77074_3_) { if (p_77074_2_ != 0) { return -1; } else { this.func_76985_a("/mob/enderman_eyes.png"); float var4 = 1.0F; GL11.glEnable(3042); GL11.glDisable(3008); GL11.glBlendFunc(1, 1); GL11.glDisable(2896); if (p_77074_1_.func_82150_aj()) { GL11.glDepthMask(false); } else { GL11.glDepthMask(true); } char var5 = '\uf0f0'; int var6 = var5 % 65536; int var7 = var5 / 65536; OpenGlHelper.func_77475_a( OpenGlHelper.field_77476_b, (float) var6 / 1.0F, (float) var7 / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(2896); GL11.glColor4f(1.0F, 1.0F, 1.0F, var4); return 1; } }
/** Renders the dragon model. Called by renderModel. */ protected void renderDragonModel( EntityDragon par1EntityDragon, float par2, float par3, float par4, float par5, float par6, float par7) { if (par1EntityDragon.deathTicks > 0) { float f = (float) par1EntityDragon.deathTicks / 200F; GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, f); loadDownloadableImageTexture(par1EntityDragon.skinUrl, "/mob/enderdragon/shuffle.png"); mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F); GL11.glDepthFunc(GL11.GL_EQUAL); } loadDownloadableImageTexture(par1EntityDragon.skinUrl, par1EntityDragon.getTexture()); mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); if (par1EntityDragon.hurtTime > 0) { GL11.glDepthFunc(GL11.GL_EQUAL); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); mainModel.render(par1EntityDragon, par2, par3, par4, par5, par6, par7); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthFunc(GL11.GL_LEQUAL); } }
public void renderKatanaDash( RenderGameOverlayEvent.Pre event, int width, int height, EntityPlayer player) { if (player.getHeldItem() != null && player.getHeldItem().getItem() == TFItems.purgesKatana && !TFPlayerData.isInVehicleMode(player) && TFHelper.isPlayerPurge(player)) { int j = TFItems.purgesKatana.getMaxItemUseDuration(player.getHeldItem()) - player.getItemInUseCount(); double d = (double) j / 10; if (d > 2.0D) { d = 2.0D; } GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(0F, 0F, 0F, 0.15F); drawTexturedModalRect(width / 2 - 26, height / 2 + 9, 0, 0, 52, 12); GL11.glColor4f(1F, 0F, 0F, 0.25F); drawTexturedModalRect(width / 2 - 25, height / 2 + 10, 0, 0, (int) (d * 25), 10); GL11.glEnable(GL11.GL_TEXTURE_2D); } }
@Override public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); GL11.glTranslated(-tileentity.xCoord, -tileentity.yCoord, -tileentity.zCoord); GL11.glTranslated(x, y, z); if (tileentity instanceof IBoxesProvider) { for (Box b : ((IBoxesProvider) tileentity).getBoxes()) { if (b.isVisible) { RenderBox.doRender( TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b); } } } else if (tileentity instanceof IBoxProvider) { Box b = ((IBoxProvider) tileentity).getBox(); if (b.isVisible) { RenderBox.doRender( TileEntityRendererDispatcher.instance.field_147553_e, getTexture(b.kind), b); } } GL11.glPopMatrix(); GL11.glPopAttrib(); GL11.glPopMatrix(); }
/** Initialise the GL context */ protected void initGL() { Log.info("Starting display " + width + "x" + height); String extensions = GL11.glGetString(GL11.GL_EXTENSIONS); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_LIGHTING); GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); GL11.glClearDepth(1); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glViewport(0, 0, width, height); GL11.glMatrixMode(GL11.GL_MODELVIEW); if (input == null) { input = new Input(height); } input.init(height); input.removeListener(lastGame); input.addListener(game); lastGame = game; }
private void renderOverlay( TileAnimationTablet tablet, ResourceLocation texture, int rotationMod, boolean useLighting, boolean useBlend, double size, float height, float forceDeg) { Minecraft mc = ClientHelper.minecraft(); mc.renderEngine.bindTexture(texture); GL11.glPushMatrix(); GL11.glDepthMask(false); if (!useLighting) GL11.glDisable(GL11.GL_LIGHTING); if (useBlend) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); } GL11.glTranslatef(0.5F, height, 0.5F); float deg = rotationMod == 0 ? forceDeg : (float) (tablet.ticksExisted * rotationMod % 360F); GL11.glRotatef(deg, 0F, 1F, 0F); GL11.glColor4f(1F, 1F, 1F, 1F); Tessellator tess = Tessellator.instance; double size1 = size / 2; double size2 = -size1; tess.startDrawingQuads(); tess.addVertexWithUV(size2, 0, size1, 0, 1); tess.addVertexWithUV(size1, 0, size1, 1, 1); tess.addVertexWithUV(size1, 0, size2, 1, 0); tess.addVertexWithUV(size2, 0, size2, 0, 0); tess.draw(); GL11.glDepthMask(true); if (!useLighting) GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
/** Rotate and blurs the skybox view in the main menu */ private void rotateAndBlurSkybox(float par1) { GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.viewportTexture); this.mc.renderEngine.func_98185_a(); GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColorMask(true, true, true, false); Tessellator var2 = Tessellator.instance; var2.startDrawingQuads(); byte var3 = 3; for (int var4 = 0; var4 < var3; ++var4) { var2.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float) (var4 + 1)); int var5 = this.width; int var6 = this.height; float var7 = (float) (var4 - var3 / 2) / 256.0F; var2.addVertexWithUV( (double) var5, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 0.0D); var2.addVertexWithUV((double) var5, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 0.0D); var2.addVertexWithUV(0.0D, 0.0D, (double) this.zLevel, (double) (1.0F + var7), 1.0D); var2.addVertexWithUV(0.0D, (double) var6, (double) this.zLevel, (double) (0.0F + var7), 1.0D); } var2.draw(); GL11.glColorMask(true, true, true, true); this.mc.renderEngine.func_98185_a(); }
public static void drawGradientRect( int minx, int miny, int maxx, int maxy, int zlevel, int color1, int color2) { float alpha1 = (float) (color1 >> 24 & 255) / 255.0F; float red1 = (float) (color1 >> 16 & 255) / 255.0F; float green1 = (float) (color1 >> 8 & 255) / 255.0F; float blue1 = (float) (color1 & 255) / 255.0F; float alpha2 = (float) (color2 >> 24 & 255) / 255.0F; float red2 = (float) (color2 >> 16 & 255) / 255.0F; float green2 = (float) (color2 >> 8 & 255) / 255.0F; float blue2 = (float) (color2 & 255) / 255.0F; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glShadeModel(GL11.GL_SMOOTH); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(red1, green1, blue1, alpha1); tessellator.addVertex((double) maxx, (double) miny, (double) zlevel); tessellator.addVertex((double) minx, (double) miny, (double) zlevel); tessellator.setColorRGBA_F(red2, green2, blue2, alpha2); tessellator.addVertex((double) minx, (double) maxy, (double) zlevel); tessellator.addVertex((double) maxx, (double) maxy, (double) zlevel); tessellator.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); }
private void renderPortalOverlay(float var1, int var2, int var3) { if (var1 < 1.0F) { var1 *= var1; var1 *= var1; var1 = var1 * 0.8F + 0.2F; } GL11.glDisable(3008 /*GL_ALPHA_TEST*/); GL11.glDisable(2929 /*GL_DEPTH_TEST*/); GL11.glDepthMask(false); GL11.glBlendFunc(770, 771); GL11.glColor4f(1.0F, 1.0F, 1.0F, var1); GL11.glBindTexture(3553 /*GL_TEXTURE_2D*/, this.mc.renderEngine.getTexture("/terrain.png")); float var4 = (float) (Block.portal.blockIndexInTexture % 16) / 16.0F; float var5 = (float) (Block.portal.blockIndexInTexture / 16) / 16.0F; float var6 = (float) (Block.portal.blockIndexInTexture % 16 + 1) / 16.0F; float var7 = (float) (Block.portal.blockIndexInTexture / 16 + 1) / 16.0F; Tessellator var8 = Tessellator.instance; var8.startDrawingQuads(); var8.addVertexWithUV(0.0D, (double) var3, -90.0D, (double) var4, (double) var7); var8.addVertexWithUV((double) var2, (double) var3, -90.0D, (double) var6, (double) var7); var8.addVertexWithUV((double) var2, 0.0D, -90.0D, (double) var6, (double) var5); var8.addVertexWithUV(0.0D, 0.0D, -90.0D, (double) var4, (double) var5); var8.draw(); GL11.glDepthMask(true); GL11.glEnable(2929 /*GL_DEPTH_TEST*/); GL11.glEnable(3008 /*GL_ALPHA_TEST*/); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); }
/** Render the EvolvedEndermans eyes */ protected int renderEyes( SCSednaEntityEvolvedEnderman par1EntityEvolvedEnderman, int par2, float par3) { if (par2 != 0) { return -1; } else { this.bindTexture(EvolvedEndermanEyesTexture); float f1 = 1.0F; GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); GL11.glDisable(GL11.GL_LIGHTING); if (par1EntityEvolvedEnderman.isInvisible()) { GL11.glDepthMask(false); } else { GL11.glDepthMask(true); } char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_LIGHTING); GL11.glColor4f(1.0F, 1.0F, 1.0F, f1); return 1; } }
public static void drawGradientRect( int x, int y, float z, int toX, int toY, Color color, Color colorFade) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glShadeModel(GL11.GL_SMOOTH); Tessellator tes = Tessellator.getInstance(); VertexBuffer vb = tes.getBuffer(); vb.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR); vb.pos(toX, y, z) .color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()) .endVertex(); vb.pos(x, y, z) .color(color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha()) .endVertex(); vb.pos(x, toY, z) .color(colorFade.getRed(), colorFade.getGreen(), colorFade.getBlue(), colorFade.getAlpha()) .endVertex(); vb.pos(toX, toY, z) .color(colorFade.getRed(), colorFade.getGreen(), colorFade.getBlue(), colorFade.getAlpha()) .endVertex(); tes.draw(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_TEXTURE_2D); }
public void renderParticle( Tessellator tess, float ptt, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { brightness = brightnessFade.updateFade(particleAge); float progress = (float) particleAge / particleMaxAge; // tess.draw(); // glPushMatrix(); glDepthMask(false); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); Minecraft.getMinecraft().renderEngine.bindTexture(tex); float scale = data.size; float[] pos = FXHelper.trackingParticleLocale(this, ptt); float[] rot = new float[] {rotX, rotXZ, rotZ, rotYZ, rotXY}; pos[0] += data.xRad * Math.cos(2 * Math.PI * progress); pos[1] += 0.5 * data.yRad * Math.cos(2 * Math.PI * progress) * Math.sin(2 * Math.PI * progress); pos[2] += data.zRad * Math.sin(2 * Math.PI * progress); draw(tess, pos, scale, rot); glDisable(GL_BLEND); glDepthMask(true); // glPopMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(FXHelper.getParticleTexture()); // tess.startDrawingQuads(); }
@SideOnly(Side.CLIENT) public static void renderItem(GuiScreen gui, ItemStack stack, int x, int y, float scale) { GL11.glPushMatrix(); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderHelper.enableGUIStandardItemLighting(); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glTranslated(x, y, 0); GL11.glScalef(scale, scale, scale); boolean flagBefore = gui.mc.fontRenderer.getUnicodeFlag(); gui.mc.fontRenderer.setUnicodeFlag(false); RenderItem.getInstance() .renderItemAndEffectIntoGUI(gui.mc.fontRenderer, gui.mc.getTextureManager(), stack, 0, 0); RenderItem.getInstance() .renderItemOverlayIntoGUI(gui.mc.fontRenderer, gui.mc.getTextureManager(), stack, 0, 0); gui.mc.fontRenderer.setUnicodeFlag(flagBefore); // GL+MC+NEI suck if (gui instanceof GuiBooklet) { RenderHelper.disableStandardItemLighting(); } GL11.glPopMatrix(); }
private void func_73968_a(float p_73968_1_) { this.field_73882_e.func_110434_K().func_110577_a(this.field_110351_G); GL11.glCopyTexSubImage2D(3553, 0, 0, 0, 0, 0, 256, 256); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); GL11.glColorMask(true, true, true, false); Tessellator var2 = Tessellator.field_78398_a; var2.func_78382_b(); byte var3 = 3; for (int var4 = 0; var4 < var3; ++var4) { var2.func_78369_a(1.0F, 1.0F, 1.0F, 1.0F / (float) (var4 + 1)); int var5 = this.field_73880_f; int var6 = this.field_73881_g; float var7 = (float) (var4 - var3 / 2) / 256.0F; var2.func_78374_a( (double) var5, (double) var6, (double) this.field_73735_i, (double) (0.0F + var7), 0.0D); var2.func_78374_a( (double) var5, 0.0D, (double) this.field_73735_i, (double) (1.0F + var7), 0.0D); var2.func_78374_a(0.0D, 0.0D, (double) this.field_73735_i, (double) (1.0F + var7), 1.0D); var2.func_78374_a( 0.0D, (double) var6, (double) this.field_73735_i, (double) (0.0F + var7), 1.0D); } var2.func_78381_a(); GL11.glColorMask(true, true, true, true); }
private void renderCryogenicChamber( ItemRenderType type, RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { GL11.glPushMatrix(); this.transform(type); FMLClientHandler.instance() .getClient() .renderEngine .bindTexture(ItemRendererMachine.chamberTexture0); this.model.renderPart("Main_Cylinder"); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(0.1F, 0.6F, 0.5F, 0.4F); this.model.renderPart("Shield_Torus"); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glPopMatrix(); }
public static void drawLine( double x, double y, double x2, double y2, float red, float green, float blue, float lineWidth, float fadeSpeed) { int count = FMLClientHandler.instance().getClient().thePlayer.ticksExisted; float alpha = fadeSpeed + MathHelper.sin((float) (count + x)) * 0.3F + 0.3F; Tessellator var12 = Tessellator.instance; GL11.glPushMatrix(); GL11.glLineWidth(lineWidth); GL11.glDisable(3553); GL11.glEnable(3042); var12.startDrawing(3); var12.setColorRGBA_F(red, green, blue, alpha); var12.addVertex(x, y, 0.0D); var12.addVertex(x2, y2, 0.0D); var12.draw(); GL11.glBlendFunc(770, 771); GL11.glDisable(32826); GL11.glDisable(3042); GL11.glEnable(3553); GL11.glPopMatrix(); }
public void renderNitroAndSpeed( RenderGameOverlayEvent.Pre event, int width, int height, EntityPlayer player) { int nitro = TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName()) == null ? 0 : TFVehichleModeMotionManager.nitroMap.get(player.getDisplayName()); int speed = (int) ((TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName()) == null ? 0 : TFVehichleModeMotionManager.velocityMap.get(player.getDisplayName())) * 100); int i = TFPlayerData.getTransformationTimer(player) * 30; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(0F, 0F, 0F, 0.3F); drawTexturedModalRect(5 - i, height - 17, 0, 0, 202, 12); drawTexturedModalRect(5 - i, height - 25, 0, 0, 202, 6); GL11.glColor4f(0.0F, 1.0F, 1.0F, 0.5F); drawTexturedModalRect(6 - i, height - 16, 0, 0, (int) (nitro * 1.25F), 10); GL11.glColor4f(1.0F, 0.0F, 0.0F, 0.5F); drawTexturedModalRect(6 - i, height - 24, 0, 0, (int) (speed * 1F), 4); GL11.glEnable(GL11.GL_TEXTURE_2D); drawCenteredString(mc.fontRenderer, "Nitro", 106 - i, height - 15, 0xffffff); drawCenteredString(mc.fontRenderer, speed + " km/h", 106 - i, height - 26, 0xffffff); }