List of usage examples for org.lwjgl.opengl GL11 glColor4f
public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha);
From source file:com.shinoow.abyssalcraft.client.render.block.RenderODB.java
License:Apache License
public void doRender(EntityODBPrimed par1EntityODBPrimed, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();//w w w.j a v a2 s .co m GL11.glTranslatef((float) par2, (float) par4, (float) par6); float var10; if (par1EntityODBPrimed.fuse - par9 + 1.0F < 10.0F) { var10 = 1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 10.0F; if (var10 < 0.0F) var10 = 0.0F; if (var10 > 1.0F) var10 = 1.0F; var10 *= var10; var10 *= var10; float var11 = 1.0F + var10 * 0.3F; GL11.glScalef(var11, var11, var11); } var10 = (1.0F - (par1EntityODBPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; bindEntityTexture(par1EntityODBPrimed); blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, par1EntityODBPrimed.getBrightness(par9)); if (par1EntityODBPrimed.fuse / 5 % 2 == 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); blockRenderer.renderBlockAsItem(AbyssalCraft.ODB, 0, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.block.RenderODBc.java
License:Apache License
public void doRender(EntityODBcPrimed par1EntityODBcPrimed, double par2, double par4, double par6, float par8, float par9) { GL11.glPushMatrix();/*from w w w. java 2 s.c o m*/ GL11.glTranslatef((float) par2, (float) par4, (float) par6); float var10; if (par1EntityODBcPrimed.fuse - par9 + 1.0F < 10.0F) { var10 = 1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 10.0F; if (var10 < 0.0F) var10 = 0.0F; if (var10 > 1.0F) var10 = 1.0F; var10 *= var10; var10 *= var10; float var11 = 1.0F + var10 * 0.3F; GL11.glScalef(var11, var11, var11); } var10 = (1.0F - (par1EntityODBcPrimed.fuse - par9 + 1.0F) / 100.0F) * 0.8F; bindEntityTexture(par1EntityODBcPrimed); blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, par1EntityODBcPrimed.getBrightness(par9)); if (par1EntityODBcPrimed.fuse / 5 % 2 == 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA); GL11.glColor4f(1.0F, 1.0F, 1.0F, var10); blockRenderer.renderBlockAsItem(AbyssalCraft.ODBcore, 0, 1.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); } GL11.glPopMatrix(); }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderAntiSpider.java
License:Apache License
protected int shouldRenderPass(EntityAntiSpider par1EntityAntiSpider, int par2, float par3) { if (par2 != 0) return -1; else {/* w ww .j ava2 s . c om*/ bindTexture(spiderEyesTextures); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); if (par1EntityAntiSpider.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); return 1; } }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java
License:Apache License
/** * Renders the dragon model. Called by renderModel. *//*from www .ja v a 2 s. c o m*/ 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); } }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java
License:Apache License
/** * Renders the animation for when an enderdragon dies *//*from w ww. ja va2 s . co m*/ protected void renderDragonDying(EntityDragonBoss par1entitydragonboss, float par2) { super.renderEquippedItems(par1entitydragonboss, par2); Tessellator tessellator = Tessellator.instance; if (par1entitydragonboss.deathTicks > 0) { RenderHelper.disableStandardItemLighting(); float f1 = (par1entitydragonboss.deathTicks + par2) / 200.0F; float f2 = 0.0F; if (f1 > 0.8F) f2 = (f1 - 0.8F) / 0.2F; Random random = new Random(432L); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(false); GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -1.0F, -2.0F); for (int i = 0; i < (f1 + f1 * f1) / 2.0F * 60.0F; ++i) { GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(random.nextFloat() * 360.0F + f1 * 90.0F, 0.0F, 0.0F, 1.0F); tessellator.startDrawing(6); float f3 = random.nextFloat() * 20.0F + 5.0F + f2 * 10.0F; float f4 = random.nextFloat() * 2.0F + 1.0F + f2 * 2.0F; tessellator.setColorRGBA_I(16777215, (int) (255.0F * (1.0F - f2))); tessellator.addVertex(0.0D, 0.0D, 0.0D); tessellator.setColorRGBA_I(16711935, 0); tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4); tessellator.addVertex(0.866D * f4, f3, -0.5F * f4); tessellator.addVertex(0.0D, f3, 1.0F * f4); tessellator.addVertex(-0.866D * f4, f3, -0.5F * f4); tessellator.draw(); } GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_BLEND); GL11.glShadeModel(GL11.GL_FLAT); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_ALPHA_TEST); RenderHelper.enableStandardItemLighting(); } }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonBoss.java
License:Apache License
/** * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. *///from w w w . j a v a2 s . c om protected int renderGlow(EntityDragonBoss par1entitydragonboss, int par2, float par3) { if (par2 == 1) GL11.glDepthFunc(GL11.GL_LEQUAL); if (par2 != 0) return -1; else { bindTexture(field_110845_h); 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); GL11.glDepthFunc(GL11.GL_EQUAL); 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; } }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonMinion.java
License:Apache License
/** * Renders the dragon model. Called by renderModel. *//*from w ww . j a v a 2 s . co m*/ protected void renderDragonModel(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); } }
From source file:com.shinoow.abyssalcraft.client.render.entity.RenderDragonMinion.java
License:Apache License
/** * Renders the overlay for glowing eyes and the mouth. Called by shouldRenderPass. *//*from w w w .j ava 2 s . co m*/ protected int renderGlow(EntityDragonMinion par1EntityDragonMinion, int par2, float par3) { if (par2 == 1) GL11.glDepthFunc(GL11.GL_LEQUAL); if (par2 != 0) return -1; else { bindTexture(field_110845_h); 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); GL11.glDepthFunc(GL11.GL_EQUAL); 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; } }
From source file:com.shinoow.abyssalcraft.common.items.armor.ItemDepthsArmor.java
License:Apache License
@Override @SideOnly(Side.CLIENT)/*from w w w.ja v a 2s . c om*/ public void renderHelmetOverlay(ItemStack stack, EntityPlayer player, ScaledResolution resolution, float partialTicks, boolean hasScreen, int mouseX, int mouseY) { final ResourceLocation coraliumBlur = new ResourceLocation("abyssalcraft:textures/misc/coraliumblur.png"); if (Minecraft.getMinecraft().gameSettings.thirdPersonView == 0 && stack != null && stack.getItem() == AbyssalCraft.Depthshelmet) { GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); Tessellator t = Tessellator.instance; ScaledResolution scale = new ScaledResolution(Minecraft.getMinecraft(), Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); int width = scale.getScaledWidth(); int height = scale.getScaledHeight(); 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); Minecraft.getMinecraft().renderEngine.bindTexture(coraliumBlur); t.startDrawingQuads(); t.addVertexWithUV(0.0D, height, 90.0D, 0.0D, 1.0D); t.addVertexWithUV(width, height, 90.0D, 1.0D, 1.0D); t.addVertexWithUV(width, 0.0D, 90.0D, 1.0D, 0.0D); t.addVertexWithUV(0.0D, 0.0D, 90.0D, 0.0D, 0.0D); t.draw(); GL11.glPopAttrib(); } }
From source file:com.sk89q.worldedit.forge.gui.GuiReferenceCard.java
License:Open Source License
@Override public void drawScreen(int mouseX, int mouseY, float par3) { int x = (this.width - this.backgroundWidth) / 2; int y = (this.height - this.backgroundHeight) / 2 - this.closeButton.height; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(new ResourceLocation(ForgeWorldEdit.MOD_ID, "textures/gui/reference.png")); this.drawTexturedModalRect(x, y, 0, 0, this.backgroundWidth, this.backgroundHeight); super.drawScreen(mouseX, mouseY, par3); }