diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index c3ff1c4..e653e18 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -1757,16 +1757,19 @@ void main() { float u2 = dot(dirDiff2, tangent2); float v2 = dot(dirDiff2, binormal2); - float sunAngularRadius = acos(0.9984); + float sunAngularRadius = acos(0.9984)*SUN_SIZE*0.01; + float mult = 1.0; + #if SUN_SIZE > MOON_SIZE + mult = smoothstep(1.3, 1.1, float(SUN_SIZE)/float(MOON_SIZE)); + #endif + u2 = u2 / (2.0 * sunAngularRadius) + 0.5; v2 = -v2 / (1.96 * sunAngularRadius) + 0.505; - if (u2 > 0.0 && u2 < 1.0 && v2 > 0.0 && v2 < 1.0) { - vec2 coronaUV = vec2(u2, v2); - vec3 coronaTex = texture(CoronaTex, coronaUV).rgb; - Background += 0.5 * coronaTex * coronaTex * coronaTex * coronaTex * coronaTex * smoothstep(0.004, 0.0002, sunMoonDist); - } + vec2 coronaUV = vec2(u2, v2); + vec3 coronaTex = texture(CoronaTex, coronaUV).rgb; + Background += 0.5 * coronaTex * coronaTex * coronaTex * coronaTex * coronaTex * smoothstep(0.004, 0.0002, sunMoonDist)*mult; } #endif @@ -1786,7 +1789,7 @@ void main() { float u = dot(dirDiff, tangent); float v = dot(dirDiff, binormal); - float moonAngularRadius = acos(0.9994) * MOON_SIZE; + float moonAngularRadius = acos(0.9994) * MOON_SIZE * 0.01; u = u / (2.0 * moonAngularRadius) + 0.5; v = -v / (2.0 * moonAngularRadius) + 0.5; diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index f541ab9..e4547dd 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -60,7 +60,9 @@ screen.CUSTOM_MOON_SETTINGS = Custom Moon Settings option.CAELUM_SUPPORT = Caelum (ArdaCraft) Support option.CAELUM_SUPPORT.comment = §cREQUIRES CUSTOM MOON ROTATION.§r Changes the light casted by the sun/moon to the correct position specified by Caelum. option.MOON_SIZE = Moon Size + suffix.MOON_SIZE = % option.SUN_SIZE = Sun Size + suffix.SUN_SIZE = % option.MOON_LATITUDE = Latitude suffix.MOON_LATITUDE = ° option.MONTH_LENGTH = Month Length diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index 9304257..f7bb602 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -396,7 +396,7 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0. #define sunColorR 1.0 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ] #define sunColorG 0.91 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ] #define sunColorB 0.81 // [0.0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12 0.13 0.14 0.15 0.16 0.17 0.18 0.19 0.2 0.21 0.22 0.23 0.24 0.25 0.26 0.27 0.28 0.29 0.3 0.31 0.32 0.33 0.34 0.35 0.36 0.37 0.38 0.39 0.4 0.41 0.42 0.43 0.44 0.45 0.46 0.47 0.48 0.49 0.5 0.51 0.52 0.53 0.54 0.55 0.56 0.57 0.58 0.59 0.6 0.61 0.62 0.63 0.64 0.65 0.66 0.67 0.68 0.69 0.7 0.71 0.72 0.73 0.74 0.75 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84 0.85 0.86 0.87 0.88 0.89 0.9 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 1.0 ] -#define SUN_SIZE 1.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.75 2.0 2.25 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] +#define SUN_SIZE 100 // [10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 175 200 225 250 300 350 400 450 500] #define moon_illuminance 600.0 //[0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 150.0 200.0 300.0 400.0 500.0 600.0 700.0 800.0 900.0 1000.0 2000.0 3000.0 4000.0 5000.0 6000.0 7000.0 8000.0 9000.0 10000.0 11000.0 12000.0 13000.0 14000.0 15000.0 20000.0 30000.0 40000.0 50000.0 60000.0 70000.0 80000.0 90000.0 100000.0 150000.0 200000.0 250000.0 300000.0 400000.0 500000.0] #define Moon_temp 8000 // [1000 1100 1200 1300 1400 1500 1600 1700 1800 1900 2000 2100 2200 2300 2400 2500 2600 2700 2800 2900 3000 3100 3200 3300 3400 3500 3600 3700 3800 3900 4000 4100 4200 4300 4400 4500 4600 4700 4800 4900 5000 5100 5200 5300 4500 5600 5700 5800 5900 6000 6100 6200 6300 6400 6500 6600 6700 6800 6900 7000 7100 7200 7300 7400 7500 7600 7700 7800 7900 8000 8100 8200 8300 8400 8500 8600 8700 8800 8900 9000 9100 9200 9300 9400 9500 9600 9700 9800 9900 10000 15000 20000 25000 50000] @@ -406,7 +406,7 @@ const float entityShadowDistanceMul = 0.25; // [0.01 0.02 0.03 0.04 0.05 0.10 0. #define REALMOON #define MOON_NORMALS -#define MOON_SIZE 1.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.75 2.0 2.25 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] +#define MOON_SIZE 100 // [10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 175 200 225 250 300 350 400 450 500] #define MOON_LATITUDE 40.0 // [-89.0 -88.0 -87.0 -86.0 -85.0 -84.0 -83.0 -82.0 -81.0 -80.0 -79.0 -78.0 -77.0 -76.0 -75.0 -74.0 -73.0 -72.0 -71.0 -70.0 -69.0 -68.0 -67.0 -66.0 -65.0 -64.0 -63.0 -62.0 -61.0 -60.0 -59.0 -58.0 -57.0 -56.0 -55.0 -54.0 -53.0 -52.0 -51.0 -50.0 -49.0 -48.0 -47.0 -46.0 -45.0 -44.0 -43.0 -42.0 -41.0 -40.0 -39.0 -38.0 -37.0 -36.0 -35.0 -34.0 -33.0 -32.0 -31.0 -30.0 -29.0 -28.0 -27.0 -26.0 -25.0 -24.0 -23.0 -22.0 -21.0 -20.0 -19.0 -18.0 -17.0 -16.0 -15.0 -14.0 -13.0 -12.0 -11.0 -10.0 -9.0 -8.0 -7.0 -6.0 -5.0 -4.0 -3.0 -2.0 -1.0 0.0 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.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] #define MONTH_LENGTH 8 // [6 7 8 9 10 11 12 13 14 15 16] #define CUSTOM_MOON_ROTATION diff --git a/shaders/lib/sky_gradient.glsl b/shaders/lib/sky_gradient.glsl index e8995f4..4bef767 100644 --- a/shaders/lib/sky_gradient.glsl +++ b/shaders/lib/sky_gradient.glsl @@ -2,7 +2,7 @@ vec3 drawSun(float cosY, vec3 nsunlight){ - return (nsunlight/0.0008821203*pow(smoothstep(cos(0.0093084168595*3.2*SUN_SIZE),cos(0.0093084168595*2.2*SUN_SIZE),cosY),3.)*0.62); + return (nsunlight/0.0008821203*pow(smoothstep(cos(0.0093084168595*3.2*SUN_SIZE*0.01),cos(0.0093084168595*2.2*SUN_SIZE*0.01),cosY),3.)*0.62); } const float pi = 3.141592653589793238462643383279502884197169; @@ -26,7 +26,7 @@ vec2 sphereMap(vec2 uv) { vec3 drawMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeStars){ - float size = cos(0.034641 * MOON_SIZE); + float size = cos(0.034641 * MOON_SIZE*0.01); float Shape = min(max(dot(WorldSunVec,PlayerPos)-size,0.0)/(1.0-size),1.0);// * clamp(-dot(WorldSunVec,PlayerPos),0,1); occludeStars *= max(1.0-Shape*5.0, 0.0); @@ -58,7 +58,7 @@ vec3 drawMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeSt } vec3 drawRealMoon(vec3 PlayerPos, vec3 WorldSunVec, vec3 Color, inout vec3 occludeStars){ - float size = cos(0.034641 * MOON_SIZE); + float size = cos(0.034641 * MOON_SIZE*0.01); float Shape = min(max(dot(WorldSunVec,PlayerPos)-size,0.0)/(1.0-size),1.0); Shape = pow(Shape, 0.15); diff --git a/shaders/texture/corona.png.mcmeta b/shaders/texture/corona.png.mcmeta new file mode 100644 index 0000000..1902a88 --- /dev/null +++ b/shaders/texture/corona.png.mcmeta @@ -0,0 +1,7 @@ +{ + "texture": + { + "blur": true, + "clamp": true + } +} \ No newline at end of file