Because of licensing, I am pretty sure I am not allowed to share the shader pack, but I will describe the tweaks I made to the default Complementary Shader to achieve these visuals. It required a bit of tinkering.

By default, Iris/Oculus can only detect vanilla biomes using the BIOME_PLAINS format. It can also detect temperature, which is what I used to make this work. Right now, the shader detects every biome that has a temperature value of 0.7, and then applies a lighting boost and changes the default cave fog to a tinted, lighter version. If any of the vanilla or modded biomes share a temperature value of 0.7, head to the Alex's Caves mod folder -> data -> worldgen -> biome and change the temperature value of Candy Cavity to be something different. Keep in mind that drastic temperature changes can break the biome's logic.

Patches:

In shaders.properties, add

uniform.float.inCandyCavity = smooth(54, if(equals(temperature, 0.7, 0.001), 1.0, 0.0), 15, 15)

under #if MC_VERSION >= 11600. This line allows the shader to detect biomes with a temperature value of 0.7 or near.

In uniforms.glsl, add

uniform float inCandyCavity;

In minimumLighting.glsl, add

minLighting += inCandyCavity * vec3(0.5, 0.5, 0.75);

right before return minLighting;. This line adds a night vision-like effect to the player when entering the Candy Cavity biome.

In mainFog.glsl, replace

    void DoCaveFog(inout vec4 color, float lViewPos) {
        float fog = GetCaveFactor() * (0.9 - 0.9 * exp(- lViewPos * 0.015 * CAVE_FOG_DENSITY));
        color = mix(color, vec4(caveFogColor, 0.0), fog);
    }

with

    void DoCaveFog(inout vec4 color, float lViewPos) {
        float cave = GetCaveFactor();
        float fogBase = cave * (0.9 - 0.9 * exp(-lViewPos * 0.015 * CAVE_FOG_DENSITY));
        float candy = clamp(inCandyCavity, 0.0, 1.0);
        float candyDensityMul = mix(1.0, 0.20, candy);
        float fog = cave * (0.9 - 0.9 * exp(-lViewPos * 0.015 * CAVE_FOG_DENSITY * candyDensityMul));
        float candyMaxFog = mix(1.0, 0.60, candy);
        fog = min(fog, candyMaxFog);
        vec3 fogCol = caveFogColor;
        vec3 candyTint = vec3(0.9647, 0.7608, 0.8118);
        fogCol = mix(fogCol, candyTint, candy);
        color = mix(color, vec4(fogCol, 0.0), fog);
    }

This changes the fog similar to the original mod. To tweak the thickness of the fog, change candyDensityMul and candyMaxFog (I set them to 0.20 and 0.60 because I think they look the best). You can also change the fog color. Right now, it is set to its original color provided by the mod.

That really is the end of all you have to do! The best part is, same steps can be done to fix Primordial Caves as well as Toxic Caves. I will share the tweaks I will make for those biomes, too. Right now, I was just too excited to share that you can work around this issue, even though it is not perfect!



by bblunder_

Share.

Comments are closed.