Skip to content
Permalink
Browse files

ugly hack: draw block particles with depth buffer on

  • Loading branch information...
octarine-noise committed Nov 7, 2014
1 parent 882f689 commit ccb45c7f403b5550426cfad91ffc0abeebc98126
@@ -2,6 +2,8 @@

import java.awt.Color;

import org.lwjgl.opengl.GL11;

import mods.betterfoliage.client.BetterFoliageClient;
import mods.betterfoliage.common.config.Config;
import mods.betterfoliage.common.util.Double3;
@@ -91,6 +93,8 @@ public void renderParticle(Tessellator tessellator, float partialTickTime, float
Double3 vec2Rot = vec1.scale(-sin[particleRotation]).add(vec2.scale(cos[particleRotation]));

tessellator.setColorRGBA_F(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha);

if (Config.leafFXOpacityHack) GL11.glDepthMask(true);
addVertex(tessellator, center.sub(vec1Rot), maxU, maxV);
addVertex(tessellator, center.sub(vec2Rot), maxU, minV);
addVertex(tessellator, center.add(vec1Rot), minU, minV);
@@ -90,6 +90,7 @@
public static double leafFXChance;
public static double leafFXPerturb;
public static double leafFXLifetime;
public static boolean leafFXOpacityHack;

public static boolean soulFXEnabled;
public static double soulFXChance;
@@ -185,6 +186,7 @@ public static void updateValues() {
leafFXChance = getDouble(Category.fallingLeaves, "chance", 0.05, 0.001, 1.0, "betterfoliage.fallingLeaves.chance");
leafFXPerturb = getDouble(Category.fallingLeaves, "perturb", 0.25, 0.01, 1.0, "betterfoliage.fallingLeaves.perturb");
leafFXLifetime = getDouble(Category.fallingLeaves, "lifetime", 5.0, 1.0, 15.0, "betterfoliage.fallingLeaves.lifetime");
leafFXOpacityHack = getBoolean(Category.fallingLeaves, "opacityHack", true, "betterfoliage.enabled.fallingLeaves.opacityHack");

soulFXEnabled = getBoolean(Category.risingSoul, "enabled", true, "betterfoliage.enabled");
soulFXChance = getDouble(Category.risingSoul, "chance", 0.02, 0.001, 1.0, "betterfoliage.risingSoul.chance");
@@ -228,7 +230,7 @@ public static void updateValues() {
setOrder(Category.algae, "enabled", "hOffset", "heightMin", "heightMax", "size", "population", "biomeList");
setOrder(Category.coral, "enabled", "shallowWater", "hOffset", "vOffset", "size", "crustSize", "population", "chance", "biomeList");
setOrder(Category.netherrack, "enabled", "hOffset", "heightMin", "heightMax", "size");
setOrder(Category.fallingLeaves, "enabled", "chance", "size", "lifetime", "speed", "windStrength", "stormStrength", "perturb");
setOrder(Category.fallingLeaves, "enabled", "chance", "size", "lifetime", "speed", "windStrength", "stormStrength", "perturb", "opacityHack");
setOrder(Category.risingSoul, "enabled", "chance", "speed", "perturb", "headSize", "trailSize", "sizeDecay", "opacity", "opacityDecay", "lifetime", "trailLength", "trailDensity");
setOrder(Category.connectedGrass, "classic", "aggressive");
}
@@ -102,6 +102,8 @@ betterfoliage.fallingLeaves.perturb=Perturbation
betterfoliage.fallingLeaves.perturb.tooltip=Magnitude of perturbation effect. Adds a corkscrew-like motion to the particle synchronized to its rotation
betterfoliage.fallingLeaves.lifetime=Maximum lifetime
betterfoliage.fallingLeaves.lifetime.tooltip=Maximum lifetime of particle in seconds. Minimum lifetime is 60%% of this value
betterfoliage.enabled.fallingLeaves.opacityHack=Opaque particles
betterfoliage.enabled.fallingLeaves.opacityHack.tooltip=Stop transparent blocks obscuring particles even when particle is in front. WARNING: may cause glitches.

betterfoliage.risingSoul=Rising souls
betterfoliage.risingSoul.tooltip=Rising soul particle FX emitted from the top of soulsand blocks

0 comments on commit ccb45c7

Please sign in to comment.
You can’t perform that action at this time.