first commit

This commit is contained in:
Rbanh committed 2024-06-22 15:15:55 -04:00
commit 0f859671ea
308 files changed
+18617

No files matched your search

@@ -0,0 +1,100 @@
// End Portal fix by fayer3#2332 (Modified)
vec3[8] colors = vec3[](
vec3(0.3472479, 0.6559956, 0.7387838) * 1.5,
vec3(0.6010780, 0.7153565, 1.060625 ),
vec3(0.4221090, 0.8135094, 0.9026056),
vec3(0.3492291, 1.0241201, 1.8612821),
vec3(0.7543085, 0.8238697, 0.6803233),
vec3(0.4144472, 0.5648165, 0.8037 ),
vec3(0.508905 , 0.6719649, 0.9982805),
vec3(0.5361914, 0.4476583, 0.8008522));
color.rgb = vec3(0.4214321, 0.4722309, 1.9922364) * 0.08;
float dither = Bayer64(gl_FragCoord.xy);
#ifdef TAA
dither = fract(dither + 1.61803398875 * mod(float(frameCounter), 3600.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);
for (int i = 1; i <= 8; i++) {
float colormult = 0.9/(30.0+i);
float rotation = (i - 0.1 * i + 0.71 * i - 11 * i + 21) * 0.01 + i * 0.01;
float Cos = cos(radians(rotation));
float Sin = sin(radians(rotation));
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(NdotU) > 0.9) {
wpos.xz /= wpos.y;
wpos.xz *= 0.06 * sign(- playerPos.y);
wpos.xz *= abs(playerPos.y) + i * dismult + add;
wpos.xz -= cameraPosition.xz * 0.05;
} else {
vec3 absPos = abs(playerPos);
if (abs(dot(normal, eastVec)) > 0.9) {
wpos.xz = wpos.yz / wpos.x;
wpos.xz *= 0.06 * sign(- playerPos.x);
wpos.xz *= abs(playerPos.x) + i * dismult + add;
wpos.xz -= cameraPosition.yz * 0.05;
} else {
wpos.xz = wpos.yx / wpos.z;
wpos.xz *= 0.06 * sign(- playerPos.z);
wpos.xz *= abs(playerPos.z) + i * dismult + add;
wpos.xz -= cameraPosition.yx * 0.05;
}
}
vec2 pos = wpos.xz;
vec2 wind = fract((frameTimeCounter + 984.0) * (i + 8) * 0.125 * offset);
vec2 coord = mat2(Cos, Sin, -Sin, Cos) * pos + wind;
if (mod(float(i), 4) < 1.5) coord = coord.yx + vec2(-1.0, 1.0) * wind.y;
vec3 psample = pow(texture2D(tex, coord).rgb, vec3(0.85)) * colors[i-1] * colormult;
color.rgb += psample * length(psample.rgb) * (3000.0 / repeat);
}
}
color.rgb *= vec3(0.09, 0.077, 0.07);
emission = 10.0;
noDirectionalShading = true;
#ifdef COATED_TEXTURES
noiseFactor = 0.0;
#endif
#ifdef PORTAL_EDGE_EFFECT
//vec3 voxelPos = SceneToVoxel(mix(playerPos, vec3(0.0), -0.02)); // Fixes weird parallax offset
vec3 voxelPos = SceneToVoxel(playerPos);
float portalOffset = 0.08333 * dither;
vec3[4] portalOffsets = vec3[](
vec3( portalOffset, 0, portalOffset),
vec3( portalOffset, 0,-portalOffset),
vec3(-portalOffset, 0, portalOffset),
vec3(-portalOffset, 0,-portalOffset)
);
float edge = 0.0;
for (int i = 0; i < 4; i++) {
int voxel = int(texelFetch(voxel_sampler, ivec3(voxelPos + portalOffsets[i]), 0).r);
if (voxel == 58 || voxel == 255) { // End Portal Frame or Bedrock
edge = 1.0; break;
}
}
#ifdef END
// No edge effect in the middle of the return fountain
vec2 var1 = abs(playerPos.xz + cameraPosition.xz - 0.5);
float var2 = max(var1.x, var1.y);
if (var2 > 1.0)
#endif
{
vec4 edgeColor = vec4(vec3(0.3, 0.6, 0.7), 1.0);
color = mix(color, edgeColor, edge);
emission = mix(emission, 5.0, edge);
}
#endif
@@ -0,0 +1,15 @@
normalM = upVec;
highlightMult = 0.0;
shadowMult = vec3(0.0);
#if MC_VERSION >= 11700
if (lmCoord.x > 0.99) { // Glowing Sign Text
lmCoordM = vec2(0.0);
emission = 1.0;
color.rgb *= length(color.rgb) + 0.5;
} else // Normal Sign Text
#endif
color.rgb *= 5.0;
@@ -0,0 +1,6 @@
smoothnessG = pow2(pow2(color.r)) * 0.65;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1,3 @@
smoothnessG = color.r * 0.4;
smoothnessD = color.r * 0.3;
@@ -0,0 +1,6 @@
smoothnessG = pow2(pow2(color.g)) * 0.75;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,6 @@
smoothnessG = pow2(pow2(color.g)) * 0.7;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,6 @@
smoothnessG = pow2(color.r) * 0.7;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.77;
#endif
@@ -0,0 +1,6 @@
smoothnessG = color.r * 0.7;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,7 @@
smoothnessG = pow2(pow2(pow2(color.g))) * 12.0;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,3 @@
smoothnessG = pow2(color.r) * 0.7;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
@@ -0,0 +1,7 @@
smoothnessG = pow2(pow2(pow2(color.g))) * 12.0;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.77;
#endif
@@ -0,0 +1,7 @@
smoothnessG = pow2(pow2(color.g)) * 8.0;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,6 @@
smoothnessG = pow2(color.g) * 0.7;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.77;
#endif
@@ -0,0 +1,6 @@
smoothnessG = color.r;
smoothnessD = color.r;
#ifdef COATED_TEXTURES
noiseFactor = 0.33;
#endif
@@ -0,0 +1,2 @@
smoothnessG = color.r;
smoothnessD = color.r * 0.65;
@@ -0,0 +1,3 @@
smoothnessG = pow2(pow2(color.g));
smoothnessD = smoothnessG;
smoothnessG = max(smoothnessG, 0.3 * color.g * float(color.g > color.b * 1.5));
@@ -0,0 +1,10 @@
materialMask = OSIEBCA * 2.0; // Copper Fresnel
smoothnessG = pow2(pow2(color.r)) + pow2(max0(color.g - color.r * 0.5)) * 0.3;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
color.rgb *= 0.6 + 0.7 * GetLuminance(color.rgb);
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1,20 @@
noSmoothLighting = true;
vec3 hsvColor = rgb2hsv(color.rgb);
if (abs(hsvColor.r - 0.09722) < 0.04305 && hsvColor.b > 0.7) { // Active Light Part
smoothnessG = 0.75;
smoothnessD = 0.35;
float blockRes = absMidCoordPos.x * atlasSize.x;
vec2 signMidCoordPosM = (floor((signMidCoordPos + 1.0) * blockRes) + 0.5) / blockRes - 1.0;
float dotsignMidCoordPos = dot(signMidCoordPosM, signMidCoordPosM);
float lBlockPosM = pow2(max0(1.0 - 1.7 * pow2(pow2(dotsignMidCoordPos))));
emission = pow2(lmCoordM.x) + 0.3 * color.r;
emission *= (0.7 + 2.0 * pow2(lBlockPosM));
} else if (color.r > 2.5 * (color.g + color.b)) { // Middle Redstone Part
emission = 4.0;
color.rgb *= color.rgb;
} else { // Copper Base
#include "/lib/materials/specificMaterials/terrain/copperBlock.glsl"
}
@@ -0,0 +1,7 @@
float lColor = length(color.rgb);
smoothnessG = lColor * 0.2;
smoothnessD = lColor * 0.15;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,11 @@
#include "/lib/materials/specificMaterials/terrain/obsidian.glsl"
highlightMult *= 0.5;
float factor0 = sqrt2(max0(color.b - color.g * 6.0));
float factor1 = pow2(color.b);
emission = 1.35 + pow2(pow2(factor1)) * 7.5;
emission *= factor0;
color.r *= 1.15;
maRecolor = vec3(factor0 * min(max0(factor1 * 0.7 - 0.1) * 1.3, 0.5));
@@ -0,0 +1,8 @@
smoothnessG = pow2(color.g) * 1.5;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
#if COLORED_LIGHTING == 0
/* Tweak to make caves with Glow Lichen look better lit and closer to vanilla Minecraft. */
lmCoordM = pow(lmCoordM + 0.0001, vec2(0.65));
#endif
@@ -0,0 +1,25 @@
materialMask = OSIEBCA; // Intense Fresnel
float factor = max(max(color.g, 0.8),max(color.b, 0.8));
float factor2 = pow2(factor);
#ifdef GBUFFERS_TERRAIN
float factor4 = pow2(factor2);
#else
float factor4 = factor2;
#endif
smoothnessG = factor - pow2(pow2(color.g)) * 0.4;
highlightMult = 3.0 * max(pow2(factor4), 0.2);
smoothnessD = factor4 * 0.75;
#if MC_VERSION < 11300
highlightMult *= 2.0;
smoothnessD /= 0.75;
#endif
color.rgb *= 0.7 + 0.4 * GetLuminance(color.rgb);
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1 @@
smoothnessG = color.r * 0.1 + 0.1;
@@ -0,0 +1,14 @@
materialMask = OSIEBCA; // Intense Fresnel
float factor = pow2(sqrt2(GetLuminance(color.rgb)));
float factor2 = pow2(factor);
float factor4 = pow2(factor2);
smoothnessG = factor - factor4 * 0.4;
highlightMult = 3.0 * factor4;
smoothnessD = factor4 * 0.75;
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1,3 @@
// End Portal Frame:Green Parts
smoothnessG = 0.25;
smoothnessD = 0.45;
@@ -0,0 +1,7 @@
float factor = pow2(pow2(color.r));
smoothnessG = factor * 0.65;
smoothnessD = smoothnessG * 0.6;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,10 @@
noSmoothLighting = true; noDirectionalShading = true;
lmCoordM = vec2(1.0, 0.0);
float blockRes = absMidCoordPos.x * atlasSize.x;
vec2 signMidCoordPosM = abs((floor((signMidCoordPos + 1.0) * blockRes) + 0.5) / blockRes - 1.0);
float value = 1.0 - max(signMidCoordPosM.x, signMidCoordPosM.y);
emission = 0.3 + value + pow(dot(color.rgb, color.rgb) * 0.33, frogPow);
emission *= 1.7;
color.rgb = pow2(color.rgb);
@@ -0,0 +1,20 @@
materialMask = OSIEBCA * 3.0; // Gold Fresnel
#ifdef GBUFFERS_TERRAIN
float colorG2 = pow2(max(color.g, color.r));
#else
float colorG2 = color.g;
#endif
float colorG4 = pow2(colorG2);
float factor = max(color.g, 0.8);
smoothnessG = min1(factor - colorG4 * 0.2);
highlightMult = 3.5 * max(colorG4, 0.7);
smoothnessD = colorG4;
color.rgb *= 0.5 + 0.4 * GetLuminance(color.rgb);
#ifdef COATED_TEXTURES
noiseFactor = 0.33;
#endif
@@ -0,0 +1,14 @@
#ifdef GBUFFERS_TERRAIN
smoothnessG = pow2(pow2(color.r * 3));
#else
smoothnessG = pow2(color.r * 3);
#endif
highlightMult = smoothnessG * 3.0;
smoothnessD = smoothnessG;
materialMask = OSIEBCA; // Intense Fresnel
color.rgb *= 0.8+ .5 * GetLuminance(color.rgb);
#ifdef COATED_TEXTURES
noiseFactor = 0.33;
#endif
@@ -0,0 +1,6 @@
smoothnessG = color.b;
smoothnessD = color.b;
#ifdef COATED_TEXTURES
noiseFactor = 0.66;
#endif
@@ -0,0 +1,6 @@
smoothnessG = pow2(color.b) * 0.8;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1,30 @@
// Tweak to prevent the animation of lava causing brightness pulsing
vec3 avgColor = vec3(0.0);
ivec2 itexCoordC = ivec2(midCoord * atlasSize + 0.0001);
for (int x = -8; x < 8; x += 2) {
for (int y = -8; y < 8; y += 2) {
avgColor += texelFetch(tex, itexCoordC + ivec2(x, y), 0).rgb;
}
}
color.rgb /= max(GetLuminance(avgColor) * 0.0390625, 0.001);
#ifdef NETHER
vec3 worldPos = playerPos + cameraPosition;
vec2 lavaPos = (floor(worldPos.xz * 16.0) + worldPos.y * 32.0) * 0.000666;
vec2 wind = vec2(frameTimeCounter * 0.012, 0.0);
float noiseSample = texture2D(noisetex, lavaPos + wind).g;
noiseSample = noiseSample - 0.5;
noiseSample *= 0.1;
color.rgb = pow(color.rgb, vec3(1.0 + noiseSample));
#endif
noDirectionalShading = true;
lmCoordM = vec2(0.0);
emission = GetLuminance(color.rgb) * 6.5;
maRecolor = vec3(clamp(pow2(pow2(pow2(smoothstep1(emission * 0.28)))), 0.12, 0.4) * 1.3) * vec3(1.0, vec2(0.7));
#if RAIN_PUDDLES >= 1
noPuddles = 1.0;
#endif
@@ -0,0 +1,26 @@
subsurfaceMode = 2;
#ifdef GBUFFERS_TERRAIN
materialMask = OSIEBCA * 253.0; // Reduced Edge TAA
#ifdef COATED_TEXTURES
doTileRandomisation = false;
#endif
#endif
#ifdef IPBR
float factor = min1(pow2(color.g - 0.15 * (color.r + color.b)) * 2.5);
smoothnessG = factor * 0.5;
highlightMult = factor * 4.0 + 2.0;
float fresnel = clamp(1.0 + dot(normalM, normalize(viewPos)), 0.0, 1.0);
highlightMult *= 1.0 - pow2(pow2(fresnel));
#endif
#ifdef SNOWY_WORLD
snowMinNdotU = min(pow2(pow2(color.g)), 0.1);
color.rgb = color.rgb * 0.5 + 0.5 * (color.rgb / glColor.rgb);
#endif
#if SHADOW_QUALITY > -1 && SHADOW_QUALITY < 3
shadowMult = vec3(sqrt1(max0(max(lmCoordM.y, min1(lmCoordM.x * 2.0)) - 0.95) * 20.0));
#endif
@@ -0,0 +1,8 @@
smoothnessG = pow2(color.r * 2.0);
smoothnessG = min1(smoothnessG);
highlightMult = smoothnessG * 2.0;
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.33;
#endif
@@ -0,0 +1,7 @@
#if MC_VERSION >= 11300
smoothnessG = pow2(color.r) * 1.5;
smoothnessG = min1(smoothnessG);
#else
smoothnessG = color.r * 0.4 + 0.2;
#endif
smoothnessD = smoothnessG;
@@ -0,0 +1,3 @@
smoothnessG = pow2(pow2(color.g)) * 2.5;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
@@ -0,0 +1,13 @@
materialMask = OSIEBCA; // Intense Fresnel
float factor = max0(0.3 - abs(color.r - 0.3)) * 1.5;
smoothnessG = factor;
highlightMult = 2.0 + min1(smoothnessG * 2.0) * 1.5;
smoothnessG = min1(smoothnessG);
smoothnessD = min1(factor + 0.07);
#ifdef COATED_TEXTURES
noiseFactor = 1.25;
#endif
@@ -0,0 +1 @@
smoothnessG = color.g * 0.25;
@@ -0,0 +1,19 @@
materialMask = OSIEBCA; // Intense Fresnel
float factor = color.g;
float factor2 = pow2(factor);
float factor4 = pow2(factor2);
float factor8 = pow2(factor4);
smoothnessG = factor - factor8 * 0.5;
highlightMult = 3.5 * factor8;
smoothnessD = factor8;
#ifdef GBUFFERS_TERRAIN
DoBrightBlockTweaks(color.rgb, 0.5, shadowMult, highlightMult);
#endif
#ifdef COATED_TEXTURES
noiseFactor = 0.5;
#endif
@@ -0,0 +1,4 @@
materialMask = OSIEBCA * 2.0; // Copper Fresnel
smoothnessG = pow2(color.r + color.g * 0.25) * 0.4;
smoothnessG = min1(smoothnessG);
smoothnessD = min1(smoothnessG * smoothnessG * 2.0);
@@ -0,0 +1,3 @@
materialMask = OSIEBCA * 3.0; // Gold Fresnel
smoothnessG = pow2(pow2(color.g));
smoothnessD = 0.5 * (smoothnessG + color.b);
@@ -0,0 +1,3 @@
materialMask = OSIEBCA; // Intense Fresnel
smoothnessG = pow2(pow2(color.r)) * 0.7;
smoothnessD = smoothnessG * 0.6;
@@ -0,0 +1,11 @@
materialMask = OSIEBCA * 5.0; // Redstone Fresnel
float factor = pow2(color.r);
smoothnessG = 0.4;
highlightMult = factor + 0.2;
smoothnessD = factor * 0.5 + 0.1;
#ifdef COATED_TEXTURES
noiseFactor = 0.77;
#endif
@@ -0,0 +1,15 @@
noSmoothLighting = true; noDirectionalShading = true;
lmCoordM.x = min(lmCoordM.x * 0.9, 0.77);
if (color.r > 0.65) {
emission = (3.5 - 2.25 * color.g) * 0.97;
color.rgb *= color.rgb;
} else if (color.r > color.g * 2.0) {
materialMask = OSIEBCA * 5.0; // Redstone Fresnel
float factor = pow2(color.r);
smoothnessG = 0.4;
highlightMult = factor + 0.4;
smoothnessD = factor * 0.7 + 0.3;
}
@@ -0,0 +1,12 @@
smoothnessG = (1.0 - pow(color.g, 64.0) * 0.3) * 0.4;
highlightMult = 2.0;
smoothnessD = smoothnessG;
#ifdef GBUFFERS_TERRAIN
DoBrightBlockTweaks(color.rgb, 0.5, shadowMult, highlightMult);
#endif
#if RAIN_PUDDLES >= 1
noPuddles = 1.0;
#endif
@@ -0,0 +1,7 @@
smoothnessG = pow2(pow2(color.g)) * 1.5;
smoothnessG = min1(smoothnessG);
smoothnessD = smoothnessG;
#ifdef COATED_TEXTURES
noiseFactor = 0.77;
#endif