first commit
This commit is contained in:
commit
0f859671ea
308 files changed
+18617
No files matched your search
@@ -0,0 +1,4 @@
|
||||
vec3 auroraLowColSqrt = vec3(AURORA_LR, AURORA_LG, AURORA_LB) * AURORA_LI / 255.0;
|
||||
vec3 auroraLowCol = auroraLowColSqrt * auroraLowColSqrt;
|
||||
vec3 auroraHighColSqrt = vec3(AURORA_HR, AURORA_HG, AURORA_HB) * AURORA_HI / 255.0;
|
||||
vec3 auroraHighCol = auroraHighColSqrt * auroraHighColSqrt;
|
||||
@@ -0,0 +1,2 @@
|
||||
vec3 blocklightColSqrt = vec3(BLOCKLIGHT_R, BLOCKLIGHT_G, BLOCKLIGHT_B) * BLOCKLIGHT_I / 255.0;
|
||||
vec3 blocklightCol = blocklightColSqrt * blocklightColSqrt;
|
||||
@@ -0,0 +1,14 @@
|
||||
#ifdef OVERWORLD
|
||||
#include "lightColor.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef NETHER
|
||||
#include "netherColor.glsl"
|
||||
#endif
|
||||
|
||||
#ifdef END
|
||||
#include "endColor.glsl"
|
||||
#endif
|
||||
|
||||
vec3 minLightColSqrt = vec3(MINLIGHT_R, MINLIGHT_G, MINLIGHT_B) * MINLIGHT_I / 255.0;
|
||||
vec3 minLightCol = minLightColSqrt * minLightColSqrt * 0.04;
|
||||
@@ -0,0 +1,2 @@
|
||||
vec4 endColSqrt = vec4(vec3(END_R, END_G, END_B) / 255.0, 1.0) * END_I;
|
||||
vec4 endCol = endColSqrt * endColSqrt;
|
||||
@@ -0,0 +1,69 @@
|
||||
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;
|
||||
vec3 lightNight = vec3(LIGHT_NR, LIGHT_NG, LIGHT_NB) * LIGHT_NI * 0.3 / 255.0;
|
||||
|
||||
vec3 ambientMorning = vec3(AMBIENT_MR, AMBIENT_MG, AMBIENT_MB) * AMBIENT_MI / 255.0;
|
||||
vec3 ambientDay = vec3(AMBIENT_DR, AMBIENT_DG, AMBIENT_DB) * AMBIENT_DI / 255.0;
|
||||
vec3 ambientEvening = vec3(AMBIENT_ER, AMBIENT_EG, AMBIENT_EB) * AMBIENT_EI / 255.0;
|
||||
vec3 ambientNight = vec3(AMBIENT_NR, AMBIENT_NG, AMBIENT_NB) * AMBIENT_NI * 0.3 / 255.0;
|
||||
|
||||
#ifdef WEATHER_PERBIOME
|
||||
uniform float isDesert, isMesa, isCold, isSwamp, isMushroom, isSavanna, isJungle;
|
||||
|
||||
vec4 weatherRain = vec4(vec3(WEATHER_RR, WEATHER_RG, WEATHER_RB) / 255.0, 1.0) * WEATHER_RI;
|
||||
vec4 weatherCold = vec4(vec3(WEATHER_CR, WEATHER_CG, WEATHER_CB) / 255.0, 1.0) * WEATHER_CI;
|
||||
vec4 weatherDesert = vec4(vec3(WEATHER_DR, WEATHER_DG, WEATHER_DB) / 255.0, 1.0) * WEATHER_DI;
|
||||
vec4 weatherBadlands = vec4(vec3(WEATHER_BR, WEATHER_BG, WEATHER_BB) / 255.0, 1.0) * WEATHER_BI;
|
||||
vec4 weatherSwamp = vec4(vec3(WEATHER_SR, WEATHER_SG, WEATHER_SB) / 255.0, 1.0) * WEATHER_SI;
|
||||
vec4 weatherMushroom = vec4(vec3(WEATHER_MR, WEATHER_MG, WEATHER_MB) / 255.0, 1.0) * WEATHER_MI;
|
||||
vec4 weatherSavanna = vec4(vec3(WEATHER_VR, WEATHER_VG, WEATHER_VB) / 255.0, 1.0) * WEATHER_VI;
|
||||
vec4 weatherJungle = vec4(vec3(WEATHER_JR, WEATHER_JG, WEATHER_JB) / 255.0, 1.0) * WEATHER_JI;
|
||||
|
||||
float weatherWeight = isCold + isDesert + isMesa + isSwamp + isMushroom + isSavanna + isJungle;
|
||||
|
||||
vec4 weatherCol = mix(
|
||||
weatherRain,
|
||||
(
|
||||
weatherCold * isCold + weatherDesert * isDesert + weatherBadlands * isMesa +
|
||||
weatherSwamp * isSwamp + weatherMushroom * isMushroom + weatherSavanna * isSavanna +
|
||||
weatherJungle * isJungle
|
||||
) / max(weatherWeight, 0.0001),
|
||||
weatherWeight
|
||||
);
|
||||
|
||||
#else
|
||||
vec4 weatherCol = vec4(vec3(WEATHER_RR, WEATHER_RG, WEATHER_RB) / 255.0, 1.0) * WEATHER_RI;
|
||||
#endif
|
||||
|
||||
float mefade = 1.0 - clamp(abs(timeAngle - 0.5) * 8.0 - 1.5, 0.0, 1.0);
|
||||
float dfade = 1.0 - pow(1.0 - timeBrightness, 1.5);
|
||||
|
||||
vec3 CalcSunColor(vec3 morning, vec3 day, vec3 evening) {
|
||||
vec3 me = mix(morning, evening, mefade);
|
||||
return mix(me, day, dfade);
|
||||
}
|
||||
|
||||
vec3 CalcLightColor(vec3 sun, vec3 night, vec3 weatherCol) {
|
||||
vec3 c = mix(night, sun, sunVisibility);
|
||||
c = mix(c, dot(c, vec3(0.299, 0.587, 0.114)) * weatherCol, rainStrength);
|
||||
return c * c;
|
||||
}
|
||||
|
||||
vec3 lightSun = mix(mix(lightMorning, lightEvening, mefade), lightDay, dfade);
|
||||
|
||||
vec3 ambientSun = mix(mix(ambientMorning, ambientEvening, mefade), ambientDay, dfade);
|
||||
|
||||
vec3 lightColRaw = mix(lightNight, lightSun, sunVisibility);
|
||||
vec3 lightColSqrt = mix(lightColRaw, dot(lightColRaw, vec3(0.299, 0.587, 0.114)) * weatherCol.rgb, rainStrength);
|
||||
vec3 lightCol = lightColSqrt * lightColSqrt;
|
||||
|
||||
vec3 ambientColRaw = mix(ambientNight, ambientSun, sunVisibility);
|
||||
vec3 ambientColSqrt = mix(ambientColRaw, dot(ambientColRaw, vec3(0.299, 0.587, 0.114)) * weatherCol.rgb, rainStrength);
|
||||
vec3 ambientCol = ambientColSqrt * ambientColSqrt;
|
||||
|
||||
// vec3 lightSun = CalcSunColor(lightMorning, lightDay, lightEvening);
|
||||
// vec3 ambientSun = CalcSunColor(ambientMorning, ambientDay, ambientEvening);
|
||||
|
||||
// vec3 lightCol = CalcLightColor(lightSun, lightNight, weatherCol.rgb);
|
||||
// vec3 ambientCol = CalcLightColor(ambientSun, ambientNight, weatherCol.rgb);
|
||||
@@ -0,0 +1,28 @@
|
||||
vec4 netherNether = vec4(vec3(NETHER_NR, NETHER_NG, NETHER_NB) / 255.0, 1.0) * NETHER_NI;
|
||||
vec4 netherValley = vec4(vec3(NETHER_VR, NETHER_VG, NETHER_VB) / 255.0, 1.0) * NETHER_VI;
|
||||
vec4 netherCrimson = vec4(vec3(NETHER_CR, NETHER_CG, NETHER_CB) / 255.0, 1.0) * NETHER_CI;
|
||||
vec4 netherWarped = vec4(vec3(NETHER_WR, NETHER_WG, NETHER_WB) / 255.0, 1.0) * NETHER_WI;
|
||||
vec4 netherBasalt = vec4(vec3(NETHER_BR, NETHER_BG, NETHER_BB) / 255.0, 1.0) * NETHER_BI;
|
||||
|
||||
#ifdef NETHER_VANILLA
|
||||
uniform vec3 fogColor;
|
||||
vec4 netherColSqrt = vec4(normalize(fogColor + 0.0001), length(fogColor));
|
||||
#else
|
||||
#ifdef WEATHER_PERBIOME
|
||||
uniform float isValley, isCrimson, isWarped, isBasalt;
|
||||
float nBiomeWeight = isValley + isCrimson + isWarped + isBasalt;
|
||||
|
||||
vec4 netherColSqrt = mix(
|
||||
netherNether,
|
||||
(
|
||||
netherValley * isValley + netherCrimson * isCrimson +
|
||||
netherWarped * isWarped + netherBasalt * isBasalt
|
||||
) / max(nBiomeWeight, 0.0001),
|
||||
nBiomeWeight
|
||||
);
|
||||
#else
|
||||
vec4 netherColSqrt = netherNether;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vec4 netherCol = netherColSqrt * netherColSqrt;
|
||||
@@ -0,0 +1,15 @@
|
||||
#ifdef SKY_VANILLA
|
||||
uniform vec3 skyColor;
|
||||
uniform vec3 fogColor;
|
||||
|
||||
vec3 skyCol = pow(skyColor, vec3(2.2)) * SKY_I * SKY_I;
|
||||
#ifdef SKY_VANILLA_USE_FOG
|
||||
vec3 fogCol = pow(fogColor, vec3(2.2)) * SKY_I * SKY_I;
|
||||
#else
|
||||
vec3 fogCol = skyCol;
|
||||
#endif
|
||||
#else
|
||||
vec3 skyColSqrt = vec3(SKY_R, SKY_G, SKY_B) * SKY_I / 255.0;
|
||||
vec3 skyCol = skyColSqrt * skyColSqrt;
|
||||
vec3 fogCol = skyCol;
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
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 GetSpecularColor(float skylight, float metalness, vec3 baseReflectance){
|
||||
vec3 specularColor = vec3(0.0);
|
||||
#ifdef OVERWORLD
|
||||
vec3 lightME = mix(lightMorning, lightEvening, mefade);
|
||||
vec3 lightDaySpec = mix(sqrt(lightME), sqrt(lightDay), dfade * 0.7);
|
||||
vec3 lightNightSpec = sqrt(lightNight * LIGHT_NI * 0.2);
|
||||
specularColor = mix(lightNightSpec, lightDaySpec * lightDaySpec, sunVisibility);
|
||||
specularColor *= specularColor * skylight;
|
||||
#endif
|
||||
#ifdef END
|
||||
specularColor = endCol.rgb * 0.35;
|
||||
#endif
|
||||
|
||||
specularColor = pow(specularColor, vec3(1.0 - 0.5 * metalness)) *
|
||||
pow(max(length(specularColor), 0.0001), 0.5 * metalness);
|
||||
|
||||
return specularColor;
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
vec4 waterColorSqrt = vec4(vec3(WATER_R, WATER_G, WATER_B) / 255.0, 1.0) * WATER_I;
|
||||
vec4 waterColor = waterColorSqrt * waterColorSqrt;
|
||||
|
||||
const float waterAlpha = WATER_A;
|
||||
const float waterFogRange = 64.0 / WATER_FOG_DENSITY;
|
||||
Reference in new issue
Block a user