custommods

This commit is contained in:
samsonsin
2025-05-29 23:31:29 +02:00
committed by samsonsin
parent b2dc5eba36
commit ee85cdd98b
799 changed files with 19536 additions and 0 deletions

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);