custommods

This commit is contained in:
samsonsin
2025-05-29 23:31:29 +02:00
committed by samsonsin
parent 7a590ecbfc
commit f4bd9ce61d
800 changed files with 19540 additions and 0 deletions

View File

@@ -0,0 +1,153 @@
//FXAA 3.11 from http://blog.simonrodriguez.fr/articles/30-07-2016_implementing_fxaa.html
float quality[12] = float[12] (1.0, 1.0, 1.0, 1.0, 1.0, 1.5, 2.0, 2.0, 2.0, 2.0, 4.0, 8.0);
void FXAA311(inout vec3 color) {
float edgeThresholdMin = 0.03125;
float edgeThresholdMax = 0.0625;
float subpixelQuality = 0.75;
int iterations = 12;
vec2 view = 1.0 / vec2(viewWidth, viewHeight);
float lumaCenter = GetLuminance(color);
float lumaDown = GetLuminance(texture2D(colortex1, texCoord + vec2( 0.0, -1.0) * view).rgb);
float lumaUp = GetLuminance(texture2D(colortex1, texCoord + vec2( 0.0, 1.0) * view).rgb);
float lumaLeft = GetLuminance(texture2D(colortex1, texCoord + vec2(-1.0, 0.0) * view).rgb);
float lumaRight = GetLuminance(texture2D(colortex1, texCoord + vec2( 1.0, 0.0) * view).rgb);
float lumaMin = min(lumaCenter, min(min(lumaDown, lumaUp), min(lumaLeft, lumaRight)));
float lumaMax = max(lumaCenter, max(max(lumaDown, lumaUp), max(lumaLeft, lumaRight)));
float lumaRange = lumaMax - lumaMin;
if (lumaRange > max(edgeThresholdMin, lumaMax * edgeThresholdMax)) {
float lumaDownLeft = GetLuminance(texture2D(colortex1, texCoord + vec2(-1.0, -1.0) * view).rgb);
float lumaUpRight = GetLuminance(texture2D(colortex1, texCoord + vec2( 1.0, 1.0) * view).rgb);
float lumaUpLeft = GetLuminance(texture2D(colortex1, texCoord + vec2(-1.0, 1.0) * view).rgb);
float lumaDownRight = GetLuminance(texture2D(colortex1, texCoord + vec2( 1.0, -1.0) * view).rgb);
float lumaDownUp = lumaDown + lumaUp;
float lumaLeftRight = lumaLeft + lumaRight;
float lumaLeftCorners = lumaDownLeft + lumaUpLeft;
float lumaDownCorners = lumaDownLeft + lumaDownRight;
float lumaRightCorners = lumaDownRight + lumaUpRight;
float lumaUpCorners = lumaUpRight + lumaUpLeft;
float edgeHorizontal = abs(-2.0 * lumaLeft + lumaLeftCorners ) +
abs(-2.0 * lumaCenter + lumaDownUp ) * 2.0 +
abs(-2.0 * lumaRight + lumaRightCorners);
float edgeVertical = abs(-2.0 * lumaUp + lumaUpCorners ) +
abs(-2.0 * lumaCenter + lumaLeftRight ) * 2.0 +
abs(-2.0 * lumaDown + lumaDownCorners );
bool isHorizontal = (edgeHorizontal >= edgeVertical);
float luma1 = isHorizontal ? lumaDown : lumaLeft;
float luma2 = isHorizontal ? lumaUp : lumaRight;
float gradient1 = luma1 - lumaCenter;
float gradient2 = luma2 - lumaCenter;
bool is1Steepest = abs(gradient1) >= abs(gradient2);
float gradientScaled = 0.25 * max(abs(gradient1), abs(gradient2));
float stepLength = isHorizontal ? view.y : view.x;
float lumaLocalAverage = 0.0;
if (is1Steepest) {
stepLength = - stepLength;
lumaLocalAverage = 0.5 * (luma1 + lumaCenter);
} else {
lumaLocalAverage = 0.5 * (luma2 + lumaCenter);
}
vec2 currentUv = texCoord;
if (isHorizontal) {
currentUv.y += stepLength * 0.5;
} else {
currentUv.x += stepLength * 0.5;
}
vec2 offset = isHorizontal ? vec2(view.x, 0.0) : vec2(0.0, view.y);
vec2 uv1 = currentUv - offset;
vec2 uv2 = currentUv + offset;
float lumaEnd1 = GetLuminance(texture2D(colortex1, uv1).rgb);
float lumaEnd2 = GetLuminance(texture2D(colortex1, uv2).rgb);
lumaEnd1 -= lumaLocalAverage;
lumaEnd2 -= lumaLocalAverage;
bool reached1 = abs(lumaEnd1) >= gradientScaled;
bool reached2 = abs(lumaEnd2) >= gradientScaled;
bool reachedBoth = reached1 && reached2;
if (!reached1) {
uv1 -= offset;
}
if (!reached2) {
uv2 += offset;
}
if (!reachedBoth) {
for(int i = 2; i < iterations; i++) {
if (!reached1) {
lumaEnd1 = GetLuminance(texture2D(colortex1, uv1).rgb);
lumaEnd1 = lumaEnd1 - lumaLocalAverage;
}
if (!reached2) {
lumaEnd2 = GetLuminance(texture2D(colortex1, uv2).rgb);
lumaEnd2 = lumaEnd2 - lumaLocalAverage;
}
reached1 = abs(lumaEnd1) >= gradientScaled;
reached2 = abs(lumaEnd2) >= gradientScaled;
reachedBoth = reached1 && reached2;
if (!reached1) {
uv1 -= offset * quality[i];
}
if (!reached2) {
uv2 += offset * quality[i];
}
if (reachedBoth) break;
}
}
float distance1 = isHorizontal ? (texCoord.x - uv1.x) : (texCoord.y - uv1.y);
float distance2 = isHorizontal ? (uv2.x - texCoord.x) : (uv2.y - texCoord.y);
bool isDirection1 = distance1 < distance2;
float distanceFinal = min(distance1, distance2);
float edgeThickness = (distance1 + distance2);
float pixelOffset = - distanceFinal / edgeThickness + 0.5;
bool isLumaCenterSmaller = lumaCenter < lumaLocalAverage;
bool correctVariation = ((isDirection1 ? lumaEnd1 : lumaEnd2) < 0.0) != isLumaCenterSmaller;
float finalOffset = correctVariation ? pixelOffset : 0.0;
float lumaAverage = (1.0 / 12.0) * (2.0 * (lumaDownUp + lumaLeftRight) + lumaLeftCorners + lumaRightCorners);
float subPixelOffset1 = clamp(abs(lumaAverage - lumaCenter) / lumaRange, 0.0, 1.0);
float subPixelOffset2 = (-2.0 * subPixelOffset1 + 3.0) * subPixelOffset1 * subPixelOffset1;
float subPixelOffsetFinal = subPixelOffset2 * subPixelOffset2 * subpixelQuality;
finalOffset = max(finalOffset, subPixelOffsetFinal);
// Compute the final UV coordinates.
vec2 finalUv = texCoord;
if (isHorizontal) {
finalUv.y += finalOffset * stepLength;
} else {
finalUv.x += finalOffset * stepLength;
}
color = texture2D(colortex1, finalUv).rgb;
}
}

View File

@@ -0,0 +1,71 @@
/*
Complementary Shaders by EminGT, based on BSL Shaders by Capt Tatsu
*/
#include "/lib/util/reprojection.glsl"
ivec2 neighbourhoodOffsets[8] = ivec2[8](
ivec2(-1, -1),
ivec2( 0, -1),
ivec2( 1, -1),
ivec2(-1, 0),
ivec2( 1, 0),
ivec2(-1, 1),
ivec2( 0, 1),
ivec2( 1, 1)
);
void NeighbourhoodClamping(vec3 color, inout vec3 tempColor, float depth, inout float edge) {
vec3 minclr = color, maxclr = color;
ivec2 texelCoord = ivec2(gl_FragCoord.xy);
for (int i = 0; i < 8; i++) {
float depthCheck = texelFetch(depthtex1, texelCoord + neighbourhoodOffsets[i], 0).r;
if (abs(GetLinearDepth(depthCheck) - GetLinearDepth(depth)) > 0.09) edge = 0.25;
vec3 clr = texelFetch(colortex1, texelCoord + neighbourhoodOffsets[i], 0).rgb;
minclr = min(minclr, clr); maxclr = max(maxclr, clr);
}
tempColor = clamp(tempColor, minclr, maxclr);
}
void TAA(inout vec3 color, inout vec4 temp) {
float depth = texture2D(depthtex1, texCoord).r;
float noTAA = texture2D(colortex7, texCoord).r;
if (depth < 0.56 || noTAA > 0.5) { // Fixes entities and hand
return;
}
vec3 coord = vec3(texCoord, depth);
vec2 prvCoord = Reprojection(coord);
vec2 view = vec2(viewWidth, viewHeight);
vec3 tempColor = texture2D(colortex2, prvCoord).gba;
if (tempColor == vec3(0.0)) { // Fixes the first frame
temp = vec4(temp.r, color);
return;
}
float edge = 0.0;
NeighbourhoodClamping(color, tempColor, depth, edge);
vec2 velocity = (texCoord - prvCoord.xy) * view;
float blendFactor = float(prvCoord.x > 0.0 && prvCoord.x < 1.0 &&
prvCoord.y > 0.0 && prvCoord.y < 1.0);
#if AA == 2 || AA == 3
float blendMinimum = 0.3;
#elif AA == 4
float blendMinimum = 0.6;
#endif
float blendVariable = 0.25;
float blendConstant = 0.65;
float lengthVelocity = length(velocity) * 50;
blendFactor *= max(exp(-lengthVelocity) * blendVariable + blendConstant - lengthVelocity * edge, blendMinimum);
color = mix(color, tempColor, blendFactor);
temp = vec4(temp.r, color);
//if (edge > 0.05) color.rgb = vec3(1.0, 0.0, 1.0);
}

View File

@@ -0,0 +1,257 @@
#if MC_VERSION >= 11900
uniform float darknessFactor;
#endif
#ifdef OVERWORLD
#include "/lib/atmospherics/sunGlare.glsl"
#endif
vec3 Fog1(vec3 color, float lWorldPos, float lViewPos, vec3 nViewPos, vec3 extra, float NdotU) {
#if defined OVERWORLD && !defined ONESEVEN && !defined TWO
#if FOG1_TYPE < 2
float fog = lWorldPos / far * (1.0/FOG1_DISTANCE_M);
#else
float fog = lViewPos / far * (1.025/FOG1_DISTANCE_M);
#endif
fog *= fog;
fog *= fog;
fog *= fog * fog;
fog = 1.0 - exp(-6.0 * fog);
if (fog > 0.0) {
vec3 artificialFogColor = GetSkyColor(lightCol, NdotU, nViewPos, false);
artificialFogColor = SunGlare(artificialFogColor, nViewPos, lightCol);
#ifdef CAVE_SKY_FIX
artificialFogColor *= 1.0 - isEyeInCave;
#endif
color.rgb = mix(color.rgb, artificialFogColor, fog);
}
#endif
#if defined NETHER && defined NETHER_FOG // extra = nether smoke (if enabled)
#if FOG1_TYPE > 0
float fog = lViewPos / far * (1.0/FOG1_DISTANCE_M);
#else
float fog = lWorldPos / far * (1.0/FOG1_DISTANCE_M);
#endif
fog *= fog;
fog *= fog;
fog = 1.0 - exp(-8.0 * fog);
vec3 artificialFogColor = pow((netherCol * 2.5) / NETHER_I, vec3(2.2)) * 4;
#ifdef NETHER_SMOKE
artificialFogColor += extra * fog;
#endif
color.rgb = mix(color.rgb, artificialFogColor, fog);
#endif
#ifdef END // extra = ender nebula (if enabled)
float fog = lWorldPos / far * (1.5/FOG1_DISTANCE_M);
fog = 1.0 - exp(-0.1 * pow(fog, 10.0));
if (fog > 0.0) {
vec3 artificialFogColor = endCol * (0.035 + 0.02 * vsBrightness);
#ifdef ENDER_NEBULA
artificialFogColor += extra * fog;
#endif
color.rgb = mix(color.rgb, artificialFogColor, fog);
}
#endif
#ifdef TWO
float fog = lWorldPos / far * (4.0/FOG1_DISTANCE_M);
fog = 1.0 - exp(-0.1 * pow(fog, 3.0));
//float NdotU = 1.0 - max(dot(nViewPos, upVec), 0.0);
NdotU = 1.0 - max(NdotU, 0.0);
NdotU = NdotU * NdotU;
#ifndef ABYSS
vec3 midnightPurple = vec3(0.0003, 0.0004, 0.002) * 1.25;
vec3 midnightFogColor = fogColor * fogColor * 0.3;
#else
vec3 midnightPurple = skyColor * skyColor * 0.00075;
vec3 midnightFogColor = fogColor * fogColor * 0.09;
#endif
vec3 artificialFogColor = mix(midnightPurple, midnightFogColor, NdotU);
color.rgb = mix(color.rgb, artificialFogColor, fog);
#endif
#ifdef SEVEN
float fog = lWorldPos / far * (1.5/FOG1_DISTANCE_M);
fog = 1.0 - exp(-0.1 * pow(fog, 10.0));
float cosT = dot(nViewPos, upVec);
vec3 twilightPurple = vec3(0.005, 0.006, 0.018);
vec3 twilightGreen = vec3(0.015, 0.03, 0.02);
#ifdef TWENTY
twilightPurple = twilightGreen * 0.1;
#endif
vec3 artificialFogColor = 2 * (twilightPurple * 2 * clamp(pow(cosT, 0.7), 0.0, 1.0) + twilightGreen * (1-clamp(pow(cosT, 0.7), 0.0, 1.0)));
color.rgb = mix(color.rgb, artificialFogColor, fog);
#endif
#ifdef ONESEVEN
float fogoneseven = lWorldPos / 16 * (1.35-sunVisibility*0.35);
fogoneseven = 1.0 - exp(-0.1 * pow(fogoneseven, 3.0));
if (fogoneseven > 0.0) {
vec3 artificialFogColor = GetSkyColor(lightCol, NdotU, nViewPos, false);
artificialFogColor = SunGlare(artificialFogColor, nViewPos, lightCol);
color.rgb = mix(color.rgb, artificialFogColor, fogoneseven);
}
#endif
return color.rgb;
}
vec3 Fog2(vec3 color, float lViewPos, vec3 worldPos) {
#ifdef OVERWORLD
#ifdef FOG2_ALTITUDE_MODE
float altitudeFactor = (worldPos.y + eyeAltitude + 1000.0 - FOG2_ALTITUDE) * 0.001;
if (altitudeFactor > 0.965 && altitudeFactor < 1.0) altitudeFactor = pow(altitudeFactor, 1.0 - (altitudeFactor - 0.965) * 28.57);
altitudeFactor = clamp(pow(altitudeFactor, 20.0), 0.0, 1.0);
#endif
//duplicate 307309760
float fog2 = lViewPos / pow(far, 0.25) * 0.112 * (1.0 + rainStrengthS * FOG2_RAIN_DISTANCE_M)
* (1.0 - sunVisibility * 0.25 * (1.0 - rainStrengthS)) / FOG2_DISTANCE_M;
fog2 = (1.0 - (exp(-50.0 * pow(fog2*0.125, 3.25) * eBS)));
fog2 *= min(FOG2_OPACITY * (3.0 + rainStrengthS * FOG2_RAIN_OPACITY_M - sunVisibility * 2.0), 1.0);
#ifdef FOG2_ALTITUDE_MODE
fog2 *= pow(clamp((eyeAltitude - FOG2_ALTITUDE*0.2) / FOG2_ALTITUDE, 0.0, 1.0), 2.5 - FOG2_RAIN_ALTITUDE_M * rainStrengthS * 2.5);
fog2 *= 1.0 - altitudeFactor * (1.0 - FOG2_RAIN_ALTITUDE_M * rainStrengthS);
#endif
float sunVisibility2 = sunVisibility * sunVisibility;
float sunVisibility4 = sunVisibility2 * sunVisibility2;
float sunVisibility8 = sunVisibility4 * sunVisibility4;
float timeBrightness2 = sqrt1(timeBrightness);
vec3 fogColor2 = mix(lightCol*0.5, skyColor*skyMult*1.25, timeBrightness2);
fogColor2 = mix(ambientNight*ambientNight, fogColor2, sunVisibility8);
if (rainStrengthS > 0.0) {
float rainStrengthS2 = 1.0 - (1.0 - rainStrengthS) * (1.0 - rainStrengthS);
vec3 rainFogColor = FOG2_RAIN_BRIGHTNESS_M * skyColCustom * (0.01 + 0.05 * sunVisibility8 + 0.1 * timeBrightness2);
rainFogColor *= mix(SKY_RAIN_NIGHT, SKY_RAIN_DAY, sunVisibility);
fogColor2 = mix(fogColor2, rainFogColor, rainStrengthS2);
}
fogColor2 *= FOG2_BRIGHTNESS;
#ifdef CAVE_SKY_FIX
fogColor2 *= 1.0 - isEyeInCave;
#endif
color.rgb = mix(color.rgb, fogColor2, fog2);
#endif
#ifdef END
float fog2 = lViewPos / pow(far, 0.25) * 0.035 * (32.0/FOG2_END_DISTANCE_M);
fog2 = 1.0 - (exp(-50.0 * pow(fog2*0.125, 4.0)));
#ifdef FOG2_ALTITUDE_MODE
float altitudeFactor = clamp((worldPos.y + eyeAltitude + 100.0 - FOG2_END_ALTITUDE) * 0.01, 0.0, 1.0);
if (altitudeFactor > 0.75 && altitudeFactor < 1.0) altitudeFactor = pow(altitudeFactor, 1.0 - (altitudeFactor - 0.75) * 4.0);
fog2 *= 1.0 - altitudeFactor;
#endif
fog2 = clamp(fog2, 0.0, 0.125) * (7.0 + fog2);
fog2 = 1 - pow(1 - fog2, 2.0 - fog2);
vec3 fogColor2 = endCol * (0.035 + 0.02 * vsBrightness);
color.rgb = mix(color.rgb, fogColor2 * FOG2_END_BRIGHTNESS, fog2 * FOG2_END_OPACITY);
#endif
#if defined SEVEN && !defined TWENTY
float fog2 = lViewPos / pow(far, 0.25) * 0.035 * (1.0 + rainStrengthS) * (3.2/FOG2_DISTANCE_M);
fog2 = 1.0 - (exp(-50.0 * pow(fog2*0.125, 4.0) * eBS));
float altitudeFactor = (worldPos.y + eyeAltitude + 1000.0 - 90 * (1 + rainStrengthS*0.5)) * 0.001;
if (altitudeFactor > 0.965 && altitudeFactor < 1.0) altitudeFactor = pow(altitudeFactor, 1.0 - (altitudeFactor - 0.965) * 28.57);
fog2 *= 1.0 - altitudeFactor;
fog2 = clamp(fog2, 0.0, 0.125) * (7.0 + fog2);
vec3 fogColor2 = vec3(0.015, 0.03, 0.02);
color.rgb = mix(color.rgb, fogColor2, fog2 * 0.80);
#endif
return color.rgb;
}
vec3 WaterFog(vec3 color, float lViewPos, float fogrange) {
float fog = lViewPos / fogrange;
fog = 1.0 - exp(-3.0 * fog * fog);
color *= pow(max(underwaterColor.rgb, vec3(0.1)), vec3(0.5)) * 3.0;
color = mix(color, 0.8 * pow(underwaterColor.rgb * (1.0 - blindFactor), vec3(2.0)), fog);
return color.rgb;
}
vec3 LavaFog(vec3 color, float lViewPos) {
#ifndef LAVA_VISIBILITY
float fog = (lViewPos - gl_Fog.start) * gl_Fog.scale;
fog *= fog;
fog = 1.0 - exp(- fog);
fog = clamp(fog, 0.0, 1.0);
#else
float fog = lViewPos * 0.02;
fog = 1.0 - exp(-3.0 * fog);
#if MC_VERSION >= 11700
if (gl_Fog.start / far < 0.0) fog = min(lViewPos * 0.01, 1.0);
#endif
#endif
//duplicate 792763950
#ifndef VANILLA_UNDERLAVA_COLOR
vec3 lavaFogColor = vec3(0.6, 0.35, 0.15);
#else
vec3 lavaFogColor = pow(fogColor, vec3(2.2));
#endif
color.rgb = mix(color.rgb, lavaFogColor, fog);
return color.rgb;
}
vec3 SnowFog(vec3 color, float lViewPos) {
float fog = lViewPos * 0.3;
fog = (1.0 - exp(-4.0 * fog * fog * fog));
color.rgb = mix(color.rgb, vec3(0.1, 0.15, 0.2), fog);
return color.rgb;
}
vec3 BlindFog(vec3 color, float lViewPos) {
float fog = lViewPos *0.04* (5.0 / blindFactor);
fog = (1.0 - exp(-6.0 * fog * fog * fog)) * blindFactor;
color.rgb = mix(color.rgb, vec3(0.0), fog);
return color.rgb;
}
#if MC_VERSION >= 11900
vec3 DarknessFog(vec3 color, float lViewPos) {
float fog = lViewPos * 0.06;
fog = (1.0 - exp(-6.0 * fog * fog * fog)) * darknessFactor;
color.rgb = mix(color.rgb, darknessColor, fog);
return color.rgb;
}
#endif
vec3 startFog(vec3 color, vec3 nViewPos, float lViewPos, vec3 worldPos, vec3 extra, float NdotU) {
#if !defined GBUFFER_CODING
if (isEyeInWater == 0) {
#ifdef FOG2
color.rgb = Fog2(color.rgb, lViewPos, worldPos);
#endif
#ifdef FOG1
color.rgb = Fog1(color.rgb, length(worldPos.xz), lViewPos, nViewPos, extra, NdotU);
#endif
}
#endif
if (blindFactor < 0.001) {
if (isEyeInWater == 1) color.rgb = WaterFog(color.rgb, lViewPos, waterFog * (1.0 + eBS));
if (isEyeInWater == 2) color.rgb = LavaFog(color.rgb, lViewPos);
#if MC_VERSION >= 11700
if (isEyeInWater == 3) color.rgb = SnowFog(color.rgb, lViewPos);
#endif
} else color.rgb = BlindFog(color.rgb, lViewPos);
#if MC_VERSION >= 11900
if (darknessFactor > 0.001) color.rgb = DarknessFog(color.rgb, lViewPos);
#endif
return color.rgb;
}

View File

@@ -0,0 +1,57 @@
float rainbowTime = sqrt3(max(pow2(pow2(sunVisibility * shadowFade)) - timeBrightness * 2.5, 0.0));
#ifdef RAINBOW_AFTER_RAIN_CHECK
rainbowTime *= sqrt3(max(wetness - 0.1, 0.0) * (1.0 - rainStrength) * (1.0 - rainStrengthS)) * isRainy;
#endif
if (rainbowTime > 0.001) {
float rainbowDistance = max(far, 256.0) * 0.25;
float rainbowLength = max(far, 256.0) * 0.75;
vec3 rainbowTranslucent = translucent;
if (water) rainbowTranslucent = vec3(float(isEyeInWater == 1));
vec4 viewPosZ1 = gbufferProjectionInverse * (vec4(texCoord, z1, 1.0) * 2.0 - 1.0);
viewPosZ1 /= viewPosZ1.w;
float lViewPosZ1 = length(viewPosZ1.xyz);
float lViewPosZ0 = length(viewPos.xyz);
float rainbowCoord = 1.0 - (cosS + 0.75) / (0.0625 * RAINBOW_DIAMETER);
float rainbowFactor = clamp(1.0 - rainbowCoord, 0.0, 1.0) * clamp(rainbowCoord, 0.0, 1.0);
rainbowFactor *= rainbowFactor * (3.0 - 2.0 * rainbowFactor);
rainbowFactor *= min(max(lViewPosZ1 - rainbowDistance, 0.0) / rainbowLength, 1.0);
rainbowFactor *= rainbowTime;
#ifdef CAVE_SKY_FIX
rainbowFactor *= 1.0 - isEyeInCave;
#endif
if (rainbowFactor > 0.0) {
#if RAINBOW_STYLE == 1
float rainbowCoordM = pow(rainbowCoord, 1.4 + max(rainbowCoord - 0.5, 0.0) * 1.6);
rainbowCoordM = smoothstep(0.0, 1.0, rainbowCoordM) * 0.85;
rainbowCoordM += (dither - 0.5) * 0.1;
vec3 rainbow = clamp(abs(mod(rainbowCoordM * 6.0 + vec3(-0.55,4.3,2.2) ,6.0)-3.0)-1.0, 0.0, 1.0);
rainbowCoordM += 0.1;
rainbow += clamp(abs(mod(rainbowCoordM * 6.0 + vec3(-0.55,4.3,2.2) ,6.0)-3.0)-1.0, 0.0, 1.0);
rainbowCoordM -= 0.2;
rainbow += clamp(abs(mod(rainbowCoordM * 6.0 + vec3(-0.55,4.3,2.2) ,6.0)-3.0)-1.0, 0.0, 1.0);
rainbow /= 3.0;
rainbow.r += pow2(max(rainbowCoord - 0.5, 0.0)) * (max(1.0 - rainbowCoord, 0.0)) * 26.0;
rainbow = pow(rainbow, vec3(2.2)) * vec3(0.25, 0.075, 0.25) * 3.0;
#else
float rainbowCoordM = pow(rainbowCoord, 1.35);
rainbowCoordM = smoothstep(0.0, 1.0, rainbowCoordM);
vec3 rainbow = clamp(abs(mod(rainbowCoordM * 6.0 + vec3(0.0,4.0,2.0) ,6.0)-3.0)-1.0, 0.0, 1.0);
rainbow *= rainbow * (3.0 - 2.0 * rainbow);
rainbow = pow(rainbow, vec3(2.2)) * vec3(0.25, 0.075, 0.25) * 3.0;
#endif
if (z1 > z0 && lViewPosZ0 < rainbowDistance + rainbowLength)
rainbow *= mix(rainbowTranslucent, vec3(1.0),
clamp((lViewPosZ0 - rainbowDistance) / rainbowLength, 0.0, 1.0)
);
if (isEyeInWater == 1) rainbow *= float(water) * 0.05;
color.rgb += rainbow * rainbowFactor;
}
}

View File

@@ -0,0 +1,70 @@
vec3 GetSkyColor(vec3 lightCol, float NdotU, vec3 nViewPos, bool isReflection) {
float timeBrightnessInv = 1.0 - timeBrightness;
float timeBrightnessInv2 = timeBrightnessInv * timeBrightnessInv;
float timeBrightnessInv4 = timeBrightnessInv2 * timeBrightnessInv2;
float timeBrightnessInv8 = timeBrightnessInv4 * timeBrightnessInv4;
float NdotSp = clamp(dot(nViewPos, sunVec) * 0.5 + 0.5, 0.001, 1.0);
float NdotS = NdotSp * NdotSp;
NdotS *= NdotS;
float absNdotU = abs(NdotU);
vec3 skyColor2 = skyColor * skyColor;
vec3 sky = mix(sqrt1(skyColor) * 0.47, skyColor2 * 0.9, absNdotU);
sky = sky * (0.5 + 0.5 * sunVisibility) * skyMult;
#ifdef ONESEVEN
sky = vec3(0.812, 0.741, 0.674) * 0.5;
#endif
float horizon = 1.0 - max(NdotU + 0.1, 0.0) * (1.0 - 0.25 * NdotS * sunVisibility);
horizon = min(horizon, 0.9);
horizon *= horizon;
float lightmix = NdotS * max(1.0 - absNdotU * 2.0, 0.0) * 0.5 + horizon + 0.05;
lightmix *= sunVisibility * (1.0 - rainStrengthS) * timeBrightnessInv8;
sky *= 2.0 - 0.5 * timeBrightnessInv4;
sky *= mix(SKY_NOON, SKY_DAY, timeBrightnessInv4);
float mult = 0.1 * (1.0 + rainStrengthS) + horizon * (0.3 + 0.1 * sunVisibility);
float meFactorP = min((1.0 - min(moonBrightness, 0.6) / 0.6) * 0.115, 0.075);
float meNdotU = 1.0 - absNdotU;
float meFactor = meFactorP * meNdotU * meNdotU * 15.0 * max(timeBrightnessInv4 - rainStrengthS, 0.0);
vec3 meColor = mix(lightMorning, lightEvening, mefade);
meColor *= meColor;
meColor *= meColor;
meColor *= meFactor * meFactor * NdotS;
vec3 finalSky = mix(sky * (1.0 - pow2(lightmix)), lightCol * sqrt(lightCol), lightmix);
vec3 nightSky = ambientNight * ambientNight * (3.25 + 2.25 * max(sqrt1(NdotU), 0.0));
nightSky *= mix(SKY_NIGHT, 1.0, sunVisibility);
finalSky += nightSky;
finalSky *= max(1.0 - length(meColor) * 0.5, 0.0);
finalSky += meColor * 0.8;
if (isReflection) {
float invNdotU = max(-NdotU, 0.0);
float groundFactor = 0.5 * (11.0 * rainStrengthS + 1.0) * (-5.0 * sunVisibility + 6.0);
float ground = exp(-groundFactor / (invNdotU * 6.0));
ground = smoothstep(0.0, 1.0, ground);
mult *= (1.0 - ground);
}
//duplicate 98765
vec3 weatherSky = weatherCol * weatherCol;
weatherSky *= GetLuminance(ambientCol / (weatherSky)) * 1.4;
weatherSky *= mix(SKY_RAIN_NIGHT, SKY_RAIN_DAY, sunVisibility);
weatherSky = max(weatherSky, skyColor2 * 0.75); // Lightning Sky Color
weatherSky *= rainStrengthS;
finalSky = mix(finalSky, weatherSky, rainStrengthS) * mult;
finalSky = pow(finalSky, vec3(1.125));
return finalSky;
}

View File

@@ -0,0 +1,399 @@
#if !defined END && !defined SEVEN && !defined NETHER
float CloudNoise(vec2 coord, vec2 wind) {
float noise = texture2D(noisetex, coord*0.125 + wind * 0.25).x * 7.0;
noise+= texture2D(noisetex, coord*0.0625 + wind * 0.15).x * 12.0;
noise+= texture2D(noisetex, coord*0.03125 + wind * 0.05).x * 12.0;
noise+= texture2D(noisetex, coord*0.015625 + wind * 0.05).x * 24.0;
return noise * 0.34;
}
float CloudCoverage(float noise, float coverage, float NdotU, float cosS) {
float noiseCoverageCosS = abs(cosS);
noiseCoverageCosS *= noiseCoverageCosS;
noiseCoverageCosS *= noiseCoverageCosS;
float NdotUmult = 0.365;
#ifdef AURORA
float auroraMult = max(1.0 - sunVisibility - rainStrengthS, 0.0);
#ifdef AURORA_BIOME_CHECK
auroraMult *= isSnowy;
#endif
#ifdef AURORA_FULL_MOON_CHECK
auroraMult *= float(moonPhase == 0);
#endif
NdotUmult *= 1.0 + 2.5 * auroraMult;
#endif
float noiseCoverage = coverage * coverage + CLOUD_AMOUNT
* (1.0 + noiseCoverageCosS * 0.175)
* (1.0 + NdotU * NdotUmult * (1.0-rainStrengthS*3.0))
- 2.5;
return max(noise - noiseCoverage, 0.0);
}
vec4 DrawCloud(vec3 viewPos, float dither, vec3 lightCol, vec3 ambientCol, float NdotU, int sampleCount) {
float cosS = dot(normalize(viewPos), sunVec);
#if AA > 1
dither = fract(16.0 * frameTimeCounter + dither);
#endif
float timeBrightnessS = sqrt1(timeBrightness);
float cloud = 0.0;
float cloudGradient = 0.0;
float gradientMix = dither * 0.1667;
float colorMultiplier = CLOUD_BRIGHTNESS * (0.23 + 0.07 * timeBrightnessS);
float noiseMultiplier = CLOUD_THICKNESS * 0.125;
float scattering = 0.5 * pow(cosS * 0.5 * (2.0 * sunVisibility - 1.0) + 0.5, 6.0);
float cloudHeightFactor = max(1.11 - 0.0015 * eyeAltitude, 0.0);
cloudHeightFactor *= cloudHeightFactor;
float cloudHeight = CLOUD_HEIGHT * cloudHeightFactor * 0.5;
#if !defined GBUFFERS_WATER && !defined DEFERRED
float skytime = frametime;
#else
float skytime = cloudtime;
#endif
float cloudSpeedFactor = 0.003;
vec2 wind = vec2(skytime * CLOUD_SPEED * cloudSpeedFactor, 0.0);
#ifdef SEVEN
wind *= 8;
#endif
vec3 cloudColor = vec3(0.0);
float stretchFactor = 2.5;
float coordFactor = 0.009375;
if (NdotU > 0.025) { //duplicate 78634
vec3 wpos = normalize((gbufferModelViewInverse * vec4(viewPos, 1.0)).xyz);
for(int i = 0; i < sampleCount; i++) {
if (cloud > 0.99) break;
vec2 planeCoord = wpos.xz * ((cloudHeight + (i + dither) * stretchFactor * 6.0 / sampleCount) / wpos.y) * 0.0085;
vec2 coord = cameraPosition.xz * 0.00025 + planeCoord;
float ang1 = (i + frametime * 0.025) * 2.391;
float ang2 = ang1 + 2.391;
coord += mix(vec2(cos(ang1), sin(ang1)), vec2(cos(ang2), sin(ang2)), dither * 0.25 + 0.75) * coordFactor;
float coverage = float(i - 3.0 + dither) * 0.725;
float noise = CloudNoise(coord, wind);
noise = CloudCoverage(noise, coverage, NdotU, cosS) * noiseMultiplier;
noise = noise / sqrt(noise * noise + 1.0);
cloudGradient = mix(cloudGradient,
mix(gradientMix * gradientMix, 1.0 - noise, 0.25),
noise * (1.0 - cloud));
cloud += max(noise - cloud * 0.95, 0.0);
cloud = mix(cloud, 1.0, rainStrengthS * pow2(noise * noise));
gradientMix += 0.2 * (6.0 / sampleCount);
}
float meFactorP = min((1.0 - min(moonBrightness, 0.6) / 0.6) * 0.115, 0.075);
vec3 meColor = vec3(0.0);
if (cosS > 0.0) {
float meNdotU = 1.0 - NdotU;
float meFactor = meFactorP * meNdotU * meNdotU * 12.0 * (1.0 - rainStrengthS);
meColor = mix(lightMorning, lightEvening, mefade);
meColor *= meColor;
meColor *= meColor;
meColor *= meFactor * meFactor * cosS;
}
float sunVisibilityM = pow(sunVisibility, 4.0 - meFactorP * 24.0);
vec3 skyColor2 = skyColor * skyColor;
vec3 cloudNightColor = ambientCol * 8.0;
vec3 cloudDayColor = pow(lightCol, vec3(1.5)) * 1.5;
vec3 cloudUpColor = mix(cloudNightColor, cloudDayColor, sunVisibilityM);
cloudUpColor *= 1.0 + scattering;
cloudUpColor += max(meColor, vec3(0.0));
vec3 cloudDownColor = skyColor2 * 0.225 * sunVisibility * skyMult;
//duplicate 98765
vec3 weatherSky = weatherCol * weatherCol;
weatherSky *= GetLuminance(ambientCol / (weatherSky)) * 1.4;
weatherSky *= mix(SKY_RAIN_NIGHT, SKY_RAIN_DAY, sunVisibility);
weatherSky = max(weatherSky, skyColor2 * 0.75); // Lightning Sky Color
weatherSky *= rainStrengthS;
#ifdef LIGHT_SHAFTS
weatherSky *= 12.5 + scattering * 47.5 * (1.0 + sunVisibility);
#else
weatherSky *= 12.5 + scattering * 47.5;
#endif
cloudUpColor = mix(cloudUpColor, weatherSky, rainStrengthS * rainStrengthS);
cloudColor = mix(cloudDownColor, cloudUpColor, cloudGradient);
cloud *= pow2(pow2(1.0 - exp(- (10.0 - 8.2 * rainStrengthS) * NdotU))); //duplicate 78634
}
return vec4(cloudColor * colorMultiplier, cloud * CLOUD_OPACITY);
}
#ifdef AURORA
float AuroraNoise(vec2 coord, vec2 wind) {
float noise = texture2D(noisetex, coord * 0.175 + wind * 0.25).x;
noise+= texture2D(noisetex, coord * 0.04375 + wind * 0.15).x * 5.0;
return noise;
}
vec3 DrawAurora(vec3 viewPos, float dither, int sampleCount, float NdotU) {
#if AA > 1
dither = fract(16.0 * frameTimeCounter + dither);
#endif
float gradientMix = dither / sampleCount;
float visibility = (1.0 - sunVisibility) * (1.0 - rainStrengthS);
visibility *= visibility;
#ifdef AURORA_BIOME_CHECK
visibility *= isSnowy;
#endif
#ifdef AURORA_FULL_MOON_CHECK
visibility *= float(moonPhase == 0);
#endif
#if !defined GBUFFERS_WATER && !defined DEFERRED
float skytime = frametime;
#else
float skytime = cloudtime;
#endif
vec2 wind = vec2(skytime * 0.00005);
vec3 aurora = vec3(0.0);
float NdotUM = min(1.08 - NdotU, 1.0);
NdotUM *= NdotUM;
NdotUM = 1.0 - NdotUM * NdotUM;
if (NdotU > 0.0 && visibility > 0.0) {
vec3 wpos = normalize((gbufferModelViewInverse * vec4(viewPos, 1.0)).xyz);
for(int i = 0; i < sampleCount; i++) {
vec2 planeCoord = wpos.xz * ((8.0 * AURORA_HEIGHT + (i + dither) * 7.0 / sampleCount) / wpos.y) * 0.004;
vec2 coord = cameraPosition.xz * 0.00001 + planeCoord;
float noise = AuroraNoise(coord, wind);
noise = max(1.0 - 1.5 / (1.0 - NdotU * 0.8) * abs(noise - 3.0), 0.0);
if (noise > 0.0) {
noise *= texture2D(noisetex, coord * 0.25 + wind * 0.25).x;
noise *= 0.5 * texture2D(noisetex, coord + wind * 16.0).x + 0.75;
noise = noise * noise * 3.0 / sampleCount;
noise *= NdotUM;
vec3 auroracolor = mix(
auroraDCol,
auroraUCol,
pow(gradientMix, 0.4));
aurora += noise * auroracolor * exp2(-6.0 * i / sampleCount);
}
gradientMix += 1.0 / sampleCount;
}
}
aurora = aurora * visibility * 1.5;
return aurora;
}
#endif
#endif
#ifdef SEVEN
float GetNoise(vec2 pos) {
return fract(sin(dot(pos, vec2(12.9898, 4.1414))) * 43758.54953);
}
vec3 DrawStars(inout vec3 color, vec3 viewPos, float NdotU) {
vec3 wpos = vec3(gbufferModelViewInverse * vec4(viewPos, 1.0));
vec3 planeCoord = 0.75 * wpos / (wpos.y + length(wpos.xz));
vec2 wind = 0.75 * vec2(frametime, 0.0);
#ifdef SEVEN
wind = vec2(0.0);
#endif
vec2 coord = planeCoord.xz * 0.5 + wind * 0.00125;
coord = floor(coord*1024.0) / 1024.0;
float multiplier = 5.0 * (1.0 - rainStrengthS) * (1 - (sunVisibility*0.9 + pow(timeBrightness, 0.05)*0.1)) * pow(NdotU, 2.0);
#ifdef SEVEN
multiplier = sqrt2(NdotU) * 5.0 * (1.0 - rainStrengthS);
#endif
float star = 1.0;
if (NdotU > 0.0) {
star *= GetNoise(coord.xy);
star *= GetNoise(coord.xy+0.1);
star *= GetNoise(coord.xy+0.23);
}
star = max(star - 0.825, 0.0) * multiplier;
vec3 stars = star * lightNight * lightNight * 160;
return vec3(stars);
}
#endif
#if defined END && defined ENDER_NEBULA
float GetNebulaStarNoise(vec2 pos) {
return fract(sin(dot(pos, vec2(12.9898, 4.1414))) * 43758.54953);
}
float NebulaNoise(vec2 coord, vec2 wind) {
float noise = texture2D(noisetex, coord * 0.175 + wind * 0.25).x;
noise+= texture2D(noisetex, coord * 0.04375 + wind * 0.15).x * 5.0;
return noise;
}
vec3 DrawEnderNebula(vec3 viewPos, float dither, vec3 lightCol, inout vec3 nebulaStars) {
float NdotU = dot(normalize(viewPos), upVec);
bool dragonBattle = gl_Fog.start / far < 0.5;
//if (gl_FragCoord.x < 960) dragonBattle = false;
//dragonBattle = true;
#if AA > 1
dither = fract(16.0 * frameTimeCounter + dither);
#endif
int sampleCount = 20;
float gradientMix = dither / sampleCount;
#if !defined GBUFFERS_WATER && !defined DEFERRED
float skytime = frametime;
#else
float skytime = cloudtime;
#endif
vec2 wind = vec2(skytime * 0.000035 * NEBULA_SPEED);
vec3 nebula = vec3(0.0);
float NdotUM = abs(NdotU);
NdotUM = 1.0 - NdotUM;
NdotUM = pow(NdotUM, (2.0 - NdotUM) * (NEBULA_DISTRIBUTION - 0.8)) * 0.85;
NdotUM = max(NdotUM, 0.0);
float compression = pow(NdotUM, NEBULA_COMPRESSION);
dither *= dragonBattle ? 0.5 + 0.5 * NEBULA_SMOOTHING : NEBULA_SMOOTHING;
vec3 nebulaPurple = 12.0 * lightCol * NEBULA_PURPLE_BRIGHTNESS;
vec3 nebulaOrange = endOrangeCol * NEBULA_ORANGE_BRIGHTNESS * 4.0;
vec3 wpos = normalize((gbufferModelViewInverse * vec4(viewPos * 1000.0, 1.0)).xyz);
if (dragonBattle) {
nebulaPurple *= 0.3;
nebulaOrange *= 2.0;
}
for(int i = 0; i < sampleCount; i++) {
vec2 planeCoord = wpos.xz * (1.0 + (i + dither) * compression * 6.0 / sampleCount) * NEBULA_SIZE;
vec2 coord = planeCoord + cameraPosition.xz * 0.00004;
float noise = NebulaNoise(coord, wind);
noise = max(0.75 - 1.0 / abs(noise - (4.0 + NdotUM * 2.0)), 0.0) * 3.0;
if (noise > 0.0) {
noise *= texture2D(noisetex, abs(coord * 0.25) + wind * 4.0).x;
float fireNoise = texture2D(noisetex, abs(coord * 0.2) + wind * 8.0).x;
noise *= 0.5 * fireNoise + 0.75;
noise = noise * noise * 3.0 / sampleCount;
noise *= NdotUM;
vec3 nebulaColor = nebulaPurple;
nebulaColor += nebulaOrange * pow(fireNoise, 5.0);
nebulaColor *= gradientMix;
nebula += noise * nebulaColor * exp2(-6.0 * i / sampleCount);
}
gradientMix += 1.0 / sampleCount;
}
vec3 starCoord = 0.75 * wpos / (abs(wpos.y) + length(wpos.xz));
vec2 starCoord2 = starCoord.xz * 0.5;
if (NdotU < 0.0) starCoord2 += 100.0;
float starFactor = 1024.0;
starCoord2 = floor(starCoord2 * starFactor) / starFactor;
float star = 1.0;
star *= GetNebulaStarNoise(starCoord2.xy);
star *= GetNebulaStarNoise(starCoord2.xy+0.1);
star *= GetNebulaStarNoise(starCoord2.xy+0.23);
star = max(star - 0.7, 0.0);
star *= star;
nebulaStars = star * lightCol * 120.0 * (1.0 - NdotUM) * NEBULA_STAR_BRIGHTNESS;
if (dragonBattle) {
nebulaStars *= vec3(2.0, 1.0, 0.5);
nebula *= vec3(2.0, 3.0, 2.0) * 0.7;
}
return nebula * 2.0;
}
#endif
#if defined NETHER && defined NETHER_SMOKE
float SmokeNoise(vec2 coord, vec2 wind) {
float noise = texture2D(noisetex, coord * 0.175 + wind * 0.25).x;
noise+= texture2D(noisetex, coord * 0.04375 + wind * 0.15).x * 5.0;
return noise;
}
vec3 DrawNetherSmoke(vec3 viewPos, float dither, vec3 lightCol) {
float NdotU = dot(normalize(viewPos), upVec);
#if AA > 1
dither = fract(16.0 * frameTimeCounter + dither);
#endif
int sampleCount = 20;
float gradientMix = dither / sampleCount;
#if !defined GBUFFERS_WATER && !defined DEFERRED
float skytime = frametime;
#else
float skytime = cloudtime;
#endif
vec2 wind = vec2(skytime * 0.00005);
vec3 smoke = vec3(0.0);
float NdotUM = abs(NdotU);
NdotUM = 1.0 - NdotUM;
vec3 wpos = normalize((gbufferModelViewInverse * vec4(viewPos, 1.0)).xyz);
for(int i = 0; i < sampleCount; i++) {
vec2 planeCoord = wpos.xz * (1.0 + (i + dither) * 6.0 / sampleCount) * 0.03;
vec2 coord = planeCoord + cameraPosition.xz * 0.0017;
float noise = SmokeNoise(coord, wind);
noise = max(0.75 - 1.0 / abs(noise - 6.0), 0.0) * 3.0;
if (noise > 0.0) {
noise *= texture2D(noisetex, abs(coord * 0.25) + wind * 8.0).x;
float heightNoise = wpos.y;
float fireNoise = texture2D(noisetex, abs(coord * 0.2) + (heightNoise + cameraPosition.y * 0.01) * 0.01 + wind * -4.0).x;
noise = noise * noise * 3.0 / sampleCount;
noise *= NdotUM;
vec3 smokeColor = pow(lightCol, vec3(0.6, 0.5, 0.6)) * 12.0 * pow(fireNoise, 5.0);
smokeColor *= gradientMix;
smoke += noise * smokeColor * exp2(-6.0 * i / sampleCount);
}
gradientMix += 1.0 / sampleCount;
}
return smoke * 2.0;
}
#endif

View File

@@ -0,0 +1,28 @@
vec3 SunGlare(vec3 color, vec3 nViewPos, vec3 lightCol) {
float cosSp = dot(nViewPos, lightVec);
if (cosSp > 0.0) {
float cosS = cosSp;
cosS *= cosS;
cosS *= cosS;
cosS *= cosS;
float visfactor = 0.075;
float sunGlare = cosS;
sunGlare = visfactor / (1.0 - (1.0 - visfactor) * sunGlare) - visfactor;
sunGlare *= cosSp;
sunGlare *= 0.25 * SUN_GLARE_STRENGTH * (1.0 - rainStrengthS);
float shadowTime = abs(sunVisibility - 0.5) * 2.0;
shadowTime *= shadowTime;
sunGlare *= shadowTime * shadowTime;
vec3 finalSunGlare = lightCol * sunGlare;
if (isEyeInWater == 1) finalSunGlare *= underwaterColor.rgb * underwaterColor.rgb * 200.0;
color += finalSunGlare;
}
return color;
}

View File

@@ -0,0 +1,67 @@
vec4 GetVolumetricClouds(float depth0, float depth1, vec3 vlAlbedo, float dither, vec4 viewPos) {
vec4 clouds = vec4(0.0);
//Color+
float sunVisibility2 = sunVisibility * sunVisibility;
float sunVisibility4 = sunVisibility2 * sunVisibility2;
vec3 cloudNightColor = ambientCol * 2.0;
vec3 cloudDayColor = pow(lightCol, vec3(1.5)) * (0.5 + 0.5 * timeBrightness);
vec3 cloudRainColor = normalize(pow(lightCol, vec3(1.0 + sunVisibility4))) * (0.015 + 0.1 * sunVisibility4 + 0.1 * timeBrightness);
vec3 cloudUpColor = mix(cloudNightColor, cloudDayColor, sunVisibility4);
cloudUpColor = mix(cloudUpColor, cloudRainColor, rainStrengthS);
vec3 cloudDownColor = cloudUpColor * 0.35;
float cloudAmountM = 0.075 * CLOUD_AMOUNT * (1.0 - 0.35 * rainStrengthS);
//Settings
float cloudAltitude = 128.0;
float cloudThickness = 24.0;
int sampleCount = 20;
float minDistFactor = 160.0 / sampleCount * sqrt(far / 256.0);
//Ray Trace
for(int i = 0; i < sampleCount; i++) {
float minDist = (i + dither) * minDistFactor;
if (depth1 < minDist || (depth0 < minDist && vlAlbedo == vec3(0.0))) break;
float distX = GetDistX(minDist);
vec4 viewPos = gbufferProjectionInverse * (vec4(texCoord, distX, 1.0) * 2.0 - 1.0);
viewPos /= viewPos.w;
vec4 wpos = gbufferModelViewInverse * viewPos;
vec3 worldPos = wpos.xyz + cameraPosition.xyz + vec3(cloudtime * 2.0, 0.0, 0.0);
float yFactor = max(cloudThickness - abs(worldPos.y - cloudAltitude), 0.0) / cloudThickness;
float disFalloff = max(32.0 - max(length(wpos.xz) - 256.0, 0.0), 0.0) / 32.0;
float smoke = 0.0;
if (yFactor * disFalloff > 0.001) {
worldPos.xz *= 2.0;
smoke = texture2D(noisetex, worldPos.xz * 0.0002 ).r * 0.5;
smoke += texture2D(noisetex, worldPos.xz * 0.0001 ).r;
smoke += texture2D(noisetex, worldPos.xz * 0.00005 ).r;
smoke += texture2D(noisetex, worldPos.xz * 0.000025).r * 2.0;
}
smoke *= disFalloff;
smoke *= sqrt1(yFactor) * 0.35;
smoke = max(smoke - cloudAmountM, 0.0);
float blend = ( (worldPos.y - cloudAltitude) / cloudThickness + 1.0 ) * 0.5;
blend = clamp(blend, 0.0, 1.0);
blend *= blend;
vec3 cloudColorSample = mix(cloudDownColor, cloudUpColor, blend);
if (depth0 < minDist) cloudColorSample *= vlAlbedo;
clouds.rgb = mix(cloudColorSample, clouds.rgb, min(clouds.a, 1.0));
clouds.a += smoke * 256.0 / sampleCount;
}
clouds *= 0.9;
clouds += clouds * dither * 0.19;
clouds = sqrt(clouds);
return clouds;
}

View File

@@ -0,0 +1,227 @@
vec4 DistortShadow(vec4 shadowpos, float distortFactor) {
shadowpos.xy *= 1.0 / distortFactor;
shadowpos.z = shadowpos.z * 0.2;
shadowpos = shadowpos * 0.5 + 0.5;
return shadowpos;
}
void GetShadowSpace(inout vec3 worldposition, inout vec4 vlposition, float shadowdepth, vec2 texCoord) {
vec4 viewPos = gbufferProjectionInverse * (vec4(texCoord, shadowdepth, 1.0) * 2.0 - 1.0);
viewPos /= viewPos.w;
vec4 wpos = gbufferModelViewInverse * viewPos;
worldposition = wpos.xyz / wpos.w;
wpos = shadowModelView * wpos;
wpos = shadowProjection * wpos;
wpos /= wpos.w;
float distb = sqrt(wpos.x * wpos.x + wpos.y * wpos.y);
float distortFactor = 1.0 - shadowMapBias + distb * shadowMapBias;
wpos = DistortShadow(wpos,distortFactor);
#if defined WATER_CAUSTICS && defined OVERWORLD && defined SMOKEY_WATER_LIGHTSHAFTS
if (isEyeInWater == 1.0) {
vec3 worldPos = ViewToWorld(viewPos.xyz);
vec3 causticpos = worldPos.xyz + cameraPosition.xyz;
float caustic = getCausticWaves(causticpos.xyz * 0.25);
wpos.xy *= 1.0 + caustic * 0.0125;
}
#endif
vlposition = wpos;
}
//Volumetric light from Robobo1221 (highly modified)
vec3 GetVolumetricRays(float depth0, float depth1, vec3 vlAlbedo, float dither, float cosS) {
vec3 vl = vec3(0.0);
#if AA > 1
float ditherAnimate = 1.61803398875 * mod(float(frameCounter), 3600.0);
dither = fract(dither + ditherAnimate);
#endif
#ifdef OVERWORLD
float visibility = 0.055;
if (isEyeInWater == 1) visibility = 0.19;
float endurance = 1.20;
#if LIGHT_SHAFT_MODE == 2
if (isEyeInWater == 0) endurance *= min(2.0 + rainStrengthS*rainStrengthS - sunVisibility * sunVisibility, 2.0);
else visibility *= 1.0 + 2.0 * pow(max(cosS, 0.0), 128.0) * float(sunVisibility > 0.5) * (1.0 - rainStrengthS);
if (endurance >= 1.0) visibility *= max((cosS + endurance) / (endurance + 1.0), 0.0);
else visibility *= pow(max((cosS + 1.0) / 2.0, 0.0), (11.0 - endurance*10.0));
#else
if (isEyeInWater == 0) endurance *= min(1.0 + rainStrengthS*rainStrengthS, 2.0);
else visibility *= 1.0 + 2.0 * pow(max(cosS, 0.0), 128.0) * float(sunVisibility > 0.5) * (1.0 - rainStrengthS);
if (endurance >= 1.0) cosS = max((cosS + endurance) / (endurance + 1.0), 0.0);
else cosS = pow(max((cosS + 1.0) / 2.0, 0.0), (11.0 - endurance*10.0));
#endif
#ifdef CAVE_SKY_FIX
visibility *= 1.0 - isEyeInCave;
#endif
#endif
#ifdef END
float visibility = 0.14285;
#endif
if (visibility > 0.0) {
#ifdef END
float maxDist = 192.0 * (1.5 - isEyeInWater);
#else
float maxDist = 288.0;
if (isEyeInWater == 1) maxDist = min(288.0, shadowDistance * 0.75);
#endif
vec3 worldposition = vec3(0.0);
vec4 vlposition = vec4(0.0);
vec3 watercol = underwaterColor.rgb / UNDERWATER_I;
watercol = pow(watercol, vec3(2.3)) * 55.0;
#ifdef END
float minDistFactor = 5.0;
#else
float minDistFactor = 11.0;
minDistFactor *= clamp(far, 128.0, 512.0) / 192.0;
float fovFactor = gbufferProjection[1][1] / 1.37;
float x = abs(texCoord.x - 0.5);
x = 1.0 - x*x;
x = pow(x, max(3.0 - fovFactor, 0.0));
minDistFactor *= x;
maxDist *= x;
#if LIGHT_SHAFT_MODE == 2
#else
float lightBrightnessM = smoothstep(0.0, 1.0, 1.0 - pow2(1.0 - max(timeBrightness, moonBrightness)));
#endif
#endif
#ifdef END
int sampleCount = 9;
#else
float addition = 0.5;
#if LIGHT_SHAFT_MODE == 2
int sampleCount = 9;
if (isEyeInWater == 0) {
sampleCount = 7;
minDistFactor *= 0.5;
}
float sampleIntensity = 2.5;
#else
int sampleCount = 9;
float sampleIntensity = 1.95;
#endif
#if LIGHT_SHAFT_QUALITY == 2
if (isEyeInWater == 0) {
float qualityFactor = 1.42857;
#if LIGHT_SHAFT_MODE == 2
sampleCount = 10;
#else
sampleCount = 13;
#endif
sampleIntensity /= qualityFactor;
minDistFactor /= 1.7; // pow(qualityFactor, 1.5)
addition *= qualityFactor;
}
#endif
#if LIGHT_SHAFT_QUALITY == 3
if (isEyeInWater == 0) {
int qualityFactor = 4;
sampleCount *= qualityFactor;
sampleIntensity /= qualityFactor;
minDistFactor /= 8; // pow(qualityFactor, 1.5)
addition *= qualityFactor;
}
#endif
#endif
for(int i = 0; i < sampleCount; i++) {
#ifdef END
float minDist = exp2(i + dither) - 0.9;
#else
float minDist = 0.0;
if (isEyeInWater == 0) {
#if LIGHT_SHAFT_MODE == 2
minDist = pow(i + dither + addition, 1.5) * minDistFactor;
#else
minDist = pow(i + dither + addition, 1.5) * minDistFactor * (0.3 - 0.1 * lightBrightnessM);
#endif
} else minDist = pow2(i + dither + 0.5) * minDistFactor * 0.045;
#endif
//if (depth0 >= far*0.9999) break;
if (minDist >= maxDist) break;
if (depth1 < minDist || (depth0 < minDist && vlAlbedo == vec3(0.0))) break;
GetShadowSpace(worldposition, vlposition, GetDistX(minDist), texCoord.st);
//vlposition.z += 0.00002;
if (length(vlposition.xy * 2.0 - 1.0) < 1.0) {
vec3 vlsample = vec3(shadow2D(shadowtex0, vlposition.xyz).z);
if (depth0 < minDist) vlsample *= vlAlbedo;
#ifdef END
if (isEyeInWater == 1) vlsample *= watercol;
vl += vlsample;
#else
if (isEyeInWater == 0) {
#if LIGHT_SHAFT_MODE == 2
vl += vlsample * sampleIntensity;
#else
vlsample *= cosS;
vl += vlsample * sampleIntensity;
#endif
} else {
vlsample *= watercol;
float sampleFactor = sqrt(minDist / maxDist);
#if LIGHT_SHAFT_MODE == 3
vlsample *= cosS;
#endif
vl += vlsample * sampleFactor * 0.55;
}
#endif
} else {
vl += 1.0;
}
}
vl = sqrt(vl * visibility);
#ifdef END
#else
#if LIGHT_SHAFT_MODE == 2
if (isEyeInWater == 0) {
float vlPower = max(1.75 - rainStrengthS + sunVisibility*0.25, 1.0);
vl = pow(vl, vec3(vlPower));
}
#else
if (isEyeInWater == 0) {
float vlPower = 2.0 - lightBrightnessM;
vl = pow(vl, vec3(vlPower));
}
#endif
#endif
vl *= 0.9;
vl += vl * dither * 0.19;
}
#ifdef GBUFFER_CODING
vl = vec3(0.0);
#endif
return vl;
}

View File

@@ -0,0 +1,2 @@
//Water fog is now located in multiple programs in different forms. I will put all of them here when I feel like it.
//Update: It's been multiple months and I'm still feeling too lazy to do it.

View File

@@ -0,0 +1,5 @@
vec3 auroraUColSqrt = vec3(AURORA_UP_R, AURORA_UP_G, AURORA_UP_B) * AURORA_UP_I / 255.0;
vec3 auroraUCol = auroraUColSqrt * auroraUColSqrt;
vec3 auroraDColSqrt = vec3(AURORA_DOWN_R, AURORA_DOWN_G, AURORA_DOWN_B) * AURORA_DOWN_I / 255.0;
vec3 auroraDCol = auroraDColSqrt * auroraDColSqrt;

View File

@@ -0,0 +1,7 @@
#ifndef COLORED_LIGHT
vec3 blocklightColSqrt = vec3(BLOCKLIGHT_R, BLOCKLIGHT_G, BLOCKLIGHT_B) * BLOCKLIGHT_I / 255.0;
vec3 blocklightCol = blocklightColSqrt * blocklightColSqrt;
#else
vec3 blocklightColSqrt = vec3(0.387, 0.31, 0.247);
vec3 blocklightCol = vec3(0.15, 0.096, 0.061);
#endif

View File

@@ -0,0 +1,11 @@
#if defined OVERWORLD || defined SEVEN
#include "lightColor.glsl"
#endif
#ifdef NETHER
#include "netherColor.glsl"
#endif
#ifdef END
#include "endColor.glsl"
#endif

View File

@@ -0,0 +1,3 @@
vec3 endColSqrt = vec3(END_R, END_G, END_B) * 2.25 / 255.0;
vec3 endCol = endColSqrt * endColSqrt;
vec3 endOrangeCol = vec3(1.0, 0.25, 0.0);

View File

@@ -0,0 +1,46 @@
#if defined MOON_PHASE_LIGHTING && !defined UNIFORM_moonPhase
#define UNIFORM_moonPhase
uniform int moonPhase;
#endif
#ifndef MOON_PHASE_LIGHTING
float nightBrightness = NIGHT_BRIGHTNESS;
#else
float nightBrightness = moonPhase == 0 ? NIGHT_BRIGHTNESS * NIGHT_LIGHTING_FULL_MOON :
moonPhase != 4 ? NIGHT_BRIGHTNESS * NIGHT_LIGHTING_PARTIAL_MOON :
NIGHT_BRIGHTNESS * NIGHT_LIGHTING_NEW_MOON;
#endif
vec3 lightMorning = vec3(LIGHT_MR, LIGHT_MG, LIGHT_MB) * LIGHT_MI / 255.0;
vec3 lightDay = vec3(LIGHT_DR, LIGHT_DG, LIGHT_DB) * LIGHT_DI / 255.0;
vec3 lightEvening = vec3(LIGHT_ER, LIGHT_EG, LIGHT_EB) * LIGHT_EI / 255.0;
#ifndef ONESEVEN
vec3 lightNight = vec3(LIGHT_NR, LIGHT_NG, LIGHT_NB) * LIGHT_NI * (vsBrightness*0.125 + 0.80) * 0.4 / 255.0 * nightBrightness;
#else
vec3 lightNight = (vec3(LIGHT_NR, LIGHT_NG, LIGHT_NB) * LIGHT_NI * 0.195 / 255.0) + vec3(0.37, 0.31, 0.25) * 0.35 ;
#endif
vec3 ambientMorning = vec3(AMBIENT_MR, AMBIENT_MG, AMBIENT_MB) * AMBIENT_MI * 1.1 / 255.0;
vec3 ambientDay = vec3(AMBIENT_DR, AMBIENT_DG, AMBIENT_DB) * AMBIENT_DI * 1.1 / 255.0;
vec3 ambientEvening = vec3(AMBIENT_ER, AMBIENT_EG, AMBIENT_EB) * AMBIENT_EI * 1.1 / 255.0;
vec3 ambientNight = vec3(AMBIENT_NR, AMBIENT_NG, AMBIENT_NB) * AMBIENT_NI * (vsBrightness*0.20 + 0.70) * 0.495 / 255.0 * nightBrightness;
vec3 weatherCol = vec3(WEATHER_RR, WEATHER_RG, WEATHER_RB) * WEATHER_RI / 255.0;
vec3 weatherIntensity = vec3(WEATHER_RI);
float mefade = 1.0 - clamp(abs(timeAngle - 0.5) * 8.0 - 1.5, 0.0, 1.0);
float dfade = 1.0 - timeBrightness;
float dfadeM = dfade * dfade;
float dfadeM2 = 1.0 - dfade * dfade;
vec3 meL = mix(lightMorning, lightEvening, mefade);
vec3 dayAllL = mix(meL, lightDay, dfadeM2);
vec3 cL = mix(lightNight, dayAllL, sunVisibility);
vec3 cL2 = mix(cL, dot(cL, vec3(0.299, 0.587, 0.114)) * weatherCol * (vsBrightness*0.1 + 0.9), rainStrengthS*0.6);
vec3 lightCol = cL2 * cL2;
vec3 meA = mix(ambientMorning, ambientEvening, mefade);
vec3 dayAllA = mix(meA, ambientDay, dfadeM2);
vec3 cA = mix(ambientNight, dayAllA, sunVisibility);
vec3 cA2 = mix(cA, dot(cA, vec3(0.299, 0.587, 0.114)) * weatherCol * (vsBrightness*0.1 + 0.9), rainStrengthS*0.6);
vec3 ambientCol = cA2 * cA2;

View File

@@ -0,0 +1,6 @@
#if MC_VERSION >= 11600
vec3 netherCol = max(fogColor * (1.0 - length(fogColor / 3.0)) * 0.25 * NETHER_I, vec3(0.001));
#else
vec3 netherColSqrt = vec3(NETHER_R, NETHER_G, NETHER_B) * 0.25 * NETHER_I / 255.0;
vec3 netherCol = netherColSqrt * netherColSqrt;
#endif

View File

@@ -0,0 +1,2 @@
vec3 selectionColSqrt = vec3(SELECTION_R, SELECTION_G, SELECTION_B) * SELECTION_I / 255.0;
vec3 selectionCol = selectionColSqrt * selectionColSqrt;

View File

@@ -0,0 +1,4 @@
vec3 sky_ColorSqrt = vec3(136.0, 172.0, 236.0) * 1.10 / 255.0;
vec3 skyColCustom = sky_ColorSqrt * sky_ColorSqrt;
vec3 skyMult = vec3(SKY_MULT_R, SKY_MULT_G, SKY_MULT_B) * SKY_MULT_I / 255.0;

View File

@@ -0,0 +1,12 @@
#if MC_VERSION > 10711
vec4 underwaterColor = vec4(pow(fogColor, vec3(UNDERWATER_R, UNDERWATER_G, UNDERWATER_B)) * UNDERWATER_I * 0.2, 1.0);
#else
vec4 underwaterColor = vec4(pow(vec3(0.2, 0.3, 1.0), vec3(UNDERWATER_R, UNDERWATER_G, UNDERWATER_B)) * UNDERWATER_I * 0.2, 1.0);
#endif
vec4 waterColorSqrt = vec4(WATER_R, WATER_G, WATER_B, 255.0) * WATER_I / 255.0;
vec4 waterColor = waterColorSqrt * waterColorSqrt;
const float waterFog = WATER_FOG;
const float waterAlpha = WATER_OPACITY;

View File

@@ -0,0 +1,789 @@
/*
Complementary Shaders by EminGT, based on BSL Shaders by Capt Tatsu
*/
/*--------------------------------------------------------------------
___ __ __ ____ ___ ____ _____ _ _ _ _____
|_ _| \/ | _ \ / _ \| _ \_ _|/ \ | \ | |_ _|
| || |\/| | |_) | | | | |_) || | / _ \ | \| | | |
| || | | | __/| |_| | _ < | |/ ___ \| |\ | | |
|___|_| |_|_| \___/|_| \_\|_/_/ \_\_| \_| |_|
.
-> -> -> EDITING THIS FILE HAS A HIGH CHANCE TO BREAK COMPLEMENTARY
-> -> -> DO NOT CHANGE ANYTHING UNLESS YOU KNOW WHAT YOU ARE DOING
-> -> -> DO NOT EXPECT SUPPORT AFTER MODIFYING SHADER FILES
--------------------------------------------------------------------*/
//Shader Options//
//#define COMPATIBILITY_MODE
#define RP_SUPPORT 1 //[1 2 3 4]
#define SECRET 0 //[0]
#define TEST 0 //[0 1 2]
#define GLOWING_ENTITY_FIX
#define END_PORTAL_REWORK
#define LIGHTNING_BOLTS_FIX
//#define NIGHT_TWILIGHT_FOREST
#define LIGHT_LEAK_FIX
#define ENTITY_NORMAL_FIX
#define THE_FORBIDDEN_OPTION 0 //[0 1 2 3]
#define WRONG_MIPMAP_FIX
#define FLICKERING_FIX
#define SKY_REF_FIX_1 2 //[1 2 3]
#define OVERLAY_FIX
#define CAVE_SKY_FIX
//#define SMOKEY_WATER_LIGHTSHAFTS
//#define MIN_LIGHT_EVERYWHERE
//#define METALLIC_WORLD
//#define ANAMORPHIC_BLOOM
//#define EXTRA_PARTICLE_EMISSION
//#define WAVING_EVERYTHING
//#define GBUFFER_CODING
//#define SHOW_RAY_TRACING
//#define RANDOM_BLOCKLIGHT
//#define OVERDRAW
#define RAIN_REF_BIOME_CHECK
//#define RAIN_REF_FORCED
#define WAVING_SPEED 1.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00]
#define WAVING_INTENSITY 1.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.25 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 17.5 20.0 25.0 30.0 35.0 40.0 45.0 50.0 55.0 60.0 65.0 70.0 75.0 80.0 90.0]
#define RAIN_WAVING_INTENSITY 1.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.25 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 17.5 20.0 25.0 30.0 35.0 40.0 45.0 50.0 55.0 60.0 65.0 70.0 75.0 80.0 90.0]
//#define DO_WAVING_UNDERGROUND
//#define DO_WAVING_ON_COMPATIBILITY
#define WAVING_FOLIAGE
//#define WAVING_LEAVES
#define WAVING_CROPS
//#define WAVING_VINES
//#define WAVING_LILY_PADS
#define NEBULA_COMPRESSION 0.00 //[-1.00 -0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define NEBULA_SMOOTHING 0.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define NEBULA_DISTRIBUTION 2.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6 13.8 14.0 14.2 14.4 14.6 14.8 15.0 15.2 15.4 15.6 15.8 16.0]
#define NEBULA_SIZE 0.03 //[0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 0.055 0.06 0.065 0.07 0.075 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25]
#define NEBULA_PURPLE_BRIGHTNESS 1.00 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00]
#define NEBULA_ORANGE_BRIGHTNESS 1.00 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00]
#define NEBULA_STAR_BRIGHTNESS 1.00 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00]
#define NEBULA_SPEED 1.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00]
//#define WATERMARK
#define WATERMARK_DURATION 1 //[1 999]
//#define GRAY_START
//#define BLURRY_START
//#define PARTICLE_VISIBILITY
//#define HAND_BLOOM_REDUCTION
//#define LAVA_VISIBILITY
#define SHOW_LIGHT_LEVELS 0 //[0 1 3 2]
#define ENTITY_EFFECT
#define HAND_SWAY 0.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0]
//#define SNOW_MODE
#define NETHER_REFRACT 1 //[0 1 2 3]
#define NIGHT_VISION 1 //[1 2]
//#define VANILLA_UNDERLAVA_COLOR
#define DYNAMIC_SHADER_LIGHT
#define DYNAMIC_LIGHT_DISTANCE 14.0 //[4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 11.0 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0 20.0 22.0 24.0 26.0 28.0 30.0 32.0 34.0 36.0 38.0 40.0 44.0 48.0 52.0 56.0 60.0 64.0]
#define GLINT_BRIGHTNESS 1.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6 13.8 14.0 14.2 14.4 14.6 14.8 15.0 15.2 15.4 15.6 15.8 16.0 18.0 20.0 22.0 24.0 26.0 28.0 30.0 32.0]
#define AO
#define AO_STRENGTH_NEW 2.2 //[0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.3 3.6 3.9 4.4 5.0]
#define AO_QUALITY 1 //[1 2 3]
#define LIGHT_SHAFTS
#define LIGHT_SHAFT_QUALITY 1 //[1 2 3]
#define LIGHT_SHAFT_STRENGTH 0.50 //[0.01 0.02 0.03 0.04 0.05 0.07 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.60 0.75 1.00 1.25 1.50 1.75 2.00 2.50 3.00 1000.0]
#define LIGHT_SHAFT_MODE 2 //[2 3]
#define LIGHT_SHAFT_NOON_MULTIPLIER 0.50 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define LIGHT_SHAFT_NIGHT_MULTIPLIER 2.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define LIGHT_SHAFT_DAY_RAIN_MULTIPLIER 1.50 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define LIGHT_SHAFT_NIGHT_RAIN_MULTIPLIER 1.50 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define LIGHT_SHAFT_UNDERWATER_MULTIPLIER 1.00 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define LIGHT_SHAFT_THE_END_MULTIPLIER 0.25 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define REFLECTION
#define REFLECTION_TRANSLUCENT
#define WATER_TRANSLUCENT_SKY_REF
#define WATER_CAUSTICS
//#define PROJECTED_CAUSTICS
//#define WATER_ABSORPTION
//#define WATER_REFRACT
#define REFRACT_STRENGTH 1.00 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
//#define BLACK_OUTLINE
//#define PROMO_OUTLINE
#define PROMO_OUTLINE_MODE 3 //[1 2 3]
#define PROMO_OUTLINE_STRENGTH 4.00 //[1.00 1.50 2.00 2.50 3.00 3.50 4.00 4.50 5.00 5.50 6.00 6.50 7.00 7.50 8.00]
#define PROMO_OUTLINE_THICKNESS 1 //[1 2 3 4]
//#define OUTLINE_ON_EVERYTHING
#define REFLECTION_SPECULAR
#define REFLECTION_ROUGH
#define SPECULAR_SKY_REF
//#define DOUBLE_QUALITY_ROUGH_REF
//#define REFLECTION_RAIN
#define REFLECTION_RAIN_COVERAGE 50 //[05 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100]
#define EMISSIVE_MULTIPLIER 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 6.00 7.00 8.00 9.00 10.00 12.50 15.00 17.50 20.00 30.00 40.00 50.00 100.00]
#define LAVA_INTENSITY 1.00 //[0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
#define FIRE_INTENSITY 1.00 //[0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
#define NORMAL_MAPPING
#define PARALLAX
#define PARALLAX_DEPTH 0.60 //[0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define SELF_SHADOW
#define SELF_SHADOW_ANGLE 2.0 //[0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0]
#define PARALLAX_QUALITY 128 //[16 32 64 128 256 512]
#define PARALLAX_DISTANCE 16 //[0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128]
#define DIRECTIONAL_LIGHTMAP
#define DIRECTIONAL_LIGHTMAP_STRENGTH 3.0 //[7.0 6.5 6.0 5.5 5.0 4.5 4.0 3.5 3.0 2.5 2.0 1.5 1.0]
#define NORMAL_MULTIPLIER 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.10 1.20 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00]
//#define GENERATED_NORMALS
//#define SAFE_GENERATED_NORMALS
//#define NOISY_TEXTURES
#define EMISSIVE_ORES
#define EMISSIVE_IRON_ORE
#define EMISSIVE_COPPER_ORE
#define EMISSIVE_GOLD_ORE
#define EMISSIVE_REDSTONE_ORE
#define EMISSIVE_EMERALD_ORE
#define EMISSIVE_LAPIS_ORE
#define EMISSIVE_DIAMOND_ORE
#define ORE_EMISSION 1.00 //[0.01 0.02 0.03 0.05 0.07 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 6.00 7.00 8.00]
//#define GLOWING_DEBRIS
//#define EMISSIVE_NETHER_ORES
#define EMISSIVE_NETHER_STEMS
#define EMISSIVE_LICHEN 1 //[0 1 2]
#define EMISSIVE_AMETHYST_BUDS
#define FANCY_NETHER_PORTAL 1 //[0 1 2]
//#define GREEN_SCREEN
//#define BLUE_SCREEN
//#define GLOWING_REDSTONE_BLOCK
//#define GLOWING_LAPIS_BLOCK
//#define ALTERNATIVE_COMMAND_BLOCK
#define DOF 2 //[1 2]
//#define DOF_IS_ON
#define RAIN_BLUR_MULT 3.00 //[0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.10 1.20 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.25 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 17.5 20.0 25.0 30.0 35.0 40.0 45.0 50.0 55.0 60.0 65.0 70.0 75.0 80.0 90.0]
#define UNDERWATER_BLUR_MULT 4.00 //[0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.10 1.20 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.25 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 17.5 20.0 25.0 30.0 35.0 40.0 45.0 50.0 55.0 60.0 65.0 70.0 75.0 80.0 90.0]
#define NETHER_BLUR
//#define ANAMORPHIC_BLUR
//#define FOV_SCALED_BLUR
//#define CHROMATIC_BLUR
#define DOF_STRENGTH 32.0 //[1.0 2.0 3.0 4.0 6.0 8.0 12.0 16.0 24.0 32.0 48.0 64.0 96.0 128.0 192.0 256.0 384.0 512.0 768.0 1024.0 1536.0 2048.0 3072.0 4096.0]
#define DOF_FOCUS 0 //[0 1 2 3 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40 42 44 46 48 50 52 54 56 58 60 62 65 67 69 72 74 76 79 81 83 86 88 91 94 96 99 102 104 107 110 113 115 118 121 124 127 130 133 136 140 143 146 149 153 156 160 163 167 170 174 178 182 185 189 193 197 201 206 210 214 219 223 227 232 237 242 246 251 256 261 267 272 277 283 288 294 300 306 312 318 324 330 337 344 350 357 364 371 379 386 394 402 410 418 427 435 444 453 462 472 481 491 501 512]
#define NETHER_BLUR_STRENGTH 64.0 //[1.0 2.0 3.0 4.0 6.0 8.0 12.0 16.0 24.0 32.0 48.0 64.0 96.0 128.0 192.0 256.0 384.0 512.0 768.0 1024.0 1536.0 2048.0 3072.0 4096.0]
//#define MOTION_BLUR
#define MOTION_BLUR_STRENGTH 1.50 //[0.05 0.07 0.10 0.15 0.20 0.25 0.35 0.50 0.75 1.00 1.25 1.50 1.75 2.00 3.00 5.00 10.00]
#define BLOOM
#define BLOOM_STRENGTH 0.40 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.75 1.00 100]
#define UNDERWATER_BLOOM_STRENGTH 0.40 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.75 1.00]
#define NETHER_BLOOM_STRENGTH 0.40 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.75 1.00]
//#define LENS_FLARE
#define LENS_FLARE_STRENGTH 1.00 //[0.10 0.15 0.20 0.25 0.30 0.40 0.50 0.75 1.00 1.25 1.50 1.75 2.00]
#define AA 3 //[0 1 2 3 4]
#define SHARPEN 0 //[0 1 2 3 4 5 6 7 8 9 10]
#define CHROMATIC_ABERRATION 0 //[0 1 2 3 4 5 6 7 8 9 10]
#define AUTO_EXPOSURE 0 //[0 1 2]
#define VIGNETTE 1 //[0 1 2]
#define VIGNETTE_STRENGTH 0.50 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.10 1.20 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 4.00 5.00]
#define SUN_GLARE
#define SUN_GLARE_STRENGTH 1.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.2 1.4 1.6 1.8 2.0 2.5 3.0 4.0 5.0]
//#define COLOR_GRADING
#define TONEMAP_EXPOSURE 5.6 //[1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 4.2 4.4 4.6 4.8 5.0 5.2 5.4 5.6 5.8 6.0 6.2 6.4 6.6 6.8 7.0 7.2 7.4 7.6 7.8 8.0 8.2 8.4 8.6 8.8 9.0 9.2 9.4 9.6 9.8 10.0 10.2 10.4 10.6 10.8 11.0 11.2 11.4 11.6 11.8 12.0 12.2 12.4 12.6 12.8 13.0 13.2 13.4 13.6 13.8 14.0 14.2 14.4 14.6 14.8 15.0 15.2 15.4 15.6 15.8 16.0]
#define TONEMAP_WHITE_CURVE 2.8 //[1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.5 4.0 4.5 5.0 6.0 7.0 8.0 9.0]
#define TONEMAP_LOWER_CURVE 1.20 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define TONEMAP_UPPER_CURVE 1.20 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define SATURATION 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define VIBRANCE 1.15 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define CG_RR 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_RG 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_RB 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_RI 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_RM 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_RC 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_GR 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_GG 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_GB 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_GI 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_GM 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_GC 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_BR 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_BG 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_BB 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_BI 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_BM 0 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_BC 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_TR 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_TG 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_TB 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define CG_TI 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CG_TM 0.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
const float sunPathRotation = -40.0; //[-60.0 -55.0 -50.0 -45.0 -40.0 -35.0 -30.0 -25.0 -20.0 -15.0 -10.0 -5.0 0.0 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0 55.0 60.0]
const int shadowMapResolution = 2048; //[256 1024 2048 3072 4096 8192]
const float shadowDistance = 192.0; //[64.0 80.0 96.0 112.0 128.0 160.0 192.0 224.0 256.0 320.0 384.0 512.0 768.0 1024.0]
#define SHADOWS
#define SHADOW_FILTER
#define SHADOW_SUBSURFACE 2 //[0 2 3]
#define SCATTERING_LEAVES 0.50 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define SCATTERING_FOLIAGE 0.80 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
const float shadowMapBias = 1.0 - 25.6 / shadowDistance;
//#define COLORED_SHADOWS
//#define CLOUD_SHADOW
//#define NO_FOLIAGE_SHADOWS
#define PIXEL_SHADOWS 0 //[0 8 16 32 64 128]
#define BLOCK_ENTITY_SHADOWS
#define ENTITY_SHADOWS
#define VAO_STRENGTH 10 //[0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 24 26 28 30 35 40 45 50]
#define SHADING_STRENGTH 0.85 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00]
#define LIGHT_MR 236 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_MG 184 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_MB 132 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_MI 1.05 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AMBIENT_MR 212 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_MG 196 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_MB 228 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_MI 0.30 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define LIGHT_DR 180 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_DG 172 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_DB 164 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_DI 1.40 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AMBIENT_DR 156 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_DG 188 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_DB 228 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_DI 0.45 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define LIGHT_ER 236 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_EG 180 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_EB 132 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_EI 1.05 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AMBIENT_ER 212 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_EG 196 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_EB 228 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_EI 0.30 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define LIGHT_NR 156 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_NG 192 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_NB 240 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define LIGHT_NI 0.70 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AMBIENT_NR 120 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_NG 164 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_NB 228 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AMBIENT_NI 0.45 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define NIGHT_BRIGHTNESS 1.00 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
//#define MOON_PHASE_LIGHTING
#define NIGHT_LIGHTING_FULL_MOON 1.05 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define NIGHT_LIGHTING_PARTIAL_MOON 0.90 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define NIGHT_LIGHTING_NEW_MOON 0.70 //[0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00 7.50 10.00 12.50 15.00 20.00 25.00 50.00]
#define BLOCKLIGHT_R 224 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define BLOCKLIGHT_G 172 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define BLOCKLIGHT_B 140 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define BLOCKLIGHT_I 0.45 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
//#define COLORED_LIGHT_DEFINE
#define LIGHT_GROUND 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AMBIENT_GROUND 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define WATER_R 172 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WATER_G 212 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WATER_B 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WATER_I 0.50 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define WATER_OPACITY 0.50 //[0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 0.99]
#define WATER_FOG 64.0 //[2.0 3.0 4.0 6.0 8.0 12.0 16.0 24.0 32.0 48.0 64.0 96.0 128.0 160.0 192.0 224.0 256.0 512.0]
#define WATER_V 0.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define UNDERWATER_R 0.33 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00]
#define UNDERWATER_G 0.21 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00]
#define UNDERWATER_B 0.26 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.20 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.30 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.40 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.50 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.60 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.70 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.80 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.00]
#define UNDERWATER_I 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define WEATHER_RR 168 //[4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WEATHER_RG 196 //[4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WEATHER_RB 255 //[4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define WEATHER_RI 1.60 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define NETHER_R 128 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define NETHER_G 64 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define NETHER_B 64 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define NETHER_I 1.75 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.50 6.00 7.00 8.00 9.00 10.00]
#define END_R 36 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define END_G 28 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define END_B 52 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define END_I 2.25 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.50 6.00 7.00 8.00 9.00 10.00]
#define SELECTION_R 164 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SELECTION_G 128 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SELECTION_B 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SELECTION_I 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define SELECTION_MODE 0 //[0 1 2 4 3]
#define AURORA_UP_R 112 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_UP_G 80 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_UP_B 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_UP_I 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define AURORA_DOWN_R 80 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_DOWN_G 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_DOWN_B 180 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define AURORA_DOWN_I 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define ENDER_NEBULA
#define AURORA
#define AURORA_BIOME_CHECK
#define AURORA_FULL_MOON_CHECK
#define AURORA_HEIGHT 0.75 //[0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10 0.12 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.10 2.20 2.30 2.40 2.50 2.60 2.70 2.80 2.90 3.00 3.50 4.00 4.50 5.00]
#define RAINBOW
#define RAINBOW_BRIGHTNESS 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00]
#define RAINBOW_DIAMETER 1.00 //[0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00]
#define RAINBOW_STYLE 1 //[1 2]
#define RAINBOW_AFTER_RAIN_CHECK
#define ROUND_SUN_MOON
//#define VANILLA_SKYBOX
#define SUN_MOON_HORIZON
#define SKYBOX_BRIGHTNESS 2.00 //[0.01 0.02 0.03 0.05 0.07 0.10 0.15 0.20 0.25 0.35 0.40 0.45 0.50 0.60 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00]
#define SKY_DAY 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 28.0 30.0 32.0]
#define SKY_NOON 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 28.0 30.0 32.0]
#define SKY_NIGHT 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 28.0 30.0 32.0]
#define SKY_RAIN_DAY 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 28.0 30.0 32.0]
#define SKY_RAIN_NIGHT 0.70 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 28.0 30.0 32.0]
#define SKY_MULT_R 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SKY_MULT_G 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SKY_MULT_B 255 //[0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104 108 112 116 120 124 128 132 136 140 144 148 152 156 160 164 168 172 176 180 184 188 192 196 200 204 208 212 216 220 224 228 232 236 240 244 248 252 255]
#define SKY_MULT_I 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define CLOUDS
#define CLOUD_THICKNESS 4.00 //[0.25 0.50 0.75 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00]
#define CLOUD_AMOUNT 10.5 //[14.0 13.5 13.0 12.5 12.0 11.5 11.0 10.5 10.0 9.5 9.0 8.5 8.0 7.5 7.0 6.5 6.0]
#define CLOUD_HEIGHT 30.0 //[2.5 5.0 10.0 15.0 20.0 25.0 30.0 35.0 40.0 45.0 50.0]
#define CLOUD_SPEED 1.00 //[0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.50 3.00 3.50 4.00 5.00]
#define CLOUD_OPACITY 0.6 //[0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0]
#define CLOUD_BRIGHTNESS 2.00 //[0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00]
//#define GALAXIES
#define GALAXY_BRIGHTNESS 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define SHADER_STARS
#define STAR_BRIGHTNESS 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define STAR_AMOUNT 1 //[1 2]
#define SUNSET_STARS
#define WATER_TYPE 0 //[0 1 2]
#define WATER_WAVES
//#define WATER_DISPLACEMENT
#define WATER_PARALLAX
#define WATER_BUMP 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 5.50 6.00 6.50 7.00 7.50 8.00]
#define WATER_NOISE_1 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00]
#define WATER_NOISE_2 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00]
#define WATER_NOISE_3 0.40 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00]
#define WATER_NOISE_4 0.30 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00]
#define SUN_MOON_WATER_REF 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00 3.25 3.50 3.75 4.00 4.25 4.50 4.75 5.00 5.50 6.00 6.50 7.00 7.50 8.00 8.50 9.00 9.50 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 26.0 28.0 30.0 32.0]
#define MOON_WATER_REF 1.00 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.40 1.50 1.60 1.70 1.80 1.90 2.00 2.25 2.50 2.75 3.00]
#define WATER_SHARPNESS 0.25 //[0.01 0.02 0.03 0.05 0.07 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50]
#define WATER_SIZE 450.0 //[25.0 50.0 100.0 150.0 200.0 250.0 300.0 350.0 400.0 450.0 500.0 550.0 600.0 650.0 700.0 750.0 800.0 850.0 900.0 950.0 1000.0 1100.0 1200.0 1300.0 1400.0 1500.0]
#define WATER_SPEED 1.25 //[0.05 0.10 0.15 0.20 0.25 0.35 0.50 0.60 0.75 0.90 1.00 1.10 1.25 1.50 1.75 2.00 2.50 3.00 3.50 4.00 4.25 4.50 4.75 5.00 5.50 6.00 6.50 7.00 7.50 8.00]
#define UNDERWATER_DISTORT 1.0 //[0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 100.0 1000.0]
//#define WHITE_WORLD
#define NETHER_FOG
//#define NETHER_SMOKE
#define FOG1
#define FOG1_DISTANCE_M 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define FOG1_TYPE 1 //[0 1 2]
#define FOG2
#define FOG2_ALTITUDE_MODE
#define FOG2_BRIGHTNESS 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define FOG2_END_BRIGHTNESS 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define FOG2_DISTANCE_M 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00]
#define FOG2_ALTITUDE 95 //[0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300]
#define FOG2_OPACITY 0.30 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define FOG2_END_DISTANCE_M 8.0 //[0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5 6.0 6.5 7.0 7.5 8.0 8.5 9.0 9.5 10.0 11.0 12.0 13.0 14.0 15.0 16.0 18.0 20.0 22.0 24.0 26.0 28.0 30.0 32.0 36.0 40.0 44.0 48.0 52.0 56.0 60.0 64.0]
#define FOG2_END_ALTITUDE 80 //[0 5 10 15 20 25 30 35 40 45 50 55 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300]
#define FOG2_END_OPACITY 0.65 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define FOG2_RAIN_OPACITY_M 3.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0]
#define FOG2_RAIN_BRIGHTNESS_M 1.00 //[0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0]
#define FOG2_RAIN_ALTITUDE_M 0.25 //[0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00]
#define FOG2_RAIN_DISTANCE_M 1.00 //[-0.95 -0.90 -0.85 -0.80 -0.75 -0.70 -0.65 -0.60 -0.55 -0.50 -0.45 -0.40 -0.35 -0.30 -0.25 -0.20 -0.15 -0.10 -0.05 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 3.05 3.10 3.15 3.20 3.25 3.30 3.35 3.40 3.45 3.50 3.55 3.60 3.65 3.70 3.75 3.80 3.85 3.90 3.95 4.00 4.25 4.50 4.75 5.00 5.25 5.50 5.75 6.00 6.25 6.50 6.75 7.00 7.50 8.00 8.50 9.00 9.50 10.0]
//#define WORLD_CURVATURE
#define OVERWORLD_CURVATURE_SIZE 2048 //[-256 -512 -1024 -2048 -4096 -8192 -16384 -32768 999999 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16]
#define NETHER_CURVATURE_SIZE 2048 //[-256 -512 -1024 -2048 -4096 -8192 -16384 -32768 999999 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16]
#define END_CURVATURE_SIZE 2048 //[-256 -512 -1024 -2048 -4096 -8192 -16384 -32768 999999 32768 16384 8192 4096 2048 1024 512 256 128 64 32 16]
#define WORLD_TIME_ANIMATION 1 //[0 1 2]
#define ANIMATION_SPEED 1.00 //[0.00 0.25 0.50 0.75 1.00 1.25 1.50 1.75 2.00 2.50 3.00 3.50 4.00 5.00 6.00 7.00 8.00 16.00 32.00 64.00 128.00]
#define MIN_LIGHT 32 //[0 1 2 3 4 6 8 12 16 24 32 48 64 96 128 192 256 384 512 768 1024 1536 2048]
//#define NO_PARTICLES
//#define BLOCKLIGHT_FLICKER
#define BLOCKLIGHT_FLICKER_STRENGTH 0.60 //[0.00 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 1.00 1.50 2.00 3.00 4.00]
//#define VL_CLOUDS_50325
//Define Handling//
#if (RP_SUPPORT == 1 && !defined COMPATIBILITY_MODE) || RP_SUPPORT > 2
#define ADV_MAT
#else
#undef SNOW_MODE
#endif
#if !defined COMPATIBILITY_MODE && RP_SUPPORT == 1
#define COMPBR
#undef PARALLAX
#undef SELF_SHADOW
#undef DIRECTIONAL_LIGHTMAP
#if !defined GENERATED_NORMALS
#undef NORMAL_MAPPING
#endif
#else
#undef NOISY_TEXTURES
#undef GENERATED_NORMALS
#endif
#ifndef NORMAL_MAPPING
#undef GENERATED_NORMALS
#undef PARALLAX
#undef SELF_SHADOW
#undef DIRECTIONAL_LIGHTMAP
#endif
#if defined ENTITY_NORMAL_FIX && (defined GBUFFERS_ENTITIES || defined GBUFFERS_HAND || defined GBUFFERS_BLOCK)
#if MC_VERSION >= 11500 && MC_VERSION < 11600
#undef NOISY_TEXTURES
#undef GENERATED_NORMALS
#undef NORMAL_MAPPING
#undef PARALLAX
#undef SELF_SHADOW
#undef DIRECTIONAL_LIGHTMAP
#endif
#if MC_VERSION < 11802 || defined GBUFFERS_ENTITIES || defined GBUFFERS_HAND
#undef NOISY_TEXTURES
#undef GENERATED_NORMALS
#ifdef COMPBR
#undef NORMAL_MAPPING
#endif
#endif
#endif
#ifndef SHADOWS
#undef LIGHT_SHAFTS
#endif
#ifdef COMPATIBILITY_MODE
#undef FLICKERING_FIX
#ifndef DO_WAVING_ON_COMPATIBILITY
#undef WAVING_FOLIAGE
#undef WAVING_LEAVES
#undef WAVING_CROPS
#undef WAVING_VINES
#undef WAVING_LILY_PADS
#endif
#endif
#if defined ADV_MAT && !defined COMPATIBILITY_MODE && defined COLORED_LIGHT_DEFINE
#define COLORED_LIGHT
#undef RANDOM_BLOCKLIGHT
#endif
#ifdef VL_CLOUDS
#undef CLOUDS
#endif
//Dimension Undefine//
#ifdef NETHER
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef RAINBOW
#endif
#ifdef END
#undef LENS_FLARE
#undef VL_CLOUDS
#undef RAINBOW
#endif
#ifdef SEVEN_2
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef CLOUDS
#undef RAINBOW
#endif
#ifdef TWO
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef RAINBOW
#endif
#ifdef SEVEN
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef RAINBOW
#endif
#ifdef TWO
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef RAINBOW
#endif
#ifdef ONESEVEN
#undef LIGHT_SHAFTS
#undef RAINBOW
#endif
#ifdef TWENTY
#undef LIGHT_SHAFTS
#undef LENS_FLARE
#undef RAINBOW
#endif
//Shenanigans//
#ifdef NETHER_BLUR
#endif
#ifdef DOF_IS_ON
#endif
#ifdef ENTITY_NORMAL_FIX
#endif
#ifdef WATER_DISPLACEMENT
#endif
#ifdef NO_PARTICLES
#endif
#ifdef FOG2_ALTITUDE_MODE
#endif
#ifdef HAND_BLOOM_REDUCTION
#endif
#ifdef OUTLINE_ON_EVERYTHING
#endif
#ifdef FOG2
#endif
#ifdef CLOUD_SHADOW
#endif
#ifdef LIGHT_SHAFTS
#endif
#ifdef NETHER_FOG
#endif
#ifdef REFLECTION_SPECULAR
#endif
#ifdef VANILLA_SKYBOX
#endif
#ifdef COLORED_LIGHT_DEFINE
#endif
#ifdef PROJECTED_CAUSTICS
#endif
#ifdef COLORED_SHADOWS
#endif
#ifdef BLOCK_ENTITY_SHADOWS
#endif
#ifdef ENTITY_SHADOWS
#endif
#ifdef WATER_REFRACT
#endif
#ifdef BLOCKLIGHT_FLICKER
#endif
//Very Common Variables//
uniform int worldTime;
#ifndef SHADOWS
float timeAngle = worldTime / 24000.0;
float shadowFade = 1.0;
#else
uniform float sunAngle;
float tAmin = fract(sunAngle - 0.033333333);
float tAlin = tAmin < 0.433333333 ? tAmin * 1.15384615385 : tAmin * 0.882352941176 + 0.117647058824;
float hA = tAlin > 0.5 ? 1.0 : 0.0;
float tAfrc = fract(tAlin * 2.0);
float tAfrs = tAfrc*tAfrc*(3.0-2.0*tAfrc);
float tAmix = hA < 0.5 ? 0.3 : -0.1;
float timeAngle = (tAfrc * (1.0-tAmix) + tAfrs * tAmix + hA) * 0.5;
float shadowFade = clamp(1.0 - (abs(abs(sunAngle - 0.5) - 0.25) - 0.23) * 100.0, 0.0, 1.0);
#endif
float timeBrightness = max(sin(timeAngle*6.28318530718),0.0);
float moonBrightness = max(sin(timeAngle*(-6.28318530718)),0.0);
vec3 darknessColor = vec3(0.0001, 0.0003, 0.0005);
//Very Common Functions//
int min1(int x) {
return min(x, 1);
}
float min1(float x) {
return min(x, 1.0);
}
int max0(int x) {
return max(x, 0);
}
float max0(float x) {
return max(x, 0.0);
}
int clamp01(int x) {
return clamp(x, 0, 1);
}
float clamp01(float x) {
return clamp(x, 0.0, 1.0);
}
int pow2(int x) {
return x * x;
}
float pow2(float x) {
return x * x;
}
vec2 pow2(vec2 x) {
return x * x;
}
vec3 pow2(vec3 x) {
return x * x;
}
vec4 pow2(vec4 x) {
return x * x;
}
float pow1_5(float x) { // Faster pow(x, 1.5) approximation (that isn't accurate at all) if x is between 0 and 1
return x - x * pow2(1.0 - x); // Thanks to SixthSurge
}
vec2 pow1_5(vec2 x) {
return x - x * pow2(1.0 - x);
}
vec3 pow1_5(vec3 x) {
return x - x * pow2(1.0 - x);
}
vec4 pow1_5(vec4 x) {
return x - x * pow2(1.0 - x);
}
float sqrt1(float x) { // Faster sqrt() approximation (that isn't accurate at all) if x is between 0 and 1
return x * (2.0 - x); // Thanks to Builderb0y
}
vec2 sqrt1(vec2 x) {
return x * (2.0 - x);
}
vec3 sqrt1(vec3 x) {
return x * (2.0 - x);
}
vec4 sqrt1(vec4 x) {
return x * (2.0 - x);
}
float sqrt2(float x) {
x = 1.0 - x;
x *= x;
x *= x;
return 1.0 - x;
}
vec2 sqrt2(vec2 x) {
x = 1.0 - x;
x *= x;
x *= x;
return 1.0 - x;
}
vec3 sqrt2(vec3 x) {
x = 1.0 - x;
x *= x;
x *= x;
return 1.0 - x;
}
vec4 sqrt2(vec4 x) {
x = 1.0 - x;
x *= x;
x *= x;
return 1.0 - x;
}
float sqrt3(float x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec2 sqrt3(vec2 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec3 sqrt3(vec3 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec4 sqrt3(vec4 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
float sqrt4(float x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec2 sqrt4(vec2 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec3 sqrt4(vec3 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
vec4 sqrt4(vec4 x) {
x = 1.0 - x;
x *= x;
x *= x;
x *= x;
x *= x;
return 1.0 - x;
}
float smoothstep1(float x) {
return x * x * (3.0 - 2.0 * x);
}
float sqrt1inv(float number) {
number = 1.0 - number;
number *= number;
return number;
}
float dot2(vec2 vector) {
return dot(vector, vector);
}
float dot2(vec3 vector) {
return dot(vector, vector);
}
float dot2(vec4 vector) {
return dot(vector, vector);
}
float min2(vec2 vector) {
return min(vector.x, vector.y);
}
float max2(vec2 vector) {
return max(vector.x, vector.y);
}
bool CheckForColor(vec3 albedo, vec3 check) { // Thanks Builderb0y
vec3 dif = albedo - check / 255.0;
return dif == clamp(dif, vec3(-0.001), vec3(0.001));
}

View File

@@ -0,0 +1,107 @@
/**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**/
vec3 glowstoneColor = vec3(0.9, 0.5, 0.2);
vec3 sealanternColor = vec3(0.5, 0.57, 0.78);
vec3 shroomlightColor = vec3(1.0, 0.3, 0.125);
vec3 jackolanternColor = vec3(0.9, 0.5, 0.2);
vec3 beaconColor = vec3(0.33, 0.51, 0.6);
vec3 endrodColor = vec3(0.53, 0.5, 0.47);
vec3 redstonetorchColor = vec3(1.0, 0.0, 0.0);
vec3 lanternColor = vec3(0.9, 0.5, 0.2);
vec3 soullanternColor = vec3(0.0, 0.7, 1.0);
vec3 torchColor = vec3(0.9, 0.5, 0.2);
vec3 soultorchColor = vec3(0.0, 0.7, 1.0);
vec3 respawnanchorColor = vec3(0.3, 0.0, 1.0);
vec3 campfireColor = vec3(0.94, 0.5, 0.2);
vec3 soulcampfireColor = vec3(0.0, 0.7, 1.0);
vec3 lavabucketColor = vec3(0.94, 0.5, 0.2);
/**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**/
vec3 heldLightAlbedo1 = vec3(0.0);
vec3 heldLightAlbedo2 = vec3(0.0);
if (heldItemId < 11012.5) {
if (heldItemId < 11005.5) {
if (heldItemId == 11001) // Glowstone
heldLightAlbedo1 = glowstoneColor;
else if (heldItemId == 11002) // Sea Lantern
heldLightAlbedo1 = sealanternColor;
else if (heldItemId == 11004) // Shroomlight
heldLightAlbedo1 = shroomlightColor;
} else {
if (heldItemId == 11007) // Jack o'Lantern
heldLightAlbedo1 = jackolanternColor;
else if (heldItemId == 11008) // Beacon
heldLightAlbedo1 = beaconColor;
else if (heldItemId == 11009) // End Rod
heldLightAlbedo1 = endrodColor;
else if (heldItemId == 11012) // Redstone Torch
heldLightAlbedo1 = redstonetorchColor;
}
} else {
if (heldItemId < 11022.5) {
if (heldItemId == 11017) // Lantern
heldLightAlbedo1 = lanternColor;
else if (heldItemId == 11018) // Soul Lantern
heldLightAlbedo1 = soullanternColor;
else if (heldItemId == 11021) // Torch
heldLightAlbedo1 = torchColor;
else if (heldItemId == 11022) // Soul Torch
heldLightAlbedo1 = soultorchColor;
} else {
if (heldItemId == 11023) // Crying Obsidian, Respawn Anchor
heldLightAlbedo1 = respawnanchorColor;
else if (heldItemId == 11024) // Campfire
heldLightAlbedo1 = campfireColor;
else if (heldItemId == 11025) // Soul Campfire
heldLightAlbedo1 = soulcampfireColor;
else if (heldItemId == 12001) // Lava Bucket
heldLightAlbedo1 = lavabucketColor;
}
}
if (heldItemId2 < 11012.5) {
if (heldItemId2 < 11005.5) {
if (heldItemId2 == 11001) // Glowstone
heldLightAlbedo2 = glowstoneColor;
else if (heldItemId2 == 11002) // Sea Lantern
heldLightAlbedo2 = sealanternColor;
else if (heldItemId2 == 11004) // Shroomlight
heldLightAlbedo2 = shroomlightColor;
} else {
if (heldItemId2 == 11007) // Jack o'Lantern
heldLightAlbedo2 = jackolanternColor;
else if (heldItemId2 == 11008) // Beacon
heldLightAlbedo2 = beaconColor;
else if (heldItemId2 == 11009) // End Rod
heldLightAlbedo2 = endrodColor;
else if (heldItemId2 == 11012) // Redstone Torch
heldLightAlbedo2 = redstonetorchColor;
}
} else {
if (heldItemId2 < 11022.5) {
if (heldItemId2 == 11017) // Lantern
heldLightAlbedo2 = lanternColor;
else if (heldItemId2 == 11018) // Soul Lantern
heldLightAlbedo2 = soullanternColor;
else if (heldItemId2 == 11021) // Torch
heldLightAlbedo2 = torchColor;
else if (heldItemId2 == 11022) // Soul Torch
heldLightAlbedo2 = soultorchColor;
} else {
if (heldItemId2 == 11023) // Crying Obsidian, Respawn Anchor
heldLightAlbedo2 = respawnanchorColor;
else if (heldItemId2 == 11024) // Campfire
heldLightAlbedo2 = campfireColor;
else if (heldItemId2 == 11025) // Soul Campfire
heldLightAlbedo2 = soulcampfireColor;
else if (heldItemId2 == 12001) // Lava Bucket
heldLightAlbedo2 = lavabucketColor;
}
}
/**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**/
vec3 heldLightAlbedo = heldLightAlbedo1 + heldLightAlbedo2;
if (dot(heldLightAlbedo, heldLightAlbedo) > 0.001) {
heldLightAlbedo /= length(heldLightAlbedo);
heldLightAlbedo *= BLOCKLIGHT_I * 0.4;
float mixFactor = finalHandLight * finalHandLight;
blocklightCol = mix(blocklightCol, heldLightAlbedo, max(mixFactor, 0.0));
}
/**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**//**/

View File

@@ -0,0 +1,353 @@
if (mat > 100.5 && mat < 10000.0) {
if (mat < 152.5) {
if (mat < 132.5) {
if (mat < 124.5) {
if (material == 120.0) { // Redstone Stuff
#ifndef WORLD_CURVATURE
float comPos = fract(worldPos.y + cameraPosition.y);
#else
float comPos = fract(oldPosition.y + cameraPosition.y);
#endif
if (comPos > 0.18) emissive = float((albedo.r > 0.65 && albedo.r > albedo.b * 1.0) || albedo.b > 0.99);
else emissive = float(albedo.r > albedo.b * 3.0 && albedo.r > 0.5) * 0.125;
emissive *= max(0.65 - 0.3 * dot(albedo.rgb, vec3(1.0, 1.0, 0.0)), 0.0);
if (specB > 900.0) { // Observer
emissive *= float(albedo.r > albedo.g * 1.5);
}
}
else if (material == 124.0) { // Warped Stem+
#ifdef EMISSIVE_NETHER_STEMS
float core = float(albedo.r < 0.1);
float edge = float(albedo.b > 0.35 && albedo.b < 0.401 && core == 0.0);
emissive = core * 0.195 + 0.035 * edge;
#endif
}
} else {
if (material == 128.0) { // Crimson Stem+
#ifdef EMISSIVE_NETHER_STEMS
emissive = float(albedo.b < 0.16);
emissive = min(pow2(lAlbedoP * lAlbedoP) * emissive * 3.0, 0.3);
#endif
}
if (material == 130.0) { // Sculk++
emissive *= max((albedo.b - albedo.r) - 0.1, 0.0) * 0.5
+ 100.0 * max(albedo.g - albedo.b, 0.0) * float(albedo.r < albedo.b - 0.1)
;
}
else if (material == 132.0) { // Command Blocks
#ifndef WORLD_CURVATURE
vec3 comPos = fract(worldPos.xyz + cameraPosition.xyz);
#else
vec3 comPos = fract(oldPosition.xyz + cameraPosition.xyz);
#endif
comPos = abs(comPos - vec3(0.5));
float comPosM = min(max(comPos.x, comPos.y), min(max(comPos.x, comPos.z), max(comPos.y, comPos.z)));
emissive = 0.0;
if (comPosM < 0.1882) { // Command Block Center
vec3 dif = vec3(albedo.r - albedo.b, albedo.r - albedo.g, albedo.b - albedo.g);
dif = abs(dif);
emissive = float(max(dif.r, max(dif.g, dif.b)) > 0.1) * 25.0;
emissive *= float(albedo.r > 0.44 || albedo.g > 0.29);
if (CheckForColor(albedo.rgb, vec3(207, 166, 139)) // Fix for Iris' precision
|| CheckForColor(albedo.rgb, vec3(201, 143, 107))
|| CheckForColor(albedo.rgb, vec3(161, 195, 180))
|| CheckForColor(albedo.rgb, vec3(131, 181, 145))
|| CheckForColor(albedo.rgb, vec3(155, 139, 207))
|| CheckForColor(albedo.rgb, vec3(135, 121, 181))) emissive = 0.0;
#ifdef ALTERNATIVE_COMMAND_BLOCK
if (emissive > 0.01) {
albedo.rgb *= vec3(0.88, 1.32, 1.9);
albedo.g = sqrt1(albedo.g) * 0.6;
albedo.rgb *= albedo.rgb * 2.0;
}
#endif
}
vec3 dif = abs(vec3(albedo.r - albedo.g, albedo.g - albedo.b, albedo.r - albedo.b));
float maxDif = max(dif.r, max(dif.g, dif.b));
smoothness = 0.38;
if (maxDif < 0.05) smoothness = 0.6;
metalness = 1.0;
}
}
} else {
if (mat < 144.5) {
if (material == 136.0) { // Snowy Grass Block
if (lAlbedoP > 1.0) smoothness = lAlbedoP * lAlbedoP * 0.165;
else metalness = 0.003;
}
else if (material == 140.0) { // Dragon Egg, Spawner
emissive = float(albedo.r + albedo.b > albedo.g * 30.0 && lAlbedoP < 0.6);
emissive *= 8.0 + float(lAlbedoP < 0.4) * 100.0;
if (albedo.b + albedo.g > albedo.r * 2.0 && lAlbedoP > 0.2) { // Spawner Metal
smoothness = 0.385;
metalness = 0.8;
}
if (max(abs(albedo.r - albedo.b), abs(albedo.g - albedo.r)) < 0.01) { // Dragon Egg Subtle Emission
emissive = 2.5 * float(lAlbedoP < 0.2);
}
}
else if (material == 144.0) // Furnaces Lit
emissive = 0.75 * float(albedo.r * albedo.r > albedo.b * 4.0 || (albedo.r > 0.9 && (albedo.r > albedo.b || albedo.r > 0.99)));
} else {
if (material == 148.0) // Torch, Soul Torch
emissive = float(albedo.r > 0.9 || albedo.b > 0.65) * (1.4 - albedo.b * 1.05);
/* {
#ifndef WORLD_CURVATURE
vec3 comPos = fract(worldPos.xyz + cameraPosition.xyz);
#else
vec3 comPos = fract(oldPosition.xyz + cameraPosition.xyz);
#endif
comPos = abs(comPos - vec3(0.5));
float comPosM = max(max(comPos.x, comPos.y), comPos.z);
emissive = clamp(1.0 - comPosM * 2.0, 0.0, 1.0);
if (emissive > 0.001) {
emissive *= emissive;
emissive *= emissive;
emissive *= pow(lAlbedoP * 0.7, 4.0) * 0.75;
emissive = min(emissive, 0.15);
} else emissive = 0.0;
lightmap.x = min(emissive * 10.0 + 0.6, 1.05);
albedo.rgb = pow(albedo.rgb, vec3(1.4 - lightmap.x));
} */
else if (material == 152.0) { // Obsidian++
smoothness = max(smoothness, 0.375);
if (specB > 0.5) { // Crying Obsidian, Respawn Anchor
emissive = (albedo.b - albedo.r) * albedo.r * 6.0;
emissive *= emissive * emissive;
emissive = clamp(emissive, 0.05, 1.0);
if (lAlbedoP > 1.6 || albedo.r > albedo.b * 1.7) emissive = 1.0;
} else {
if (lAlbedoP > 0.75) { // Enchanting Table Diamond
f0 = smoothness;
smoothness = 0.9 - f0 * 0.1;
metalness = 0.0;
}
if (albedo.r > albedo.g + albedo.b) { // Enchanting Table Cloth
smoothness = max(smoothness - 0.45, 0.0);
metalness = 0.0;
}
}
}
}
}
} else {
if (mat < 170.5) {
if (mat < 162.5) {
if (material == 156.0) { // Campfires, Powered Lever
if (albedo.g + albedo.b > albedo.r * 2.3 && albedo.g > 0.38 && albedo.g > albedo.b * 0.9) emissive = 0.09;
if (albedo.r > albedo.b * 3.0 || albedo.r > 0.8) emissive = 0.65;
emissive *= max(1.0 - albedo.b + albedo.r, 0.0);
emissive *= lAlbedoP;
}
else if (material == 160.0) { // Cauldron, Hopper, Anvils
if (color.r < 0.99) { // Cauldron Water
cauldron = 1.0, smoothness = 1.0, metalness = 0.0;
skymapMod = lmCoord.y * 0.475 + 0.515;
#if defined REFLECTION_RAIN && defined RAIN_REF_BIOME_CHECK
noRain = 1.0;
#endif
#if WATER_TYPE == 0
albedo.rgb = waterColor.rgb;
#elif WATER_TYPE == 1
albedo.rgb = pow(albedo.rgb, vec3(1.3));
#else
albedo.rgb = vec3(0.4, 0.5, 0.4) * (pow(albedo.rgb, vec3(2.8)) + 4 * waterColor.rgb * pow(albedo.r, 1.8)
+ 16 * waterColor.rgb * pow(albedo.g, 1.8) + 4 * waterColor.rgb * pow(albedo.b, 1.8));
albedo.rgb = pow(albedo.rgb * 1.5, vec3(0.5, 0.6, 0.5)) * 0.6;
albedo.rgb *= 1 + length(albedo.rgb) * pow(WATER_OPACITY, 32.0) * 2.0;
#endif
#ifdef NORMAL_MAPPING
vec2 cauldronCoord1 = texCoord + fract(frametime * 0.003);
float cauldronNoise1 = texture2D(noisetex, cauldronCoord1).r;
vec2 cauldronCoord2 = texCoord - fract(frametime * 0.003);
float cauldronNoise2 = texture2D(noisetex, cauldronCoord2).r;
float waveFactor = 0.027 + 0.065 * lightmap.y;
normalMap.xy += (0.5 * waveFactor) * (cauldronNoise1 * cauldronNoise2 - 0.3);
albedo.rgb *= (1.0 - waveFactor * 0.5) + waveFactor * cauldronNoise1 * cauldronNoise2;
#endif
}
#if MC_VERSION >= 11700
else if (albedo.r * 1.5 > albedo.g + albedo.b) { // Cauldron Lava
metalness = 0.0;
smoothness = 0.0;
#ifndef WORLD_CURVATURE
float comPos = fract(worldPos.y + cameraPosition.y);
#else
float comPos = fract(oldPosition.y + cameraPosition.y);
#endif
comPos = fract(comPos);
if (comPos > 0.2 && comPos < 0.99) {
emissive = 1.0;
albedo.rgb *= LAVA_INTENSITY * 0.9;
}
}
else if (dot(albedo.rgb, albedo.rgb) > 2.7) { // Cauldron Powder Snow
metalness = 0.0;
smoothness = pow(lAlbedoP, 1.8037) * 0.185;
smoothness = min(smoothness, 1.0);
}
#endif
}
else if (material == 162.0) { // Glowstone, Magma Block
#include "/lib/other/mipLevel.glsl"
emissive = pow(lAlbedoP, specB) * fract(specB) * 20.0;
emissive += miplevel * 2.5;
}
} else {
if (material == 164.0) { // Chorus Plant, Chorus Flower Age 5
if (albedo.g > 0.55 && albedo.r < albedo.g * 1.1) {
emissive = 1.0;
}
}
else if (material == 168.0) { // Overworld Ore Handling Except Redstone
float stoneDif = max(abs(albedo.r - albedo.g), max(abs(albedo.r - albedo.b), abs(albedo.g - albedo.b)));
float brightFactor = max(lAlbedoP - 1.5, 0.0);
float ore = max(max(stoneDif - 0.175 + specG, 0.0), brightFactor);
#ifdef EMISSIVE_ORES
emissive *= sqrt4(ore) * 0.15 * ORE_EMISSION;
#endif
metalness = 0.0;
#if !defined EMISSIVE_ORES || !defined EMISSIVE_IRON_ORE
if (abs(specG - 0.07) < 0.0001) {
float oreM = min(pow2(ore * ore) * 300.0, 1.0);
smoothness = mix(smoothness, 1.0, oreM);
metalness = mix(metalness, 0.8, sqrt3(oreM));
}
#endif
#if !defined EMISSIVE_ORES || !defined EMISSIVE_COPPER_ORE
if (abs(specG - 0.1) < 0.0001) {
float oreM = sqrt3(min(ore * 0.25, 1.0));
smoothness = mix(smoothness, 0.5, oreM);
if (oreM > 0.01) metalness = 0.8;
}
#endif
#if !defined EMISSIVE_ORES || !defined EMISSIVE_GOLD_ORE
if (abs(specG - 0.002) < 0.0001) {
float oreM = min(pow2(ore * ore) * 40.0, 1.0);
smoothness = mix(smoothness, 0.5, oreM);
if (oreM > 0.01) metalness = 0.8;
}
#endif
#if !defined EMISSIVE_ORES || !defined EMISSIVE_EMERALD_ORE
if (abs(specG - 0.0015) < 0.0001) {
if (ore > 0.01) {
float oreM = 1.0 - min(ore * 0.75, 1.0);
smoothness = mix(smoothness, 1.0, oreM);
extraSpecularM = 1.0;
}
}
#endif
#if !defined EMISSIVE_ORES || !defined EMISSIVE_DIAMOND_ORE
if (abs(specG - 0.001) < 0.0001) {
if (ore > 0.01) {
float oreM = 1.0 - min(ore, 1.0);
smoothness = mix(smoothness, 1.0, oreM);
extraSpecularM = 1.0;
}
}
#endif
}
else if (material == 170.0) { // Block of Amethyst++
smoothness = min(pow((max(1.73 - lAlbedoP, 0.0) + 1.0), 0.81) * 0.5, 1.0);
#ifdef EMISSIVE_AMETHYST_BUDS
#ifndef WORLD_CURVATURE
vec3 comPos = fract(worldPos.xyz + cameraPosition.xyz);
#else
vec3 comPos = fract(oldPosition.xyz + cameraPosition.xyz);
#endif
comPos = abs(comPos - vec3(0.5));
float comPosM = max(max(comPos.x, comPos.y), comPos.z);
emissive = clamp(1.0 - comPosM * 2.0, 0.0, 1.0);
if (emissive > 0.001) {
float orangeFactor = sqrt1(emissive * sqrt2(1.0 - lmCoord.x));
emissive *= emissive;
emissive *= emissive;
emissive *= pow(lAlbedoP * 0.7, 4.0) * 0.75;
emissive = min(emissive, 0.15) * 1.1;
albedo.rgb = pow(albedo.rgb, mix(vec3(1.0), vec3(1.0, 1.0, 2.0), orangeFactor));
float whiteFactor = pow(clamp(albedo.g * (1.0 + emissive), 0.0, 1.0), 10.0);
albedo.rgb = mix(albedo.rgb, vec3(1.0), whiteFactor);
} else emissive = 0.0;
#endif
}
}
} else {
if (mat < 176.5) {
if (material == 172.0) { // Wet Farmland
if (lAlbedoP > 0.3) smoothness = lAlbedoP * 0.7;
else smoothness = lAlbedoP * 2.7;
smoothness = min(smoothness, 1.0);
}
else if (material == 174.0) { // Emissive Redstone Ores
float stoneDif = max(abs(albedo.r - albedo.g), max(abs(albedo.r - albedo.b), abs(albedo.g - albedo.b)));
float brightFactor = max(lAlbedoP - 1.5, 0.0);
float ore = max(max(stoneDif - 0.175 + specG, 0.0), brightFactor);
emissive *= sqrt4(ore) * 0.11 * ORE_EMISSION;
metalness = 0.0;
// Fix white pixels
if (emissive > 0.01) {
float whitePixelFactor = max(lAlbedoP * lAlbedoP * 2.2, 1.0);
albedo.rgb = pow(albedo.rgb, vec3(whitePixelFactor));
}
}
else if (material == 176.0) { // Beacon
#ifndef WORLD_CURVATURE
vec3 comPos = fract(worldPos.xyz + cameraPosition.xyz);
#else
vec3 comPos = fract(oldPosition.xyz + cameraPosition.xyz);
#endif
comPos = abs(comPos - vec3(0.5));
float comPosM = max(max(comPos.x, comPos.y), comPos.z);
if (comPosM < 0.4 && albedo.b > 0.5) { // Beacon Core
albedo.rgb = vec3(0.35, 1.0, 0.975);
if (lAlbedoP > 1.5) albedo.rgb = vec3(1.0);
else if (lAlbedoP > 1.3) albedo.rgb = vec3(0.35, 1.0, 0.975);
else if (lAlbedoP > 1.15) albedo.rgb *= 0.86;
else albedo.rgb *= 0.78;
emissive = 1.5;
}
}
} else {
if (material == 180.0) { // End Rod
if (lAlbedoP > 1.3) {
smoothness = 0.0;
emissive = 0.4;
}
}
else if (material == 184.0) { // Rails
if (albedo.r > albedo.g * 2.0 + albedo.b) {
if (lAlbedoP > 0.45) { // Rail Redstone Lit
emissive = lAlbedoP;
} else { // Rail Redstone Unlit
smoothness = 0.4;
metalness = 1.0;
}
} else {
if (albedo.r > albedo.g + albedo.b || abs(albedo.r - albedo.b) < 0.1) { // Rail Gold, Rail Iron
smoothness = 0.4;
metalness = 1.0;
}
}
}
}
}
}
}
#ifdef EMISSIVE_NETHER_ORES
if (specB < -9.0) {
emissive = float(albedo.r + albedo.g > albedo.b * 2.0 && albedo.g > albedo.b * (1.2 - albedo.g * 0.5));
if (abs(albedo.g - albedo.b) < 0.1) emissive *= float(albedo.b > 0.35 || albedo.b < 0.05); // Eliminate Some Pixels On Quartz Ore
emissive *= albedo.r * 0.05 * ORE_EMISSION;
if (emissive > 0.01) // Desaturate Some Red-Looking Pixels
albedo.rgb = mix(albedo.rgb, vec3(dot(albedo.rgb, vec3(0.4, 0.5, 0.07))), clamp((albedo.r - albedo.g) * 2.0, 0.0, 0.3));
}
#endif

View File

@@ -0,0 +1,869 @@
if (mc_Entity.x == 31 || mc_Entity.x == 6 || mc_Entity.x == 59 ||
mc_Entity.x == 175 || mc_Entity.x == 176 || mc_Entity.x == 83 ||
mc_Entity.x == 104 || mc_Entity.x == 105 || mc_Entity.x == 11019) // Foliage++
#ifdef NOISY_TEXTURES
noiseVarying = 1001.0,
#endif
#ifndef SHADOWS
normal = upVec, color.rgb *= 0.9,
#else
mat = 1.0,
#endif
lmCoord.x = clamp(lmCoord.x, 0.0, 0.87), quarterNdotUfactor = 0.0;
if (mc_Entity.x == 18 || mc_Entity.x == 9600 || mc_Entity.x == 9100) // Leaves, Vine, Lily Pad
#ifdef COMPBR
specR = 12.065, specG = 0.003,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 1001.0,
#endif
mat = 2.0;
if (mc_Entity.x == 10) // Lava
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
mat = 4.0,
specB = 0.25, quarterNdotUfactor = 0.0, color.a = 1.0, lmCoord.x = 0.9,
color.rgb = normalize(color.rgb) * vec3(LAVA_INTENSITY * 1.45);
if (mc_Entity.x == 1010) // Fire
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
specB = 0.25, lmCoord.x = 0.98, color.a = 1.0, color.rgb = vec3(FIRE_INTENSITY * 0.67);
if (mc_Entity.x == 210) // Soul Fire
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
specB = 0.25, lmCoord.x = 0.0, color.a = 1.0, color.rgb = vec3(FIRE_INTENSITY * 0.53);
if (mc_Entity.x == 12345) // Custom Emissive
lmCoord = vec2(0.0), specB = 2.05;
if (mc_Entity.x == 300) // No Vanilla AO
#ifdef NOISY_TEXTURES
noiseVarying = 1001.0,
#endif
color.a = 1.0;
if (lmCoord.x > 0.99) // Clamp full bright emissives
lmCoord.x = 0.9;
#ifdef COMPBR
if (mc_Entity.x < 10380.5) {
if (mc_Entity.x < 10115.5) {
if (mc_Entity.x < 10052.5) {
if (mc_Entity.x < 10008.5) {
if (mc_Entity.x < 10002.5) {
if (mc_Entity.x == 10000) { // Grass Block
#if MC_VERSION > 10710
if (color.b < 0.99) { // Grass Block Grass
specR = 8.034, specG = 0.003;
} else // Grass Block Dirt
#endif
specR = 2.035, specG = 0.003;
}
else if (mc_Entity.x == 10001) // Snowy Grass Block
mat = 136.0, // Separation of Snow and Dirt will be handled in terrainFragment.glsl
specR = 2.035;
else if (mc_Entity.x == 10002) // Sand
specR = 80.004, mat = 3.0;
} else {
if (mc_Entity.x == 10003) // Stone+, Coal Ore
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
specR = 20.04;
else if (mc_Entity.x == 10007) // Dirt, Coarse Dirt, Podzol, Grass Path, Dirt Path, Farmland Dry
specR = 2.035, specG = 0.003;
else if (mc_Entity.x == 10008) // Glass, Glass Pane
specR = 0.8, lmCoord.x = clamp(lmCoord.x, 0.0, 0.87), mipmapDisabling = 1.0;
}
} else {
if (mc_Entity.x < 10012.5) {
if (mc_Entity.x == 10009) // Snow+, Snow Block
specR = 18.037, mat = 3.0;
else if (mc_Entity.x == 10010) // Gravel
specR = 32.06;
else if (mc_Entity.x == 10012) // Cobblestone+, Clay
specR = 18.037;
} else {
if (mc_Entity.x == 10050) // Red Sand
specR = 80.115, mat = 3.0;
else if (mc_Entity.x == 10051) // Andesite, Diorite, Granite, Basalt+, Tuff, Dripstone+
specR = 12.05;
else if (mc_Entity.x == 10052) // Terracottas
#ifdef NOISY_TEXTURES
noiseVarying = 0.275,
#endif
specR = 2.045, mat = 15000.0, color.rgb = vec3(0.03, 1.0, 0.0);
}
}
} else {
if (mc_Entity.x < 10106.5) {
if (mc_Entity.x < 10102.5) {
if (mc_Entity.x == 10053) // Packed Ice, Purpur Block+, Beehive
#ifdef NOISY_TEXTURES
noiseVarying = 0.4,
#endif
specR = 20.055;
else if (mc_Entity.x == 10058) // Blue Ice, Calcite
#ifdef NOISY_TEXTURES
noiseVarying = 0.4,
#endif
specR = 20.065, extraSpecular = 1.0;
else if (mc_Entity.x == 10101) // Birch Log+
specR = 3.055;
else if (mc_Entity.x == 10102) // Oak Log+
specR = 8.055;
} else {
if (mc_Entity.x == 10103) // Jungle Log+, Acacia Log+
specR = 6.055;
else if (mc_Entity.x == 10105) // Spruce Log+, Scaffolding, Cartography Table, Bee Nest
specR = 6.06;
else if (mc_Entity.x == 10106) // Warped Log+
specR = 10.07, mat = 124.0,
mipmapDisabling = 1.0;
}
} else {
if (mc_Entity.x < 10111.5) {
if (mc_Entity.x == 10107) // Crimson Log+
specR = 10.07, mat = 128.0,
mipmapDisabling = 1.0;
else if (mc_Entity.x == 10108) // Dark Oak Log+
specR = 2.04;
else if (mc_Entity.x == 10111) // Birch Planks+, Fletching Table, Loom
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
specR = 20.036;
} else {
if (mc_Entity.x == 10112) // Oak Planks+, Jungle Planks+, Bookshelf, Composter
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
specR = 20.055;
else if (mc_Entity.x == 10114) // Acacia Planks+, Barrel
#ifdef NOISY_TEXTURES
noiseVarying = 0.7,
#endif
specR = 20.075;
else if (mc_Entity.x == 10115) // Spruce Planks+, Smithing Table
#ifdef NOISY_TEXTURES
noiseVarying = 0.7,
#endif
specR = 20.12;
}
}
}
} else {
if (mc_Entity.x < 10338.5) {
if (mc_Entity.x < 10312.5) {
if (mc_Entity.x < 10118.5) {
if (mc_Entity.x == 10116) // Warped Planks+
#ifdef NOISY_TEXTURES
noiseVarying = 1.3,
#endif
specR = 12.075;
else if (mc_Entity.x == 10117) // Crimson Planks+, Note Block, Jukebox
#ifdef NOISY_TEXTURES
noiseVarying = 1.3,
#endif
specR = 12.095;
else if (mc_Entity.x == 10118) // Dark Oak Planks+
specR = 20.4;
} else {
if (mc_Entity.x == 10300) // Stone Bricks++, Dried Kelp Block
#ifdef NOISY_TEXTURES
noiseVarying = 0.7,
#endif
specR = 20.09;
else if (mc_Entity.x == 10304) // Nether Ores, Blackstone++
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
#ifdef EMISSIVE_NETHER_ORES
specB = -10.0,
#endif
specR = 12.087, mat = 20000.0, color.rgb = vec3(1.0, 0.7, 1.0);
else if (mc_Entity.x == 10308) // Netherrack, Crimson/Warped Nylium
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
specR = 12.087, mat = 20000.0, color.rgb = vec3(1.0, 0.7, 1.0);
else if (mc_Entity.x == 10312) // Polished Andesite, Polished Diorite, Polished Granite, Melon
specR = 6.085;
}
} else {
if (mc_Entity.x < 10328.5) {
if (mc_Entity.x == 10316) // Nether Bricks+
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
specR = 12.375, mat = 20000.0, color.rgb = vec3(0.55, 1.0, 1.0);
else if (mc_Entity.x == 10320 || mc_Entity.x == 10324) // Iron Block+
specR = 6.07, specG = 131.0;
else if (mc_Entity.x == 10328) // Gold Block+
specR = 8.1, mat = 30000.0, color.rgb = vec3(1.0, 1.0, 1.0), specG = 1.0;
} else {
if (mc_Entity.x == 10332) // Diamond Block
#ifdef NOISY_TEXTURES
noiseVarying = 0.65,
#endif
specR = 100.007, mat = 201.0, extraSpecular = 1.0;
else if (mc_Entity.x == 10336) // Emerald Block
#ifdef NOISY_TEXTURES
noiseVarying = 0.65,
#endif
specR = 7.2, mat = 201.0, extraSpecular = 1.0;
else if (mc_Entity.x == 10338) { // Block of Amethyst, Budding Amethyst
mat = 170.0, extraSpecular = 1.0;
}
}
}
} else {
if (mc_Entity.x < 10356.5) {
if (mc_Entity.x < 10344.5) {
if (mc_Entity.x == 10340) // Netherite Block
specR = 12.135, specG = 0.7;
else if (mc_Entity.x == 10342) // Amethyst Buds/Cluster
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
mat = 170.0;
else if (mc_Entity.x == 10344) // Ancient Debris
#ifdef NOISY_TEXTURES
noiseVarying = 2.0,
#endif
#ifdef GLOWING_DEBRIS
specB = 6.0 + min(0.3 * ORE_EMISSION, 0.9), color.a = 1.0,
#endif
specR = 8.07, specG = 0.7;
} else {
if (mc_Entity.x == 10348) // Block of Redstone
#ifdef GLOWING_REDSTONE_BLOCK
specB = 7.20, mat = 20000.0, color.rgb = vec3(1.1), color.a = 1.0,
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
#endif
specR = 8.05, specG = 1.0;
else if (mc_Entity.x == 10352) // Lapis Lazuli Block
#ifdef GLOWING_LAPIS_BLOCK
specB = 6.20, mat = 20000.0, color.rgb = vec3(1.13), color.a = 1.0,
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
#endif
specR = 16.11;
else if (mc_Entity.x == 10356) // Carpets, Wools
specR = 2.02, mat = 15000.0, color.rgb = vec3(0.03, 1.0, 0.0), specG = 0.003, lmCoord.x *= 0.96;
}
} else {
if (mc_Entity.x < 10368.5) {
if (mc_Entity.x == 10360) // Obsidian
#ifdef NOISY_TEXTURES
noiseVarying = 2.0,
#endif
specR = 2.15, specG = 0.6, mat = 152.0, extraSpecular = 1.0;
else if (mc_Entity.x == 10364) // Enchanting Table
specR = 2.15, specG = 0.6, mat = 152.0, extraSpecular = 1.0;
else if (mc_Entity.x == 10368) // Chain
specR = 0.5, specG = 1.0,
lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
} else {
if (mc_Entity.x == 10372) // Cauldron, Hopper, Anvils
specR = 1.08, specG = 1.0, mat = 160.0,
lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
else if (mc_Entity.x == 10376) // Sandstone+
specR = 24.029;
else if (mc_Entity.x == 10380) // Red Sandstone+
specR = 24.085;
}
}
}
}
} else {
if (mc_Entity.x < 11038.5) {
if (mc_Entity.x < 10432.5) {
if (mc_Entity.x < 10408.5) {
if (mc_Entity.x < 10392.5) {
if (mc_Entity.x == 10384) // Quartz+, Daylight Detector, Honeycomb Block
#ifdef NOISY_TEXTURES
noiseVarying = 0.35,
#endif
specR = 16.082, extraSpecular = 1.0;
else if (mc_Entity.x == 10388) // Chorus Plant, Chorus Flower Age 5
mat = 164.0, specR = 6.1,
mipmapDisabling = 1.0, lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
else if (mc_Entity.x == 10392) // Chorus Flower Age<=4
specB = 5.0001, specR = 5.07,
mipmapDisabling = 1.0, lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
} else {
if (mc_Entity.x == 10396) // End Stone++, Smooth Stone+, Lodestone, TNT, Pumpkin+, Mushroom Blocks, Deepslate++, Mud, Mangrove Roots, Muddy Mangrove Roots, Packed Mud, Mud Bricks+
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
specR = 12.065;
else if (mc_Entity.x == 10400) // Bone Block
#ifdef NOISY_TEXTURES
noiseVarying = 0.35,
#endif
specR = 8.055;
else if (mc_Entity.x == 10404) // Concretes
#ifdef NOISY_TEXTURES
noiseVarying = 0.2,
#endif
specR = 3.044, mat = 15000.0, color.rgb = vec3(0.03, 1.0, 0.0);
else if (mc_Entity.x == 10408) // Concrete Powders
specR = 6.014, mat = 15000.0, color.rgb = vec3(0.01, 1.0, 0.0);
}
} else {
if (mc_Entity.x < 10420.5) {
if (mc_Entity.x == 10412) // Bedrock
#ifdef NOISY_TEXTURES
noiseVarying = 2.0,
#endif
specR = 16.0675;
else if (mc_Entity.x == 10416) // Hay Block, Target
specR = 16.085, specG = 0.003, mat = 20000.0, color.rgb = vec3(1.0, 0.0, 0.0);
else if (mc_Entity.x == 10420) // Bricks+, Furnaces Unlit, Dispenser, Dropper
specR = 10.07;
} else {
if (mc_Entity.x == 10424) { // Farmland Wet
if (dot(upVec, normal) > 0.75) { // Top (Actual Farmland Wet)
mat = 172.0;
} else { // Sides And Bottom (Dirt)
specR = 2.035, specG = 0.003;
}
}
else if (mc_Entity.x == 10428) // Crafting Table
specR = 24.06;
else if (mc_Entity.x == 10432) // Cave Vines With Glow Berries
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
specB = 8.3, mat = 20000.0, color.rgb = vec3(1.2, -5.0, 0.0),
mipmapDisabling = 1.0, lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
}
}
} else {
if (mc_Entity.x < 11012.5) {
if (mc_Entity.x < 10444.5) {
if (mc_Entity.x == 10436) // Prismarine+
#ifdef NOISY_TEXTURES
noiseVarying = 1.3,
#endif
specR = 3.08, specG = 0.75;
else if (mc_Entity.x == 10440) // Dark Prismarine+
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
specR = 3.11, specG = 0.75;
else if (mc_Entity.x == 10444) // Glazed Terracottas
specR = 0.5;
} else {
if (mc_Entity.x == 11004) // Glowstone
#ifdef NOISY_TEXTURES
noiseVarying = 2.0,
#endif
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
lmCoord.x = 0.87, specB = 3.05, mat = 162.0,
//mipmapDisabling = 1.0,
color.rgb = vec3(0.69, 0.65, 0.6);
else if (mc_Entity.x == 11008) // Sea Lantern
#ifdef COLORED_LIGHT
lightVarying = 4.0,
#endif
specR = 3.1, specG = 0.75,
lmCoord.x = 0.85, specB = 16.025,
mat = 17000.0, color.rgb = vec3(1.5, 0.67, 2.9),
quarterNdotUfactor = 0.0, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11012) // Magma Block
#ifdef NOISY_TEXTURES
noiseVarying = 2.0,
#endif
lmCoord = vec2(0.0), specB = 2.05, color.rgb = vec3(0.85, 0.84, 0.7), mat = 162.0,
//mipmapDisabling = 1.0,
quarterNdotUfactor = 0.0;
}
} else {
if (mc_Entity.x < 11024.5) {
if (mc_Entity.x == 11016) // Shroomlight
#ifdef NOISY_TEXTURES
noiseVarying = 2.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 1.0,
#endif
lmCoord.x = 0.81, specB = 16.005,
mat = 17000.0, color.rgb = vec3(1.5, 0.8, 1.0),
quarterNdotUfactor = 0.0;
else if (mc_Entity.x == 11020) // Redstone Lamp Lit
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
lmCoord.x = 0.915, specB = 5.099, color.rgb = vec3(0.6), quarterNdotUfactor = 0.0,
specG = 0.63, specR = 0.55, mipmapDisabling = 1.0, extraSpecular = 1.0;
else if (mc_Entity.x == 11024) // Redstone Lamp Unlit
specG = 0.63, specR = 3.15, mipmapDisabling = 1.0, extraSpecular = 1.0;
} else {
if (mc_Entity.x == 11028) // Jack o'Lantern
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
mat = 17000.0, color.rgb = vec3(1.54, 1.0, 1.15),
specR = 12.065, lmCoord.x = 0.87, specB = 16.00008, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11032) // Beacon
#ifdef COLORED_LIGHT
lightVarying = 4.0,
#endif
mat = 176.0, lmCoord.x = 0.87;
else if (mc_Entity.x == 11036) // End Rod
#ifdef NOISY_TEXTURES
noiseVarying = 0.0,
#endif
#ifdef COLORED_LIGHT
lightVarying = 4.0,
#endif
specR = 1.0, lmCoord.x = 0.88, mat = 180.0;
else if (mc_Entity.x == 11038) // Froglight+
#ifdef COLORED_LIGHT
lightVarying = 1.0,
#endif
lmCoord.x = 0.7, specB = 7.0001, quarterNdotUfactor = 0.0;
}
}
}
} else {
if (mc_Entity.x < 11084.5) {
if (mc_Entity.x < 11060.5) {
if (mc_Entity.x < 11048.5) {
if (mc_Entity.x == 11040) // Dragon Egg, Spawner
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
mat = 140.0;
else if (mc_Entity.x == 11044) // Redstone Wire
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
specB = smoothstep(0.0, 1.0, pow2(length(color.rgb))) * 0.07;
else if (mc_Entity.x == 11048) // Redstone Torch
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
mat = 120.0, lmCoord.x = min(lmCoord.x, 0.86), mipmapDisabling = 1.0;
} else {
if (mc_Entity.x == 11052) // Redstone Repeater & Comparator Powered
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
mat = 120.0, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11056) // Redstone Repeater & Comparator Unpowered
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
mat = 120.0, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11060) // Observer
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
specR = 10.07, mat = 120.0, specB = 1000.0;
}
} else {
if (mc_Entity.x < 11072.5) {
if (mc_Entity.x == 11064) // Command Blocks
#ifdef NOISY_TEXTURES
noiseVarying = 2.5,
#endif
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
mat = 132.0, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11068) // Lantern
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
lmCoord.x = 0.87, specB = 3.4, mat = 20000.0, color.rgb = vec3(1.0, 0.0, 0.0),
#ifndef REFLECTION_SPECULAR
specB -= fract(specB) * 0.85,
#endif
specR = 0.5, specG = 1.0;
else if (mc_Entity.x == 11072) // Soul Lantern
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
lmCoord.x = min(lmCoord.x, 0.87), specB = 4.15, mat = 20000.0, color.rgb = vec3(0.0, 1.0, 0.0),
#ifndef REFLECTION_SPECULAR
specB -= fract(specB) * 0.85,
#endif
specR = 0.5, specG = 1.0;
} else {
if (mc_Entity.x == 11076) // Crimson Fungus, Warped Fungus, Twisting Vines, Weeping Vines
quarterNdotUfactor = 0.0,
specB = 16.007, mat = 20000.0, color.rgb = vec3(1.0, 0.0, 0.0);
else if (mc_Entity.x == 11078) { // Glow Lichen
#if EMISSIVE_LICHEN > 0
#if EMISSIVE_LICHEN == 1
float lightFactor = max(1.0 - lmCoord.y, 0.0);
lightFactor *= lightFactor;
lightFactor *= lightFactor;
lightFactor *= lightFactor;
lightFactor *= lightFactor;
#else
float lightFactor = 1.0;
#endif
specB = 15.0002 + 0.3 * lightFactor;
mat = 17000, color.rgb = vec3(1.11, 0.8, 1.0 + lightFactor * 0.07);
#endif
lmCoord.x = clamp(lmCoord.x, 0.0, 0.9);
}
else if (mc_Entity.x == 11080) // Furnaces Lit
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
specR = 10.07, mat = 144.0, lmCoord.x = pow(lmCoord.x, 1.35);
else if (mc_Entity.x == 11084) // Torch
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 1.0,
#endif
lmCoord.x = min(lmCoord.x, 0.86), mat = 148.0, mipmapDisabling = 1.0;
}
}
} else {
if (mc_Entity.x < 11112.5) {
if (mc_Entity.x < 11100.5) {
if (mc_Entity.x == 11088) // Soul Torch
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
lmCoord.x = min(lmCoord.x, 0.86), mat = 148.0, mipmapDisabling = 1.0;
else if (mc_Entity.x == 11092) // Crying Obsidian, Respawn Anchor
#ifdef NOISY_TEXTURES
noiseVarying = 1.5,
#endif
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
specR = 2.15, specG = 0.6, mat = 152.0,
specB = 0.75, lmCoord.x = min(lmCoord.x, 0.88), mipmapDisabling = 1.0, extraSpecular = 1.0;
else if (mc_Entity.x == 11096) // Campfire, Powered Lever
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
lmCoord.x = min(lmCoord.x, 0.885), mat = 156.0;
else if (mc_Entity.x == 11100) // Soul Campfire
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
lmCoord.x = min(lmCoord.x, 0.885), mat = 156.0;
} else {
if (mc_Entity.x == 11104) // Jigsaw Block, Structure Block
#ifdef SNOW_MODE
noSnow = 1.0,
#endif
specB = 8.003, quarterNdotUfactor = 0.0;
else if (mc_Entity.x == 11108) // Sea Pickle
#ifdef COLORED_LIGHT
lightVarying = 5.0,
#endif
specB = 12.0003, lmCoord.x = min(lmCoord.x, 0.885), mipmapDisabling = 1.0;
else if (mc_Entity.x == 11110) // Sculk++ 0.01
specR = 12.065, specB = 0.01, mat = 130.0;
else if (mc_Entity.x == 11111) // Sculk++ 0.03
specR = 12.065, specB = 0.03, mat = 130.0;
else if (mc_Entity.x == 11112) // Lit Candles
#ifdef COLORED_LIGHT
lightVarying = 3.0,
#endif
lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
}
} else {
if (mc_Entity.x < 11129.5) {
if (mc_Entity.x < 11123.5) {
if (mc_Entity.x < 11119.5) {
if (mc_Entity.x == 11116) // Diamond Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_DIAMOND_ORE
specB = 0.30,
#else
specG = 0.001,
#endif
#else
specG = 0.001,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
mat = 168.0, specR = 20.04;
else if (mc_Entity.x == 11117) // Deepslate Diamond Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_DIAMOND_ORE
specB = 0.30,
#else
specG = 0.001,
#endif
#else
specG = 0.001,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
mat = 168.0, specR = 12.065;
else if (mc_Entity.x == 11118) // Emerald Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_EMERALD_ORE
specB = 0.30,
#else
specG = 0.0015,
#endif
#else
specG = 0.0015,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
mat = 168.0, specR = 20.04;
else if (mc_Entity.x == 11119) // Deepslate Emerald Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_EMERALD_ORE
specB = 0.30,
#else
specG = 0.0015,
#endif
#else
specG = 0.0015,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
mat = 168.0, specR = 12.065;
} else {
if (mc_Entity.x == 11120) // Gold Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_GOLD_ORE
specB = 0.08,
#else
specG = 0.002,
#endif
#else
specG = 0.002,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
mat = 168.0, specR = 20.04;
else if (mc_Entity.x == 11121) // Deepslate Gold Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_GOLD_ORE
specB = 0.08,
#else
specG = 0.002,
#endif
#else
specG = 0.002,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
mat = 168.0, specR = 12.065;
else if (mc_Entity.x == 11122) // Lapis Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_LAPIS_ORE
specB = 0.08, mat = 168.0,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
specR = 20.04;
else if (mc_Entity.x == 11123) // Deepslate Lapis Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_LAPIS_ORE
specB = 0.08, mat = 168.0,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
specR = 12.065;
}
} else {
if (mc_Entity.x == 11124) // Redstone Ore Unlit
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_REDSTONE_ORE
specB = 4.2, mat = 174.0,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
specR = 20.04;
else if (mc_Entity.x == 11125) // Deepslate Redstone Ore Unlit
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_REDSTONE_ORE
specB = 4.2, mat = 174.0,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
specR = 12.065;
else if (mc_Entity.x == 11128) // Redstone Ore Lit
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
lmCoord.x *= 0.95,
specB = 4.27, mat = 174.0,
specR = 20.04;
else if (mc_Entity.x == 11129) // Deepslate Redstone Ore Lit
#ifdef COLORED_LIGHT
lightVarying = 2.0,
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
lmCoord.x *= 0.95,
specB = 4.27, mat = 174.0,
specR = 12.065;
}
} else {
if (mc_Entity.x < 11135.5) {
if (mc_Entity.x == 11132) // Iron Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_IRON_ORE
specB = 0.05,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
mat = 168.0, specG = 0.07, specR = 20.04;
else if (mc_Entity.x == 11133) // Deepslate Iron Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_IRON_ORE
specB = 0.05,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
mat = 168.0, specG = 0.07, specR = 12.065;
} else {
if (mc_Entity.x == 11136) // Copper Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_COPPER_ORE
specB = 2.02,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.77,
#endif
mat = 168.0, specG = 0.1, specR = 20.04;
else if (mc_Entity.x == 11137) // Deepslate Copper Ore
#ifdef EMISSIVE_ORES
#ifdef EMISSIVE_COPPER_ORE
specB = 2.02,
#endif
#endif
#ifdef NOISY_TEXTURES
noiseVarying = 0.5,
#endif
mat = 168.0, specG = 0.1, specR = 12.065;
else if (mc_Entity.x == 11200) // Rails
mat = 184.0, lmCoord.x = clamp(lmCoord.x, 0.0, 0.87), mipmapDisabling = 1.0;
}
}
}
}
}
}
// Too bright near a light source fix
if (mc_Entity.x == 99 || mc_Entity.x == 10324)
lmCoord.x = clamp(lmCoord.x, 0.0, 0.87);
// Mipmap Fix
/*if (mc_Entity.x == 98465498894)
mipmapDisabling = 1.0; */
#endif
#if !defined COMPBR && defined COLORED_LIGHT
if (mc_Entity.x < 11048.5) {
if (mc_Entity.x < 11020.5) {
if (mc_Entity.x == 10432) // Cave Vines With Glow Berries
lightVarying = 3.0;
else if (mc_Entity.x == 11004) // Glowstone
lightVarying = 3.0;
else if (mc_Entity.x == 11008) // Sea Lantern
lightVarying = 4.0;
else if (mc_Entity.x == 11016) // Shroomlight
lightVarying = 1.0;
else if (mc_Entity.x == 11020) // Redstone Lamp Lit
lightVarying = 3.0;
} else {
if (mc_Entity.x == 11028) // Jack o'Lantern
lightVarying = 3.0;
else if (mc_Entity.x == 11032) // Beacon
lightVarying = 4.0;
else if (mc_Entity.x == 11036) // End Rod
lightVarying = 4.0;
else if (mc_Entity.x == 11038) // Froglight+
lightVarying = 1.0;
else if (mc_Entity.x == 11048) // Redstone Torch
lightVarying = 2.0;
}
} else {
if (mc_Entity.x < 11088.5) {
if (mc_Entity.x == 11068) // Lantern
lightVarying = 3.0;
else if (mc_Entity.x == 11072) // Soul Lantern
lightVarying = 2.0;
else if (mc_Entity.x == 11080) // Furnaces Lit
lightVarying = 3.0;
else if (mc_Entity.x == 11084) // Torch
lightVarying = 1.0;
else if (mc_Entity.x == 11088) // Soul Torch
lightVarying = 2.0;
} else {
if (mc_Entity.x == 11092) // Crying Obsidian, Respawn Anchor
lightVarying = 2.0;
else if (mc_Entity.x == 11096) // Campfire
lightVarying = 3.0;
else if (mc_Entity.x == 11100) // Soul Campfire
lightVarying = 2.0;
else if (mc_Entity.x == 11108) // Sea Pickle
lightVarying = 5.0;
else if (mc_Entity.x == 11112) // Lit Candles
lightVarying = 3.0;
else if (mc_Entity.x == 11128) // Redstone Ore Lit
lightVarying = 2.0;
}
}
#endif

View File

@@ -0,0 +1,26 @@
float waterH(vec3 pos) {
float noise = 0;
vec2 wind = vec2(frametime) * 0.25 * WATER_SPEED;
float yFactor = 0.5;
noise+= texture2D(noisetex,(pos.xz + wind - pos.y * yFactor) / 1024.0 * 1.1).r * 1.0;
noise+= texture2D(noisetex,(pos.xz - wind - pos.y * yFactor) / 1024.0 * 1.5).r * 0.8;
noise-= texture2D(noisetex,(pos.xz + wind + pos.y * yFactor) / 1024.0 * 2.5).r * 0.6;
noise+= texture2D(noisetex,(pos.xz - wind - pos.y * yFactor) / 1024.0 * 5.0).r * 0.4;
noise-= texture2D(noisetex,(pos.xz + wind + pos.y * yFactor) / 1024.0 * 8.0).r * 0.2;
return noise;
}
float getCausticWaves(vec3 pos) {
float deltaPos = 0.1;
float caustic_h0 = waterH(pos);
float caustic_h1 = waterH(pos + vec3( deltaPos, 0.0, 0.0));
float caustic_h2 = waterH(pos + vec3(-deltaPos, 0.0, 0.0));
float caustic_h3 = waterH(pos + vec3( 0.0, 0.0, deltaPos));
float caustic_h4 = waterH(pos + vec3( 0.0, 0.0, -deltaPos));
float caustic = max((1.0-abs(0.5-caustic_h0))*(1.0-(abs(caustic_h1-caustic_h2)+abs(caustic_h3-caustic_h4))),0.0);
caustic = max(pow(caustic,3.5),0.0)*2.0;
return caustic;
}

View File

@@ -0,0 +1,442 @@
#if defined SHADOWS && ((defined PROJECTED_CAUSTICS && !defined GBUFFERS_WATER) || defined COLORED_SHADOWS) && defined OVERWORLD
uniform sampler2DShadow shadowtex1;
#endif
#if (defined OVERWORLD || defined END || defined SEVEN) && defined SHADOWS
#include "/lib/lighting/shadows.glsl"
vec3 DistortShadow(inout vec3 worldPos, float distortFactor) {
worldPos.xy /= distortFactor;
worldPos.z *= 0.2;
return worldPos * 0.5 + 0.5;
}
#endif
#if defined WATER_CAUSTICS && defined OVERWORLD
#include "/lib/lighting/caustics.glsl"
#endif
float GetFakeShadow(float skyLight) {
float fakeShadow = 0.0;
#ifndef END
if (isEyeInWater == 0) skyLight = pow(skyLight, 30.0);
fakeShadow = skyLight;
#else
#ifdef SHADOWS
fakeShadow = 1.0;
#else
fakeShadow = 0.0;
#endif
#endif
return fakeShadow;
}
void GetLighting(inout vec3 albedo, inout vec3 shadow, inout vec3 lightAlbedo, vec3 viewPos, float lViewPos, vec3 worldPos,
vec2 lightmap, float smoothLighting, float NdotL, float quarterNdotU,
float parallaxShadow, float emissive, float subsurface, float leaves, float materialAO) {
vec3 fullShadow = vec3(0.0);
float fullShadow1 = 0.0;
float fakeShadow = 0.0;
float shadowMult = 1.0;
float shadowTime = 1.0;
float water = 0.0;
#if PIXEL_SHADOWS > 0 && !defined GBUFFERS_HAND
worldPos = floor((worldPos + cameraPosition) * PIXEL_SHADOWS + 0.001) / PIXEL_SHADOWS - cameraPosition + 0.5 / PIXEL_SHADOWS;
#endif
#if defined OVERWORLD || defined END || defined SEVEN
#ifdef SHADOWS
shadow = vec3(1.0);
if ((NdotL > 0.0 || subsurface > 0.001)) {
float shadowLength = shadowDistance * 0.9166667 - length(vec4(worldPos.x, worldPos.y, worldPos.y, worldPos.z));
//shadowDistance * 0.9166667 is shadowDistance - shadowDistance / 12.0
#if (defined OVERWORLD || defined SEVEN) && defined LIGHT_LEAK_FIX
if (isEyeInWater == 0) shadowLength *= float(lightmap.y > 0.001);
#endif
#ifdef TEST_12312
vec3 shadowPos = WorldToShadow(worldPos);
float distb = sqrt(shadowPos.x * shadowPos.x + shadowPos.y * shadowPos.y);
float distortFactor = distb * shadowMapBias + (1.0 - shadowMapBias);
shadowPos = DistortShadow(shadowPos, distortFactor);
bool doShadow = min2(shadowPos.xy) > 0.0
&& max2(shadowPos.xy) < 1.0;
if (!doShadow || shadowLength < 0.000001) albedo.rgb = vec3(1.0, 0.0, 1.0);
shadowLength = 999999.0;
#endif
if (shadowLength > 0.000001) {
#ifndef TEST_12312
vec3 shadowPos = WorldToShadow(worldPos);
float distb = sqrt(shadowPos.x * shadowPos.x + shadowPos.y * shadowPos.y);
float distortFactor = distb * shadowMapBias + (1.0 - shadowMapBias);
shadowPos = DistortShadow(shadowPos, distortFactor);
#endif
#ifdef NORMAL_MAPPING
float NdotLm = clamp(dot(normal, lightVec) * 1.01 - 0.01, 0.0, 1.0) * 0.99 + 0.01;
NdotL = min(NdotL, NdotLm);
#else
float NdotLm = NdotL * 0.99 + 0.01;
#endif
float dotWorldPos = dot(worldPos.xyz, worldPos.xyz);
float biasFactor = sqrt(1.0 - NdotLm * NdotLm) / NdotLm;
float distortBias = distortFactor * shadowDistance / 256.0;
distortBias *= 8.0 * distortBias;
float bias = (distortBias * biasFactor + dotWorldPos * 0.000005 + 0.05) / shadowMapResolution;
float offset = 1.0 / shadowMapResolution;
int doSubsurface = 0;
if (subsurface > 0.001) {
if (leaves < 0.5) {
float UdotLm = clamp(dot(upVec, lightVec) * 1.01 - 0.01, 0.0, 1.0) * 0.99 + 0.01;
float biasFactorF = sqrt(1.0 - UdotLm * UdotLm) / UdotLm;
bias = (distortBias * biasFactorF + 0.05) / shadowMapResolution * 1.3;
} else bias = 0.0002;
offset = 0.002;
#if SHADOW_SUBSURFACE > 2
doSubsurface = 14;
#endif
}
if (isEyeInWater == 1) offset *= 5.0;
#if PIXEL_SHADOWS > 0 && !defined GBUFFERS_HAND
bias += 0.0025 / PIXEL_SHADOWS * (1.0 + subsurface);
#endif
shadowPos.z -= bias;
shadow = GetShadow(shadowPos, offset, water, doSubsurface);
float extraSideLight = 1.0;
shadow *= (1.0 + extraSideLight) - extraSideLight * quarterNdotU;
#if defined PROJECTED_CAUSTICS && defined WATER_CAUSTICS && defined OVERWORLD && !defined GBUFFERS_WATER
if (isEyeInWater == 0) {
water = float(water > 0.99);
water *= sqrt2(NdotL);
float shadowSum = (shadow.r + shadow.g + shadow.b) / 3.0;
water *= pow2(1.0 - shadowSum);
}
#ifdef GBUFFERS_ENTITIES
if (entityId == 1089) { // Boats
water = 0.0;
}
#endif
#endif
}
float shadowSmooth = 16.0;
if (shadowLength < shadowSmooth) {
float shadowLengthDecider = max(shadowLength / shadowSmooth, 0.0);
float skyLightShadow = GetFakeShadow(lightmap.y);
shadow = mix(vec3(skyLightShadow), shadow, shadowLengthDecider);
subsurface *= mix(subsurface * 0.5, subsurface, shadowLengthDecider);
fakeShadow = mix(1.0, fakeShadow, shadowLengthDecider);
fakeShadow = 1.0 - fakeShadow;
fakeShadow *= fakeShadow;
fakeShadow = 1.0 - fakeShadow;
}
#ifdef TEST_12312
if (shadow.r < 0.1 && albedo.r + albedo.b < 1.9) {
float timeThing1 = abs(fract(frameTimeCounter * 1.35) - 0.5) * 2.0;
float timeThing2 = abs(fract(frameTimeCounter * 1.15) - 0.5) * 2.0;
float timeThing3 = abs(fract(frameTimeCounter * 1.55) - 0.5) * 2.0;
albedo.rgb = 3.0 * pow(vec3(timeThing1, timeThing2, timeThing3), vec3(3.2));
}
#endif
}
#else
shadow = vec3(GetFakeShadow(lightmap.y));
#endif
#if defined CLOUD_SHADOW && defined OVERWORLD
float cloudSize = 0.000025;
vec2 wind = vec2(frametime, 0.0) * CLOUD_SPEED * 6.0;
float cloudShadow = texture2D(noisetex, cloudSize * (wind + (worldPos.xz + cameraPosition.xz))).r;
cloudShadow += texture2D(noisetex, cloudSize * (vec2(1000.0) + wind + (worldPos.xz + cameraPosition.xz))).r;
cloudShadow = clamp(cloudShadow, 0.0, 1.0);
cloudShadow *= cloudShadow;
cloudShadow *= cloudShadow;
shadow *= cloudShadow;
#endif
#ifdef ADV_MAT
#ifdef SELF_SHADOW
float shadowNdotL = min(NdotL + 0.5, 1.0);
shadowNdotL *= shadowNdotL;
shadow *= mix(1.0, parallaxShadow, shadowNdotL);
#endif
#endif
fullShadow = shadow * max(NdotL, subsurface * (1.0 - max(rainStrengthS, (1.0 - sunVisibility)) * 0.40));
fullShadow1 = (fullShadow.r + fullShadow.g + fullShadow.b) / 3.0;
#ifdef ADV_MAT
shadow *= float(fullShadow1 > 0.01);
#endif
#if defined OVERWORLD && !defined TWO
shadowMult = 1.0 * (1.0 - 0.95 * rainStrengthS);
shadowTime = abs(sunVisibility - 0.5) * 2.0;
shadowTime *= shadowTime;
shadowMult *= shadowTime * shadowTime;
#ifndef LIGHT_LEAK_FIX
ambientCol *= pow(lightmap.y, 2.5);
#else
if (isEyeInWater == 1) ambientCol *= pow(lightmap.y, 2.5);
#endif
vec3 lightingCol = pow(lightCol, vec3(1.0 + sunVisibility * 1.5 - 0.5 * timeBrightness));
#ifdef SHADOWS
lightingCol *= (1.0 + 0.5 * leaves);
#else
lightingCol *= (1.0 + 0.4 * leaves);
#endif
vec3 shadowDecider = fullShadow * shadowMult;
if (isEyeInWater == 1) shadowDecider *= pow(min(lightmap.y * 1.03, 1.0), 200.0);
ambientCol *= AMBIENT_GROUND;
lightingCol *= LIGHT_GROUND;
vec3 sceneLighting = mix(ambientCol, lightingCol, shadowDecider);
#ifdef LIGHT_LEAK_FIX
if (isEyeInWater == 0) sceneLighting *= pow(lightmap.y, 2.5);
#endif
#endif
#ifdef END
vec3 ambientEnd = endCol * 0.07;
vec3 lightEnd = endCol * 0.17;
vec3 shadowDecider = fullShadow;
vec3 sceneLighting = mix(ambientEnd, lightEnd, shadowDecider);
sceneLighting *= END_I * (0.7 + 0.4 * vsBrightness);
#endif
#ifdef TWO
#ifndef ABYSS
vec3 sceneLighting = vec3(0.0003, 0.0004, 0.002) * 10.0;
#else
vec3 sceneLighting = pow(fogColor, vec3(0.2)) * 0.125;
#endif
#endif
#if defined SEVEN && !defined SEVEN_2
sceneLighting = vec3(0.005, 0.006, 0.018) * 133 * (0.3 * fullShadow + 0.025);
#endif
#ifdef SEVEN_2
vec3 sceneLighting = vec3(0.005, 0.006, 0.018) * 33 * (1.0 * fullShadow + 0.025);
#endif
#if defined SEVEN || defined SEVEN_2
sceneLighting *= lightmap.y * lightmap.y;
#endif
#if defined SHADOWS && defined OVERWORLD
if (subsurface > 0.001) {
float VdotL = clamp(dot(normalize(viewPos.xyz), lightVec), 0.0, 1.0);
vec3 subsurfaceGlow = (5.5 + 8.0 * leaves) * (1.0 - fakeShadow) * shadowTime * fullShadow * pow(VdotL, 10.0);
subsurfaceGlow *= 1.0 - rainStrengthS * 0.68;
albedo.rgb += max(albedo.g * normalize(sqrt((albedo.rgb + vec3(0.001)) * lightCol)) * subsurfaceGlow, vec3(0.0));
}
#endif
#else
#ifdef NETHER
#if MC_VERSION >= 11600
if (quarterNdotU < 0.5625) quarterNdotU = 0.5625 + (0.4 - quarterNdotU * 0.7111111111111111);
#endif
#if MC_VERSION >= 11600
vec3 sceneLighting = normalize(sqrt(max(fogColor, vec3(0.001)))) * 0.0385 * NETHER_I * (vsBrightness*0.5 + 0.6);
#else
vec3 sceneLighting = normalize(netherCol) * 0.0385 * NETHER_I * (vsBrightness*0.5 + 0.6);
#endif
#else
vec3 sceneLighting = vec3(0.0);
#endif
#endif
#ifdef DYNAMIC_SHADER_LIGHT
float handLight = min(float(heldBlockLightValue2 + heldBlockLightValue), 15.0) / 15.0;
float handLightFactor = 1.0 - min(DYNAMIC_LIGHT_DISTANCE * handLight, lViewPos) / (DYNAMIC_LIGHT_DISTANCE * handLight);
#ifdef GBUFFERS_WATER
if (mat > 0.05) handLight *= 0.9;
#endif
#ifdef GBUFFERS_HAND
handLight = min(handLight, 0.95);
#endif
float finalHandLight = handLight * handLightFactor;
lightmap.x = max(finalHandLight * 0.95, lightmap.x);
#endif
float lightmapX2 = lightmap.x * lightmap.x;
float lightmapXM1 = pow2(pow2(lightmapX2)) * lightmapX2;
float lightmapXM2 = max((lightmap.x - 0.05) * 0.925, 0.0);
float newLightmap = mix(lightmapXM1 * 5.0 + lightmapXM2, lightmapXM1 * 4.0 + lightmapXM2 * 1.5, vsBrightness);
#ifdef BLOCKLIGHT_FLICKER
float frametimeM = frametime * 0.5;
float lightFlicker = min(((1 - clamp(sin(fract(frametimeM*2.7) + frametimeM*3.7) - 0.75, 0.0, 0.25) * BLOCKLIGHT_FLICKER_STRENGTH)
* max(fract(frametimeM*1.4), (1 - BLOCKLIGHT_FLICKER_STRENGTH * 0.25))) / (1.0 - BLOCKLIGHT_FLICKER_STRENGTH * 0.2)
, 0.8) * 1.25
* 0.8 + 0.2 * clamp((cos(fract(frametimeM*0.47) * fract(frametimeM*1.17) + fract(frametimeM*2.17))) * 1.5, 1.0 - BLOCKLIGHT_FLICKER_STRENGTH * 0.25, 1.0);
newLightmap *= lightFlicker;
#endif
#ifdef RANDOM_BLOCKLIGHT
float CLr = texture2D(noisetex, 0.00006 * (worldPos.xz + cameraPosition.xz)).r;
float CLg = texture2D(noisetex, 0.00009 * (worldPos.xz + cameraPosition.xz)).r;
float CLb = texture2D(noisetex, 0.00014 * (worldPos.xz + cameraPosition.xz)).r;
blocklightCol = vec3(CLr, CLg, CLb);
blocklightCol *= blocklightCol * BLOCKLIGHT_I * 2.22;
#endif
#ifdef COLORED_LIGHT
#ifdef GBUFFERS_TERRAIN
if (lightVarying > 0.5) {
if (lightVarying < 1.5) {
lightAlbedo = albedo;
}
else if (lightVarying < 2.5) {
#ifdef COMPBR
lightAlbedo = float(eyeBrightness.x < 144) * emissive * albedo;
#else
lightAlbedo = float(eyeBrightness.x < 144) * albedo;
#endif
}
else if (lightVarying < 3.5) {
lightAlbedo = vec3(0.7, 0.5, 0.2);
}
else if (lightVarying < 4.5) { // Sea Lantern, Beacon, End Rod
lightAlbedo = albedo * vec3(0.6, 0.85, 1.0);
}
else if (lightVarying < 5.5) { // Sea Pickles
lightAlbedo = vec3(0.2, 0.9, 1.0);
}
}
//if (lViewPos > 16.0) lightAlbedo = vec3(0.0);
#endif
vec3 blocklightComplex = texture2D(colortex9, texCoord).rgb;
blocklightComplex *= 0.75 + 2.0 * blocklightComplex.b;
blocklightCol = mix(blocklightCol, blocklightComplex, 0.7);
#ifdef DYNAMIC_SHADER_LIGHT
#include "/lib/ifchecks/heldColoredLighting.glsl"
#endif
#endif
vec3 blockLighting = blocklightCol * newLightmap * newLightmap;
vec3 minLighting = vec3(0.000000000001 + (MIN_LIGHT * 0.0035 * (vsBrightness*0.0775 + 0.0125)));
#ifndef MIN_LIGHT_EVERYWHERE
minLighting *= (1.0 - eBS);
#endif
#ifdef GBUFFERS_WATER
minLighting *= 2.0;
#endif
float shade = pow(quarterNdotU, SHADING_STRENGTH);
vec3 emissiveLighting = albedo.rgb * emissive * 20.0 / shade * EMISSIVE_MULTIPLIER;
float nightVisionLighting = nightVision * 0.25;
if (smoothLighting > 0.01) {
smoothLighting = clamp(smoothLighting, 0.0, 1.0);
#if VAO_STRENGTH == 10
smoothLighting *= smoothLighting;
#else
smoothLighting = pow(smoothLighting, 0.2 * VAO_STRENGTH);
#endif
} else smoothLighting = 1.0;
if (materialAO < 1.0) {
smoothLighting *= pow(materialAO, max(1.0 - shadowTime * length(shadow) * NdotL - lmCoord.x, 0.0));
}
albedo *= sceneLighting + blockLighting + emissiveLighting + nightVisionLighting + minLighting;
albedo *= shade;
albedo *= smoothLighting;
#if defined WATER_CAUSTICS && defined OVERWORLD
#if defined PROJECTED_CAUSTICS && !defined GBUFFERS_WATER
if (water > 0.0 || isEyeInWater == 1) {
#else
if ((isEyeInWater != 0 && isEyeInWater != 2 && isEyeInWater != 3)) {
// Not just doing (isEyeInWater == 1) to fix caustics appearing in shadows on AMD Mesa with Iris
#endif
vec3 albedoCaustic = albedo;
float skyLightMap = lightmap.y * lightmap.y * (3.0 - 2.0 * lightmap.y);
float skyLightMapA = pow2(pow2((1.0 - skyLightMap)));
float skyLightMapB = skyLightMap > 0.98 ? (1.0 - skyLightMap) * 50.0 : 1.0;
float causticfactor = 1.0 - lightmap.x * 0.8;
vec3 causticpos = worldPos.xyz + cameraPosition.xyz;
float caustic = getCausticWaves(causticpos);
vec3 causticcol = underwaterColor.rgb / UNDERWATER_I;
#if defined PROJECTED_CAUSTICS && !defined GBUFFERS_WATER
if (isEyeInWater == 0) {
causticfactor *= 1.0 - skyLightMapA;
causticfactor *= 10.0;
causticcol = sqrt(normalize(waterColor.rgb + vec3(0.01)) * 0.32 * sqrt(UNDERWATER_I));
#ifndef WATER_ABSORPTION
albedoCaustic = albedo.rgb * causticcol * 3.0;
causticcol *= 0.53;
#else
albedoCaustic = albedo.rgb * water * 1.74;
causticcol = sqrt(causticcol) * 0.2;
#endif
} else {
#endif
causticfactor *= shadow.g * sqrt2(NdotL) * (1.0 - rainStrengthS);
causticfactor *= 0.25 - 0.15 * skyLightMapA;
causticfactor *= skyLightMapB;
albedoCaustic = (albedo.rgb + albedo.rgb * underwaterColor.rgb * 16.0) * 0.225;
#ifdef WATER_ABSORPTION
albedoCaustic *= 1.5;
#endif
albedoCaustic += albedo.rgb * underwaterColor.rgb * caustic * sqrt1(lightmap.x) * 4.0 * skyLightMapB;
causticcol = sqrt(causticcol) * 30.0;
#if defined PROJECTED_CAUSTICS && !defined GBUFFERS_WATER
}
#endif
vec3 lightcaustic = caustic * causticfactor * causticcol * UNDERWATER_I;
albedoCaustic *= 1.0 + lightcaustic;
#if defined PROJECTED_CAUSTICS && !defined GBUFFERS_WATER
if (isEyeInWater == 0) albedo = mix(albedo, albedoCaustic, max(water - rainStrengthS, 0.0));
else albedo = albedoCaustic;
#else
albedo = albedoCaustic;
#endif
}
#endif
#if defined GBUFFERS_HAND && defined HAND_BLOOM_REDUCTION
float albedoStrength = (albedo.r + albedo.g + albedo.b) / 10.0;
if (albedoStrength > 1.0) albedo.rgb = albedo.rgb * max(2.0 - albedoStrength, 0.34);
#endif
#if MC_VERSION >= 11900
albedo *= 1.0 - clamp(darknessLightFactor * (2.0 - emissive * 10000.0), 0.0, 1.0);
#endif
}

View File

@@ -0,0 +1,161 @@
//GGX area light approximation from Horizon Zero Dawn
float GetNoHSquared(float radiusTan, float NoL, float NoV, float VoL) {
float radiusCos = 1.0 / sqrt(1.0 + radiusTan * radiusTan);
float RoL = 2.0 * NoL * NoV - VoL;
if (RoL >= radiusCos)
return 1.0;
float rOverLengthT = radiusCos * radiusTan / sqrt(1.0 - RoL * RoL);
float NoTr = rOverLengthT * (NoV - RoL * NoL);
float VoTr = rOverLengthT * (2.0 * NoV * NoV - 1.0 - RoL * VoL);
float triple = sqrt(clamp(1.0 - NoL * NoL - NoV * NoV - VoL * VoL + 2.0 * NoL * NoV * VoL, 0.0, 1.0));
float NoBr = rOverLengthT * triple, VoBr = rOverLengthT * (2.0 * triple * NoV);
float NoLVTr = NoL * radiusCos + NoV + NoTr, VoLVTr = VoL * radiusCos + 1.0 + VoTr;
float p = NoBr * VoLVTr, q = NoLVTr * VoLVTr, s = VoBr * NoLVTr;
float xNum = q * (-0.5 * p + 0.25 * VoBr * NoLVTr);
float xDenom = p * p + s * ((s - 2.0 * p)) + NoLVTr * ((NoL * radiusCos + NoV) * VoLVTr * VoLVTr +
q * (-0.5 * (VoLVTr + VoL * radiusCos) - 0.5));
float twoX1 = 2.0 * xNum / (xDenom * xDenom + xNum * xNum);
float sinTheta = twoX1 * xDenom;
float cosTheta = 1.0 - twoX1 * xNum;
NoTr = cosTheta * NoTr + sinTheta * NoBr;
VoTr = cosTheta * VoTr + sinTheta * VoBr;
float newNoL = NoL * radiusCos + NoTr;
float newVoL = VoL * radiusCos + VoTr;
float NoH = NoV + newNoL;
float HoH = 2.0 * newVoL + 2.0;
return clamp(NoH * NoH / HoH, 0.0, 1.0);
}
float SchlickGGX(float NoL, float NoV, float roughness) {
float k = roughness * 0.5;
float smithL = 0.5 / (NoL * (1.0 - k) + k);
float smithV = 0.5 / (NoV * (1.0 - k) + k);
return smithL * smithV;
}
float GGX(vec3 normal, vec3 viewPos, vec3 lightVec, float smoothness, float f0, float sunSize) {
float roughness = 1.0 - smoothness;
if (roughness < 0.05) roughness = 0.05;
float roughnessP = roughness;
roughness *= roughness; roughness *= roughness;
vec3 halfVec = normalize(lightVec - viewPos);
float dotLH = clamp(dot(halfVec, lightVec), 0.0, 1.0);
float dotNL = clamp(dot(normal, lightVec), 0.0, 1.0);
float dotNV = dot(normal, -viewPos);
float dotNH = GetNoHSquared(sunSize, dotNL, dotNV, dot(-viewPos, lightVec));
float denom = dotNH * roughness - dotNH + 1.0;
float D = roughness / (3.141592653589793 * denom * denom);
float F = exp2((-5.55473 * dotLH - 6.98316) * dotLH) * (1.0 - f0) + f0;
float k2 = roughness * 0.5;
float specular = max(dotNL * dotNL * D * F / (dotLH * dotLH * (1.0 - k2) + k2), 0.0);
specular = max(specular, 0.0);
specular = specular / (0.125 * specular + 1.0);
float schlick = SchlickGGX(dotNL, dotNV, roughness);
schlick = pow(schlick * 0.5, roughnessP);
specular *= clamp(schlick, 0.0, 1.25);
if (sunVisibility == 0.0) specular *= float(moonPhase == 0) * 0.35 + 0.65 - float(moonPhase == 4) * 0.65;
else specular *= 1.5;
return specular * (1.0 - isEyeInWater*0.75);
}
float stylisedGGX(vec3 normal, vec3 oldNormal, vec3 nViewPos, vec3 lightVec, float f0) {
vec3 halfVec = normalize(lightVec - nViewPos);
float dotLH = clamp(dot(halfVec, lightVec), 0.0, 1.0);
float dotOldL = clamp(dot(oldNormal, lightVec), 0.0, 1.0);
float dotNmOL = clamp(dot(normal - oldNormal, lightVec), 0.0, 1.0);
float sunSize = 0.037;
float dotNH = GetNoHSquared(sunSize, dotOldL, dot(oldNormal, -nViewPos), dot(-nViewPos, lightVec));
dotOldL *= dotOldL;
float roughness = 0.05;
float denom = dotNH * roughness - dotNH + 1.0;
float D = roughness / (3.141592653589793 * denom * denom);
float F = exp2((-5.55473 * dotLH - 6.98316) * dotLH) * (1.0 - f0) + f0;
float k2 = roughness * 0.25;
float specular = max(dotOldL * D * F / (dotLH * dotLH * (1.0 - k2) + k2), 0.0);
specular = max(specular, 0.0);
specular = specular / (0.125 * specular + 1.0);
dotNmOL *= dotNH * dotNH;
dotNmOL *= dotNmOL * 350.0 * SUN_MOON_WATER_REF;
dotNmOL *= dotNmOL;
dotNmOL = max(dotNmOL * 0.25, sunVisibility * pow2(dotNmOL * dotNmOL));
specular *= 0.075 + 9.0 * min(dotNmOL * 6.0, 50.0);
specular *= 0.4 + 1.71 * dotOldL;
if (sunVisibility == 0.0) {
specular *= 0.25 * MOON_WATER_REF;
specular *= float(moonPhase == 0) * 0.35 + 0.65 - float(moonPhase == 4) * 0.65;
}
return max(specular * (1.0 - isEyeInWater*0.75), 0.0);
}
vec3 GetMetalCol(float f0) {
int metalidx = int(f0 * 255.0);
if (metalidx == 230) return vec3(0.24867, 0.22965, 0.21366);
if (metalidx == 231) return vec3(0.88140, 0.57256, 0.11450);
if (metalidx == 232) return vec3(0.81715, 0.82021, 0.83177);
if (metalidx == 233) return vec3(0.27446, 0.27330, 0.27357);
if (metalidx == 234) return vec3(0.84430, 0.48677, 0.22164);
if (metalidx == 235) return vec3(0.36501, 0.35675, 0.37653);
if (metalidx == 236) return vec3(0.42648, 0.37772, 0.31138);
if (metalidx == 237) return vec3(0.91830, 0.89219, 0.83662);
return vec3(1.0);
}
vec3 GetSpecularHighlight(float smoothness, float metalness, float f0, vec3 specularColor,
vec3 rawAlbedo, vec3 shadow, vec3 normal, vec3 viewPos) {
if (dot(shadow, shadow) < 0.001) return vec3(0.0);
#ifdef END
smoothness *= 0.0;
#endif
float specular = GGX(normal, normalize(viewPos), lightVec, smoothness, f0,
0.01 * sunVisibility + 0.06);
specular *= sqrt1inv(rainStrengthS);
#ifdef SHADOWS
specular *= shadowFade;
#endif
specularColor = pow(specularColor, vec3(1.0 - 0.5 * metalness));
#ifdef COMPBR
specularColor *= pow(rawAlbedo, vec3(metalness * 0.8));
#else
#if RP_SUPPORT == 3
if (metalness > 0.5) {
if (f0 < 1.0) specularColor *= GetMetalCol(f0);
else specularColor *= rawAlbedo;
}
#else
specularColor *= pow(rawAlbedo, vec3(metalness));
#endif
#endif
return specular * specularColor * shadow;
}

View File

@@ -0,0 +1,98 @@
uniform sampler2DShadow shadowtex0;
#if defined COLORED_SHADOWS && defined OVERWORLD
uniform sampler2D shadowcolor1;
#endif
#if defined PROJECTED_CAUSTICS && defined WATER_CAUSTICS && defined OVERWORLD && !defined GBUFFERS_WATER
uniform sampler2D shadowcolor0;
#endif
vec2 shadowoffsets[8] = vec2[8]( vec2( 0.0 , 1.0 ),
vec2( 0.7071, 0.7071),
vec2( 1.0 , 0.0 ),
vec2( 0.7071,-0.7071),
vec2( 0.0 ,-1.0 ),
vec2(-0.7071,-0.7071),
vec2(-1.0 , 0.0 ),
vec2(-0.7071, 0.7071));
vec2 offsetDist(float x, float s) {
float n = fract(x * 1.414) * 3.1415;
return vec2(cos(n), sin(n)) * 1.4 * x / s;
}
vec3 SampleBasicShadow(vec3 shadowPos, inout float water) {
float shadow0 = shadow2D(shadowtex0, vec3(shadowPos.st, shadowPos.z)).x;
#if (defined COLORED_SHADOWS || (defined PROJECTED_CAUSTICS && defined WATER_CAUSTICS && !defined GBUFFERS_WATER)) && defined OVERWORLD
vec3 shadowcol = vec3(0.0);
if (shadow0 < 1.0) {
float shadow1 = shadow2D(shadowtex1, vec3(shadowPos.st, shadowPos.z)).x;
if (shadow1 > 0.9999) {
#if defined COLORED_SHADOWS && defined OVERWORLD
shadowcol = texture2D(shadowcolor1, shadowPos.st).rgb * shadow1;
#endif
#if defined PROJECTED_CAUSTICS && defined WATER_CAUSTICS && defined OVERWORLD && !defined GBUFFERS_WATER
water = texture2D(shadowcolor0, shadowPos.st).r * shadow1;
#endif
}
}
return shadowcol * (1.0 - shadow0) + shadow0;
#else
return vec3(shadow0);
#endif
}
vec3 SampleFilteredShadow(vec3 shadowPos, float offset, inout float water) {
vec3 shadow = SampleBasicShadow(vec3(shadowPos.st, shadowPos.z), water) * 2.0;
for(int i = 0; i < 8; i++) {
shadow+= SampleBasicShadow(vec3(offset * 1.2 * shadowoffsets[i] + shadowPos.st, shadowPos.z), water);
}
return shadow * 0.1;
}
float InterleavedGradientNoise() {
float n = 52.9829189 * fract(0.06711056 * gl_FragCoord.x + 0.00583715 * gl_FragCoord.y);
return fract(n + 1.61803398875 * mod(float(frameCounter), 3600.0));
}
vec3 SampleTAAFilteredShadow(vec3 shadowPos, float offset, inout float water, int doSubsurface) {
float noise = InterleavedGradientNoise();
vec3 shadow = vec3(0.0);
offset = offset * (2.0 - 0.5 * (0.85 + 0.25 * (3072.0 / shadowMapResolution)));
if (shadowMapResolution < 400.0) offset *= 30.0;
#if SHADOW_SUBSURFACE < 3
int sampleCount = 2;
#else
int sampleCount = 2 + doSubsurface;
#endif
for(int i = 0; i < sampleCount; i++) {
vec2 offset = offsetDist(noise + i, sampleCount) * offset;
shadow += SampleBasicShadow(vec3(shadowPos.st + offset, shadowPos.z), water);
shadow += SampleBasicShadow(vec3(shadowPos.st - offset, shadowPos.z), water);
}
shadow /= sampleCount * 2;
return shadow;
}
vec3 GetShadow(vec3 shadowPos, float offset, inout float water, int doSubsurface) {
#ifdef SHADOW_FILTER
#if AA > 1
vec3 shadow = SampleTAAFilteredShadow(shadowPos, offset, water, doSubsurface);
#else
vec3 shadow = SampleFilteredShadow(shadowPos, offset, water);
#endif
#else
vec3 shadow = SampleBasicShadow(shadowPos, water);
#endif
return shadow;
}

View File

@@ -0,0 +1,68 @@
// End Portal fix by fayer3#2332 (Modified)
if (blockEntityId == 200) {
if (albedo.b < 10.1) {
vec3[9] colors = vec3[](
vec3(0.347247, 0.605995, 0.758838) * 1.5,
vec3(0.601078, 0.715565, 1.060625),
vec3(0.422100, 0.813094, 0.902606),
vec3(0.349221, 1.024201, 1.861281),
vec3(0.754305, 0.828697, 0.680323),
vec3(0.414472, 0.568165, 0.8037 ) * 0.9,
vec3(0.508905, 0.679649, 0.998285) * 0.9,
vec3(0.531914, 0.547583, 0.800852) * 0.7,
vec3(0.261914, 0.747583, 0.700852) * 0.5);
albedo.rgb = vec3(0.4214321, 0.4722309, 1.9922364) * 0.07;
float dither = Bayer64(gl_FragCoord.xy);
#if AA > 1
dither = fract(dither + frameTimeCounter * 16.0);
int repeat = 4;
#else
int repeat = 8;
#endif
float dismult = 0.5;
for (int j = 0; j < repeat; j++) {
float add = float(j + dither) * 0.0625 / float(repeat);
int samples = 9;
if (j > 2) samples = 6;
for (int i = 1; i <= samples; i++) {
float colormult = 0.9/(30.0+i);
vec2 offset = vec2(0.0, 1.0/(3600.0/24.0)) * pow(16.0 - i, 2.0) * 0.004;
vec3 wpos = normalize((gbufferModelViewInverse * vec4(viewPos * (i * dismult + 1), 1.0)).xyz);
if (abs(dot(normal, upVec)) > 0.9) {
wpos.xz /= wpos.y;
wpos.xz *= 0.06 * sign(- worldPos.y);
wpos.xz *= abs(worldPos.y) + i * dismult + add;
wpos.xz -= cameraPosition.xz * 0.05;
} else {
vec3 absPos = abs(worldPos);
if (abs(dot(normal, eastVec)) > 0.9) {
wpos.xz = wpos.yz / wpos.x;
wpos.xz *= 0.06 * sign(- worldPos.x);
wpos.xz *= abs(worldPos.x) + i * dismult + add;
wpos.xz -= cameraPosition.yz * 0.05;
} else {
wpos.xz = wpos.yx / wpos.z;
wpos.xz *= 0.06 * sign(- worldPos.z);
wpos.xz *= abs(worldPos.z) + i * dismult + add;
wpos.xz -= cameraPosition.yx * 0.05;
}
}
vec2 pos = wpos.xz;
vec2 wind = fract((frametime + 984.0) * (i + 8) * 0.125 * offset);
vec2 coord = pos + wind;
if (mod(float(i), 4) < 1.5) coord = coord.yx + vec2(-1.0, 1.0) * wind.y;
vec3 psample = pow(texture2D(texture, coord).rgb, vec3(0.85)) * colors[i-1] * colormult;
albedo.rgb += psample * length(psample.rgb) * (2500.0 / repeat);
}
}
} else {
albedo.rgb *= 2.2;
emissive = 0.25;
}
quarterNdotU = 1.0;
lightmap = vec2(0.9, 0.0);
}

View File

@@ -0,0 +1,34 @@
#ifdef OVERWORLD
#if MC_VERSION < 11800
float lxMin = 0.533334;
#else
float lxMin = 0.000001;
#endif
float lyMin = 0.533334;
#else
float lxMin = 0.8;
float lyMin = 0.533334;
#endif
bool xDanger = false;
bool yDanger = false;
if (lmCoord.x < lxMin) xDanger = true;
#ifndef NETHER
if (lmCoord.y < lyMin) yDanger = true;
#else
if (lmCoord.x < lyMin) yDanger = true;
#endif
if (xDanger) {
vec2 indicatePos = worldPos.xz + cameraPosition.xz;
indicatePos = 1.0 - 2.0 * abs(fract(indicatePos) - 0.5);
float minPos = min(indicatePos.x, indicatePos.y);
float maxPos = max(indicatePos.x, indicatePos.y);
float dif = abs(indicatePos.x - indicatePos.y);
vec3 dangerColor = vec3(0.4, 0.2, 0.0);
if (yDanger) dangerColor = vec3(0.125, 0.0, 0.0);
float indicateFactor = float(minPos > 0.5);
albedo.rgb = mix(albedo.rgb, dangerColor, indicateFactor);
}

View File

@@ -0,0 +1,5 @@
// This mipLevel is corrected to give the result for 16x textures regardless of the actual texture resolution
vec2 mipx = dcdx / vTexCoordAM.zw * 16.0;
vec2 mipy = dcdy / vTexCoordAM.zw * 16.0;
float delta = max(dot(mipx, mipx), dot(mipy, mipy));
float miplevel = max(0.5 * log2(delta), 0.0);

View File

@@ -0,0 +1,50 @@
#include "/lib/outline/blackOutlineOffset.glsl"
void BlackOutline(inout vec3 color, sampler2D depth, float wFogMult) {
float ph = 1.0 / 1080.0;
float pw = ph / aspectRatio;
float outline = 1.0;
float z = GetLinearDepth(texture2D(depth, texCoord).r) * far * 2.0;
float minZ = 1.0, sampleZA = 0.0, sampleZB = 0.0;
for(int i = 0; i < 12; i++) {
vec2 offset = vec2(pw, ph) * blackOutlineOffsets[i];
sampleZA = texture2D(depth, texCoord + offset).r;
sampleZB = texture2D(depth, texCoord - offset).r;
float sampleZsum = GetLinearDepth(sampleZA) + GetLinearDepth(sampleZB);
outline *= clamp(1.0 - (z - sampleZsum * far), 0.0, 1.0);
minZ = min(minZ, min(sampleZA,sampleZB));
}
vec4 viewPos = gbufferProjectionInverse * (vec4(texCoord.x, texCoord.y, minZ, 1.0) * 2.0 - 1.0);
viewPos /= viewPos.w;
color = color * outline;
if (outline < 1.0) {
vec3 nViewPos = normalize(viewPos.xyz);
float NdotU = dot(nViewPos, upVec);
float lViewPos = length(viewPos.xyz);
vec3 worldPos = ViewToWorld(viewPos.xyz);
vec3 theFog = startFog(color.rgb, nViewPos, lViewPos, worldPos, vec3(0.0), NdotU);
color.rgb = mix(theFog, color.rgb, pow(outline, 4));
}
}
float BlackOutlineMask(sampler2D depth0, sampler2D depth1) {
float ph = 1.0 / 1080.0;
float pw = ph / aspectRatio;
float mask = 0.0;
for(int i = 0; i < 12; i++) {
vec2 offset = vec2(pw, ph) * blackOutlineOffsets[i];
mask += float(texture2D(depth0, texCoord + offset).r <
texture2D(depth1, texCoord + offset).r);
mask += float(texture2D(depth0, texCoord - offset).r <
texture2D(depth1, texCoord - offset).r);
}
return clamp(mask,0.0,1.0);
}

View File

@@ -0,0 +1,14 @@
vec2 blackOutlineOffsets[12] = vec2[12](
vec2(-2.0,2.0),
vec2(-1.0,2.0),
vec2( 0.0,2.0),
vec2( 1.0,2.0),
vec2( 2.0,2.0),
vec2(-2.0,1.0),
vec2(-1.0,1.0),
vec2( 0.0,1.0),
vec2( 1.0,1.0),
vec2( 2.0,1.0),
vec2( 1.0,0.0),
vec2( 2.0,0.0)
);

View File

@@ -0,0 +1,11 @@
#include "/lib/outline/blackOutlineOffset.glsl"
void DepthOutline(inout float z) {
float ph = 1.0 / 1080.0;
float pw = ph / aspectRatio;
for(int i = 0; i < 12; i++) {
vec2 offset = vec2(pw, ph) * blackOutlineOffsets[i];
z = min(z, texture2D(depthtex1, texCoord + offset).r);
z = min(z, texture2D(depthtex1, texCoord - offset).r);
}
}

View File

@@ -0,0 +1,63 @@
vec2 promoOutlineOffsets[4] = vec2[4](vec2(-1.0,1.0),vec2(0.0,1.0),vec2(1.0,1.0),vec2(1.0,0.0));
void PromoOutline(inout vec3 color, sampler2D depth) {
float ph = 1.0 / 1080.0;
float pw = ph / aspectRatio;
float outlined = 1.0;
float z = GetLinearDepth(texture2D(depth, texCoord).r) * far;
float totalz = 0.0;
float maxz = 0.0;
float sampleza = 0.0;
float samplezb = 0.0;
int sampleCount = PROMO_OUTLINE_THICKNESS * 4;
for(int i = 0; i < sampleCount; i++) {
vec2 offset = (1.0 + floor(i / 4.0)) * vec2(pw, ph) * promoOutlineOffsets[int(mod(float(i), 4))];
sampleza = GetLinearDepth(texture2D(depth, texCoord + offset).r) * far;
samplezb = GetLinearDepth(texture2D(depth, texCoord - offset).r) * far;
if (i < 4) maxz = max(maxz, max(sampleza, samplezb));
outlined *= clamp(1.0 - ((sampleza + samplezb) - z * 2.0) * 32.0 / z, 0.0, 1.0);
totalz += sampleza + samplezb;
}
#if PROMO_OUTLINE_MODE == 2
float outlinea = 1.0;
float outlineb = 1.0;
#else
float outlinea = 1.0 - clamp((z * 8.0 - totalz) * 64.0 / z, 0.0, 1.0) *
clamp(1.0 - ((z * 8.0 - totalz) * 32.0 - 1.0) / z, 0.0, 1.0);
float outlineb = clamp(1.0 + 8.0 * (z - maxz) / z, 0.0, 1.0);
#endif
float outAB = pow(outlinea * outlineb, 0.1);
float outlinec = clamp(1.0 + 64.0 * (z - maxz) / z, 0.0, 1.0);
float outline = (0.35 * outAB + 0.65) *
(0.75 * (1.0 - outlined) * outlinec + 1.0);
float fog = 0.0;
#ifdef FOG1
float fogZ = texture2D(depthtex0, texCoord).r;
vec4 screenPos = vec4(texCoord, fogZ, 1.0);
vec4 viewPos = gbufferProjectionInverse * (screenPos * 2.0 - 1.0);
viewPos /= viewPos.w;
fog = length(viewPos) / far * 1.5 * (1.5/FOG1_DISTANCE_M);
fog = 1.0 - exp(-0.1 * pow(fog, 10));
#endif
float outlinePower = PROMO_OUTLINE_STRENGTH / PROMO_OUTLINE_THICKNESS;
if (outline < 1.0) {
outlinePower = PROMO_OUTLINE_STRENGTH;
}
outline = pow(outline, outlinePower);
#if PROMO_OUTLINE_MODE == 3
outline = abs(outline - 1.0) + 1.0;
#endif
vec3 color2 = color.rgb * outline;
color = mix(color2, color, fog);
}

View File

@@ -0,0 +1,91 @@
float fovmult = gbufferProjection[1][1] / 1.37373871;
float BaseLens(vec2 lightPos, float size, float dist, float hardness) {
vec2 lensCoord = (texCoord + (lightPos * dist - 0.5)) * vec2(aspectRatio,1.0);
float lens = clamp(1.0 - length(lensCoord) / (size * fovmult), 0.0, 1.0 / hardness) * hardness;
lens *= lens; lens *= lens;
return lens;
}
float OverlapLens(vec2 lightPos, float size, float dista, float distb) {
return BaseLens(lightPos, size, dista, 2.0) * BaseLens(lightPos, size, distb, 2.0);
}
float PointLens(vec2 lightPos, float size, float dist) {
return BaseLens(lightPos, size, dist, 1.5) + BaseLens(lightPos, size * 4.0, dist, 1.0) * 0.5;
}
float RingLensTransform(float lensFlare) {
return pow(1.0 - pow(1.0 - pow(lensFlare, 0.25), 10.0), 5.0);
}
float RingLens(vec2 lightPos, float size, float distA, float distB) {
float lensFlare1 = RingLensTransform(BaseLens(lightPos, size, distA, 1.0));
float lensFlare2 = RingLensTransform(BaseLens(lightPos, size, distB, 1.0));
float lensFlare = clamp(lensFlare2 - lensFlare1, 0.0, 1.0);
lensFlare *= sqrt(lensFlare);
return lensFlare;
}
float AnamorphicLens(vec2 lightPos) {
vec2 lensCoord = abs(texCoord - lightPos.xy - 0.5) * vec2(aspectRatio * 0.1, 2.0);
float lens = clamp(1.0 - length(pow(lensCoord, vec2(0.85))) * 4.0 / fovmult, 0.0, 1.0);
lens *= lens * lens;
return lens;
}
vec3 AddLens(float lens, vec3 color, float truePos) {
float isMoon = truePos * 0.5 + 0.5;
vec3 lensColor = mix(color, GetLuminance(color) * lightNight * 0.25, isMoon * 0.98);
float visibility = mix(sunVisibility, 1.0 - sunVisibility, isMoon);
visibility *= visibility;
visibility *= visibility;
return lens * lensColor * visibility;
}
float getLensVisibilityA(vec2 lightPos) {
float str = length(lightPos * vec2(aspectRatio, 1.0));
return pow(clamp(str * 8.0, 0.0, 1.0), 2.0) - clamp(str * 3.0 - 1.5, 0.0, 1.0);
}
float getLensVisibilityB(vec2 lightPos) {
float str = length(lightPos * vec2(aspectRatio, 1.0));
return (1.0 - clamp(str * 3.0 - 1.5, 0.0, 1.0));
}
void LensFlare(inout vec3 color, vec2 lightPos, float truePos, float multiplier) {
float visibilityA = getLensVisibilityA(lightPos);
float visibilityB = getLensVisibilityB(lightPos);
multiplier *= multiplier;
if (visibilityB > 0.001) {
vec3 lensFlare = (
AddLens(BaseLens(lightPos, 0.3, -0.45, 1.0), vec3(2.2, 1.2, 0.1), truePos) * 0.07 +
AddLens(BaseLens(lightPos, 0.3, 0.10, 1.0), vec3(2.2, 0.4, 0.1), truePos) * 0.03 +
AddLens(BaseLens(lightPos, 0.3, 0.30, 1.0), vec3(2.2, 0.2, 0.1), truePos) * 0.04 +
AddLens(BaseLens(lightPos, 0.3, 0.50, 1.0), vec3(2.2, 0.4, 2.5), truePos) * 0.05 +
AddLens(BaseLens(lightPos, 0.3, 0.70, 1.0), vec3(1.8, 0.4, 2.5), truePos) * 0.06 +
AddLens(BaseLens(lightPos, 0.3, 0.90, 1.0), vec3(0.1, 0.2, 2.5), truePos) * 0.07 +
AddLens(OverlapLens(lightPos, 0.08, -0.28, -0.39), vec3(2.5, 1.2, 0.1), truePos) * 0.015 +
AddLens(OverlapLens(lightPos, 0.08, -0.20, -0.31), vec3(2.5, 0.5, 0.1), truePos) * 0.010 +
AddLens(OverlapLens(lightPos, 0.12, 0.06, 0.19), vec3(2.5, 0.2, 0.1), truePos) * 0.020 +
AddLens(OverlapLens(lightPos, 0.12, 0.15, 0.28), vec3(1.8, 0.1, 1.2), truePos) * 0.015 +
AddLens(OverlapLens(lightPos, 0.12, 0.24, 0.37), vec3(1.0, 0.1, 2.5), truePos) * 0.010 +
AddLens(PointLens(lightPos, 0.03, -0.55), vec3(2.5, 1.6, 0.0), truePos) * 0.20 +
AddLens(PointLens(lightPos, 0.02, -0.40), vec3(2.5, 1.0, 0.0), truePos) * 0.15 +
AddLens(PointLens(lightPos, 0.04, 0.43), vec3(2.5, 0.6, 0.6), truePos) * 0.20 +
AddLens(PointLens(lightPos, 0.02, 0.60), vec3(0.2, 0.6, 2.5), truePos) * 0.15 +
AddLens(PointLens(lightPos, 0.03, 0.67), vec3(0.7, 1.1, 3.0), truePos) * 0.25 +
AddLens(RingLens(lightPos, 0.22, 0.44, 0.46), vec3(0.10, 0.35, 2.50), truePos) +
AddLens(RingLens(lightPos, 0.15, 0.98, 0.99), vec3(0.15, 0.40, 2.55), truePos) * 2.5
) * visibilityA + (
AddLens(AnamorphicLens(lightPos), vec3(0.3,0.7,1.0), truePos) * 0.5
) * visibilityB;
color = mix(color, vec3(1.0), lensFlare * multiplier);
}
}

View File

@@ -0,0 +1,47 @@
vec3 GetN(int idx) {
if (idx == 230) return vec3(2.9114, 2.9497, 2.5845);
if (idx == 231) return vec3(0.18299, 0.42108, 1.3734);
if (idx == 232) return vec3(1.3456, 0.96521, 0.61722);
if (idx == 233) return vec3(3.1071, 3.1812, 2.3230);
if (idx == 234) return vec3(0.27105, 0.67693, 1.3164);
if (idx == 235) return vec3(1.9100, 1.8300, 1.4400);
if (idx == 236) return vec3(2.3757, 2.0847, 1.8453);
if (idx == 237) return vec3(0.15943, 0.14512, 0.13547);
return vec3(0.0);
}
vec3 GetK(int idx) {
if (idx == 230) return vec3(3.0893, 2.9318, 2.7670);
if (idx == 231) return vec3(3.4242, 2.3459, 1.7704);
if (idx == 232) return vec3(7.4746, 6.3995, 5.3031);
if (idx == 233) return vec3(3.3314, 3.3291, 3.1350);
if (idx == 234) return vec3(3.6092, 2.6248, 2.2921);
if (idx == 235) return vec3(3.5100, 3.4000, 3.1800);
if (idx == 236) return vec3(4.2655, 3.7153, 3.1365);
if (idx == 237) return vec3(3.9291, 3.1900, 2.3808);
return vec3(1.0);
}
vec3 ComplexFresnel(float fresnel, float f0) {
int metalidx = int(f0 * 255.0);
vec3 k = GetK(metalidx);
vec3 n = GetN(metalidx);
float invFresnel = 1.0 - fresnel;
vec3 k2 = k * k;
vec3 n2 = n * n;
float invFresnel2 = invFresnel * invFresnel;
vec3 rs_num = n2 + k2 - 2 * n * invFresnel + invFresnel2;
vec3 rs_den = n2 + k2 + 2 * n * invFresnel + invFresnel2;
vec3 rs = rs_num / rs_den;
vec3 rp_num = (n2 + k2) * invFresnel2 - 2 * n * invFresnel + 1;
vec3 rp_den = (n2 + k2) * invFresnel2 + 2 * n * invFresnel + 1;
vec3 rp = rp_num / rp_den;
vec3 fresnel3 = clamp(0.5 * (rs + rp), vec3(0.0), vec3(1.0));
fresnel3 *= fresnel3;
return fresnel3;
}

View File

@@ -0,0 +1,51 @@
vec3 nvec3(vec4 pos) {
return pos.xyz/pos.w;
}
vec4 nvec4(vec3 pos) {
return vec4(pos.xyz, 1.0);
}
float cdist(vec2 coord) {
return max(abs(coord.s-0.5) * 1.95, abs(coord.t-0.5) * 2.0);
}
vec4 Raytrace(sampler2D depthtex, vec3 viewPos, vec3 normal, float dither) {
vec3 pos = vec3(0.0);
float dist = 0.0;
#if AA > 1
dither = fract(dither + frameTimeCounter);
#endif
vec3 start = viewPos;
vec3 vector = reflect(normalize(viewPos), normalize(normal));
viewPos += vector;
vec3 tvector = vector;
int sr = 0;
for(int i = 0; i < 30; i++) {
pos = nvec3(gbufferProjection * nvec4(viewPos)) * 0.5 + 0.5;
if (pos.x < -0.05 || pos.x > 1.05 || pos.y < -0.05 || pos.y > 1.05) break;
vec3 rfragpos = vec3(pos.xy, texture2D(depthtex,pos.xy).r);
rfragpos = nvec3(gbufferProjectionInverse * nvec4(rfragpos * 2.0 - 1.0));
dist = length(start - rfragpos);
float err = length(viewPos - rfragpos);
float lVector = length(vector);
if (lVector > 1.0) lVector = pow(lVector, 1.14);
if (err < lVector) {
sr++;
if(sr >= 6) break;
tvector -= vector;
vector *= 0.1;
}
vector *= 2.0;
tvector += vector * (dither * 0.05 + 1.0);
viewPos = start + tvector;
}
return vec4(pos, dist);
}

View File

@@ -0,0 +1,52 @@
vec3 nvec3(vec4 pos) {
return pos.xyz/pos.w;
}
vec4 nvec4(vec3 pos) {
return vec4(pos.xyz, 1.0);
}
float cdist(vec2 coord) {
return max(abs(coord.s-0.5) * 1.82, abs(coord.t-0.5) * 2.0);
}
vec4 Raytrace(sampler2D depthtex, vec3 viewPos, vec3 normal, float dither) {
vec3 pos = vec3(0.0);
float dist = 0.0;
#if AA > 1
dither = fract(dither + frameTimeCounter);
#endif
vec3 start = viewPos;
vec3 vector = 0.5 * reflect(normalize(viewPos), normalize(normal));
viewPos += vector;
vec3 tvector = vector;
float difFactor = 0.4;
int sr = 0;
for(int i = 0; i < 30; i++) {
pos = nvec3(gbufferProjection * nvec4(viewPos)) * 0.5 + 0.5;
if (pos.x < -0.05 || pos.x > 1.05 || pos.y < -0.05 || pos.y > 1.05) break;
vec3 rfragpos = vec3(pos.xy, texture2D(depthtex,pos.xy).r);
rfragpos = nvec3(gbufferProjectionInverse * nvec4(rfragpos * 2.0 - 1.0));
dist = length(start - rfragpos);
float err = length(viewPos - rfragpos);
float lVector = length(vector) * (1.0 + clamp(0.25 * sqrt(dist), 0.3, 0.8));
if (err < lVector || (dist < difFactor && err > difFactor)) {
sr++;
if(sr >= 6) break;
tvector -= vector;
vector *= 0.1;
}
vector *= 2.0;
tvector += vector * (dither * 0.02 + 0.765);
viewPos = start + tvector;
}
return vec4(pos, dist);
}

View File

@@ -0,0 +1,33 @@
vec4 RoughReflection(vec3 viewPos, vec3 normal, float dither, float smoothness) {
vec4 color = vec4(0.0);
vec4 pos = Raytrace(depthtex0, viewPos, normal, dither);
float border = clamp(1.0 - pow(cdist(pos.st), 50.0), 0.0, 1.0);
if (pos.z < 1.0 - 1e-5) {
#ifdef REFLECTION_ROUGH
float dist = 1.0 - exp(-0.125 * (1.0 - smoothness) * pos.a);
float lod = log2(viewHeight / 8.0 * (1.0 - smoothness) * dist) * 0.35;
#else
float lod = 0.0;
#endif
float check = float(texture2DLod(depthtex0, pos.st, 0).r < 1.0 - 1e-5);
if (lod < 1.0) {
color.a = check;
if (color.a > 0.1) color.rgb = texture2DLod(colortex0, pos.st, 0).rgb;
} else {
float alpha = check;
if (alpha > 0.1) {
color.rgb += texture2DLod(colortex0, pos.st, max(lod - 1.0, 0)).rgb;
color.a += alpha;
}
}
color *= color.a;
color.a *= border;
}
color.rgb *= 1.8 * (1.0 - 0.065 * min(length(color.rgb), 10.0));
return color;
}

View File

@@ -0,0 +1,21 @@
vec4 SimpleReflection(vec3 viewPos, vec3 normal, float dither, float skyLightFactor) {
vec4 reflection = vec4(0.0);
vec4 pos = Raytrace(depthtex1, viewPos, normal, dither);
float border = clamp(1.0 - pow(cdist(pos.st), 50.0), 0.0, 1.0);
if (pos.z < 1.0 - 1e-5) {
float refDepth = texture2D(depthtex1, pos.st).r;
reflection.a = float(0.999999 > refDepth);
if (reflection.a > 0.001) {
reflection.rgb = texture2D(gaux2, pos.st).rgb;
if (refDepth > 0.9995) reflection.rgb *= sqrt3(skyLightFactor);
}
reflection.a *= border;
}
reflection.rgb = pow(reflection.rgb * 2.0, vec3(8.0));
return reflection;
}

View File

@@ -0,0 +1,48 @@
void AutoGenerateNormals(inout vec4 normalMap, vec3 albedoP, float delta) {
float packSizeGN = 128.0;
float lOriginalAlbedo = length(albedoP);
float normalMult = max(1.0 - delta, 0.0) * 1.8 * sqrt(NORMAL_MULTIPLIER);
float normalClamp = 0.05;
#ifndef SAFE_GENERATED_NORMALS
vec2 offsetR = 16.0 / atlasSize;
#else
vec2 offsetR = max(vTexCoordAM.z, vTexCoordAM.w) * vec2(float(atlasSize.y) / float(atlasSize.x), 1.0);
#endif
offsetR /= packSizeGN;
vec2 midCoord = texCoord - vTexCoordL / 2.0;
vec2 vTexCoordAM_M = vTexCoordAM.zw * (0.5 - 0.5 / packSizeGN);
if (normalMult > 0.0) {
for(int i = 0; i < 4; i++) {
vec2 offsetCoord;
if (i == 0) {
offsetCoord = texCoord + vec2( 0.0, offsetR.y);
if (offsetCoord.y > midCoord.y + vTexCoordAM_M.y) continue;
} else if (i == 1) {
offsetCoord = texCoord + vec2( offsetR.x, 0.0);
if (offsetCoord.x > midCoord.x + vTexCoordAM_M.x) continue;
} else if (i == 2) {
offsetCoord = texCoord + vec2( 0.0,-offsetR.y);
if (offsetCoord.y < midCoord.y - vTexCoordAM_M.y) continue;
} else if (i == 3) {
offsetCoord = texCoord + vec2(-offsetR.x, 0.0);
if (offsetCoord.x < midCoord.x - vTexCoordAM_M.x) continue;
}
float lNearbyAlbedo = length(texture2D(texture, offsetCoord).rgb);
float dif = lOriginalAlbedo - lNearbyAlbedo;
if (dif > 0.0) dif = max(dif - normalClamp, 0.0);
else dif = min(dif + normalClamp, 0.0);
dif *= normalMult;
if (i == 0)
normalMap.y += dif;
else if (i == 1)
normalMap.x += dif;
else if (i == 2)
normalMap.y -= dif;
else if (i == 3)
normalMap.x -= dif;
}
}
}

View File

@@ -0,0 +1,23 @@
mat3 GetLightmapTBN(vec3 viewPos) {
mat3 lightmapTBN = mat3(normalize(dFdx(viewPos)), normalize(dFdy(viewPos)), vec3(0.0));
lightmapTBN[2] = cross(lightmapTBN[0], lightmapTBN[1]);
return lightmapTBN;
}
float DirectionalLightmap(float lightmap, float lightmapRaw, vec3 normal, mat3 lightmapTBN) {
if (lightmap < 0.001) return lightmap;
vec2 deriv = vec2(dFdx(lightmapRaw), dFdy(lightmapRaw)) * 256.0;
vec3 dir = normalize(vec3(deriv.x * lightmapTBN[0] +
0.0005 * lightmapTBN[2] +
deriv.y * lightmapTBN[1]));
float pwr = clamp(dot(normal, dir), -1.0, 1.0);
if (abs(pwr) > 0.0)
pwr = pow(abs(pwr), 9.0 / DIRECTIONAL_LIGHTMAP_STRENGTH) * sign(pwr) * lightmap;
if (length(deriv) > 0.001)
lightmap = pow(lightmap, 1.0 - pwr);
return lightmap;
}

View File

@@ -0,0 +1,30 @@
void GetMaterials(out float smoothness, out float metalness, out float f0,
out vec3 normal, out vec3 rawAlbedo, vec2 coord) {
vec2 specularData = texture2D(colortex3, coord).rg;
smoothness = specularData.r;
#ifdef COMPBR
if (smoothness < 0.5) {
smoothness /= 0.5;
f0 = 1.0;
}
else {
smoothness = (smoothness - 0.5) / 0.5;
f0 = 4.0;
}
metalness = specularData.g;
#else
#if RP_SUPPORT == 3
f0 = specularData.g;
metalness = f0 >= 0.9 ? 1.0 : 0.0;
#else
metalness = specularData.g;
f0 = 0.78 * metalness + 0.02;
#endif
#endif
normal = DecodeNormal(texture2D(colortex6, coord).xy);
rawAlbedo = texture2D(colortex1, coord).rgb;
}

View File

@@ -0,0 +1,70 @@
void GetMaterials(out float smoothness, out float metalness, out float f0, out float metalData,
inout float emissive, out float materialAO, out vec4 normalMap,
vec2 newCoord, vec2 dcdx, vec2 dcdy) {
#ifdef MC_SPECULAR_MAP
#ifdef WRONG_MIPMAP_FIX
vec4 specularMap = texture2DLod(specular, newCoord, 0);
#else
vec4 specularMap = texture2D(specular, newCoord);
#endif
#else
vec4 specularMap = vec4(0.0, 0.0, 0.0, 1.0);
#endif
#ifdef NORMAL_MAPPING
normalMap = textureGrad(normals, newCoord, dcdx, dcdy).rgba;
normalMap.xyz += vec3(0.5, 0.5, 0.0);
normalMap.xyz = pow(normalMap.xyz, vec3(NORMAL_MULTIPLIER));
normalMap.xyz -= vec3(0.5, 0.5, 0.0);
#endif
#if RP_SUPPORT == 4
smoothness = specularMap.r;
metalness = specularMap.g;
f0 = 0.78 * metalness + 0.02;
metalData = metalness;
materialAO = 1.0;
float materialEmissive = specularMap.b;
#ifdef NORMAL_MAPPING
normalMap.xyz = normalMap.xyz * 2.0 - 1.0;
#endif
#else
smoothness = specularMap.r;
f0 = specularMap.g;
metalness = f0 >= 0.9 ? 1.0 : 0.0;
metalData = f0;
#ifdef NORMAL_MAPPING
materialAO = normalMap.z;
#else
materialAO = texture2D(normals, newCoord).z;
#endif
materialAO *= materialAO;
float materialEmissive = specularMap.a < 1.0 ? specularMap.a : 0.0;
#ifdef NORMAL_MAPPING
normalMap.xyz = normalMap.xyz * 2.0 - 1.0;
float normalCheck = normalMap.x + normalMap.y;
if (normalCheck > -1.999) {
if (length(normalMap.xy) > 1.0) normalMap.xy = normalize(normalMap.xy);
normalMap.z = sqrt(1.0 - dot(normalMap.xy, normalMap.xy));
normalMap.xyz = normalize(clamp(normalMap.xyz, vec3(-1.0), vec3(1.0)));
} else {
normalMap.xyz = vec3(0.0, 0.0, 1.0);
materialAO = 1.0;
}
#endif
#endif
materialEmissive = pow(materialEmissive, 2.5 + 2.0 * materialEmissive);
emissive = mix(materialEmissive, 1.0, emissive);
materialAO = clamp(materialAO, 0.01, 1.0);
}

View File

@@ -0,0 +1,27 @@
void NoiseCoatTextures(inout vec4 albedo, inout float smoothness, inout float emissive, inout float metalness, vec3 worldPos, float miplevel, float noiseVaryingM, float snowFactor) {
float packSizeNT = 64.0;
#ifndef SAFE_GENERATED_NORMALS
vec2 noiseCoord = floor(vTexCoordL.xy / 32.0 * packSizeNT * atlasSize) / packSizeNT / 12.0;
#else
vec2 offsetR = max(vTexCoordAM.z, vTexCoordAM.w) * vec2(float(atlasSize.y) / float(atlasSize.x), 1.0);
vec2 noiseCoord = floor(vTexCoordL.xy / 2.0 * packSizeNT / offsetR) / packSizeNT / 12.0;
#endif
if (noiseVaryingM < 999.0) {
noiseCoord += 0.21 * (floor((worldPos.xz + cameraPosition.xz) + 0.001) + floor((worldPos.y + cameraPosition.y) + 0.001));
} else {
noiseVaryingM -= 1000.0;
}
float noiseTexture = texture2D(noisetex, noiseCoord).r;
noiseTexture = noiseTexture * 0.75 + 0.625;
float colorBrightness = 0.2126 * albedo.r + 0.7152 * albedo.g + 0.0722 * albedo.b;
float noiseFactor = 0.7 * sqrt(1.0 - colorBrightness) * (1.0 - 0.5 * metalness)
* (1.0 - 0.25 * smoothness) * max(1.0 - emissive, 0.0);
#if defined SNOW_MODE && defined OVERWORLD
noiseFactor *= 2.0 * max(0.5 - snowFactor, 0.0);
#endif
noiseFactor *= noiseVaryingM;
noiseFactor *= max(1.0 - miplevel * 0.25, 0.0);
noiseTexture = pow(noiseTexture, noiseFactor);
albedo.rgb *= noiseTexture;
smoothness = min(smoothness * sqrt(2.0 - noiseTexture), 1.0);
}

View File

@@ -0,0 +1,77 @@
vec4 ReadNormal(vec2 coord) {
coord = fract(coord) * vTexCoordAM.pq + vTexCoordAM.st;
return textureGrad(normals, coord, dcdx, dcdy);
}
void GetParallaxCoord(float parallaxFade, inout vec2 newCoord, inout float parallaxDepth) {
vec2 coord = vTexCoord.st;
float invParallaxQuality = 1.0 / PARALLAX_QUALITY;
if (parallaxFade < 1.0) {
vec3 normalMap = ReadNormal(vTexCoord.st).xyz * 2.0 - 1.0;
float normalCheck = normalMap.x + normalMap.y;
float minHeight = 1.0 - invParallaxQuality;
if (viewVector.z < 0.0 && ReadNormal(vTexCoord.st).a < minHeight && normalCheck > -1.999) {
float multiplier = 0.25 * (1.0 - parallaxFade) * PARALLAX_DEPTH /
(-viewVector.z * PARALLAX_QUALITY);
vec2 interval = viewVector.xy * multiplier;
#ifdef SELF_SHADOW
float lowSurface = 0.0;
#endif
for(int i = 0; i < PARALLAX_QUALITY; i++) {
float normalA = ReadNormal(coord).a;
if (normalA < 1.0 - float(i) / PARALLAX_QUALITY) {
coord += interval;
#ifdef SELF_SHADOW
parallaxDepth = normalA;
#endif
} else break;
}
newCoord = fract(coord.st) * vTexCoordAM.pq + vTexCoordAM.st;
}
}
}
float GetParallaxShadow(float parallaxFade, vec2 coord, vec3 lightVec, mat3 tbn, float parallaxDepth, float normalDepth) {
float parallaxshadow = 1.0;
float invParallaxQuality = 1.0 / PARALLAX_QUALITY;
float minHeight = 1.0 - invParallaxQuality;
if (dist < PARALLAX_DISTANCE + 32.0) {
#ifdef PARALLAX
float heightCheck = parallaxDepth;
#else
float heightCheck = normalDepth;
#endif
if (heightCheck < minHeight) {
vec3 parallaxdir = tbn * lightVec;
parallaxdir.xy *= 0.2 * SELF_SHADOW_ANGLE * PARALLAX_DEPTH;
vec2 newvTexCoord = (coord - vTexCoordAM.st) / vTexCoordAM.pq;
float step = 1.28 / PARALLAX_QUALITY;
float height = normalDepth;
#ifdef PARALLAX
int parallaxD32 = PARALLAX_QUALITY / 32;
#endif
for(int i = 0; i < PARALLAX_QUALITY / 4; i++) {
float currentHeight = height + parallaxdir.z * step * i;
vec2 parallaxCoord = fract(newvTexCoord + parallaxdir.xy * i * step) *
vTexCoordAM.pq + vTexCoordAM.st;
float offsetHeight = textureGrad(normals, parallaxCoord, dcdx, dcdy).a;
#ifdef PARALLAX
if (i == parallaxD32) height = parallaxDepth;
#endif
parallaxshadow *= clamp(1.0 - (offsetHeight - currentHeight) * 40.0, 0.0, 1.0);
if (parallaxshadow < 0.01) break;
}
parallaxshadow = mix(parallaxshadow, 1.0, parallaxFade);
}
}
return parallaxshadow;
}

View File

@@ -0,0 +1,26 @@
float GetPuddles(vec2 pos) {
float noise = texture2D(noisetex, pos).r;
noise+= texture2D(noisetex, pos * 0.5).r *2.0;
noise+= texture2D(noisetex, pos * 0.25).r *4.0;
noise+= texture2D(noisetex, pos * 0.125).r *8.0;
noise *= REFLECTION_RAIN_COVERAGE * 0.055;
noise = max((noise-15.5) * 0.8 - 1.2 , 0.0);
#ifndef RAIN_REF_FORCED
float wetnessM = wetness;
#else
float wetnessM = 1.0;
#endif
noise *= wetnessM;
noise /= sqrt(noise * noise + 1.0);
#if REFLECTION_RAIN_COVERAGE == 100
noise = mix(noise, 1.0, min(sqrt1(wetnessM) * 2.0, 1.0));
#endif
#ifdef RAIN_REF_BIOME_CHECK
noise *= isRainy;
#endif
noise = clamp((noise - 0.75) * 4.5, 0.0, 1.0);
return noise;
}

View File

@@ -0,0 +1,9 @@
//Thanks to Jessie for dithering
float Bayer2 (vec2 c) { c = 0.5 * floor(c); return fract(1.5 * fract(c.y) + c.x); }
float Bayer4 (vec2 c) { return 0.25 * Bayer2 (0.5 * c) + Bayer2(c); }
float Bayer8 (vec2 c) { return 0.25 * Bayer4 (0.5 * c) + Bayer2(c); }
float Bayer16 (vec2 c) { return 0.25 * Bayer8 (0.5 * c) + Bayer2(c); }
float Bayer32 (vec2 c) { return 0.25 * Bayer16 (0.5 * c) + Bayer2(c); }
float Bayer64 (vec2 c) { return 0.25 * Bayer32 (0.5 * c) + Bayer2(c); }
float Bayer128(vec2 c) { return 0.25 * Bayer64 (0.5 * c) + Bayer2(c); }
float Bayer256(vec2 c) { return 0.25 * Bayer128(0.5 * c) + Bayer2(c); }

View File

@@ -0,0 +1,15 @@
//Spheremap Transform from https://aras-p.info/texts/CompactNormalStorage.html
vec2 EncodeNormal(vec3 n) {
float f = sqrt(n.z * 8.0 + 8.0);
return n.xy / f + 0.5;
}
vec3 DecodeNormal(vec2 enc) {
vec2 fenc = enc * 4.0 - 2.0;
float f = dot(fenc,fenc);
float g = sqrt(1.0 - f / 4.0);
vec3 n;
n.xy = fenc * g;
n.z = 1.0 - f / 2.0;
return n;
}

View File

@@ -0,0 +1,20 @@
//Jitter offset from Chocapic13
uniform float framemod8;
uniform float velocity;
vec2 jitterOffsets[8] = vec2[8]( // LiteTAA Jitter
vec2( 0.125,-0.375),
vec2(-0.125, 0.375),
vec2( 0.625, 0.125),
vec2( 0.375,-0.625),
vec2(-0.625, 0.625),
vec2(-0.875,-0.125),
vec2( 0.375,-0.875),
vec2( 0.875, 0.875)
);
vec2 TAAJitter(vec2 coord, float w) {
vec2 offset = jitterOffsets[int(framemod8)] * (w / vec2(viewWidth, viewHeight));
offset *= max(1.0 - velocity * 400.0, 0.0) * 0.125;
return coord + offset;
}

View File

@@ -0,0 +1,20 @@
//Jitter offset from Chocapic13
uniform float framemod8;
uniform float velocity;
vec2 jitterOffsets[8] = vec2[8]( // IntenseTAA Jitter
vec2( 0.125,-0.375),
vec2(-0.125, 0.375),
vec2( 0.625, 0.125),
vec2( 0.375,-0.625),
vec2(-0.625, 0.625),
vec2(-0.875,-0.125),
vec2( 0.375,-0.875),
vec2( 0.875, 0.875)
);
vec2 TAAJitter(vec2 coord, float w) {
vec2 offset = jitterOffsets[int(framemod8)] * (w / vec2(viewWidth, viewHeight));
offset *= max(1.0 - velocity * 400.0, 0.0);
return coord + offset;
}

View File

@@ -0,0 +1,16 @@
//Previous frame reprojection from Chocapic13
vec2 Reprojection(vec3 pos) {
pos = pos * 2.0 - 1.0;
vec4 viewPosPrev = gbufferProjectionInverse * vec4(pos, 1.0);
viewPosPrev /= viewPosPrev.w;
viewPosPrev = gbufferModelViewInverse * viewPosPrev;
vec3 cameraOffset = cameraPosition - previousCameraPosition;
cameraOffset *= float(pos.z > 0.56);
vec4 previousPosition = viewPosPrev + vec4(cameraOffset, 0.0);
previousPosition = gbufferPreviousModelView * previousPosition;
previousPosition = gbufferPreviousProjection * previousPosition;
return previousPosition.xy / previousPosition.w * 0.5 + 0.5;
}

View File

@@ -0,0 +1,20 @@
#define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z)
#define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz)
vec3 ScreenToView(vec3 pos) {
vec4 iProjDiag = vec4(gbufferProjectionInverse[0].x,
gbufferProjectionInverse[1].y,
gbufferProjectionInverse[2].zw);
vec3 p3 = pos * 2.0 - 1.0;
vec4 viewPos = iProjDiag * p3.xyzz + gbufferProjectionInverse[3];
return viewPos.xyz / viewPos.w;
}
vec3 ViewToWorld(vec3 pos) {
return mat3(gbufferModelViewInverse) * pos + gbufferModelViewInverse[3].xyz;
}
vec3 WorldToShadow(vec3 pos) {
vec3 shadowpos = mat3(shadowModelView) * pos + shadowModelView[3].xyz;
return projMAD(shadowProjection, shadowpos);
}

View File

@@ -0,0 +1,96 @@
float wavingTime = frametime * WAVING_SPEED;
const float PI = 3.1415927;
float pi2wt = 6.2831854 * (wavingTime * 24.0);
vec3 calcWave(vec3 pos, float fm, float mm, float ma, float f0, float f1, float f2, float f3, float f4, float f5) {
vec3 ret;
float magnitude, d0, d1, d2, d3;
magnitude = sin(pi2wt * fm + pos.x*0.5 + pos.z*0.5 + pos.y*0.5) * mm + ma;
d0 = sin(pi2wt * f0);
d1 = sin(pi2wt * f1);
d2 = sin(pi2wt * f2);
ret.x = sin(pi2wt*f3 + d0 + d1 - pos.x + pos.z + pos.y) * magnitude;
ret.z = sin(pi2wt*f4 + d1 + d2 + pos.x - pos.z + pos.y) * magnitude;
ret.y = sin(pi2wt*f5 + d2 + d0 + pos.z + pos.y - pos.y) * magnitude;
return ret;
}
vec3 calcMove(in vec3 pos, float f0, float f1, float f2, float f3, float f4, float f5, vec3 amp1, vec3 amp2) {
vec3 move1 = calcWave(pos , 0.0027, 0.0400, 0.0400, 0.0127, 0.0089, 0.0114, 0.0063, 0.0224, 0.0015) * amp1;
vec3 move2 = calcWave(pos+move1, 0.0348, 0.0400, 0.0400, f0, f1, f2, f3, f4, f5) * amp2;
vec3 returner = move1 + move2;
return returner;
}
float calcLilypadMove(vec3 worldPos) {
float wave = sin(2 * PI * (wavingTime*0.7 + worldPos.x * 0.14 + worldPos.z * 0.07))
+ sin(2 * PI * (wavingTime*0.5 + worldPos.x * 0.10 + worldPos.z * 0.20));
return wave * 0.0125;
}
vec3 WavingBlocks(vec3 position, float istopv, float lmCoordY) {
vec3 wave = vec3(0.0);
vec3 worldpos = position + cameraPosition;
#ifdef WAVING_CROPS
if (mc_Entity.x == 59 && (istopv > 0.9 || fract(worldpos.y + 0.0675) > 0.01)) { // Crops
if (length(position) < 2.0) wave.xz += position.xz*max(5.0/pow(max(length(position*vec3(8.0,2.0,8.0)-vec3(0.0,2.0,0.0)),2.0),1.0)-0.625,0.0);
wave += calcMove(worldpos, 0.0041, 0.0070, 0.0044, 0.0038, 0.0240, 0.0000, vec3(0.4,0.0,0.4), vec3(0.2,0.0,0.2));
}
if (mc_Entity.x == 104 && (istopv > 0.9 || fract(worldpos.y + 0.0675) > 0.01)) { // Stems
wave += calcMove(worldpos, 0.0041, 0.0070, 0.0044, 0.0038, 0.0240, 0.0000, vec3(0.1,0.4,0.1), vec3(0.05,0.2,0.05));
}
#endif
#ifdef WAVING_FOLIAGE
if (mc_Entity.x == 31 && istopv > 0.9) { // Foliage
if (length(position) < 2.0) wave.xz += position.xz*max(5.0/pow(max(length(position*vec3(8.0,2.0,8.0)-vec3(0.0,2.0,0.0)),2.0),1.0)-0.625,0.0);
wave += calcMove(worldpos, 0.0041, 0.0070, 0.0044, 0.0038, 0.0063, 0.0000, vec3(0.8,0.0,0.8), vec3(0.4,0.0,0.4));
}
if (mc_Entity.x == 175 || (mc_Entity.x == 176.0 && (istopv > 0.9 || fract(worldpos.y+0.005)>0.01))) { // Double Plants
wave += calcMove(worldpos, 0.0041, 0.005, 0.0044, 0.0038, 0.0240, 0.0000, vec3(0.8,0.1,0.8), vec3(0.4,0.0,0.4));
}
if (mc_Entity.x == 6 && (istopv > 0.9 || fract(worldpos.y + 0.005) > 0.01)) { // Plants
wave += calcMove(worldpos, 0.0041, 0.005, 0.0044, 0.0038, 0.0240, 0.0000, vec3(0.6,0.0,0.6), vec3(0.3,0.0,0.3));
}
#endif
#ifdef WAVING_LEAVES
if (mc_Entity.x == 18) // Leaves
wave += calcMove(worldpos, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(0.5,0.5,0.5), vec3(0.25,0.25,0.25));
#endif
#ifdef WAVING_VINES
if (mc_Entity.x == 9600) // Vines
wave += calcMove(worldpos, 0.0040, 0.0064, 0.0043, 0.0035, 0.0037, 0.0041, vec3(0.25,0.5,0.25), vec3(0.125,0.25,0.125));
#endif
#ifdef WAVING_LILY_PADS
if (mc_Entity.x == 9100) // Lily Pads
wave.y += calcLilypadMove(worldpos);
#endif
#ifdef WAVING_EVERYTHING
wave += calcWave(worldpos, 0.0027, 0.0400, 0.0400, 0.0127, 0.0089, 0.0114, 0.0063, 0.0224, 0.0015);
#endif
wave *= WAVING_INTENSITY * mix(1.0, RAIN_WAVING_INTENSITY, rainStrengthS);
#ifndef DO_WAVING_UNDERGROUND
wave *= float(lmCoordY > 0.9);
#endif
return wave;
}
float WavingWater(vec3 worldPos, float lmCoordY) {
float fractY = fract(worldPos.y + cameraPosition.y + 0.005);
worldPos += cameraPosition.xyz;
float waterWaveTime = frametime * WATER_SPEED * 0.8;
float wave = sin(6.28 * (waterWaveTime * 0.7 + worldPos.x * 0.14 + worldPos.z * 0.07)) +
sin(6.28 * (waterWaveTime * 0.5 + worldPos.x * 0.10 + worldPos.z * 0.20));
#if !defined DO_WAVING_UNDERGROUND && MC_VERSION >= 11800
wave *= float(lmCoordY > 0.9);
#endif
if (fractY > 0.01) return wave * 0.0125;
else return 0.0;
}

View File

@@ -0,0 +1,20 @@
float WorldCurvature(vec2 pos) {
#if defined END
float curvature = dot(pos, pos) / END_CURVATURE_SIZE;
#if END_CURVATURE_SIZE == 999999
curvature *= 0.0;
#endif
#elif defined NETHER
float curvature = dot(pos, pos) / NETHER_CURVATURE_SIZE;
#if NETHER_CURVATURE_SIZE == 999999
curvature *= 0.0;
#endif
#else
float curvature = dot(pos, pos) / OVERWORLD_CURVATURE_SIZE;
#if OVERWORLD_CURVATURE_SIZE == 999999
curvature *= 0.0;
#endif
#endif
return curvature;
}