List of usage examples for org.lwjgl.opengl GL11 glDepthMask
public static void glDepthMask(@NativeType("GLboolean") boolean flag)
From source file:stevekung.mods.moreplanets.planets.fronos.particles.EntityBlueFlameFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f = (this.particleAge + par2) / this.particleMaxAge; this.particleScale = this.flameScale * (1.0F - f * f * 1.0F); super.renderParticle(tessellator, par2, par3, par4, par5, par6, par7); tessellator.draw();/*from ww w . jav a 2s . c om*/ GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_BLEND); FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(this.texture)); float sizeFactor = 0.1F * this.particleScale; float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setBrightness(240); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.fronos.particles.EntityJungleIrisFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { super.renderParticle(tessellator, par2, par3, par4, par5, par6, par7); tessellator.draw();//from w w w .j av a 2 s . c o m GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_BLEND); FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(this.texture)); float sizeFactor = 0.1F * this.particleScale; float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setBrightness(200); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 0.75F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.fronos.particles.EntityOrangeDandelionFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { tessellator.draw();//ww w . j a v a 2s . c om GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(3042); FMLClientHandler.instance().getClient().renderEngine .bindTexture(new ResourceLocation(EntityOrangeDandelionFX.texture)); float sizeFactor = 0.1F * this.particleScale; float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setBrightness(240); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(3042); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.fronos.particles.EntityPinkDandelionFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { tessellator.draw();/*from ww w .ja v a 2s.com*/ GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(3042); FMLClientHandler.instance().getClient().renderEngine .bindTexture(new ResourceLocation(EntityPinkDandelionFX.texture)); final float sizeFactor = 0.1F * this.particleScale; final float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); final float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); final float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setBrightness(240); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(3042); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.fronos.particles.EntityPurpleDandelionFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { tessellator.draw();/*from w w w . j a va2s . com*/ GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(3042); FMLClientHandler.instance().getClient().renderEngine .bindTexture(new ResourceLocation(EntityPurpleDandelionFX.texture)); final float sizeFactor = 0.1F * this.particleScale; final float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); final float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); final float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setBrightness(240); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(3042); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.kapteynb.dimension.sky.SkyProviderKapteynB.java
License:Creative Commons License
@Override public void render(float partialTicks, WorldClient world, Minecraft mc) { GL11.glDisable(GL11.GL_TEXTURE_2D);/*ww w . ja va 2 s . c o m*/ GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableStandardItemLighting(); GL11.glDisable(GL11.GL_TEXTURE_2D); Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); float f1 = (float) vec3.xCoord; float f2 = (float) vec3.yCoord; float f3 = (float) vec3.zCoord; float f6; if (mc.gameSettings.anaglyph) { float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; f1 = f4; f2 = f5; f3 = f6; } GL11.glColor3f(f1, f2, f3); Tessellator tessellator1 = Tessellator.instance; GL11.glDepthMask(false); GL11.glEnable(GL11.GL_FOG); GL11.glColor3f(f1, f2, f3); GL11.glCallList(this.glSkyList); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); RenderHelper.disableStandardItemLighting(); float f7; float f8; float f9; float f10; float f18 = world.getStarBrightness(partialTicks); if (f18 > 0.0F) { GL11.glColor4f(f18, f18, f18, f18); GL11.glCallList(this.starList); } float[] afloat = new float[4]; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glPushMatrix(); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); afloat[0] = 255 / 255.0F; afloat[1] = 0 / 255.0F; afloat[2] = 0 / 255.0F; afloat[3] = 0.25F; f6 = afloat[0]; f7 = afloat[1]; f8 = afloat[2]; float f11; if (mc.gameSettings.anaglyph) { f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; f6 = f9; f7 = f10; f8 = f11; } f18 = 1.0F - f18; tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * 2 / f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render sun aura f10 = 20.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render larger sun aura f10 = 40.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); GL11.glPopMatrix(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glEnable(GL11.GL_TEXTURE_2D); OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); GL11.glPushMatrix(); f7 = 0.0F; f8 = 0.0F; f9 = 0.0F; GL11.glTranslatef(f7, f8, f9); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); f10 = 15.1F / 3.5F; tessellator1.startDrawingQuads(); tessellator1.addVertex(-f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, f10); tessellator1.addVertex(-f10, 99.9D, f10); tessellator1.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // Render sun GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); //Some blanking to conceal the stars f10 = this.sunSize / 3.5F; tessellator1.startDrawingQuads(); tessellator1.addVertex(-f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, f10); tessellator1.addVertex(-f10, 99.9D, f10); tessellator1.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); f10 = this.sunSize; mc.renderEngine.bindTexture(this.kapteynStarTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, 100.0D, -f10, 0.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, -f10, 1.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D); tessellator1.addVertexWithUV(-f10, 100.0D, f10, 0.0D, 1.0D); tessellator1.draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glPopMatrix(); GL11.glPushMatrix(); // Satellite GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); f10 = 6.0F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-800F, 20.0F, 10.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.satelliteTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, -100.0D, f10, 0, 1); tessellator1.addVertexWithUV(f10, -100.0D, f10, 1, 1); tessellator1.addVertexWithUV(f10, -100.0D, -f10, 1, 0); tessellator1.addVertexWithUV(-f10, -100.0D, -f10, 0, 0); tessellator1.draw(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_FOG); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor3f(0.0F, 0.0F, 0.0F); double d0 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon(); if (d0 < 0.0D) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 12.0F, 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); f8 = 1.0F; f9 = -((float) (d0 + 65.0D)); f10 = -f8; tessellator1.startDrawingQuads(); tessellator1.setColorRGBA_I(0, 255); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.draw(); } if (world.provider.isSkyColored()) { GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F); } else { GL11.glColor3f(f1, f2, f3); } GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -((float) (d0 - 16.0D)), 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); }
From source file:stevekung.mods.moreplanets.planets.kapteynb.particles.EntityUraniumSmokeFX.java
License:Creative Commons License
@Override public void renderParticle(Tessellator tessellator, float par2, float par3, float par4, float par5, float par6, float par7) { float f6 = (this.particleAge + par2) / this.particleMaxAge; this.particleScale = this.lavaParticleScale * (1.0F - f6 * f6); super.renderParticle(tessellator, par2, par3, par4, par5, par6, par7); tessellator.draw();/*from www .java 2s . c o m*/ GL11.glPushMatrix(); GL11.glDepthMask(false); GL11.glEnable(3042); FMLClientHandler.instance().getClient().renderEngine.bindTexture(new ResourceLocation(this.texture)); float sizeFactor = 0.1F * this.particleScale; float var13 = (float) (this.prevPosX + (this.posX - this.prevPosX) * par2 - EntityFX.interpPosX); float var14 = (float) (this.prevPosY + (this.posY - this.prevPosY) * par2 - EntityFX.interpPosY); float var15 = (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * par2 - EntityFX.interpPosZ); tessellator.startDrawingQuads(); tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, 1.0F); tessellator.addVertexWithUV(var13 - par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 - par5 * sizeFactor - par7 * sizeFactor, 0.0D, 1.0D); tessellator.addVertexWithUV(var13 - par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 - par5 * sizeFactor + par7 * sizeFactor, 1.0D, 1.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor + par6 * sizeFactor, var14 + par4 * sizeFactor, var15 + par5 * sizeFactor + par7 * sizeFactor, 1.0D, 0.0D); tessellator.addVertexWithUV(var13 + par3 * sizeFactor - par6 * sizeFactor, var14 - par4 * sizeFactor, var15 + par5 * sizeFactor - par7 * sizeFactor, 0.0D, 0.0D); tessellator.draw(); GL11.glDisable(3042); GL11.glDepthMask(true); GL11.glPopMatrix(); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.particles); tessellator.startDrawingQuads(); }
From source file:stevekung.mods.moreplanets.planets.mercury.dimension.sky.SkyProviderMercury.java
License:Creative Commons License
@Override public void render(float partialTicks, WorldClient world, Minecraft mc) { GL11.glDisable(GL11.GL_TEXTURE_2D);// w w w .j a va 2 s . co m GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableStandardItemLighting(); GL11.glDisable(GL11.GL_TEXTURE_2D); Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); float f1 = (float) vec3.xCoord; float f2 = (float) vec3.yCoord; float f3 = (float) vec3.zCoord; float f6; if (mc.gameSettings.anaglyph) { float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; f1 = f4; f2 = f5; f3 = f6; } GL11.glColor3f(0, 0, 0); Tessellator tessellator1 = Tessellator.instance; GL11.glDepthMask(false); GL11.glEnable(GL11.GL_FOG); GL11.glColor3f(0, 0, 0); GL11.glCallList(this.glSkyList); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); RenderHelper.disableStandardItemLighting(); float f7; float f8; float f9; float f10; float f18 = world.getStarBrightness(partialTicks); if (f18 > 0.0F) { GL11.glColor4f(f18, f18, f18, f18); GL11.glCallList(this.starList); } float[] afloat = new float[4]; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glPushMatrix(); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); afloat[0] = 255 / 255.0F; afloat[1] = 255 / 255.0F; afloat[2] = 235 / 255.0F; afloat[3] = 1.0F; f6 = afloat[0]; f7 = afloat[1]; f8 = afloat[2]; float f11; if (mc.gameSettings.anaglyph) { f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; f6 = f9; f7 = f10; f8 = f11; } f18 = 1.0F - f18; tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * 2 / f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render sun aura f10 = 100.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render larger sun aura f10 = 150.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); GL11.glPopMatrix(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glEnable(GL11.GL_TEXTURE_2D); OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); GL11.glPushMatrix(); f7 = 0.0F; f8 = 0.0F; f9 = 0.0F; GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glTranslatef(f7, f8, f9); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); // Render sun GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); f10 = this.sunSize; mc.renderEngine.bindTexture(this.sunTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, 100.0D, -f10, 0.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, -f10, 1.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D); tessellator1.addVertexWithUV(-f10, 100.0D, f10, 0.0D, 1.0D); tessellator1.draw(); GL11.glDisable(GL11.GL_BLEND); // Earth f10 = 0.35F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(15.0F, 5.0F, 0.0F, 0.0F); GL11.glRotatef(-32F, -100.0F, -20.0F, 180.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.earthTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, -100.0D, f10, 0, 1); tessellator1.addVertexWithUV(f10, -100.0D, f10, 1, 1); tessellator1.addVertexWithUV(f10, -100.0D, -f10, 1, 0); tessellator1.addVertexWithUV(-f10, -100.0D, -f10, 0, 0); tessellator1.draw(); // Venus f10 = 1.55F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-600F, 50.0F, 10.0F, 10.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 10.0F, 0.0F, 0.0F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.venusTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, -100.0D, f10, 0, 1); tessellator1.addVertexWithUV(f10, -100.0D, f10, 1, 1); tessellator1.addVertexWithUV(f10, -100.0D, -f10, 1, 0); tessellator1.addVertexWithUV(-f10, -100.0D, -f10, 0, 0); tessellator1.draw(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_FOG); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor3f(0.0F, 0.0F, 0.0F); double d0 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon(); if (d0 < 0.0D) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 12.0F, 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); f8 = 1.0F; f9 = -((float) (d0 + 65.0D)); f10 = -f8; tessellator1.startDrawingQuads(); tessellator1.setColorRGBA_I(0, 255); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.draw(); } if (world.provider.isSkyColored()) { GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F); } else { GL11.glColor3f(f1, f2, f3); } GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -((float) (d0 - 16.0D)), 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); }
From source file:stevekung.mods.moreplanets.planets.nibiru.dimension.sky.SkyProviderNibiru.java
License:Creative Commons License
@Override public void render(float partialTicks, WorldClient world, Minecraft mc) { GL11.glDisable(GL11.GL_TEXTURE_2D);/* ww w . j a v a 2s .c o m*/ GL11.glDisable(GL12.GL_RESCALE_NORMAL); RenderHelper.enableStandardItemLighting(); GL11.glDisable(GL11.GL_TEXTURE_2D); Vec3 vec3 = world.getSkyColor(mc.renderViewEntity, partialTicks); float f1 = (float) vec3.xCoord; float f2 = (float) vec3.yCoord; float f3 = (float) vec3.zCoord; float f6; if (mc.gameSettings.anaglyph) { float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; f1 = f4; f2 = f5; f3 = f6; } GL11.glColor3f(f1, f2, f3); Tessellator tessellator1 = Tessellator.instance; GL11.glDepthMask(false); GL11.glEnable(GL11.GL_FOG); GL11.glColor3f(f1, f2, f3); GL11.glCallList(this.glSkyList); GL11.glDisable(GL11.GL_FOG); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); OpenGlHelper.glBlendFunc(770, 771, 1, 0); RenderHelper.disableStandardItemLighting(); float f7; float f8; float f9; float f10; float f18 = world.getStarBrightness(partialTicks); if (f18 > 0.0F) { GL11.glColor4f(f18, f18, f18, f18); GL11.glCallList(this.starList); } float[] afloat = new float[4]; GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glShadeModel(GL11.GL_SMOOTH); GL11.glPushMatrix(); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); afloat[0] = 0 / 255.0F; afloat[1] = 225 / 255.0F; afloat[2] = 255 / 255.0F; afloat[3] = 0.3F; f6 = afloat[0]; f7 = afloat[1]; f8 = afloat[2]; float f11; if (mc.gameSettings.anaglyph) { f9 = (f6 * 30.0F + f7 * 59.0F + f8 * 11.0F) / 100.0F; f10 = (f6 * 30.0F + f7 * 70.0F) / 100.0F; f11 = (f6 * 30.0F + f8 * 70.0F) / 100.0F; f6 = f9; f7 = f10; f8 = f11; } f18 = 1.0F - f18; tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * 2 / f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render sun aura f10 = 10.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); tessellator1.startDrawing(GL11.GL_TRIANGLE_FAN); tessellator1.setColorRGBA_F(f6 * f18, f7 * f18, f8 * f18, afloat[3] * f18); tessellator1.addVertex(0.0D, 100.0D, 0.0D); tessellator1.setColorRGBA_F(afloat[0] * f18, afloat[1] * f18, afloat[2] * f18, 0.0F); // Render larger sun aura f10 = 25.0F; tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.addVertex(0, 100.0D, (double) -f10 * 1.5F); tessellator1.addVertex(f10, 100.0D, -f10); tessellator1.addVertex((double) f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(f10, 100.0D, f10); tessellator1.addVertex(0, 100.0D, (double) f10 * 1.5F); tessellator1.addVertex(-f10, 100.0D, f10); tessellator1.addVertex((double) -f10 * 1.5F, 100.0D, 0); tessellator1.addVertex(-f10, 100.0D, -f10); tessellator1.draw(); GL11.glPopMatrix(); GL11.glShadeModel(GL11.GL_FLAT); GL11.glEnable(GL11.GL_TEXTURE_2D); OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE, GL11.GL_ONE, GL11.GL_ZERO); GL11.glPushMatrix(); GL11.glPopMatrix(); GL11.glPushMatrix(); f7 = 0.0F; f8 = 0.0F; f9 = 0.0F; GL11.glTranslatef(f7, f8, f9); GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); f10 = 10.0F / 3.5F; tessellator1.startDrawingQuads(); tessellator1.addVertex(-f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, f10); tessellator1.addVertex(-f10, 99.9D, f10); tessellator1.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); // Render sirius GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0.0F, 0.0F, 0.0F, 1.0F); //Some blanking to conceal the stars f10 = this.sunSize / 3.5F; tessellator1.startDrawingQuads(); tessellator1.addVertex(-f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, -f10); tessellator1.addVertex(f10, 99.9D, f10); tessellator1.addVertex(-f10, 99.9D, f10); tessellator1.draw(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); f10 = this.sunSize + 7; mc.renderEngine.bindTexture(this.siriusTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, 100.0D, -f10, 0.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, -f10, 1.0D, 0.0D); tessellator1.addVertexWithUV(f10, 100.0D, f10, 1.0D, 1.0D); tessellator1.addVertexWithUV(-f10, 100.0D, f10, 0.0D, 1.0D); tessellator1.draw(); // Render polongnius f10 = 1.2F; GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(200F, 1.0F, 0.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.polongniusTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, -100.0D, f10, 0, 1); tessellator1.addVertexWithUV(f10, -100.0D, f10, 1, 1); tessellator1.addVertexWithUV(f10, -100.0D, -f10, 1, 0); tessellator1.addVertexWithUV(-f10, -100.0D, -f10, 0, 0); tessellator1.draw(); GL11.glPopMatrix(); GL11.glPushMatrix(); // Render fronos f10 = 0.25F; GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(0.6F, 0.6F, 0.6F); GL11.glRotatef(40.0F, 0.0F, 0.0F, 1.0F); GL11.glRotatef(0F, 1.0F, 0.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F); FMLClientHandler.instance().getClient().renderEngine.bindTexture(this.fronosTexture); tessellator1.startDrawingQuads(); tessellator1.addVertexWithUV(-f10, -100.0D, f10, 0, 1); tessellator1.addVertexWithUV(f10, -100.0D, f10, 1, 1); tessellator1.addVertexWithUV(f10, -100.0D, -f10, 1, 0); tessellator1.addVertexWithUV(-f10, -100.0D, -f10, 0, 0); tessellator1.draw(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_FOG); GL11.glPopMatrix(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor3f(0.0F, 0.0F, 0.0F); double d0 = mc.thePlayer.getPosition(partialTicks).yCoord - world.getHorizon(); if (d0 < 0.0D) { GL11.glPushMatrix(); GL11.glTranslatef(0.0F, 12.0F, 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); f8 = 1.0F; f9 = -((float) (d0 + 65.0D)); f10 = -f8; tessellator1.startDrawingQuads(); tessellator1.setColorRGBA_I(0, 255); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f9, f8); tessellator1.addVertex(f8, f9, -f8); tessellator1.addVertex(-f8, f9, -f8); tessellator1.addVertex(-f8, f9, f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, -f8); tessellator1.addVertex(-f8, f10, f8); tessellator1.addVertex(f8, f10, f8); tessellator1.addVertex(f8, f10, -f8); tessellator1.draw(); } if (world.provider.isSkyColored()) { GL11.glColor3f(f1 * 0.2F + 0.04F, f2 * 0.2F + 0.04F, f3 * 0.6F + 0.1F); } else { GL11.glColor3f(f1, f2, f3); } GL11.glPushMatrix(); GL11.glTranslatef(0.0F, -((float) (d0 - 16.0D)), 0.0F); GL11.glCallList(this.glSkyList2); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(true); }
From source file:stevekung.mods.moreplanets.planets.nibiru.render.entities.RenderInfectedEvolvedSpiderBoss.java
License:Creative Commons License
protected int shouldRenderPass(EntityEvolvedInfectedSpiderBoss spider, int par2) { if (par2 != 0) { return -1; } else {/*from www . ja v a 2s. c om*/ this.bindTexture(this.spiderEyesTextures); GL11.glEnable(GL11.GL_BLEND); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE); if (spider.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; } }