/** * Creates the entity outline shader to be stored in RenderGlobal.entityOutlineShader */ public void makeEntityOutlineShader() { if (OpenGlHelper.shadersSupported) { if (ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json"); try { this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation); this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final"); } catch (IOException ioexception) { logger.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)ioexception); this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } catch (JsonSyntaxException jsonsyntaxexception) { logger.warn((String)("Failed to load shader: " + resourcelocation), (Throwable)jsonsyntaxexception); this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } } else { this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } }
/** * Creates the entity outline shader to be stored in RenderGlobal.entityOutlineShader */ public void makeEntityOutlineShader() { if (OpenGlHelper.shadersSupported) { if (ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } ResourceLocation resourcelocation = new ResourceLocation("shaders/post/entity_outline.json"); try { this.entityOutlineShader = new ShaderGroup(this.mc.getTextureManager(), this.mc.getResourceManager(), this.mc.getFramebuffer(), resourcelocation); this.entityOutlineShader.createBindFramebuffers(this.mc.displayWidth, this.mc.displayHeight); this.entityOutlineFramebuffer = this.entityOutlineShader.getFramebufferRaw("final"); } catch (IOException ioexception) { LOGGER.warn("Failed to load shader: {}", new Object[] {resourcelocation, ioexception}); this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } catch (JsonSyntaxException jsonsyntaxexception) { LOGGER.warn("Failed to load shader: {}", new Object[] {resourcelocation, jsonsyntaxexception}); this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } } else { this.entityOutlineShader = null; this.entityOutlineFramebuffer = null; } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistanceTemp = this.thirdPersonDistance; if (this.mc.gameSettings.smoothCamera) { float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } else { this.smoothCamFilterX = 0.0F; this.smoothCamFilterY = 0.0F; this.mouseFilterXAxis.reset(); this.mouseFilterYAxis.reset(); } if (this.mc.getRenderViewEntity() == null) { this.mc.setRenderViewEntity(this.mc.thePlayer); } float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity())); float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 32.0F; float f2 = f3 * (1.0F - f4) + f4; this.fogColor1 += (f2 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (BossStatus.hasColorModifier) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } BossStatus.hasColorModifier = false; } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistanceTemp = this.thirdPersonDistance; if (this.mc.gameSettings.smoothCamera) { float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } else { this.smoothCamFilterX = 0.0F; this.smoothCamFilterY = 0.0F; this.mouseFilterXAxis.reset(); this.mouseFilterYAxis.reset(); } if (this.mc.getRenderViewEntity() == null) { this.mc.setRenderViewEntity(this.mc.thePlayer); } Entity entity = this.mc.getRenderViewEntity(); double d0 = entity.posX; double d1 = entity.posY + (double)entity.getEyeHeight(); double d2 = entity.posZ; float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(d0, d1, d2)); float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; f4 = MathHelper.clamp_float(f4, 0.0F, 1.0F); float f2 = f3 * (1.0F - f4) + f4; this.fogColor1 += (f2 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (BossStatus.hasColorModifier) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } BossStatus.hasColorModifier = false; } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistanceTemp = this.thirdPersonDistance; if (this.mc.gameSettings.smoothCamera) { float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } else { this.smoothCamFilterX = 0.0F; this.smoothCamFilterY = 0.0F; this.mouseFilterXAxis.reset(); this.mouseFilterYAxis.reset(); } if (this.mc.getRenderViewEntity() == null) { this.mc.setRenderViewEntity(this.mc.thePlayer); } float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity())); float f4 = (float) this.mc.gameSettings.renderDistanceChunks / 32.0F; float f2 = f3 * (1.0F - f4) + f4; this.fogColor1 += (f2 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (BossStatus.hasColorModifier) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } BossStatus.hasColorModifier = false; } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistancePrev = 4.0F; if (this.mc.gameSettings.smoothCamera) { float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } else { this.smoothCamFilterX = 0.0F; this.smoothCamFilterY = 0.0F; this.mouseFilterXAxis.reset(); this.mouseFilterYAxis.reset(); } if (this.mc.getRenderViewEntity() == null) { this.mc.setRenderViewEntity(this.mc.player); } Entity entity = this.mc.getRenderViewEntity(); double d2 = entity.posX; double d0 = entity.posY + (double)entity.getEyeHeight(); double d1 = entity.posZ; float f2 = this.mc.world.getLightBrightness(new BlockPos(d2, d0, d1)); float f3 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; f3 = MathHelper.clamp(f3, 0.0F, 1.0F); float f4 = f2 * (1.0F - f3) + f3; this.fogColor1 += (f4 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (this.mc.ingameGUI.getBossOverlay().shouldDarkenSky()) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } if (this.field_190567_ac > 0) { --this.field_190567_ac; if (this.field_190567_ac == 0) { this.field_190566_ab = null; } } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistancePrev = 4.0F; if (this.mc.gameSettings.smoothCamera) { float f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; float f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } else { this.smoothCamFilterX = 0.0F; this.smoothCamFilterY = 0.0F; this.mouseFilterXAxis.reset(); this.mouseFilterYAxis.reset(); } if (this.mc.getRenderViewEntity() == null) { this.mc.setRenderViewEntity(this.mc.thePlayer); } float f3 = this.mc.theWorld.getLightBrightness(new BlockPos(this.mc.getRenderViewEntity())); float f4 = (float)this.mc.gameSettings.renderDistanceChunks / 32.0F; float f2 = f3 * (1.0F - f4) + f4; this.fogColor1 += (f2 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (this.mc.ingameGUI.getBossOverlay().shouldDarkenSky()) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }
/** * Updates the entity renderer */ public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistanceTemp = this.thirdPersonDistance; this.prevDebugCamYaw = this.debugCamYaw; this.prevDebugCamPitch = this.debugCamPitch; this.prevDebugCamFOV = this.debugCamFOV; this.prevCamRoll = this.camRoll; float var1; float var2; if (this.mc.gameSettings.smoothCamera) { var1 = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; var2 = var1 * var1 * var1 * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * var2); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * var2); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } if (this.mc.renderViewEntity == null) { this.mc.renderViewEntity = this.mc.thePlayer; } var1 = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ)); var2 = (float)(this.mc.gameSettings.renderDistanceChunks / 16); float var3 = var1 * (1.0F - var2) + var2; this.fogColor1 += (var3 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (BossStatus.hasColorModifier) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } BossStatus.hasColorModifier = false; } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }
public void updateRenderer() { if (OpenGlHelper.shadersSupported && ShaderLinkHelper.getStaticShaderLinkHelper() == null) { ShaderLinkHelper.setNewStaticShaderLinkHelper(); } this.updateFovModifierHand(); this.updateTorchFlicker(); this.fogColor2 = this.fogColor1; this.thirdPersonDistanceTemp = this.thirdPersonDistance; this.prevDebugCamYaw = this.debugCamYaw; this.prevDebugCamPitch = this.debugCamPitch; this.prevDebugCamFOV = this.debugCamFOV; this.prevCamRoll = this.camRoll; float f; float f1; if (this.mc.gameSettings.smoothCamera) { f = this.mc.gameSettings.mouseSensitivity * 0.6F + 0.2F; f1 = f * f * f * 8.0F; this.smoothCamFilterX = this.mouseFilterXAxis.smooth(this.smoothCamYaw, 0.05F * f1); this.smoothCamFilterY = this.mouseFilterYAxis.smooth(this.smoothCamPitch, 0.05F * f1); this.smoothCamPartialTicks = 0.0F; this.smoothCamYaw = 0.0F; this.smoothCamPitch = 0.0F; } if (this.mc.renderViewEntity == null) { this.mc.renderViewEntity = this.mc.thePlayer; } f = this.mc.theWorld.getLightBrightness(MathHelper.floor_double(this.mc.renderViewEntity.posX), MathHelper.floor_double(this.mc.renderViewEntity.posY), MathHelper.floor_double(this.mc.renderViewEntity.posZ)); f1 = (float)this.mc.gameSettings.renderDistanceChunks / 16.0F; float f2 = f * (1.0F - f1) + f1; this.fogColor1 += (f2 - this.fogColor1) * 0.1F; ++this.rendererUpdateCount; this.itemRenderer.updateEquippedItem(); this.addRainParticles(); this.bossColorModifierPrev = this.bossColorModifier; if (BossStatus.hasColorModifier) { this.bossColorModifier += 0.05F; if (this.bossColorModifier > 1.0F) { this.bossColorModifier = 1.0F; } BossStatus.hasColorModifier = false; } else if (this.bossColorModifier > 0.0F) { this.bossColorModifier -= 0.0125F; } }