Optifine Clouds

This commit is contained in:
peytonplayz595 2023-09-10 10:26:23 -05:00
parent 4cb7e5b9c0
commit 577e01f0ac
8 changed files with 497 additions and 382 deletions

View File

@ -138,6 +138,14 @@ public class Config {
return Minecraft.getMinecraft().gameSettings.ofChunkUpdates; return Minecraft.getMinecraft().gameSettings.ofChunkUpdates;
} }
public static boolean isCloudsFancy() {
return Minecraft.getMinecraft().gameSettings.ofClouds != 0 ? Minecraft.getMinecraft().gameSettings.ofClouds == 2 : Minecraft.getMinecraft().gameSettings.fancyGraphics;
}
public static boolean isCloudsOff() {
return Minecraft.getMinecraft().gameSettings.ofClouds != 0 ? Minecraft.getMinecraft().gameSettings.ofClouds == 3 : false;
}
public static int limit(int p_limit_0_, int p_limit_1_, int p_limit_2_) { public static int limit(int p_limit_0_, int p_limit_1_, int p_limit_2_) {
return p_limit_0_ < p_limit_1_ ? p_limit_1_ : (p_limit_0_ > p_limit_2_ ? p_limit_2_ : p_limit_0_); return p_limit_0_ < p_limit_1_ ? p_limit_1_ : (p_limit_0_ > p_limit_2_ ? p_limit_2_ : p_limit_0_);
} }

View File

@ -0,0 +1,71 @@
package net.PeytonPlayz585.shadow.gui;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiOptionButton;
import net.minecraft.client.gui.GuiOptionSlider;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.resources.I18n;
import net.minecraft.client.settings.GameSettings;
public class GuiDetails extends GuiScreen {
private GuiScreen prevScreen;
protected String title;
private GameSettings settings;
//private static GameSettings.Options[] enumOptions = new GameSettings.Options[] {GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT, GameSettings.Options.TREES, GameSettings.Options.RAIN, GameSettings.Options.SKY, GameSettings.Options.STARS, GameSettings.Options.SUN_MOON, GameSettings.Options.SHOW_CAPES, GameSettings.Options.TRANSLUCENT_BLOCKS, GameSettings.Options.HELD_ITEM_TOOLTIPS, GameSettings.Options.DROPPED_ITEMS, GameSettings.Options.ENTITY_SHADOWS, GameSettings.Options.VIGNETTE, GameSettings.Options.DYNAMIC_FOV};
private static GameSettings.Options[] enumOptions = new GameSettings.Options[] { GameSettings.Options.CLOUDS, GameSettings.Options.CLOUD_HEIGHT};
public GuiDetails(GuiScreen p_i47_1_) {
this.prevScreen = p_i47_1_;
this.settings = Minecraft.getMinecraft().gameSettings;
}
/**
* Adds the buttons (and other controls) to the screen in question. Called when the GUI is displayed and when the
* window resizes, the buttonList is cleared beforehand.
*/
public void initGui() {
this.title = I18n.format("Detail Settings", new Object[0]);
this.buttonList.clear();
for (int i = 0; i < enumOptions.length; ++i) {
GameSettings.Options gamesettings$options = enumOptions[i];
int j = width / 2 - 155 + i % 2 * 160;
int k = height / 6 + 21 * (i / 2) - 12;
if (!gamesettings$options.getEnumFloat()) {
this.buttonList.add(new GuiOptionButton(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options, this.settings.getKeyBinding(gamesettings$options)));
} else {
this.buttonList.add(new GuiOptionSlider(gamesettings$options.returnEnumOrdinal(), j, k, gamesettings$options));
}
}
this.buttonList.add(new GuiButton(200, width / 2 - 100, height / 6 + 168 + 11, I18n.format("gui.done", new Object[0])));
}
/**
* Called by the controls from the buttonList when activated. (Mouse pressed for buttons)
*/
protected void actionPerformed(GuiButton button) {
if (button.enabled) {
if (button.id < 200 && button instanceof GuiOptionButton) {
this.settings.setOptionValue(((GuiOptionButton)button).returnEnumOptions(), 1);
button.displayString = this.settings.getKeyBinding(GameSettings.Options.getEnumOptions(button.id));
}
if (button.id == 200) {
this.mc.gameSettings.saveOptions();
this.mc.displayGuiScreen(this.prevScreen);
}
}
}
/**
* Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
*/
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
this.drawCenteredString(this.fontRendererObj, this.title, width / 2, 15, 16777215);
super.drawScreen(mouseX, mouseY, partialTicks);
}
}

View File

@ -24,7 +24,7 @@ public class GuiPerformance extends GuiScreen {
* window resizes, the buttonList is cleared beforehand. * window resizes, the buttonList is cleared beforehand.
*/ */
public void initGui() { public void initGui() {
this.title = I18n.format("of.options.performanceTitle", new Object[0]); this.title = I18n.format("Performance Settings", new Object[0]);
this.buttonList.clear(); this.buttonList.clear();
for (int i = 0; i < enumOptions.length; ++i) { for (int i = 0; i < enumOptions.length; ++i) {

View File

@ -0,0 +1,89 @@
package net.PeytonPlayz585.shadow.other;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.entity.Entity;
public class CloudRenderer {
private Minecraft mc;
private boolean updated = false;
private boolean renderFancy = false;
int cloudTickCounter;
float partialTicks;
private int glListClouds = -1;
private int cloudTickCounterUpdate = 0;
private double cloudPlayerX = 0.0D;
private double cloudPlayerY = 0.0D;
private double cloudPlayerZ = 0.0D;
public CloudRenderer(Minecraft p_i28_1_) {
this.mc = p_i28_1_;
this.glListClouds = GLAllocation.generateDisplayLists();
}
public void prepareToRender(boolean p_prepareToRender_1_, int p_prepareToRender_2_, float p_prepareToRender_3_) {
if (this.renderFancy != p_prepareToRender_1_) {
this.updated = false;
}
this.renderFancy = p_prepareToRender_1_;
this.cloudTickCounter = p_prepareToRender_2_;
this.partialTicks = p_prepareToRender_3_;
}
public boolean shouldUpdateGlList() {
if (!this.updated) {
return true;
} else if (this.cloudTickCounter >= this.cloudTickCounterUpdate + 20) {
return true;
} else {
Entity entity = this.mc.getRenderViewEntity();
boolean flag = this.cloudPlayerY + (double)entity.getEyeHeight() < 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F);
boolean flag1 = entity.prevPosY + (double)entity.getEyeHeight() < 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F);
return flag1 != flag;
}
}
public void startUpdateGlList() {
EaglercraftGPU.glNewList(this.glListClouds, RealOpenGLEnums.GL_COMPILE);
}
public void endUpdateGlList() {
EaglercraftGPU.glEndList();
this.cloudTickCounterUpdate = this.cloudTickCounter;
this.cloudPlayerX = this.mc.getRenderViewEntity().prevPosX;
this.cloudPlayerY = this.mc.getRenderViewEntity().prevPosY;
this.cloudPlayerZ = this.mc.getRenderViewEntity().prevPosZ;
this.updated = true;
GlStateManager.resetColor();
}
public void renderGlList() {
Entity entity = this.mc.getRenderViewEntity();
double d0 = entity.prevPosX + (entity.posX - entity.prevPosX) * (double)this.partialTicks;
double d1 = entity.prevPosY + (entity.posY - entity.prevPosY) * (double)this.partialTicks;
double d2 = entity.prevPosZ + (entity.posZ - entity.prevPosZ) * (double)this.partialTicks;
double d3 = (double)((float)(this.cloudTickCounter - this.cloudTickCounterUpdate) + this.partialTicks);
float f = (float)(d0 - this.cloudPlayerX + d3 * 0.03D);
float f1 = (float)(d1 - this.cloudPlayerY);
float f2 = (float)(d2 - this.cloudPlayerZ);
GlStateManager.pushMatrix();
if (this.renderFancy) {
GlStateManager.translate(-f / 12.0F, -f1, -f2 / 12.0F);
} else {
GlStateManager.translate(-f, -f1, -f2);
}
GlStateManager.callList(this.glListClouds);
GlStateManager.popMatrix();
GlStateManager.resetColor();
}
public void reset() {
this.updated = false;
}
}

View File

@ -141,6 +141,10 @@ public class GuiVideoSettings extends GuiScreen {
this.mc.displayGuiScreen(new GuiPerformance(this)); this.mc.displayGuiScreen(new GuiPerformance(this));
} }
if(parGuiButton.id == 201) {
this.mc.displayGuiScreen(new GuiDetails(this));
}
if (this.guiGameSettings.guiScale != i) { if (this.guiGameSettings.guiScale != i) {
ScaledResolution scaledresolution = new ScaledResolution(this.mc); ScaledResolution scaledresolution = new ScaledResolution(this.mc);
int j = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledWidth();

View File

@ -174,6 +174,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
private GameOverlayFramebuffer overlayFramebuffer; private GameOverlayFramebuffer overlayFramebuffer;
private float eagPartialTicks = 0.0f; private float eagPartialTicks = 0.0f;
public boolean fogStandard = false; public boolean fogStandard = false;
private float clipDistance = 128.0F;
public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) { public EntityRenderer(Minecraft mcIn, IResourceManager resourceManagerIn) {
this.useShader = false; this.useShader = false;
@ -599,15 +600,23 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.translate((float) (-(pass * 2 - 1)) * f, 0.0F, 0.0F); GlStateManager.translate((float) (-(pass * 2 - 1)) * f, 0.0F, 0.0F);
} }
this.clipDistance = this.farPlaneDistance * 2.0F;
if (this.clipDistance < 173.0F) {
this.clipDistance = 173.0F;
}
if (this.mc.theWorld.provider.getDimensionId() == 1) {
this.clipDistance = 256.0F;
}
if (this.cameraZoom != 1.0D) { if (this.cameraZoom != 1.0D) {
GlStateManager.translate((float) this.cameraYaw, (float) (-this.cameraPitch), 0.0F); GlStateManager.translate((float) this.cameraYaw, (float) (-this.cameraPitch), 0.0F);
GlStateManager.scale(this.cameraZoom, this.cameraZoom, 1.0D); GlStateManager.scale(this.cameraZoom, this.cameraZoom, 1.0D);
} }
float farPlane = this.farPlaneDistance * 2.0f * MathHelper.SQRT_2; GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance);
GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), DeferredStateManager.setGBufferNearFarPlanes(0.05f, clipDistance);
(float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, farPlane);
DeferredStateManager.setGBufferNearFarPlanes(0.05f, farPlane);
GlStateManager.matrixMode(GL_MODELVIEW); GlStateManager.matrixMode(GL_MODELVIEW);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
if (this.mc.gameSettings.anaglyph) { if (this.mc.gameSettings.anaglyph) {
@ -1159,21 +1168,18 @@ public class EntityRenderer implements IResourceManagerReloadListener {
this.mc.mcProfiler.endStartSection("sky"); this.mc.mcProfiler.endStartSection("sky");
GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.matrixMode(GL_PROJECTION);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance);
(float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F);
GlStateManager.matrixMode(GL_MODELVIEW); GlStateManager.matrixMode(GL_MODELVIEW);
renderglobal.renderSky(partialTicks, pass); renderglobal.renderSky(partialTicks, pass);
GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.matrixMode(GL_PROJECTION);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance);
(float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F,
this.farPlaneDistance * MathHelper.SQRT_2);
GlStateManager.matrixMode(GL_MODELVIEW); GlStateManager.matrixMode(GL_MODELVIEW);
} }
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
GlStateManager.shadeModel(GL_SMOOTH); GlStateManager.shadeModel(GL_SMOOTH);
if (entity.posY + (double) entity.getEyeHeight() < 128.0D) { if (entity.posY + (double)entity.getEyeHeight() < 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F)) {
this.renderCloudsCheck(renderglobal, partialTicks, pass); this.renderCloudsCheck(renderglobal, partialTicks, pass);
} }
@ -1280,7 +1286,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.enableCull(); GlStateManager.enableCull();
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.disableFog(); GlStateManager.disableFog();
if (entity.posY + (double) entity.getEyeHeight() >= 128.0D) { if (entity.posY + (double)entity.getEyeHeight() >= 128.0D + (double)(this.mc.gameSettings.ofCloudsHeight * 128.0F)) {
this.mc.mcProfiler.endStartSection("aboveClouds"); this.mc.mcProfiler.endStartSection("aboveClouds");
this.renderCloudsCheck(renderglobal, partialTicks, pass); this.renderCloudsCheck(renderglobal, partialTicks, pass);
} }
@ -1296,26 +1302,22 @@ public class EntityRenderer implements IResourceManagerReloadListener {
} }
private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) { private void renderCloudsCheck(RenderGlobal renderGlobalIn, float partialTicks, int pass) {
if (this.mc.gameSettings.func_181147_e() != 0) { if (this.mc.gameSettings.renderDistanceChunks >= 4 && !Config.isCloudsOff()) {
this.mc.mcProfiler.endStartSection("clouds"); this.mc.mcProfiler.endStartSection("clouds");
GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance * 4.0F);
(float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, this.farPlaneDistance * 4.0F); GlStateManager.matrixMode(5888);
GlStateManager.matrixMode(GL_MODELVIEW);
GlStateManager.pushMatrix(); GlStateManager.pushMatrix();
this.setupFog(0, partialTicks); this.setupFog(0, partialTicks);
renderGlobalIn.renderClouds(partialTicks, pass); renderGlobalIn.renderClouds(partialTicks, pass);
GlStateManager.disableFog(); GlStateManager.disableFog();
GlStateManager.popMatrix(); GlStateManager.popMatrix();
GlStateManager.matrixMode(GL_PROJECTION); GlStateManager.matrixMode(5889);
GlStateManager.loadIdentity(); GlStateManager.loadIdentity();
GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), GlStateManager.gluPerspective(this.getFOVModifier(partialTicks, true), (float)this.mc.displayWidth / (float)this.mc.displayHeight, 0.05F, this.clipDistance);
(float) this.mc.displayWidth / (float) this.mc.displayHeight, 0.05F, GlStateManager.matrixMode(5888);
this.farPlaneDistance * MathHelper.SQRT_2);
GlStateManager.matrixMode(GL_MODELVIEW);
} }
} }
private void addRainParticles() { private void addRainParticles() {

View File

@ -13,6 +13,7 @@ import java.util.Map;
import net.PeytonPlayz585.shadow.Config; import net.PeytonPlayz585.shadow.Config;
import net.PeytonPlayz585.shadow.CustomSky; import net.PeytonPlayz585.shadow.CustomSky;
import net.PeytonPlayz585.shadow.opengl.OpenGLManager; import net.PeytonPlayz585.shadow.opengl.OpenGLManager;
import net.PeytonPlayz585.shadow.other.CloudRenderer;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom; import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.HString; import net.lax1dude.eaglercraft.v1_8.HString;
import net.lax1dude.eaglercraft.v1_8.Keyboard; import net.lax1dude.eaglercraft.v1_8.Keyboard;
@ -190,8 +191,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
public Set chunksToResortTransparency = new LinkedHashSet(); public Set chunksToResortTransparency = new LinkedHashSet();
public Set chunksToUpdateForced = new LinkedHashSet(); public Set chunksToUpdateForced = new LinkedHashSet();
private CloudRenderer cloudRenderer;
public RenderGlobal(Minecraft mcIn) { public RenderGlobal(Minecraft mcIn) {
this.cloudRenderer = new CloudRenderer(mcIn);
this.mc = mcIn; this.mc = mcIn;
this.renderManager = mcIn.getRenderManager(); this.renderManager = mcIn.getRenderManager();
this.renderEngine = mcIn.getTextureManager(); this.renderEngine = mcIn.getTextureManager();
@ -1488,80 +1491,74 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
} }
public void renderClouds(float partialTicks, int pass) { public void renderClouds(float partialTicks, int pass) {
if (!Config.isCloudsOff()) {
if (this.mc.theWorld.provider.isSurfaceWorld()) { if (this.mc.theWorld.provider.isSurfaceWorld()) {
if (this.mc.gameSettings.func_181147_e() == 2) { if (Config.isCloudsFancy()) {
this.renderCloudsFancy(partialTicks, pass); this.renderCloudsFancy(partialTicks, pass);
} else { } else {
this.cloudRenderer.prepareToRender(false, this.cloudTickCounter, partialTicks);
partialTicks = 0.0F;
GlStateManager.disableCull(); GlStateManager.disableCull();
float f = (float) (this.mc.getRenderViewEntity().lastTickPosY float f9 = (float)(this.mc.getRenderViewEntity().lastTickPosY + (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY) * (double)partialTicks);
+ (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY)
* (double) partialTicks);
boolean flag = true; boolean flag = true;
boolean flag1 = true; boolean flag1 = true;
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
this.renderEngine.bindTexture(locationCloudsPng); this.renderEngine.bindTexture(locationCloudsPng);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
if (this.cloudRenderer.shouldUpdateGlList()) {
this.cloudRenderer.startUpdateGlList();
Vec3 vec3 = this.theWorld.getCloudColour(partialTicks); Vec3 vec3 = this.theWorld.getCloudColour(partialTicks);
float f1 = (float) vec3.xCoord; float f = (float)vec3.xCoord;
float f2 = (float) vec3.yCoord; float f1 = (float)vec3.yCoord;
float f3 = (float) vec3.zCoord; float f2 = (float)vec3.zCoord;
if (pass != 2) { if (pass != 2) {
float f4 = (f1 * 30.0F + f2 * 59.0F + f3 * 11.0F) / 100.0F; float f3 = (f * 30.0F + f1 * 59.0F + f2 * 11.0F) / 100.0F;
float f5 = (f1 * 30.0F + f2 * 70.0F) / 100.0F; float f4 = (f * 30.0F + f1 * 70.0F) / 100.0F;
float f6 = (f1 * 30.0F + f3 * 70.0F) / 100.0F; float f5 = (f * 30.0F + f2 * 70.0F) / 100.0F;
f = f3;
f1 = f4; f1 = f4;
f2 = f5; f2 = f5;
f3 = f6;
} }
float f10 = 4.8828125E-4F; float f10 = 4.8828125E-4F;
double d2 = (double)((float)this.cloudTickCounter + partialTicks); double d2 = (double)((float)this.cloudTickCounter + partialTicks);
double d0 = this.mc.getRenderViewEntity().prevPosX double d0 = this.mc.getRenderViewEntity().prevPosX + (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) * (double)partialTicks + d2 * 0.029999999329447746D;
+ (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) double d1 = this.mc.getRenderViewEntity().prevPosZ + (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ) * (double)partialTicks;
* (double) partialTicks
+ d2 * 0.029999999329447746D;
double d1 = this.mc.getRenderViewEntity().prevPosZ
+ (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ)
* (double) partialTicks;
int i = MathHelper.floor_double(d0 / 2048.0D); int i = MathHelper.floor_double(d0 / 2048.0D);
int j = MathHelper.floor_double(d1 / 2048.0D); int j = MathHelper.floor_double(d1 / 2048.0D);
d0 = d0 - (double)(i * 2048); d0 = d0 - (double)(i * 2048);
d1 = d1 - (double)(j * 2048); d1 = d1 - (double)(j * 2048);
float f7 = this.theWorld.provider.getCloudHeight() - f + 0.33F; float f6 = this.theWorld.provider.getCloudHeight() - f9 + 0.33F;
float f8 = (float) (d0 * 4.8828125E-4D); f6 = f6 + this.mc.gameSettings.ofCloudsHeight * 128.0F;
float f9 = (float) (d1 * 4.8828125E-4D); float f7 = (float)(d0 * 4.8828125E-4D);
float f8 = (float)(d1 * 4.8828125E-4D);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR);
for (int k = -256; k < 256; k += 32) { for (int k = -256; k < 256; k += 32) {
for (int l = -256; l < 256; l += 32) { for (int l = -256; l < 256; l += 32) {
worldrenderer.pos((double) (k + 0), (double) f7, (double) (l + 32)) worldrenderer.pos((double)(k + 0), (double)f6, (double)(l + 32)).tex((double)((float)(k + 0) * 4.8828125E-4F + f7), (double)((float)(l + 32) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex();
.tex((double) ((float) (k + 0) * 4.8828125E-4F + f8), worldrenderer.pos((double)(k + 32), (double)f6, (double)(l + 32)).tex((double)((float)(k + 32) * 4.8828125E-4F + f7), (double)((float)(l + 32) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex();
(double) ((float) (l + 32) * 4.8828125E-4F + f9)) worldrenderer.pos((double)(k + 32), (double)f6, (double)(l + 0)).tex((double)((float)(k + 32) * 4.8828125E-4F + f7), (double)((float)(l + 0) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex();
.color(f1, f2, f3, 0.8F).endVertex(); worldrenderer.pos((double)(k + 0), (double)f6, (double)(l + 0)).tex((double)((float)(k + 0) * 4.8828125E-4F + f7), (double)((float)(l + 0) * 4.8828125E-4F + f8)).color(f, f1, f2, 0.8F).endVertex();
worldrenderer.pos((double) (k + 32), (double) f7, (double) (l + 32))
.tex((double) ((float) (k + 32) * 4.8828125E-4F + f8),
(double) ((float) (l + 32) * 4.8828125E-4F + f9))
.color(f1, f2, f3, 0.8F).endVertex();
worldrenderer.pos((double) (k + 32), (double) f7, (double) (l + 0))
.tex((double) ((float) (k + 32) * 4.8828125E-4F + f8),
(double) ((float) (l + 0) * 4.8828125E-4F + f9))
.color(f1, f2, f3, 0.8F).endVertex();
worldrenderer.pos((double) (k + 0), (double) f7, (double) (l + 0))
.tex((double) ((float) (k + 0) * 4.8828125E-4F + f8),
(double) ((float) (l + 0) * 4.8828125E-4F + f9))
.color(f1, f2, f3, 0.8F).endVertex();
} }
} }
tessellator.draw(); tessellator.draw();
this.cloudRenderer.endUpdateGlList();
}
this.cloudRenderer.renderGlList();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableBlend(); GlStateManager.disableBlend();
GlStateManager.enableCull(); GlStateManager.enableCull();
} }
} }
} }
}
/**+ /**+
* Checks if the given position is to be rendered with cloud fog * Checks if the given position is to be rendered with cloud fog
@ -1571,33 +1568,31 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
} }
private void renderCloudsFancy(float partialTicks, int pass) { private void renderCloudsFancy(float partialTicks, int pass) {
this.cloudRenderer.prepareToRender(true, this.cloudTickCounter, partialTicks);
partialTicks = 0.0F;
GlStateManager.disableCull(); GlStateManager.disableCull();
float f = (float) (this.mc.getRenderViewEntity().lastTickPosY float f = (float)(this.mc.getRenderViewEntity().lastTickPosY + (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY) * (double)partialTicks);
+ (this.mc.getRenderViewEntity().posY - this.mc.getRenderViewEntity().lastTickPosY)
* (double) partialTicks);
Tessellator tessellator = Tessellator.getInstance(); Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer(); WorldRenderer worldrenderer = tessellator.getWorldRenderer();
float f1 = 12.0F; float f1 = 12.0F;
float f2 = 4.0F; float f2 = 4.0F;
double d0 = (double)((float)this.cloudTickCounter + partialTicks); double d0 = (double)((float)this.cloudTickCounter + partialTicks);
double d1 = (this.mc.getRenderViewEntity().prevPosX double d1 = (this.mc.getRenderViewEntity().prevPosX + (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) * (double)partialTicks + d0 * 0.029999999329447746D) / 12.0D;
+ (this.mc.getRenderViewEntity().posX - this.mc.getRenderViewEntity().prevPosX) * (double) partialTicks double d2 = (this.mc.getRenderViewEntity().prevPosZ + (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ) * (double)partialTicks) / 12.0D + 0.33000001311302185D;
+ d0 * 0.029999999329447746D) / 12.0D;
double d2 = (this.mc.getRenderViewEntity().prevPosZ
+ (this.mc.getRenderViewEntity().posZ - this.mc.getRenderViewEntity().prevPosZ) * (double) partialTicks)
/ 12.0D + 0.33000001311302185D;
float f3 = this.theWorld.provider.getCloudHeight() - f + 0.33F; float f3 = this.theWorld.provider.getCloudHeight() - f + 0.33F;
f3 = f3 + this.mc.gameSettings.ofCloudsHeight * 128.0F;
int i = MathHelper.floor_double(d1 / 2048.0D); int i = MathHelper.floor_double(d1 / 2048.0D);
int j = MathHelper.floor_double(d2 / 2048.0D); int j = MathHelper.floor_double(d2 / 2048.0D);
d1 = d1 - (double)(i * 2048); d1 = d1 - (double)(i * 2048);
d2 = d2 - (double)(j * 2048); d2 = d2 - (double)(j * 2048);
this.renderEngine.bindTexture(locationCloudsPng); this.renderEngine.bindTexture(locationCloudsPng);
GlStateManager.enableBlend(); GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0); GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
Vec3 vec3 = this.theWorld.getCloudColour(partialTicks); Vec3 vec3 = this.theWorld.getCloudColour(partialTicks);
float f4 = (float)vec3.xCoord; float f4 = (float)vec3.xCoord;
float f5 = (float)vec3.yCoord; float f5 = (float)vec3.yCoord;
float f6 = (float)vec3.zCoord; float f6 = (float)vec3.zCoord;
if (pass != 2) { if (pass != 2) {
float f7 = (f4 * 30.0F + f5 * 59.0F + f6 * 11.0F) / 100.0F; float f7 = (f4 * 30.0F + f5 * 59.0F + f6 * 11.0F) / 100.0F;
float f8 = (f4 * 30.0F + f5 * 70.0F) / 100.0F; float f8 = (f4 * 30.0F + f5 * 70.0F) / 100.0F;
@ -1634,182 +1629,85 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
case 0: case 0:
GlStateManager.colorMask(false, true, true, true); GlStateManager.colorMask(false, true, true, true);
break; break;
case 1: case 1:
GlStateManager.colorMask(true, false, false, true); GlStateManager.colorMask(true, false, false, true);
break; break;
case 2: case 2:
GlStateManager.colorMask(true, true, true, true); GlStateManager.colorMask(true, true, true, true);
} }
} }
this.cloudRenderer.renderGlList();
}
if (this.cloudRenderer.shouldUpdateGlList()) {
this.cloudRenderer.startUpdateGlList();
for (int j1 = -3; j1 <= 4; ++j1) {
for (int l = -3; l <= 4; ++l) { for (int l = -3; l <= 4; ++l) {
for (int i1 = -3; i1 <= 4; ++i1) {
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL); worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
float f22 = (float) (l * 8); float f22 = (float)(j1 * 8);
float f23 = (float) (i1 * 8); float f23 = (float)(l * 8);
float f24 = f22 - f19; float f24 = f22 - f19;
float f25 = f23 - f20; float f25 = f23 - f20;
if (f3 > -5.0F) { if (f3 > -5.0F) {
worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 8.0F)) worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17), worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
(double) ((f23 + 8.0F) * 0.00390625F + f18)) worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
.color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex(); worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + 8.0F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + 8.0F) * 0.00390625F + f18))
.color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F), (double) (f25 + 0.0F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
worldrenderer.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F), (double) (f25 + 0.0F))
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f10, f11, f12, 0.8F).normal(0.0F, -1.0F, 0.0F).endVertex();
} }
if (f3 <= 5.0F) { if (f3 <= 5.0F) {
worldrenderer worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 8.0F)) worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 8.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17), worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
(double) ((f23 + 8.0F) * 0.00390625F + f18)) worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F - 9.765625E-4F), (double)(f25 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
.color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); }
worldrenderer
.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 8.0F)) if (j1 > -1) {
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17), for (int i1 = 0; i1 < 8; ++i1) {
(double) ((f23 + 8.0F) * 0.00390625F + f18)) worldrenderer.pos((double)(f24 + (float)i1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
.color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos((double)(f24 + (float)i1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)i1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer worldrenderer.pos((double)(f24 + (float)i1 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 0.0F)) worldrenderer.pos((double)(f24 + (float)i1 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)i1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17), }
(double) ((f23 + 0.0F) * 0.00390625F + f18)) }
.color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex();
worldrenderer if (j1 <= 1) {
.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F - 9.765625E-4F), (double) (f25 + 0.0F)) for (int k1 = 0; k1 < 8; ++k1) {
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17), worldrenderer.pos((double)(f24 + (float)k1 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
(double) ((f23 + 0.0F) * 0.00390625F + f18)) worldrenderer.pos((double)(f24 + (float)k1 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 8.0F)).tex((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 8.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
.color(f4, f5, f6, 0.8F).normal(0.0F, 1.0F, 0.0F).endVertex(); worldrenderer.pos((double)(f24 + (float)k1 + 1.0F - 9.765625E-4F), (double)(f3 + 4.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer.pos((double)(f24 + (float)k1 + 1.0F - 9.765625E-4F), (double)(f3 + 0.0F), (double)(f25 + 0.0F)).tex((double)((f22 + (float)k1 + 0.5F) * 0.00390625F + f17), (double)((f23 + 0.0F) * 0.00390625F + f18)).color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
}
} }
if (l > -1) { if (l > -1) {
for (int j1 = 0; j1 < 8; ++j1) { for (int l1 = 0; l1 < 8; ++l1) {
worldrenderer worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)l1 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)l1 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
.pos((double) (f24 + (float) j1 + 0.0F), (double) (f3 + 0.0F), worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)l1 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)l1 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
(double) (f25 + 8.0F)) worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)l1 + 0.0F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)l1 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
.tex((double) ((f22 + (float) j1 + 0.5F) * 0.00390625F + f17), worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)l1 + 0.0F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)l1 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
(double) ((f23 + 8.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) j1 + 0.0F), (double) (f3 + 4.0F),
(double) (f25 + 8.0F))
.tex((double) ((f22 + (float) j1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 8.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) j1 + 0.0F), (double) (f3 + 4.0F),
(double) (f25 + 0.0F))
.tex((double) ((f22 + (float) j1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) j1 + 0.0F), (double) (f3 + 0.0F),
(double) (f25 + 0.0F))
.tex((double) ((f22 + (float) j1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(-1.0F, 0.0F, 0.0F).endVertex();
} }
} }
if (l <= 1) { if (l <= 1) {
for (int k1 = 0; k1 < 8; ++k1) {
worldrenderer
.pos((double) (f24 + (float) k1 + 1.0F - 9.765625E-4F), (double) (f3 + 0.0F),
(double) (f25 + 8.0F))
.tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 8.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) k1 + 1.0F - 9.765625E-4F), (double) (f3 + 4.0F),
(double) (f25 + 8.0F))
.tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 8.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) k1 + 1.0F - 9.765625E-4F), (double) (f3 + 4.0F),
(double) (f25 + 0.0F))
.tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
worldrenderer
.pos((double) (f24 + (float) k1 + 1.0F - 9.765625E-4F), (double) (f3 + 0.0F),
(double) (f25 + 0.0F))
.tex((double) ((f22 + (float) k1 + 0.5F) * 0.00390625F + f17),
(double) ((f23 + 0.0F) * 0.00390625F + f18))
.color(f26, f27, f28, 0.8F).normal(1.0F, 0.0F, 0.0F).endVertex();
}
}
if (i1 > -1) {
for (int l1 = 0; l1 < 8; ++l1) {
worldrenderer
.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F),
(double) (f25 + (float) l1 + 0.0F))
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17),
(double) ((f23 + (float) l1 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F),
(double) (f25 + (float) l1 + 0.0F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + (float) l1 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F),
(double) (f25 + (float) l1 + 0.0F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + (float) l1 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F),
(double) (f25 + (float) l1 + 0.0F))
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17),
(double) ((f23 + (float) l1 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, -1.0F).endVertex();
}
}
if (i1 <= 1) {
for (int i2 = 0; i2 < 8; ++i2) { for (int i2 = 0; i2 < 8; ++i2) {
worldrenderer worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 4.0F), (double)(f25 + (float)i2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)i2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
.pos((double) (f24 + 0.0F), (double) (f3 + 4.0F), worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 4.0F), (double)(f25 + (float)i2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)i2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
(double) (f25 + (float) i2 + 1.0F - 9.765625E-4F)) worldrenderer.pos((double)(f24 + 8.0F), (double)(f3 + 0.0F), (double)(f25 + (float)i2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 8.0F) * 0.00390625F + f17), (double)((f23 + (float)i2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17), worldrenderer.pos((double)(f24 + 0.0F), (double)(f3 + 0.0F), (double)(f25 + (float)i2 + 1.0F - 9.765625E-4F)).tex((double)((f22 + 0.0F) * 0.00390625F + f17), (double)((f23 + (float)i2 + 0.5F) * 0.00390625F + f18)).color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
(double) ((f23 + (float) i2 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 8.0F), (double) (f3 + 4.0F),
(double) (f25 + (float) i2 + 1.0F - 9.765625E-4F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + (float) i2 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 8.0F), (double) (f3 + 0.0F),
(double) (f25 + (float) i2 + 1.0F - 9.765625E-4F))
.tex((double) ((f22 + 8.0F) * 0.00390625F + f17),
(double) ((f23 + (float) i2 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
worldrenderer
.pos((double) (f24 + 0.0F), (double) (f3 + 0.0F),
(double) (f25 + (float) i2 + 1.0F - 9.765625E-4F))
.tex((double) ((f22 + 0.0F) * 0.00390625F + f17),
(double) ((f23 + (float) i2 + 0.5F) * 0.00390625F + f18))
.color(f13, f14, f15, 0.8F).normal(0.0F, 0.0F, 1.0F).endVertex();
} }
} }
tessellator.draw(); tessellator.draw();
} }
} }
this.cloudRenderer.endUpdateGlList();
} }
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
@ -2600,6 +2498,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
} }
} }
public void resetClouds() {
this.cloudRenderer.reset();
}
class ContainerLocalRenderInformation { class ContainerLocalRenderInformation {
final RenderChunk renderChunk; final RenderChunk renderChunk;
final EnumFacing facing; final EnumFacing facing;

View File

@ -82,10 +82,6 @@ public class GameSettings {
public boolean anaglyph; public boolean anaglyph;
public boolean fboEnable = true; public boolean fboEnable = true;
public int limitFramerate = 260; public int limitFramerate = 260;
/**+
* Clouds flag
*/
public int clouds = 1;
public boolean fancyGraphics = false; public boolean fancyGraphics = false;
/**+ /**+
* Smooth Lighting * Smooth Lighting
@ -200,6 +196,12 @@ public class GameSettings {
public boolean ofClearWater = false; public boolean ofClearWater = false;
public int ofBetterGrass = 3; public int ofBetterGrass = 3;
//Detail Settings
/** Clouds flag */
public int clouds = 2;
public int ofClouds = 0;
public float ofCloudsHeight = 0.0F;
//Optifine Animations //Optifine Animations
public int ofAnimatedWater = 0; public int ofAnimatedWater = 0;
public int ofAnimatedLava = 0; public int ofAnimatedLava = 0;
@ -347,6 +349,11 @@ public class GameSettings {
this.ofAoLevel = parFloat1; this.ofAoLevel = parFloat1;
this.mc.renderGlobal.loadRenderers(); this.mc.renderGlobal.loadRenderers();
} }
if (parOptions == GameSettings.Options.CLOUD_HEIGHT) {
this.ofCloudsHeight = parFloat1;
this.mc.renderGlobal.resetClouds();
}
} }
/**+ /**+
@ -370,10 +377,6 @@ public class GameSettings {
this.viewBobbing = !this.viewBobbing; this.viewBobbing = !this.viewBobbing;
} }
if (parOptions == GameSettings.Options.RENDER_CLOUDS) {
this.clouds = (this.clouds + parInt1) % 3;
}
if (parOptions == GameSettings.Options.FORCE_UNICODE_FONT) { if (parOptions == GameSettings.Options.FORCE_UNICODE_FONT) {
this.forceUnicodeFont = !this.forceUnicodeFont; this.forceUnicodeFont = !this.forceUnicodeFont;
this.mc.fontRendererObj this.mc.fontRendererObj
@ -636,6 +639,17 @@ public class GameSettings {
} }
} }
if (parOptions == GameSettings.Options.CLOUDS) {
++this.ofClouds;
if (this.ofClouds > 3) {
this.ofClouds = 0;
}
this.updateRenderClouds();
this.mc.renderGlobal.resetClouds();
}
this.saveOptions(); this.saveOptions();
} }
@ -653,7 +667,8 @@ public class GameSettings {
: (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (float) this.mipmapLevels : (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (float) this.mipmapLevels
: (parOptions == GameSettings.Options.RENDER_DISTANCE ? (float) this.renderDistanceChunks : (parOptions == GameSettings.Options.RENDER_DISTANCE ? (float) this.renderDistanceChunks
: (parOptions == GameSettings.Options.AO_LEVEL ? this.ofAoLevel : (parOptions == GameSettings.Options.AO_LEVEL ? this.ofAoLevel
: 0.0F)))))))))))); : (parOptions == GameSettings.Options.CLOUD_HEIGHT ? this.ofCloudsHeight
: 0.0F)))))))))))));
} }
public boolean getOptionOrdinalValue(GameSettings.Options parOptions) { public boolean getOptionOrdinalValue(GameSettings.Options parOptions) {
@ -738,7 +753,6 @@ public class GameSettings {
return parOptions == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int) (f * 200.0F) + "%")) return parOptions == GameSettings.Options.SENSITIVITY ? (f == 0.0F ? s + I18n.format("options.sensitivity.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.sensitivity.max", new Object[0]) : s + (int) (f * 200.0F) + "%"))
: (parOptions == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int) f1)) : (parOptions == GameSettings.Options.FOV ? (f1 == 70.0F ? s + I18n.format("options.fov.min", new Object[0]) : (f1 == 110.0F ? s + I18n.format("options.fov.max", new Object[0]) : s + (int) f1))
: (parOptions == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == parOptions.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int) f1 + " fps") : (parOptions == GameSettings.Options.FRAMERATE_LIMIT ? (f1 == parOptions.valueMax ? s + I18n.format("options.framerateLimit.max", new Object[0]) : s + (int) f1 + " fps")
: (parOptions == GameSettings.Options.RENDER_CLOUDS ? (f1 == parOptions.valueMin ? s + I18n.format("options.cloudHeight.min", new Object[0]) : s + ((int) f1 + 128))
: (parOptions == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int) (f * 100.0F) + "%")) : (parOptions == GameSettings.Options.GAMMA ? (f == 0.0F ? s + I18n.format("options.gamma.min", new Object[0]) : (f == 1.0F ? s + I18n.format("options.gamma.max", new Object[0]) : s + "+" + (int) (f * 100.0F) + "%"))
: (parOptions == GameSettings.Options.SATURATION ? s + (int) (f * 400.0F) + "%" : (parOptions == GameSettings.Options.SATURATION ? s + (int) (f * 400.0F) + "%"
: (parOptions == GameSettings.Options.CHAT_OPACITY ? s + (int) (f * 90.0F + 10.0F) + "%" : (parOptions == GameSettings.Options.CHAT_OPACITY ? s + (int) (f * 90.0F + 10.0F) + "%"
@ -749,6 +763,7 @@ public class GameSettings {
: (parOptions == GameSettings.Options.RENDER_DISTANCE ? s + (int) f1 + (f1 == 1.0F ? " chunk" : " chunks") : (parOptions == GameSettings.Options.RENDER_DISTANCE ? s + (int) f1 + (f1 == 1.0F ? " chunk" : " chunks")
: (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") : (parOptions == GameSettings.Options.MIPMAP_LEVELS ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%")
: (parOptions == GameSettings.Options.AO_LEVEL ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%") : (parOptions == GameSettings.Options.AO_LEVEL ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%")
: (parOptions == GameSettings.Options.CLOUD_HEIGHT ? (f == 0.0F ? s + I18n.format("options.off", new Object[0]) : s + (int) (f * 100.0F) + "%")
: "yee"))))))))))))); : "yee")))))))))))));
} else if (parOptions.getEnumBoolean()) { } else if (parOptions.getEnumBoolean()) {
boolean flag = this.getOptionOrdinalValue(parOptions); boolean flag = this.getOptionOrdinalValue(parOptions);
@ -761,8 +776,6 @@ public class GameSettings {
return s + getTranslation(PARTICLES, this.particleSetting); return s + getTranslation(PARTICLES, this.particleSetting);
} else if (parOptions == GameSettings.Options.AMBIENT_OCCLUSION) { } else if (parOptions == GameSettings.Options.AMBIENT_OCCLUSION) {
return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion); return s + getTranslation(AMBIENT_OCCLUSIONS, this.ambientOcclusion);
} else if (parOptions == GameSettings.Options.RENDER_CLOUDS) {
return s + getTranslation(field_181149_aW, this.clouds);
} else if (parOptions == GameSettings.Options.GRAPHICS) { } else if (parOptions == GameSettings.Options.GRAPHICS) {
if (this.fancyGraphics) { if (this.fancyGraphics) {
return s + I18n.format("options.graphics.fancy", new Object[0]); return s + I18n.format("options.graphics.fancy", new Object[0]);
@ -883,6 +896,20 @@ public class GameSettings {
return this.ofSmoothFps ? s + "ON" : s + "OFF"; return this.ofSmoothFps ? s + "ON" : s + "OFF";
} else if (parOptions == GameSettings.Options.CHUNK_UPDATES) { } else if (parOptions == GameSettings.Options.CHUNK_UPDATES) {
return s + this.ofChunkUpdates; return s + this.ofChunkUpdates;
} else if (parOptions == GameSettings.Options.CLOUDS) {
switch (this.ofClouds) {
case 1:
return s + "Fast";
case 2:
return s + "Fancy";
case 3:
return s + "OFF";
default:
return s + "Default";
}
} else { } else {
return s; return s;
} }
@ -973,16 +1000,6 @@ public class GameSettings {
} }
} }
if (astring[0].equals("renderClouds")) {
if (astring[1].equals("true")) {
this.clouds = 2;
} else if (astring[1].equals("false")) {
this.clouds = 0;
} else if (astring[1].equals("fast")) {
this.clouds = 1;
}
}
if (astring[0].equals("resourcePacks")) { if (astring[0].equals("resourcePacks")) {
this.resourcePacks.clear(); this.resourcePacks.clear();
for (Object o : (new JSONArray(s.substring(s.indexOf(58) + 1))).toList()) { for (Object o : (new JSONArray(s.substring(s.indexOf(58) + 1))).toList()) {
@ -1295,6 +1312,17 @@ public class GameSettings {
this.ofChunkUpdates = Config.limit(this.ofChunkUpdates, 1, 5); this.ofChunkUpdates = Config.limit(this.ofChunkUpdates, 1, 5);
} }
if (astring[0].equals("ofClouds") && astring.length >= 2) {
this.ofClouds = Integer.valueOf(astring[1]).intValue();
this.ofClouds = Config.limit(this.ofClouds, 0, 3);
this.updateRenderClouds();
}
if (astring[0].equals("ofCloudsHeight") && astring.length >= 2) {
this.ofCloudsHeight = Float.valueOf(astring[1]).floatValue();
this.ofCloudsHeight = Config.limit(this.ofCloudsHeight, 0.0F, 1.0F);
}
Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode()); Keyboard.setFunctionKeyModifier(keyBindFunction.getKeyCode());
for (SoundCategory soundcategory : SoundCategory.values()) { for (SoundCategory soundcategory : SoundCategory.values()) {
@ -1351,17 +1379,6 @@ public class GameSettings {
printwriter.println("difficulty:" + this.difficulty.getDifficultyId()); printwriter.println("difficulty:" + this.difficulty.getDifficultyId());
printwriter.println("fancyGraphics:" + this.fancyGraphics); printwriter.println("fancyGraphics:" + this.fancyGraphics);
printwriter.println("ao:" + this.ambientOcclusion); printwriter.println("ao:" + this.ambientOcclusion);
switch (this.clouds) {
case 0:
printwriter.println("renderClouds:false");
break;
case 1:
printwriter.println("renderClouds:fast");
break;
case 2:
printwriter.println("renderClouds:true");
}
printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks)); printwriter.println("resourcePacks:" + toJSONArray(this.resourcePacks));
printwriter.println("incompatibleResourcePacks:" + toJSONArray(this.field_183018_l)); printwriter.println("incompatibleResourcePacks:" + toJSONArray(this.field_183018_l));
printwriter.println("lastServer:" + this.lastServer); printwriter.println("lastServer:" + this.lastServer);
@ -1440,6 +1457,8 @@ public class GameSettings {
} }
printwriter.println("ofSmoothFps:" + this.ofSmoothFps); printwriter.println("ofSmoothFps:" + this.ofSmoothFps);
printwriter.println("ofChunkUpdates:" + this.ofChunkUpdates); printwriter.println("ofChunkUpdates:" + this.ofChunkUpdates);
printwriter.println("ofClouds:" + this.ofClouds);
printwriter.println("ofCloudsHeight:" + this.ofCloudsHeight);
for (KeyBinding keybinding : this.keyBindings) { for (KeyBinding keybinding : this.keyBindings) {
printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode()); printwriter.println("key_" + keybinding.getKeyDescription() + ":" + keybinding.getKeyCode());
@ -1522,10 +1541,6 @@ public class GameSettings {
this.sendSettingsToServer(); this.sendSettingsToServer();
} }
public int func_181147_e() {
return this.renderDistanceChunks >= 4 ? this.clouds : 0;
}
public boolean func_181148_f() { public boolean func_181148_f() {
return this.field_181150_U; return this.field_181150_U;
} }
@ -1549,7 +1564,6 @@ public class GameSettings {
ANAGLYPH("options.anaglyph", false, true), ANAGLYPH("options.anaglyph", false, true),
FRAMERATE_LIMIT("options.framerateLimit", true, false, 10.0F, 260.0F, 10.0F), FRAMERATE_LIMIT("options.framerateLimit", true, false, 10.0F, 260.0F, 10.0F),
FBO_ENABLE("options.fboEnable", false, true), FBO_ENABLE("options.fboEnable", false, true),
RENDER_CLOUDS("options.renderClouds", false, false),
GRAPHICS("options.graphics", false, false), GRAPHICS("options.graphics", false, false),
AMBIENT_OCCLUSION("options.ao", false, false), AMBIENT_OCCLUSION("options.ao", false, false),
GUI_SCALE("options.guiScale", false, false), GUI_SCALE("options.guiScale", false, false),
@ -1609,7 +1623,9 @@ public class GameSettings {
FOG_START("Fog Start", false, false), FOG_START("Fog Start", false, false),
SHADER_PROFILE("Profile", false, false), SHADER_PROFILE("Profile", false, false),
SMOOTH_FPS("Smooth FPS", false, false), SMOOTH_FPS("Smooth FPS", false, false),
CHUNK_UPDATES("Chunk Updates", false, false); CHUNK_UPDATES("Chunk Updates", false, false),
CLOUDS("Clouds", false, false),
CLOUD_HEIGHT("Cloud Height", true, false);
private final boolean enumFloat; private final boolean enumFloat;
private final boolean enumBoolean; private final boolean enumBoolean;
@ -1714,4 +1730,27 @@ public class GameSettings {
private void updateWaterOpacity() { private void updateWaterOpacity() {
ClearWater.updateWaterOpacity(this, this.mc.theWorld); ClearWater.updateWaterOpacity(this, this.mc.theWorld);
} }
private void updateRenderClouds() {
switch (this.ofClouds) {
case 1:
this.clouds = 1;
break;
case 2:
this.clouds = 2;
break;
case 3:
this.clouds = 0;
break;
default:
if (this.fancyGraphics) {
this.clouds = 2;
} else {
this.clouds = 1;
}
}
}
} }