Ajout du FOG dans un biome
-
Merci !

Je pence avoir trouvé ce qui m’intersse:/** * Sets up the fog to be rendered. If the arg passed in is -1 the fog starts at 0 and goes to 80% of far plane * distance and is used for sky rendering. */ private void setupFog(int par1, float par2) { EntityLivingBase entitylivingbase = this.mc.renderViewEntity; boolean flag = false; if (entitylivingbase instanceof EntityPlayer) { flag = ((EntityPlayer)entitylivingbase).capabilities.isCreativeMode; } if (par1 == 999) { GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); GL11.glFogf(GL11.GL_FOG_START, 0.0F); GL11.glFogf(GL11.GL_FOG_END, 8.0F); if (GLContext.getCapabilities().GL_NV_fog_distance) { GL11.glFogi(34138, 34139); } GL11.glFogf(GL11.GL_FOG_START, 0.0F); } else { GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(this.fogColorRed, this.fogColorGreen, this.fogColorBlue, 1.0F)); GL11.glNormal3f(0.0F, -1.0F, 0.0F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); int j = ActiveRenderInfo.getBlockIdAtEntityViewpoint(this.mc.theWorld, entitylivingbase, par2); float f1; if (entitylivingbase.isPotionActive(Potion.blindness)) { f1 = 5.0F; int k = entitylivingbase.getActivePotionEffect(Potion.blindness).getDuration(); if (k < 20) { f1 = 5.0F + (this.farPlaneDistance - 5.0F) * (1.0F - (float)k / 20.0F); } GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); if (par1 < 0) { GL11.glFogf(GL11.GL_FOG_START, 0.0F); GL11.glFogf(GL11.GL_FOG_END, f1 * 0.8F); } else { GL11.glFogf(GL11.GL_FOG_START, f1 * 0.25F); GL11.glFogf(GL11.GL_FOG_END, f1); } if (GLContext.getCapabilities().GL_NV_fog_distance) { GL11.glFogi(34138, 34139); } } else if (this.cloudFog) { GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F); } else if (j > 0 && Block.blocksList[j].blockMaterial == Material.water) { GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); if (entitylivingbase.isPotionActive(Potion.waterBreathing)) { GL11.glFogf(GL11.GL_FOG_DENSITY, 0.05F); } else { GL11.glFogf(GL11.GL_FOG_DENSITY, 0.1F - (float)EnchantmentHelper.getRespiration(entitylivingbase) * 0.03F); } } else if (j > 0 && Block.blocksList[j].blockMaterial == Material.lava) { GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_EXP); GL11.glFogf(GL11.GL_FOG_DENSITY, 2.0F); } else { f1 = this.farPlaneDistance; if (this.mc.theWorld.provider.getWorldHasVoidParticles() && !flag) { double d0 = (double)((entitylivingbase.getBrightnessForRender(par2) & 15728640) >> 20) / 16.0D + (entitylivingbase.lastTickPosY + (entitylivingbase.posY - entitylivingbase.lastTickPosY) * (double)par2 + 4.0D) / 32.0D; if (d0 < 1.0D) { if (d0 < 0.0D) { d0 = 0.0D; } d0 *= d0; float f2 = 100.0F * (float)d0; if (f2 < 5.0F) { f2 = 5.0F; } if (f1 > f2) { f1 = f2; } } } GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); if (par1 < 0) { GL11.glFogf(GL11.GL_FOG_START, 0.0F); GL11.glFogf(GL11.GL_FOG_END, f1 * 0.8F); } else { GL11.glFogf(GL11.GL_FOG_START, f1 * 0.25F); GL11.glFogf(GL11.GL_FOG_END, f1); } if (GLContext.getCapabilities().GL_NV_fog_distance) { GL11.glFogi(34138, 34139); } if (this.mc.theWorld.provider.doesXZShowFog((int)entitylivingbase.posX, (int)entitylivingbase.posZ)) { GL11.glFogf(GL11.GL_FOG_START, f1 * 0.05F); GL11.glFogf(GL11.GL_FOG_END, Math.min(f1, 192.0F) * 0.5F); } } GL11.glEnable(GL11.GL_COLOR_MATERIAL); GL11.glColorMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT); } }
Mais par contre je n’est aucun idée de comment appliquer ça au joueur qui est dans le biome.

-
Tu met ça dans la classe de ton biome et tu fais un updateTick
-
Merci mais je ne comprend rien au :
GL11.GL_FOG_MOD GL11.GL_FOG_COLOR GL11.GL_FOG_START GL11.GL_FOG_END GL11.GL_FOG GL11.GL_FOG_DENSITY -
c’est les différent paramètre du fog
-
Oui mais comment on peut bien réglé c’est paramètre?
De plus toute les chose que j’essaye de faire n’ont aucun effet mit appart de faire lag:
private FloatBuffer setFogColorBuffer(float par1, float par2, float par3, float par4) { this.fogColorBuffer.clear(); this.fogColorBuffer.put(par1).put(par2).put(par3).put(par4); this.fogColorBuffer.flip(); return this.fogColorBuffer; } public void updateTick(World world, int x, int y, int z) { GL11.glFog(GL11.GL_FOG_COLOR, this.setFogColorBuffer(0.0F, 0.0F, 0.0F, 1.0F)); GL11.glFogi(GL11.GL_FOG_MODE, GL11.GL_LINEAR); GL11.glFogf(GL11.GL_FOG_START, 0.0F); GL11.glFogf(GL11.GL_FOG_END, 8.0F); System.out.println("Test!"); } -
Alors la je sais pas j’ai jamais test le fog
-
Pas grave,je vais continuer de chercher:)
-
ok prévient moi si tu y arrive
-
Ok np

De toute façon si je y arrive je pence faire un tuto plus poussé pour les biomes en 1.6

-
ok merci ^^
-
J’ai enfin trouvé comment a fais le coddeur de biome o plenty tout est dans cette importe :
import worldcore.interfaces.IWCFog;