private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { if (this.mc.gameSettings.func_181147_e() != 0) { this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); this.setupFog(0, partialTicks); renderGlobalIn.renderClouds(partialTicks, pass); GlStateManager.disableFog(); GlStateManager.popMatrix(); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); GlStateManager.matrixMode(5888); } }
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff() && Shaders.shouldRenderClouds(this.mc.gameSettings)) { this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); this.setupFog(0, partialTicks); renderGlobalIn.renderClouds(partialTicks, pass); GlStateManager.disableFog(); GlStateManager.popMatrix(); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance); GlStateManager.matrixMode(5888); } }
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff()) { this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); this.setupFog(0, partialTicks); renderGlobalIn.renderClouds(partialTicks, pass); GlStateManager.disableFog(); GlStateManager.popMatrix(); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.clipDistance); GlStateManager.matrixMode(5888); } }
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass, double p_180437_4_, double p_180437_6_, double p_180437_8_) { if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff() && Shaders.shouldRenderClouds(this.mc.gameSettings)) { this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); this.setupFog(0, partialTicks); renderGlobalIn.renderClouds(partialTicks, pass, p_180437_4_, p_180437_6_, p_180437_8_); GlStateManager.disableFog(); GlStateManager.popMatrix(); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance); GlStateManager.matrixMode(5888); } }
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { if (this.mc.gameSettings.shouldRenderClouds() != 0) { this.mc.mcProfiler.endStartSection("clouds"); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); this.setupFog(0, partialTicks); renderGlobalIn.renderClouds(partialTicks, pass); GlStateManager.disableFog(); GlStateManager.popMatrix(); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); GlStateManager.matrixMode(5888); } }
/** * Render player hand */ private void renderHand(float partialTicks, int xOffset) { if (!this.debugView) { GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(-(xOffset * 2 - 1)) * f, 0.0F, 0.0F); } Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(xOffset * 2 - 1) * 0.1F, 0.0F, 0.0F); } GlStateManager.pushMatrix(); this.hurtCameraEffect(partialTicks); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) { this.enableLightmap(); this.itemRenderer.renderItemInFirstPerson(partialTicks); this.disableLightmap(); } GlStateManager.popMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag) { this.itemRenderer.renderOverlays(partialTicks); this.hurtCameraEffect(partialTicks); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } } }
private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) { Tessellator var4 = Tessellator.getInstance(); WorldRenderer var5 = var4.getWorldRenderer(); GlStateManager.matrixMode((int)5889); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); Project.gluPerspective((float)120.0f, (float)1.0f, (float)0.05f, (float)10.0f); GlStateManager.matrixMode((int)5888); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); GlStateManager.color((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f); GlStateManager.rotate((float)180.0f, (float)1.0f, (float)0.0f, (float)0.0f); GlStateManager.rotate((float)90.0f, (float)0.0f, (float)0.0f, (float)1.0f); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GlStateManager.disableCull(); GlStateManager.depthMask((boolean)false); GlStateManager.tryBlendFuncSeparate((int)770, (int)771, (int)1, (int)0); int var6 = 8; int var7 = 0; while (var7 < var6 * var6) { GlStateManager.pushMatrix(); float var8 = ((float)(var7 % var6) / (float)var6 - 0.5f) / 64.0f; float var9 = ((float)(var7 / var6) / (float)var6 - 0.5f) / 64.0f; float var10 = 0.0f; GlStateManager.translate((float)var8, (float)var9, (float)var10); GlStateManager.rotate((float)(MathHelper.sin((float)((this.panoramaTimer + p_73970_3_) / 400.0f)) * 25.0f + 20.0f), (float)1.0f, (float)0.0f, (float)0.0f); GlStateManager.rotate((float)((- this.panoramaTimer + p_73970_3_) * 0.1f), (float)0.0f, (float)1.0f, (float)0.0f); int var11 = 0; while (var11 < 6) { GlStateManager.pushMatrix(); if (var11 == 1) { GlStateManager.rotate((float)90.0f, (float)0.0f, (float)1.0f, (float)0.0f); } if (var11 == 2) { GlStateManager.rotate((float)180.0f, (float)0.0f, (float)1.0f, (float)0.0f); } if (var11 == 3) { GlStateManager.rotate((float)-90.0f, (float)0.0f, (float)1.0f, (float)0.0f); } if (var11 == 4) { GlStateManager.rotate((float)90.0f, (float)1.0f, (float)0.0f, (float)0.0f); } if (var11 == 5) { GlStateManager.rotate((float)-90.0f, (float)1.0f, (float)0.0f, (float)0.0f); } this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var11]); var5.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); int l = 255 / (var11 + 1); float f3 = 0.0F; var5.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, l).endVertex(); var5.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, l).endVertex(); var5.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, l).endVertex(); var5.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, l).endVertex(); var4.draw(); GlStateManager.popMatrix(); ++var11; } GlStateManager.popMatrix(); GlStateManager.colorMask((boolean)true, (boolean)true, (boolean)true, (boolean)false); ++var7; } var5.setTranslation(0.0, 0.0, 0.0); GlStateManager.colorMask((boolean)true, (boolean)true, (boolean)true, (boolean)true); GlStateManager.matrixMode((int)5889); GlStateManager.popMatrix(); GlStateManager.matrixMode((int)5888); GlStateManager.popMatrix(); GlStateManager.depthMask((boolean)true); GlStateManager.enableCull(); GlStateManager.enableDepth(); }
private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_) { Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); GlStateManager.matrixMode(5889); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GlStateManager.disableCull(); GlStateManager.depthMask(false); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); int i = 8; for (int j = 0; j < i * i; ++j) { GlStateManager.pushMatrix(); float f = ((float) (j % i) / (float) i - 0.5F) / 64.0F; float f1 = ((float) (j / i) / (float) i - 0.5F) / 64.0F; float f2 = 0.0F; GlStateManager.translate(f, f1, f2); GlStateManager.rotate(MathHelper.sin(((float) this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(-((float) this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); for (int k = 0; k < 6; ++k) { GlStateManager.pushMatrix(); if (k == 1) { GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); } if (k == 2) { GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); } if (k == 3) { GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); } if (k == 4) { GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); } if (k == 5) { GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); } this.mc.getTextureManager().bindTexture(titlePanoramaPaths[k]); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); int l = 255 / (j + 1); float f3 = 0.0F; worldrenderer.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, l).endVertex(); worldrenderer.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, l).endVertex(); worldrenderer.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, l).endVertex(); worldrenderer.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, l).endVertex(); tessellator.draw(); GlStateManager.popMatrix(); } GlStateManager.popMatrix(); GlStateManager.colorMask(true, true, true, false); } worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); GlStateManager.colorMask(true, true, true, true); GlStateManager.matrixMode(5889); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); GlStateManager.popMatrix(); GlStateManager.depthMask(true); GlStateManager.enableCull(); GlStateManager.enableDepth(); }
/** * Render player hand */ private void renderHand(float partialTicks, int xOffset) { if (!this.debugView) { GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float) (-(xOffset * 2 - 1)) * f, 0.0F, 0.0F); } Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float) (xOffset * 2 - 1) * 0.1F, 0.0F, 0.0F); } GlStateManager.pushMatrix(); this.hurtCameraEffect(partialTicks); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase) this.mc.getRenderViewEntity()).isPlayerSleeping(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) { this.enableLightmap(); this.itemRenderer.renderItemInFirstPerson(partialTicks); this.disableLightmap(); } GlStateManager.popMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag) { this.itemRenderer.renderOverlays(partialTicks); this.hurtCameraEffect(partialTicks); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } } }
public void renderHand(float p_renderHand_1_, int p_renderHand_2_, boolean p_renderHand_3_, boolean p_renderHand_4_, boolean p_renderHand_5_) { if (!this.debugView) { GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(-(p_renderHand_2_ * 2 - 1)) * 0.07F, 0.0F, 0.0F); } if (Config.isShaders()) { Shaders.applyHandDepth(); } Project.gluPerspective(this.getFOVModifier(p_renderHand_1_, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(p_renderHand_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); } boolean flag = false; if (p_renderHand_3_) { GlStateManager.pushMatrix(); this.hurtCameraEffect(p_renderHand_1_); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_renderHand_1_); } flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); boolean flag1 = !ReflectorForge.renderFirstPersonHand(this.mc.renderGlobal, p_renderHand_1_, p_renderHand_2_); if (flag1 && this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) { this.enableLightmap(); if (Config.isShaders()) { ShadersRender.renderItemFP(this.itemRenderer, p_renderHand_1_, p_renderHand_5_); } else { this.itemRenderer.renderItemInFirstPerson(p_renderHand_1_); } this.disableLightmap(); } GlStateManager.popMatrix(); } if (!p_renderHand_4_) { return; } this.disableLightmap(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag) { this.itemRenderer.renderOverlays(p_renderHand_1_); this.hurtCameraEffect(p_renderHand_1_); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_renderHand_1_); } } }
/** * sets up projection, view effects, camera position/rotation */ private void setupCameraTransform(float partialTicks, int pass) { this.farPlaneDistance = (float)(this.mc.gameSettings.renderDistanceChunks * 16); GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(-(pass * 2 - 1)) * 0.07F, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GlStateManager.translate((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); GlStateManager.scale(this.cameraZoom, this.cameraZoom, 1.0D); } Project.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * MathHelper.SQRT_2); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(pass * 2 - 1) * 0.1F, 0.0F, 0.0F); } this.hurtCameraEffect(partialTicks); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } float f1 = this.mc.thePlayer.prevTimeInPortal + (this.mc.thePlayer.timeInPortal - this.mc.thePlayer.prevTimeInPortal) * partialTicks; if (f1 > 0.0F) { int i = 20; if (this.mc.thePlayer.isPotionActive(MobEffects.NAUSEA)) { i = 7; } float f2 = 5.0F / (f1 * f1 + 5.0F) - f1 * 0.04F; f2 = f2 * f2; GlStateManager.rotate(((float)this.rendererUpdateCount + partialTicks) * (float)i, 0.0F, 1.0F, 1.0F); GlStateManager.scale(1.0F / f2, 1.0F, 1.0F); GlStateManager.rotate(-((float)this.rendererUpdateCount + partialTicks) * (float)i, 0.0F, 1.0F, 1.0F); } this.orientCamera(partialTicks); if (this.debugView) { switch (this.debugViewDirection) { case 0: GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); break; case 1: GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); break; case 2: GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); break; case 3: GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); break; case 4: GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); } } }
/** * Render player hand */ private void renderHand(float partialTicks, int pass) { if (!this.debugView) { GlStateManager.matrixMode(5889); GlStateManager.loadIdentity(); float f = 0.07F; if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(-(pass * 2 - 1)) * 0.07F, 0.0F, 0.0F); } Project.gluPerspective(this.getFOVModifier(partialTicks, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); GlStateManager.matrixMode(5888); GlStateManager.loadIdentity(); if (this.mc.gameSettings.anaglyph) { GlStateManager.translate((float)(pass * 2 - 1) * 0.1F, 0.0F, 0.0F); } GlStateManager.pushMatrix(); this.hurtCameraEffect(partialTicks); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } boolean flag = this.mc.getRenderViewEntity() instanceof EntityLivingBase && ((EntityLivingBase)this.mc.getRenderViewEntity()).isPlayerSleeping(); if (!net.minecraftforge.client.ForgeHooksClient.renderFirstPersonHand(mc.renderGlobal, partialTicks, pass)) if (this.mc.gameSettings.thirdPersonView == 0 && !flag && !this.mc.gameSettings.hideGUI && !this.mc.playerController.isSpectator()) { this.enableLightmap(); this.itemRenderer.renderItemInFirstPerson(partialTicks); this.disableLightmap(); } GlStateManager.popMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !flag) { this.itemRenderer.renderOverlays(partialTicks); this.hurtCameraEffect(partialTicks); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(partialTicks); } } }
private void renderHand(float p_78476_1_, int p_78476_2_) { if (this.debugViewDirection <= 0) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); float var3 = 0.07F; if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(-(p_78476_2_ * 2 - 1)) * var3, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); } Project.gluPerspective(this.getFOVModifier(p_78476_1_, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { float var4 = 0.6666667F; GL11.glScalef(1.0F, var4, 1.0F); } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.hurtCameraEffect(p_78476_1_); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_78476_1_); } if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { this.enableLightmap((double)p_78476_1_); this.itemRenderer.renderItemInFirstPerson(p_78476_1_); this.disableLightmap((double)p_78476_1_); } GL11.glPopMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { this.itemRenderer.renderOverlays(p_78476_1_); this.hurtCameraEffect(p_78476_1_); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_78476_1_); } } }
/** * Sets up 3d projection, shadowing, skybox, all that good stuff. */ private void setupRendering(Camera cam, long time) { //sets up the camera projection and position GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); Project.gluPerspective(mc.gameSettings.fovSetting, (float)mc.displayWidth / mc.displayHeight, 0.001F, 50000); GL11.glRotatef((float)cam.rot.y, 1F, 0F, 0F); GL11.glRotatef((float)cam.rot.x, 0F, 1F, 0F); GL11.glRotatef((float)cam.rot.z, 0F, 0F, 1F); GL11.glTranslatef((float)-cam.pos.x, (float)-cam.pos.y, (float)-cam.pos.z); //sets up the model space GlStateManager.matrixMode(GL_MODELVIEW); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); //glScalef(0.6f, 1f, 0.6f); //GL11.glRotatef(-time * following.getOrbit().getRotation(), 0, 1, 0); //enables depth glEnable(GL_DEPTH_TEST); GlStateManager.enableAlpha(); GlStateManager.enableBlend(); GlStateManager.pushMatrix(); renderSkybox(cam.pos); //sets up shadowing GlStateManager.enableLighting(); GlStateManager.enableLight(0); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, setColorBuffer(0f, 0f, 0f, 1f)); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_DIFFUSE, setColorBuffer(0.6f, 0.6f, 0.6f, 1.0F)); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_AMBIENT, setColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_SPECULAR, setColorBuffer(0f, 0f, 0f, 1.0F)); GlStateManager.shadeModel(GL_SMOOTH); GL11.glLightModel(GL11.GL_LIGHT_MODEL_AMBIENT, setColorBuffer(0f, 0f, 0f, 1.0F)); }
/** * Draws the main menu panorama */ private void drawPanorama(float partialTicks) { int panoramaTimer = (useGlobalPanoramaTimer ? LaminateInternal.globalPanoramaTimer : this.panoramaTimer); TessellatorAccess tess = LaminateInternal.tess(); GL.matrixMode(5889); GL.pushMatrix(); GL.loadIdentity(); Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); GL.matrixMode(5888); GL.pushMatrix(); GL.loadIdentity(); GL.color(1.0F, 1.0F, 1.0F, 1.0F); GL.rotate(180.0F, 1.0F, 0.0F, 0.0F); GL.rotate(90.0F, 0.0F, 0.0F, 1.0F); GL.enableBlend(); GL.disableAlpha(); GL.disableCull(); GL.depthMask(false); GL.tryBlendFuncSeparate(770, 771, 1, 0); int i = 8; for (int j = 0; j < i * i; ++j) { GL.pushMatrix(); float f = ((float) (j % i) / (float) i - 0.5F) / 64.0F; float f1 = ((float) (j / i) / (float) i - 0.5F) / 64.0F; float f2 = 0.0F; GL.translate(f, f1, f2); GL.rotate(MathHelper.sin((panoramaTimer + partialTicks) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); GL.rotate(-(panoramaTimer + partialTicks) * 0.1F, 0.0F, 1.0F, 0.0F); for (int k = 0; k < 6; ++k) { GL.pushMatrix(); if (k == 1) { GL.rotate(90.0F, 0.0F, 1.0F, 0.0F); } if (k == 2) { GL.rotate(180.0F, 0.0F, 1.0F, 0.0F); } if (k == 3) { GL.rotate(-90.0F, 0.0F, 1.0F, 0.0F); } if (k == 4) { GL.rotate(90.0F, 1.0F, 0.0F, 0.0F); } if (k == 5) { GL.rotate(-90.0F, 1.0F, 0.0F, 0.0F); } Minecraft.getMinecraft().getTextureManager().bindTexture(panoramaPaths[k]); tess.begin(GL11.GL_QUADS, TessellatorAccess.Format.POSITION_TEX_COLOR); int l = 255 / (j + 1); tess.pos(-1.0D, -1.0D, 1.0D).tex(0.0D, 0.0D).color(255, 255, 255, l).endVertex(); tess.pos(1.0D, -1.0D, 1.0D).tex(1.0D, 0.0D).color(255, 255, 255, l).endVertex(); tess.pos(1.0D, 1.0D, 1.0D).tex(1.0D, 1.0D).color(255, 255, 255, l).endVertex(); tess.pos(-1.0D, 1.0D, 1.0D).tex(0.0D, 1.0D).color(255, 255, 255, l).endVertex(); tess.draw(); GL.popMatrix(); } GL.popMatrix(); GL.colorMask(true, true, true, false); } GL.colorMask(true, true, true, true); GL.matrixMode(5889); GL.popMatrix(); GL.matrixMode(5888); GL.popMatrix(); GL.depthMask(true); GL.enableCull(); GL.enableDepth(); }
/** * Render player hand */ private void renderHand(float par1, int par2) { if (this.debugViewDirection <= 0) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); float var3 = 0.07F; if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(-(par2 * 2 - 1)) * var3, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); } Project.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { float var4 = 0.6666667F; GL11.glScalef(1.0F, var4, 1.0F); } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.hurtCameraEffect(par1); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { this.enableLightmap((double)par1); this.itemRenderer.renderItemInFirstPerson(par1); this.disableLightmap((double)par1); } GL11.glPopMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { this.itemRenderer.renderOverlays(par1); this.hurtCameraEffect(par1); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } } }
public static void perspective(float fovy, float aspect, float zNear, float zFar) { transform(); Project.gluPerspective(fovy, aspect, zNear, zFar); }
private void renderHand(float p_78476_1_, int p_78476_2_) { if (this.debugViewDirection <= 0) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); float f1 = 0.07F; if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(-(p_78476_2_ * 2 - 1)) * f1, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); } Project.gluPerspective(this.getFOVModifier(p_78476_1_, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { float f2 = 0.6666667F; GL11.glScalef(1.0F, f2, 1.0F); } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.hurtCameraEffect(p_78476_1_); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_78476_1_); } if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { this.enableLightmap((double)p_78476_1_); this.itemRenderer.renderItemInFirstPerson(p_78476_1_); this.disableLightmap((double)p_78476_1_); } GL11.glPopMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { this.itemRenderer.renderOverlays(p_78476_1_); this.hurtCameraEffect(p_78476_1_); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(p_78476_1_); } } }
private void drawPanorama(final float partialTick) { Minecraft mc = Minecraft.getMinecraft(); Tessellator tessellator = Tessellator.getInstance(); WorldRenderer worldrenderer = tessellator.getWorldRenderer(); GlStateManager.matrixMode(5889); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); GlStateManager.matrixMode(5888); GlStateManager.pushMatrix(); GlStateManager.loadIdentity(); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F); GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GlStateManager.disableCull(); GlStateManager.depthMask(false); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0); byte b0 = 8; for (int k = 0; k < b0 * b0; ++k) { GlStateManager.pushMatrix(); float f1 = ((float)(k % b0) / (float)b0 - 0.5F) / 64.0F; float f2 = ((float)(k / b0) / (float)b0 - 0.5F) / 64.0F; float f3 = 0.0F; GlStateManager.translate(f1, f2, f3); GlStateManager.rotate(MathHelper.sin(((float)panoramaTimer + partialTick) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); GlStateManager.rotate(-((float)panoramaTimer + partialTick) * 0.1F, 0.0F, 1.0F, 0.0F); for (int l = 0; l < 6; ++l) { GlStateManager.pushMatrix(); if (l == 1) { GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F); } if (l == 2) { GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F); } if (l == 3) { GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F); } if (l == 4) { GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F); } if (l == 5) { GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F); } mc.getTextureManager().bindTexture(overridePaths == null ? titlePanoramaPaths[l] : overridePaths[l]); worldrenderer.startDrawingQuads(); worldrenderer.setColorRGBA_I(16777215, 255 / (k + 1)); float f4 = 0.0F; worldrenderer.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + f4), (double)(0.0F + f4)); worldrenderer.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - f4), (double)(0.0F + f4)); worldrenderer.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - f4), (double)(1.0F - f4)); worldrenderer.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + f4), (double)(1.0F - f4)); tessellator.draw(); GlStateManager.popMatrix(); } GlStateManager.popMatrix(); GlStateManager.colorMask(true, true, true, false); } worldrenderer.setTranslation(0.0D, 0.0D, 0.0D); GlStateManager.colorMask(true, true, true, true); GlStateManager.matrixMode(5889); GlStateManager.popMatrix(); GlStateManager.matrixMode(5888); GlStateManager.popMatrix(); GlStateManager.depthMask(true); GlStateManager.enableCull(); GlStateManager.enableDepth(); }
private void func_78479_a(float p_78479_1_, int p_78479_2_) { this.field_78530_s = (float)(256 >> this.field_78531_r.field_71474_y.field_74339_e); GL11.glMatrixMode(5889); GL11.glLoadIdentity(); float var3 = 0.07F; if(this.field_78531_r.field_71474_y.field_74337_g) { GL11.glTranslatef((float)(-(p_78479_2_ * 2 - 1)) * var3, 0.0F, 0.0F); } if(this.field_78503_V != 1.0D) { GL11.glTranslatef((float)this.field_78502_W, (float)(-this.field_78509_X), 0.0F); GL11.glScaled(this.field_78503_V, this.field_78503_V, 1.0D); } Project.gluPerspective(this.func_78481_a(p_78479_1_, true), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 2.0F); float var4; if(this.field_78531_r.field_71442_b.func_78747_a()) { var4 = 0.6666667F; GL11.glScalef(1.0F, var4, 1.0F); } GL11.glMatrixMode(5888); GL11.glLoadIdentity(); if(this.field_78531_r.field_71474_y.field_74337_g) { GL11.glTranslatef((float)(p_78479_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); } this.func_78482_e(p_78479_1_); if(this.field_78531_r.field_71474_y.field_74336_f) { this.func_78475_f(p_78479_1_); } var4 = this.field_78531_r.field_71439_g.field_71080_cy + (this.field_78531_r.field_71439_g.field_71086_bY - this.field_78531_r.field_71439_g.field_71080_cy) * p_78479_1_; if(var4 > 0.0F) { byte var5 = 20; if(this.field_78531_r.field_71439_g.func_70644_a(Potion.field_76431_k)) { var5 = 7; } float var6 = 5.0F / (var4 * var4 + 5.0F) - var4 * 0.04F; var6 *= var6; GL11.glRotatef(((float)this.field_78529_t + p_78479_1_) * (float)var5, 0.0F, 1.0F, 1.0F); GL11.glScalef(1.0F / var6, 1.0F, 1.0F); GL11.glRotatef(-((float)this.field_78529_t + p_78479_1_) * (float)var5, 0.0F, 1.0F, 1.0F); } this.func_78467_g(p_78479_1_); if(this.field_78532_q > 0) { int var7 = this.field_78532_q - 1; if(var7 == 1) { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); } if(var7 == 2) { GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } if(var7 == 3) { GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } if(var7 == 4) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); } if(var7 == 5) { GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); } } }
private void func_78476_b(float p_78476_1_, int p_78476_2_) { if(this.field_78532_q <= 0) { GL11.glMatrixMode(5889); GL11.glLoadIdentity(); float var3 = 0.07F; if(this.field_78531_r.field_71474_y.field_74337_g) { GL11.glTranslatef((float)(-(p_78476_2_ * 2 - 1)) * var3, 0.0F, 0.0F); } if(this.field_78503_V != 1.0D) { GL11.glTranslatef((float)this.field_78502_W, (float)(-this.field_78509_X), 0.0F); GL11.glScaled(this.field_78503_V, this.field_78503_V, 1.0D); } Project.gluPerspective(this.func_78481_a(p_78476_1_, false), (float)this.field_78531_r.field_71443_c / (float)this.field_78531_r.field_71440_d, 0.05F, this.field_78530_s * 2.0F); if(this.field_78531_r.field_71442_b.func_78747_a()) { float var4 = 0.6666667F; GL11.glScalef(1.0F, var4, 1.0F); } GL11.glMatrixMode(5888); GL11.glLoadIdentity(); if(this.field_78531_r.field_71474_y.field_74337_g) { GL11.glTranslatef((float)(p_78476_2_ * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.func_78482_e(p_78476_1_); if(this.field_78531_r.field_71474_y.field_74336_f) { this.func_78475_f(p_78476_1_); } if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !this.field_78531_r.field_71451_h.func_70608_bn() && !this.field_78531_r.field_71474_y.field_74319_N && !this.field_78531_r.field_71442_b.func_78747_a()) { this.func_78463_b((double)p_78476_1_); this.field_78516_c.func_78440_a(p_78476_1_); this.func_78483_a((double)p_78476_1_); } GL11.glPopMatrix(); if(this.field_78531_r.field_71474_y.field_74320_O == 0 && !this.field_78531_r.field_71451_h.func_70608_bn()) { this.field_78516_c.func_78447_b(p_78476_1_); this.func_78482_e(p_78476_1_); } if(this.field_78531_r.field_71474_y.field_74336_f) { this.func_78475_f(p_78476_1_); } } }
private void func_73970_b(int p_73970_1_, int p_73970_2_, float p_73970_3_) { Tessellator var4 = Tessellator.field_78398_a; GL11.glMatrixMode(5889); GL11.glPushMatrix(); GL11.glLoadIdentity(); Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); GL11.glMatrixMode(5888); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); GL11.glEnable(3042); GL11.glDisable(3008); GL11.glDisable(2884); GL11.glDepthMask(false); GL11.glBlendFunc(770, 771); byte var5 = 8; for(int var6 = 0; var6 < var5 * var5; ++var6) { GL11.glPushMatrix(); float var7 = ((float)(var6 % var5) / (float)var5 - 0.5F) / 64.0F; float var8 = ((float)(var6 / var5) / (float)var5 - 0.5F) / 64.0F; float var9 = 0.0F; GL11.glTranslatef(var7, var8, var9); GL11.glRotatef(MathHelper.func_76126_a(((float)this.field_73979_m + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); GL11.glRotatef(-((float)this.field_73979_m + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F); for(int var10 = 0; var10 < 6; ++var10) { GL11.glPushMatrix(); if(var10 == 1) { GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); } if(var10 == 2) { GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); } if(var10 == 3) { GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); } if(var10 == 4) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); } if(var10 == 5) { GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); } this.field_73882_e.func_110434_K().func_110577_a(field_73978_o[var10]); var4.func_78382_b(); var4.func_78384_a(16777215, 255 / (var6 + 1)); float var11 = 0.0F; var4.func_78374_a(-1.0D, -1.0D, 1.0D, (double)(0.0F + var11), (double)(0.0F + var11)); var4.func_78374_a(1.0D, -1.0D, 1.0D, (double)(1.0F - var11), (double)(0.0F + var11)); var4.func_78374_a(1.0D, 1.0D, 1.0D, (double)(1.0F - var11), (double)(1.0F - var11)); var4.func_78374_a(-1.0D, 1.0D, 1.0D, (double)(0.0F + var11), (double)(1.0F - var11)); var4.func_78381_a(); GL11.glPopMatrix(); } GL11.glPopMatrix(); GL11.glColorMask(true, true, true, false); } var4.func_78373_b(0.0D, 0.0D, 0.0D); GL11.glColorMask(true, true, true, true); GL11.glMatrixMode(5889); GL11.glPopMatrix(); GL11.glMatrixMode(5888); GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glEnable(2884); GL11.glEnable(3008); GL11.glEnable(2929); }
/** * Render player hand */ private void renderHand(float par1, int par2) { if (this.debugViewDirection <= 0) { GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); float f1 = 0.07F; if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(-(par2 * 2 - 1)) * f1, 0.0F, 0.0F); } if (this.cameraZoom != 1.0D) { GL11.glTranslatef((float)this.cameraYaw, (float)(-this.cameraPitch), 0.0F); GL11.glScaled(this.cameraZoom, this.cameraZoom, 1.0D); } Project.gluPerspective(this.getFOVModifier(par1, false), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.farPlaneDistance * 2.0F); if (this.mc.playerController.enableEverythingIsScrewedUpMode()) { float f2 = 0.6666667F; GL11.glScalef(1.0F, f2, 1.0F); } GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); if (this.mc.gameSettings.anaglyph) { GL11.glTranslatef((float)(par2 * 2 - 1) * 0.1F, 0.0F, 0.0F); } GL11.glPushMatrix(); this.hurtCameraEffect(par1); if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping() && !this.mc.gameSettings.hideGUI && !this.mc.playerController.enableEverythingIsScrewedUpMode()) { this.enableLightmap((double)par1); this.itemRenderer.renderItemInFirstPerson(par1); this.disableLightmap((double)par1); } GL11.glPopMatrix(); if (this.mc.gameSettings.thirdPersonView == 0 && !this.mc.renderViewEntity.isPlayerSleeping()) { this.itemRenderer.renderOverlays(par1); this.hurtCameraEffect(par1); } if (this.mc.gameSettings.viewBobbing) { this.setupViewBobbing(par1); } } }