mirror of
https://github.com/X0nk/Bliss-Shader.git
synced 2024-12-22 17:47:34 +08:00
DOUBLE CLOUD LAYER TEST VERSION. make ambient sss brightness slider work.
This commit is contained in:
parent
eabc47d999
commit
d90a15e694
@ -12,7 +12,8 @@
|
||||
####### ----- blocks with SSS ----- #######
|
||||
## strong sss
|
||||
block.10004 =minecraft:tall_seagrass minecraft:seagrass minecraft:kelp minecraft:large_fern:half=lower minecraft:tall_grass minecraft:tall_seagrass minecraft:kelp_plant minecraft:peony minecraft:rose_bush minecraft:lilac minecraft:sunflower:half=lower minecraft:packed_ice minecraft:blue_ice minecraft:melon_stem minecraft:pumpkin_stem minecraft:attached_melon_stem minecraft:attached_pumpkin_stem minecraft:lily_pad \
|
||||
westerosblocks:blackberry_bush westerosblocks:blueberry_bush westerosblocks:raspberry_bush westerosblocks:juniper_bush westerosblocks:red_rose_bush westerosblocks:pink_rose_bush westerosblocks:white_rose_bush westerosblocks:yellow_rose_bush westerosblocks:yellow_wildflowers westerosblocks:green_spiny_herb westerosblocks:green_leafy_herb westerosblocks:orange_marigolds westerosblocks:orange_trollius westerosblocks:blue_forgetmenots westerosblocks:pink_wildflowers westerosblocks:yellow_tansy westerosblocks:blue_flax westerosblocks:white_daisies westerosblocks:yellow_daisies westerosblocks:green_scrub_grass westerosblocks:dead_scrub_grass westerosblocks:yellow_bedstraw westerosblocks:orange_bells westerosblocks:blue_bells westerosblocks:blue_swamp_bells westerosblocks:yellow_buttercups westerosblocks:orange_bog_asphodel westerosblocks:yellow_lupine westerosblocks:blue_hyacinth westerosblocks:pink_thistle westerosblocks:yellow_dandelions westerosblocks:yellow_daffodils westerosblocks:yellow_roses westerosblocks:strawberry_bush westerosblocks:white_lilyofthevalley westerosblocks:yellow_bells westerosblocks:yellow_sunflower westerosblocks:white_roses westerosblocks:red_dark_roses westerosblocks:yellow_hellebore westerosblocks:meadow_fescue westerosblocks:red_poppies westerosblocks:red_roses westerosblocks:purple_pansies westerosblocks:purple_roses westerosblocks:orange_sun_star westerosblocks:pink_primrose westerosblocks:red_aster westerosblocks:blue_chicory westerosblocks:red_flowering_spiny_herb westerosblocks:purple_foxglove westerosblocks:pink_allium westerosblocks:purple_violets westerosblocks:white_chamomile westerosblocks:red_tulips westerosblocks:white_peony westerosblocks:purple_alpine_sowthistle westerosblocks:red_carnations westerosblocks:magenta_roses westerosblocks:red_chrysanthemum westerosblocks:blue_orchid westerosblocks:yellow_rudbeckia westerosblocks:pink_tulips westerosblocks:cranberry_bush westerosblocks:purple_lavender westerosblocks:red_sourleaf_bush westerosblocks:pink_sweet_peas westerosblocks:red_sorrel westerosblocks:pink_roses westerosblocks:unshaded_grass westerosblocks:cow_parsely westerosblocks:bracken westerosblocks:lady_fern westerosblocks:nettle westerosblocks:dead_bracken westerosblocks:fireweed westerosblocks:heather westerosblocks:red_fern westerosblocks:dock_leaf westerosblocks:jasmine_vines westerosblocks:dappled_moss westerosblocks:cushion_moss_wall westerosblocks:hemp_short westerosblocks:hemp_tall westerosblocks:hemp_dense westerosblocks:crop_carrots westerosblocks:crop_wheat westerosblocks:crop_turnips westerosblocks:crop_peas westerosblocks:cattails westerosblocks:jungle_tall_fern westerosblocks:jungle_tall_grass westerosblocks:savanna_tall_grass
|
||||
westerosblocks:blackberry_bush westerosblocks:blueberry_bush westerosblocks:raspberry_bush westerosblocks:juniper_bush westerosblocks:red_rose_bush westerosblocks:pink_rose_bush westerosblocks:white_rose_bush westerosblocks:yellow_rose_bush westerosblocks:yellow_wildflowers westerosblocks:green_spiny_herb westerosblocks:green_leafy_herb westerosblocks:orange_marigolds westerosblocks:orange_trollius westerosblocks:blue_forgetmenots westerosblocks:pink_wildflowers westerosblocks:yellow_tansy westerosblocks:blue_flax westerosblocks:white_daisies westerosblocks:yellow_daisies westerosblocks:green_scrub_grass westerosblocks:dead_scrub_grass westerosblocks:yellow_bedstraw westerosblocks:orange_bells westerosblocks:blue_bells westerosblocks:blue_swamp_bells westerosblocks:yellow_buttercups westerosblocks:orange_bog_asphodel westerosblocks:yellow_lupine westerosblocks:blue_hyacinth westerosblocks:pink_thistle westerosblocks:yellow_dandelions westerosblocks:yellow_daffodils westerosblocks:yellow_roses westerosblocks:strawberry_bush westerosblocks:white_lilyofthevalley westerosblocks:yellow_bells westerosblocks:yellow_sunflower westerosblocks:white_roses westerosblocks:red_dark_roses westerosblocks:yellow_hellebore westerosblocks:meadow_fescue westerosblocks:red_poppies westerosblocks:red_roses westerosblocks:purple_pansies westerosblocks:purple_roses westerosblocks:orange_sun_star westerosblocks:pink_primrose westerosblocks:red_aster westerosblocks:blue_chicory westerosblocks:red_flowering_spiny_herb westerosblocks:purple_foxglove westerosblocks:pink_allium westerosblocks:purple_violets westerosblocks:white_chamomile westerosblocks:red_tulips westerosblocks:white_peony westerosblocks:purple_alpine_sowthistle westerosblocks:red_carnations westerosblocks:magenta_roses westerosblocks:red_chrysanthemum westerosblocks:blue_orchid westerosblocks:yellow_rudbeckia westerosblocks:pink_tulips westerosblocks:cranberry_bush westerosblocks:purple_lavender westerosblocks:red_sourleaf_bush westerosblocks:pink_sweet_peas westerosblocks:red_sorrel westerosblocks:pink_roses westerosblocks:unshaded_grass westerosblocks:cow_parsely westerosblocks:bracken westerosblocks:lady_fern westerosblocks:nettle westerosblocks:dead_bracken westerosblocks:fireweed westerosblocks:heather westerosblocks:red_fern westerosblocks:dock_leaf westerosblocks:jasmine_vines westerosblocks:dappled_moss westerosblocks:cushion_moss_wall westerosblocks:hemp_short westerosblocks:hemp_tall westerosblocks:hemp_dense westerosblocks:crop_carrots westerosblocks:crop_wheat westerosblocks:crop_turnips westerosblocks:crop_peas westerosblocks:cattails westerosblocks:jungle_tall_fern westerosblocks:jungle_tall_grass westerosblocks:savanna_tall_grass \
|
||||
# iron_door oak_door spruce_door birch_door jungle_door acacia_door dark_oak_door mangrove_door cherry_door bamboo_door crimson_door warped_door iron_trapdoor oak_trapdoor spruce_trapdoor birch_trapdoor jungle_trapdoor acacia_trapdoor dark_oak_trapdoor mangrove_trapdoor cherry_trapdoor bamboo_trapdoor crimson_trapdoor warped_trapdoor
|
||||
|
||||
## weak sss
|
||||
block.10006 = minecraft:grass_block:snowy=true minecraft:snow_block minecraft:snow powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant vine tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan bamboo bamboo_sapling minecraft:spore_blossom minecraft:cave_vines minecraft:cave_vines_plant minecraft:glow_lichen minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle minecraft:honeycomb_block
|
||||
|
@ -491,7 +491,7 @@ vec3 SubsurfaceScattering_sky(vec3 albedo, float Scattering, float Density){
|
||||
// vec3 scatter = sqrt(exp(-(absorbed * Scattering * 15))) * (1.0 - Scattering);
|
||||
// vec3 scatter = exp(-5 * Scattering)*vec3(1);
|
||||
|
||||
vec3 scatter = exp((Scattering*Scattering) * absorbed * -5) * sqrt(1.0 - Scattering);
|
||||
vec3 scatter = exp((Scattering*Scattering) * absorbed * -5.0) * sqrt(1.0 - Scattering);
|
||||
|
||||
// scatter *= pow(Density,LabSSS_Curve);
|
||||
scatter *= clamp(1 - exp(Density * -10),0,1);
|
||||
@ -640,7 +640,7 @@ void main() {
|
||||
Background += Sky;
|
||||
|
||||
#ifdef VOLUMETRIC_CLOUDS
|
||||
vec4 Clouds = texture2D_bicubic(colortex0, texcoord*CLOUDS_QUALITY);
|
||||
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise);
|
||||
Background = Background * Clouds.a + Clouds.rgb;
|
||||
#endif
|
||||
|
||||
@ -839,6 +839,7 @@ void main() {
|
||||
float SkylightDir = ambientcoefs.y*1.5;
|
||||
if(isGrass) SkylightDir = 1.25;
|
||||
|
||||
|
||||
float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.25 + (1.0-lightmap.y) * 0.75) ;
|
||||
|
||||
AmbientLightColor *= skylight;
|
||||
@ -949,7 +950,7 @@ void main() {
|
||||
SkySSS = ScreenSpace_SSS(viewPos, FlatNormals, hand, isLeaf, noise);
|
||||
#endif
|
||||
|
||||
vec3 ambientColor = (averageSkyCol_Clouds / 10.0);
|
||||
vec3 ambientColor = averageSkyCol_Clouds / 12.0; // divide by 12 to match the brightest part of ambient light facing up
|
||||
float skylightmap = pow(lightmap.y,3);
|
||||
|
||||
Indirect_SSS = SubsurfaceScattering_sky(albedo, SkySSS, LabSSS);
|
||||
@ -961,7 +962,7 @@ void main() {
|
||||
SSS_forSky *= skylightmap;
|
||||
|
||||
//light up dark parts so its more visible
|
||||
Indirect_lighting = max(Indirect_lighting, SSS_forSky);
|
||||
Indirect_lighting = max(Indirect_lighting, SSS_forSky * ambientsss_brightness);
|
||||
|
||||
// apply to ambient light.
|
||||
Indirect_lighting = max(Indirect_lighting, Indirect_SSS * ambientsss_brightness);
|
||||
|
@ -174,6 +174,20 @@ vec3 viewToWorld(vec3 viewPosition) {
|
||||
void applyContrast(inout vec3 color, float contrast){
|
||||
color = ((color - 0.5) * max(contrast, 0.0)) + 0.5;
|
||||
}
|
||||
|
||||
void ApplyDistortion(inout vec2 Texcoord, vec2 TangentNormals, vec2 depths){
|
||||
|
||||
vec2 UnalteredTexcoord = Texcoord;
|
||||
|
||||
// Texcoord = min(Texcoord, 1.0-abs(Texcoord));
|
||||
|
||||
Texcoord = abs(Texcoord + (TangentNormals * clamp((ld(depths.x) - ld(depths.y)) * 0.5,0.0,0.15)) * RENDER_SCALE );
|
||||
|
||||
float DistortedAlpha = decodeVec2(texture2D(colortex11,Texcoord).b).g;
|
||||
|
||||
if(DistortedAlpha <= 0.001) Texcoord = UnalteredTexcoord; // remove distortion on non-translucents
|
||||
}
|
||||
|
||||
void main() {
|
||||
/* DRAWBUFFERS:73 */
|
||||
|
||||
@ -234,12 +248,18 @@ void main() {
|
||||
|
||||
/// --- REFRACTION --- ///
|
||||
#ifdef Refraction
|
||||
refractedCoord += (tangentNormals * clamp((ld(z2) - ld(z)) * 0.5,0.0,0.15)) * RENDER_SCALE;
|
||||
// refractedCoord += tangentNormals * 0.1 * RENDER_SCALE;
|
||||
// refractedCoord = clamp(refractedCoord + (tangentNormals * clamp((ld(z2) - ld(z)) * 0.5,0.0,0.15)) * RENDER_SCALE ,-1.0,1.0);
|
||||
|
||||
float refractedalpha = decodeVec2(texture2D(colortex11,refractedCoord).b).g;
|
||||
float refractedalpha2 = texture2D(colortex7,refractedCoord).a;
|
||||
if( refractedalpha <= 0.001 || z < 0.56) refractedCoord = texcoord; // remove refracted coords on solids
|
||||
// // refractedCoord = clamp(refractedCoord - tangentNormals, refractedCoord-0.5,refractedCoord);
|
||||
|
||||
// // if(tangentNormals.xy <= vec2(0.0, 0.0) ) refractedCoord = abs(refractedCoord - tangentNormals);
|
||||
// // refractedCoord += tangentNormals * 0.1 * RENDER_SCALE;
|
||||
|
||||
// float refractedalpha = decodeVec2(texture2D(colortex11,refractedCoord).b).g;
|
||||
// // float refractedalpha2 = texture2D(colortex7,refractedCoord).a;
|
||||
// if( refractedalpha <= 0.001) refractedCoord = texcoord; // remove refracted coords on solids
|
||||
|
||||
ApplyDistortion(refractedCoord, tangentNormals, vec2(z2,z));
|
||||
#endif
|
||||
|
||||
/// --- MAIN COLOR BUFFER --- ///
|
||||
|
@ -334,13 +334,15 @@ uniform int moonPhase;
|
||||
|
||||
#define Daily_Weather
|
||||
|
||||
#define Cloud_Speed 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]
|
||||
#define Cloud_Speed 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 3.0 4.0 5.0 6.0 7.0 8.0 9.0 10.0]
|
||||
|
||||
#define Cumulus
|
||||
#define Cumulus_coverage 0.7 // [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]
|
||||
#define Cumulus_density 0.5 // [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.00]
|
||||
#define Cumulus_height 250 // [-100 -90 -80 -70 -60 -50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160 170 180 190 200 210 220 230 240 250 260 270 280 290 300 310 320 330 340 350 360 370 380 390 400 410 420 430 440 450 460 470 480 490 500 510 520 530 540 550 560 570 580 590 600 700 800 900 1000]
|
||||
|
||||
#define Cumulus2_coverage 0.7 // [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]
|
||||
|
||||
|
||||
#define Altostratus
|
||||
#define Alto_coverage 0.1 // [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]
|
||||
|
@ -99,6 +99,35 @@ vec4 texture2D_bicubic(sampler2D tex, vec2 uv)
|
||||
g1(fuv.y) * (g0x * texture2D(tex, p2) +
|
||||
g1x * texture2D(tex, p3));
|
||||
}
|
||||
vec4 texture2D_bicubic_offset(sampler2D tex, vec2 uv, float noise)
|
||||
{
|
||||
float offsets = noise * (2.0 * 3.141592653589793238462643383279502884197169);
|
||||
vec2 circleOffsets = vec2(sin(offsets), cos(offsets));
|
||||
|
||||
vec4 texelSize = vec4(texelSize,1.0/texelSize);
|
||||
uv = uv*texelSize.zw;
|
||||
|
||||
vec2 iuv = floor( uv + circleOffsets );
|
||||
vec2 fuv = fract( uv + circleOffsets );
|
||||
|
||||
float g0x = g0(fuv.x);
|
||||
float g1x = g1(fuv.x);
|
||||
float h0x = h0(fuv.x);
|
||||
float h1x = h1(fuv.x);
|
||||
float h0y = h0(fuv.y);
|
||||
float h1y = h1(fuv.y);
|
||||
|
||||
vec2 p0 = (vec2(iuv.x + h0x, iuv.y + h0y) - 0.5) * (texelSize.xy);
|
||||
vec2 p1 = (vec2(iuv.x + h1x, iuv.y + h0y) - 0.5) * (texelSize.xy);
|
||||
vec2 p2 = (vec2(iuv.x + h0x, iuv.y + h1y) - 0.5) * (texelSize.xy);
|
||||
vec2 p3 = (vec2(iuv.x + h1x, iuv.y + h1y) - 0.5) * (texelSize.xy);
|
||||
|
||||
return (g0(fuv.y) * (g0x * texture2D(tex, p0) +
|
||||
g1x * texture2D(tex, p1)) +
|
||||
g1(fuv.y) * (g0x * texture2D(tex, p2) +
|
||||
g1x * texture2D(tex, p3)));
|
||||
}
|
||||
|
||||
vec2 sphereToCarte(vec3 dir) {
|
||||
float lonlat = atan(-dir.x, -dir.z);
|
||||
return vec2(lonlat * (0.5/pi) +0.5,0.5*dir.y+0.5);
|
||||
|
@ -46,29 +46,50 @@ float densityAtPos(in vec3 pos){
|
||||
return mix(xy.r,xy.g, f.y);
|
||||
}
|
||||
|
||||
float cloudCov(in vec3 pos,vec3 samplePos){
|
||||
float cloudCov(in vec3 pos, vec3 samplePos, float minHeight, float maxHeight){
|
||||
float FinalCloudCoverage = 0.0;
|
||||
vec2 SampleCoords0 = (samplePos.xz + cloud_movement) / 5000;
|
||||
vec2 SampleCoords1 = (samplePos.xz - cloud_movement) / 500;
|
||||
|
||||
float CloudLarge = texture2D(noisetex, (samplePos.xz + cloud_movement) / 5000 ).b;
|
||||
float CloudSmall = texture2D(noisetex, (samplePos.xz - cloud_movement) / 500 ).r;
|
||||
|
||||
|
||||
float Topshape = max(pos.y - (MaxCumulusHeight - 75), 0.0) / 200;
|
||||
Topshape += max(exp((pos.y - MaxCumulusHeight) / 10.0 ), 0.0) ;
|
||||
|
||||
float coverage = abs(pow(CloudLarge,1)*2.0 - 1.2)*0.5 - (1.0-CloudSmall);
|
||||
float FinalShape = DailyWeather_Cumulus(coverage) - Topshape;
|
||||
|
||||
// cap the top and bottom for reasons
|
||||
float capbase = sqrt(max((CumulusHeight+12.5) - pos.y, 0.0)/50) * (1-rainStrength);
|
||||
float captop = max(pos.y - MaxCumulusHeight, 0.0);
|
||||
/// when the coordinates reach a certain height, alter the sample coordinates
|
||||
if(max(pos.y - (maxHeight + 80),0.0) > 0.0){
|
||||
SampleCoords0 = -( (samplePos.zx + cloud_movement*2) / 15000);
|
||||
SampleCoords1 = -( (samplePos.zx - cloud_movement*2) / 1500);
|
||||
}
|
||||
|
||||
FinalShape = max(FinalShape - capbase - captop , 0.0);
|
||||
float CloudLarge = texture2D(noisetex, SampleCoords0 ).b;
|
||||
float CloudSmall = texture2D(noisetex, SampleCoords1 ).r;
|
||||
|
||||
return FinalShape;
|
||||
float coverage = abs(pow(CloudLarge,1)*2.0 - 1.2)*0.5 - (1.0-CloudSmall);
|
||||
float FirstLayerCoverage = DailyWeather_Cumulus(coverage);
|
||||
|
||||
/////// FIRST LAYER
|
||||
float layer0 = min(min(FirstLayerCoverage, clamp(maxHeight - pos.y,0,1)), 1.0 - clamp(minHeight - pos.y,0,1));
|
||||
|
||||
float Topshape = max(pos.y - (maxHeight - 75),0.0) / 200.0;
|
||||
Topshape += max(pos.y - (maxHeight - 10),0.0) / 50.0;
|
||||
|
||||
float Baseshape = max(minHeight + 12.5 - pos.y, 0.0) / 50.0;
|
||||
|
||||
FinalCloudCoverage += max(layer0 - Topshape - Baseshape,0.0);
|
||||
|
||||
/////// SECOND LAYER
|
||||
float layer1 = min(min(coverage+Cumulus2_coverage, clamp(maxHeight + 200 - pos.y,0,1)), 1.0 - clamp(minHeight + 200 - pos.y,0,1));
|
||||
|
||||
Topshape = max(pos.y - (maxHeight - 75 + 200), 0.0) / 200;
|
||||
Topshape += max(pos.y - (maxHeight - 10 + 200), 0.0) / 50;
|
||||
Baseshape = max(minHeight + 12.5 + 200 - pos.y, 0.0) / 50.0;
|
||||
|
||||
FinalCloudCoverage += max(layer1 - Topshape - Baseshape ,0.0);
|
||||
|
||||
return FinalCloudCoverage ;
|
||||
}
|
||||
|
||||
//Erode cloud with 3d Perlin-worley noise, actual cloud value
|
||||
float cloudVol(in vec3 pos,in vec3 samplePos,in float cov, in int LoD){
|
||||
float cloudVol(in vec3 pos,in vec3 samplePos,in float cov, in int LoD, float minHeight, float maxHeight){
|
||||
float upperPlane = 1.0 - clamp(pos.y - (maxHeight + 80),0.0,1.0);
|
||||
|
||||
|
||||
float noise = 0.0 ;
|
||||
float totalWeights = 0.0;
|
||||
float pw = log(fbmPower1);
|
||||
@ -76,30 +97,34 @@ float cloudVol(in vec3 pos,in vec3 samplePos,in float cov, in int LoD){
|
||||
|
||||
samplePos.xz -= cloud_movement/4;
|
||||
|
||||
samplePos.xz += pow( max(pos.y - (CumulusHeight+20), 0.0) / 20.0,1.50);
|
||||
samplePos.xz += pow( max(pos.y - (minHeight+20), 0.0) / 20.0,1.50) * upperPlane;
|
||||
|
||||
noise += 1.0-densityAtPos(samplePos * 200.) ;
|
||||
noise += (1.0-densityAtPos(samplePos * mix(100.0,200.0,upperPlane)) ) * mix(2.0,1.0,upperPlane);
|
||||
|
||||
if (LoD > 0) {
|
||||
float smallnoise = densityAtPos(samplePos * mix(450.0,600.0,upperPlane));
|
||||
noise += ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.6 * sqrt(noise);
|
||||
}
|
||||
|
||||
float smallnoise = densityAtPos(samplePos * 600.);
|
||||
if (LoD > 0) noise += ((1-smallnoise) - max(0.15 - abs(smallnoise * 2.0 - 0.55) * 0.5,0.0)*1.5) * 0.6 * sqrt(noise);
|
||||
noise *= 1.0-cov;
|
||||
|
||||
|
||||
noise = noise*noise;
|
||||
noise = noise*noise * (upperPlane*0.5+0.5);
|
||||
float cloud = max(cov - noise*noise*fbmAmount,0.0);
|
||||
|
||||
return cloud;
|
||||
}
|
||||
|
||||
float GetCumulusDensity(in vec3 pos, in int LoD){
|
||||
float GetCumulusDensity(in vec3 pos, in int LoD, float minHeight, float maxHeight){
|
||||
|
||||
vec3 samplePos = pos*vec3(1.0,1./48.,1.0)/4;
|
||||
|
||||
float coverageSP = cloudCov(pos,samplePos);
|
||||
float coverageSP = cloudCov(pos,samplePos, minHeight, maxHeight);
|
||||
|
||||
// return coverageSP;
|
||||
if (coverageSP > 0.001) {
|
||||
if (LoD < 0) return max(coverageSP - 0.27*fbmAmount,0.0);
|
||||
return cloudVol(pos,samplePos,coverageSP,LoD);
|
||||
return cloudVol(pos,samplePos,coverageSP,LoD ,minHeight, maxHeight) ;
|
||||
} else return 0.0;
|
||||
}
|
||||
|
||||
@ -110,9 +135,6 @@ float GetAltostratusDensity(vec3 pos){
|
||||
|
||||
float shape = (small + pow((1.0-large),2.0))/2.0;
|
||||
|
||||
// float erode = 1-texture2D(noisetex, (pos.xz / ((1-small)*0.5+1.0) - cloud_movement)/1000. + vec2(-small,1-small)/5).b;
|
||||
// float shape = max((small + pow((1.0-large),2.0))/2.0 - erode*0.05,0.0);
|
||||
|
||||
float Coverage; float Density;
|
||||
DailyWeather_Alto(Coverage, Density);
|
||||
|
||||
@ -136,54 +158,35 @@ float phaseg(float x, float g){
|
||||
|
||||
|
||||
// random magic number bullshit go!
|
||||
vec3 Cloud_lighting(
|
||||
float CloudShape,
|
||||
float SkyShadowing,
|
||||
float SunShadowing,
|
||||
float MoonShadowing,
|
||||
vec3 SkyColors,
|
||||
vec3 sunContribution,
|
||||
vec3 sunContributionMulti,
|
||||
vec3 moonContribution,
|
||||
float AmbientShadow,
|
||||
int cloudType,
|
||||
vec3 pos,
|
||||
float time
|
||||
vec3 DoCloudLighting(
|
||||
float density,
|
||||
float densityFaded,
|
||||
|
||||
vec3 skyLightCol,
|
||||
float skyScatter,
|
||||
|
||||
float sunShadows,
|
||||
vec3 sunScatter,
|
||||
vec3 sunMultiScatter
|
||||
|
||||
// float moonShadows,
|
||||
// vec3 moonScatter
|
||||
){
|
||||
// float powder = 1.0 - exp((CloudShape*CloudShape) * -800);
|
||||
float powder = 1.0 - exp(CloudShape * -10);
|
||||
float powder = 1.0 - exp(densityFaded * -10);
|
||||
float lesspowder = powder*0.4+0.6;
|
||||
|
||||
vec3 skyLighting = SkyColors;
|
||||
vec3 skyLight = skyLightCol;
|
||||
|
||||
#ifdef Altostratus
|
||||
/// a special conditon where scattered light exiting altocumulus clouds come down onto the cumulus clouds below.
|
||||
float cov = 0.0;
|
||||
float den = 0.0;
|
||||
DailyWeather_Alto(cov, den);
|
||||
skyLight *= exp2((skyScatter*skyScatter) * densityFaded * -35.0) * lesspowder;
|
||||
// skyLight *= exp(skyScatter * -10);
|
||||
|
||||
skyLighting += sunContributionMulti * 0.3 * exp2(AmbientShadow * SkyShadowing * -20) * clamp( 1.0 - pow( abs(den - 0.35) * 4.0 , 5.0) ,0.0,1.0) * cov;
|
||||
#endif
|
||||
vec3 sunLight = exp(sunShadows * -15 + powder ) * sunScatter;
|
||||
sunLight += exp(sunShadows * -4) * sunMultiScatter * (powder*0.7+0.3);
|
||||
|
||||
// skyLighting *= (1.0 - sqrt(exp2((1.0-SkyShadowing) * AmbientShadow * -10))) * lesspowder ;
|
||||
skyLighting *= exp2((AmbientShadow*AmbientShadow) * SkyShadowing * -35) * lesspowder;
|
||||
// vec3 moonLighting = exp(MoonShadowing * -7 + powder) * moonContribution;
|
||||
|
||||
|
||||
|
||||
|
||||
vec3 sunLighting = exp(SunShadowing * -15 + powder ) * sunContribution ;
|
||||
sunLighting += exp(SunShadowing * -4) * sunContributionMulti * (powder*0.7+0.3);
|
||||
|
||||
vec3 moonLighting = exp(MoonShadowing * -7 + powder) * moonContribution;
|
||||
|
||||
if(cloudType == 1){
|
||||
skyLighting = SkyColors * exp(-sqrt(SkyShadowing)) * lesspowder;
|
||||
|
||||
sunLighting = exp(SunShadowing * -5 ) * sunContribution;
|
||||
sunLighting += exp(SunShadowing * -1) * sunContributionMulti * powder;
|
||||
}
|
||||
|
||||
return skyLighting + moonLighting + sunLighting ;
|
||||
return skyLight + sunLight;
|
||||
}
|
||||
|
||||
vec4 renderClouds(
|
||||
@ -192,176 +195,122 @@ vec4 renderClouds(
|
||||
vec3 SunColor,
|
||||
vec3 MoonColor,
|
||||
vec3 SkyColor
|
||||
){
|
||||
){
|
||||
|
||||
#ifndef VOLUMETRIC_CLOUDS
|
||||
return vec4(0.0,0.0,0.0,1.0);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
float total_extinction = 1.0;
|
||||
vec3 color = vec3(0.0);
|
||||
//project pixel position into projected shadowmap space
|
||||
vec4 viewPos = normalize(gbufferModelViewInverse*vec4(FragPosition,1.0));
|
||||
vec3 eyeplayepos = normalize(mat3(gbufferModelViewInverse) * FragPosition.xyz);
|
||||
|
||||
maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
|
||||
|
||||
vec3 dV_view = normalize(viewPos.xyz);
|
||||
vec3 dV_view2 = dV_view;
|
||||
|
||||
dV_view.y += 0.05;
|
||||
|
||||
//setup ray to start at the start of the cloud plane and end at the end of the cloud plane
|
||||
dV_view *= max(MaxCumulusHeight - CumulusHeight, 0.0)/abs(dV_view.y)/maxIT_clouds;
|
||||
|
||||
float mult = length(dV_view);
|
||||
|
||||
// i want the samples to stay at one point in the world, but as the height coordinates go negative everything goes insideout, so this is a work around....
|
||||
float startFlip = mix(max(cameraPosition.y - MaxCumulusHeight,0.0), max(CumulusHeight-cameraPosition.y,0), clamp(dV_view.y,0,1));
|
||||
vec3 progress_view = dV_view*Dither.x + cameraPosition + (dV_view/abs(dV_view.y))*startFlip ;
|
||||
|
||||
|
||||
// thank you emin for this world interseciton thing
|
||||
// float lViewPosM = length(FragPosition) < far * 1.5 ? length(FragPosition) - 1.0 : 1000000000.0;
|
||||
// bool IntersecTerrain = false;
|
||||
|
||||
////// lighting stuff
|
||||
float shadowStep = 200.;
|
||||
// vec3 dV_Sun = normalize(mat3(gbufferModelViewInverse)*sunVec)*shadowStep;
|
||||
|
||||
vec3 dV_Sun = WsunVec*shadowStep;
|
||||
// vec3 dV_Sun_small = dV_Sun/shadowStep;
|
||||
|
||||
float SdotV = dot(mat3(gbufferModelView)*WsunVec,normalize(FragPosition));
|
||||
// if(dV_Sun.y/shadowStep < -0.1) dV_Sun = -dV_Sun;
|
||||
|
||||
float mieDay = phaseg(SdotV, 0.75);
|
||||
float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ;
|
||||
|
||||
vec3 sunScattering = SunColor * mieDay * 3.14;
|
||||
vec3 sunMultiScattering = SunColor * mieDayMulti * 4.0;
|
||||
|
||||
SkyColor *= clamp(abs(dV_Sun.y)/100.,0.5,1.0);
|
||||
SunColor = SunColor * clamp(dV_Sun.y ,0.0,1.0);
|
||||
MoonColor *= clamp(-dV_Sun.y,0.0,1.0);
|
||||
|
||||
#ifdef ambientLight_only
|
||||
SunColor = vec3(0.0);
|
||||
MoonColor = vec3(0.0);
|
||||
#endif
|
||||
|
||||
if(dV_Sun.y/shadowStep < -0.1) dV_Sun = -dV_Sun;
|
||||
|
||||
|
||||
|
||||
|
||||
// first cloud layer
|
||||
float MinHeight_0 = Cumulus_height;
|
||||
float MaxHeight_0 = 100 + MinHeight_0;
|
||||
|
||||
// second cloud layer
|
||||
float MinHeight_1 = MaxHeight_0 + 50;
|
||||
float MaxHeight_1 = 100 + MinHeight_1;
|
||||
|
||||
float allDensities = Cumulus_density;
|
||||
float StepSize = 200;
|
||||
|
||||
//project pixel position into projected shadowmap space
|
||||
vec4 viewPos = normalize(gbufferModelViewInverse * vec4(FragPosition,1.0) );
|
||||
|
||||
// maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
|
||||
|
||||
maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT));
|
||||
// maxIT_clouds = 30;
|
||||
|
||||
float mieDay = phaseg(SdotV, 0.75);
|
||||
float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ;
|
||||
vec3 dV_view = normalize(viewPos.xyz);
|
||||
|
||||
vec3 sunContribution = SunColor * mieDay * 3.14;
|
||||
vec3 sunContributionMulti = SunColor * mieDayMulti * 4.0;
|
||||
// dV_view.y += 0.05; /// cloud plane curvature
|
||||
|
||||
float mieNight = (phaseg(-SdotV,0.8) + phaseg(-SdotV, 0.35)*4);
|
||||
vec3 moonContribution = MoonColor * mieNight;
|
||||
dV_view *= 300/abs(dV_view.y)/maxIT_clouds;
|
||||
float mult = length(dV_view);
|
||||
|
||||
float timing = 1.0 - clamp(pow(abs(dV_Sun.y)/150.0,2.0),0.0,1.0);
|
||||
float startFlip = mix(max(cameraPosition.y - MaxHeight_0 - 200,0.0), max(MinHeight_0 - cameraPosition.y,0), clamp(dV_view.y,0,1));
|
||||
vec3 progress_view = dV_view*Dither.x + cameraPosition + dV_view/abs(dV_view.y) * startFlip;
|
||||
|
||||
|
||||
|
||||
|
||||
#ifdef Cumulus
|
||||
|
||||
|
||||
for(int i=0;i<maxIT_clouds;i++) {
|
||||
|
||||
// IntersecTerrain = length(progress_view - cameraPosition) > lViewPosM;
|
||||
// if(IntersecTerrain) break;
|
||||
|
||||
float cumulus = GetCumulusDensity(progress_view, 1) ;
|
||||
// cumulus = max(cumulus - (1-texture2D(noisetex, (eyeplayepos + cameraPosition / 500).xz*10).b)*0.1, 0.0 );
|
||||
#ifdef Cumulus
|
||||
for(int i = 0; i < maxIT_clouds; i++) {
|
||||
|
||||
float alteredDensity = Cumulus_density * clamp(exp( (progress_view.y - (MaxCumulusHeight - 75)) / 9.0 ),0.0,1.0);
|
||||
// determine the base of each cloud layer
|
||||
bool isUpperLayer = max(progress_view.y - MinHeight_1,0.0) > 0.0;
|
||||
float CloudBaseHeights = isUpperLayer ? 200.0 + MaxHeight_0 : MaxHeight_0;
|
||||
|
||||
// if(isUpperLayer) allDensities = 0.25;
|
||||
float cumulus = GetCumulusDensity(progress_view, 1, MinHeight_0, MaxHeight_0);
|
||||
|
||||
float fadedDensity = allDensities * clamp(exp( (progress_view.y - (CloudBaseHeights - 70)) / 9.0 ),0.0,1.0);
|
||||
|
||||
if(cumulus > 1e-5){
|
||||
float muE = cumulus*alteredDensity;
|
||||
float muE = cumulus*fadedDensity;
|
||||
|
||||
float Sunlight = 0.0;
|
||||
float MoonLight = 0.0;
|
||||
float sunLight = 0.0;
|
||||
// float MoonLight = 0.0;
|
||||
for (int j=0; j < 3; j++){
|
||||
|
||||
// vec3 shadowSamplePos = progress_view + dV_Sun * (shadowStepSize[j] + Dither.y*shadowdither[j]);
|
||||
// float shadow = GetCumulusDensity(shadowSamplePos, max(1-j,0)) * Cumulus_density;
|
||||
|
||||
vec3 shadowSamplePos = progress_view + dV_Sun * (0.1 + j * (0.1 + Dither.y*0.05));
|
||||
float shadow = GetCumulusDensity(shadowSamplePos, 0) * Cumulus_density;
|
||||
float shadow = GetCumulusDensity(shadowSamplePos, 0, MinHeight_0, MaxHeight_0) * allDensities;
|
||||
|
||||
Sunlight += shadow;
|
||||
MoonLight += shadow;
|
||||
sunLight += shadow;
|
||||
// MoonLight += shadow;
|
||||
}
|
||||
|
||||
#ifdef Altostratus
|
||||
// cast a shadow from higher clouds onto lower clouds
|
||||
vec3 HighAlt_shadowPos = progress_view + dV_Sun/abs(dV_Sun.y) * max(AltostratusHeight - progress_view.y,0.0);
|
||||
float HighAlt_shadow = GetAltostratusDensity(HighAlt_shadowPos);
|
||||
Sunlight += HighAlt_shadow;
|
||||
#endif
|
||||
|
||||
if(max(progress_view.y - MaxHeight_1 + 20,0.0) < 1.0) sunLight += allDensities * 2.0 * GetCumulusDensity(progress_view + dV_Sun/abs(dV_Sun.y) * max(MaxHeight_1 - progress_view.y,0.0), 0, MinHeight_0, MaxHeight_0);
|
||||
|
||||
// float ambientlightshadow = 1.0 - clamp(exp((progress_view.y - (MaxCumulusHeight - 50)) / 100.0),0.0,1.0) ;
|
||||
float ambientlightshadow = clamp((MaxCumulusHeight - progress_view.y - 50) / 100.0, 0.0,1.0);
|
||||
|
||||
vec3 S = Cloud_lighting(muE, cumulus*Cumulus_density, Sunlight, MoonLight, SkyColor, sunContribution, sunContributionMulti, moonContribution, ambientlightshadow, 0, progress_view, WsunVec.y);
|
||||
|
||||
#ifndef TEST
|
||||
S += Iris_Lightningflash_VLcloud(progress_view - cameraPosition, lightningBoltPosition.xyz) * ambientlightshadow * exp(muE * -10.0) ;
|
||||
#endif
|
||||
float skyScatter = clamp((CloudBaseHeights - 20 - progress_view.y) / 275.0,0.0,1.0);
|
||||
|
||||
vec3 Sint = (S - S * exp(-mult*muE)) / max(muE,1e-5);
|
||||
color += max(muE*Sint*total_extinction,0.0);
|
||||
vec3 Lighting = DoCloudLighting(muE, cumulus, SkyColor, skyScatter, sunLight, sunScattering, sunMultiScattering);
|
||||
|
||||
// Lighting = vec3(1,0,0) * 30 * cumulus;
|
||||
// if(max(progress_view.y - MaxHeight_0,0.0) > 0.0) Lighting = vec3(0,1,0) * 30 * cumulus;
|
||||
// if(max(progress_view.y - MaxHeight_0 - 99,0.0) > 0.0) Lighting = vec3(0,0,1) * 30 * cumulus;
|
||||
|
||||
color += max(Lighting - Lighting*exp(-mult*muE),0.0) * total_extinction;
|
||||
total_extinction *= max(exp(-mult*muE),0.0);
|
||||
|
||||
|
||||
if (total_extinction < 1e-5) break;
|
||||
}
|
||||
|
||||
progress_view += dV_view;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef Altostratus
|
||||
if (max(AltostratusHeight-cameraPosition.y,0.0)/max(normalize(dV_view).y,0.0) / 100000.0 < AltostratusHeight) {
|
||||
|
||||
vec3 progress_view_high = dV_view2 + cameraPosition + dV_view2/dV_view2.y * max(AltostratusHeight-cameraPosition.y,0.0);
|
||||
float altostratus = GetAltostratusDensity(progress_view_high);
|
||||
|
||||
float Sunlight = 0.0;
|
||||
float MoonLight = 0.0;
|
||||
|
||||
if(altostratus > 1e-5){
|
||||
for (int j = 0; j < 2; j++){
|
||||
|
||||
vec3 shadowSamplePos_high = progress_view_high + (dV_Sun * (1.0 - abs(WsunVec.y))) * (1 + j + Dither.y);
|
||||
float shadow = GetAltostratusDensity(shadowSamplePos_high);
|
||||
Sunlight += shadow / (1 + j);
|
||||
|
||||
// vec3 shadowSamplePos_high = progress_view_high + dV_Sun * float(j+Dither.y);
|
||||
// float shadow = GetAltostratusDensity(shadowSamplePos_high);
|
||||
// Sunlight += shadow;
|
||||
}
|
||||
vec3 S = Cloud_lighting(altostratus, altostratus, Sunlight, MoonLight, SkyColor, sunContribution, sunContributionMulti, moonContribution, 1, 1, progress_view_high, timing);
|
||||
|
||||
vec3 Sint = (S - S * exp(-mult*altostratus)) / max(altostratus,1e-5);
|
||||
color += max(altostratus*Sint*total_extinction,0.0);
|
||||
total_extinction *= max(exp(-mult*altostratus),0.0);
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
vec3 normView = normalize(dV_view);
|
||||
|
||||
// Assume fog color = sky gradient at long distance
|
||||
vec4 fogColor = vec4(skyFromTex(normView, colortex4)/30.0, 0.0);
|
||||
float fog = clamp(abs(max(cameraPosition.y, 255.0) + MaxCumulusHeight) / max(abs(CumulusHeight-cameraPosition.y),0.00001) * abs(normView.y/1.5),0,1);
|
||||
float fog = clamp(abs(max(cameraPosition.y, 255.0) + MaxHeight_0) / max(abs(MinHeight_0-cameraPosition.y),0.00001) * abs(normView.y/1.5),0,1);
|
||||
|
||||
// fog = pow(1.0 - exp(fog * -(5 - rainStrength*3)),2.0);
|
||||
fog = 1.0 - clamp(exp((fog*fog) * -5.0),0.0,1.0);
|
||||
fog = 1.0 - clamp(exp((fog*fog) * -35.0),0.0,1.0);
|
||||
|
||||
// fog = 1.0;
|
||||
|
||||
// if(IntersecTerrain) fog = 1.0;
|
||||
// return vec4(vec3(fog),0.0);
|
||||
return mix(fogColor, vec4(color, total_extinction), clamp(fog,0.0,1.0));
|
||||
// return vec4(color, total_extinction);
|
||||
}
|
||||
|
||||
#endif
|
||||
@ -369,21 +318,30 @@ vec4 renderClouds(
|
||||
|
||||
float GetCloudShadow(vec3 feetPlayerPos){
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
float MinHeight_0 = Cumulus_height;
|
||||
float MaxHeight_0 = 100 + MinHeight_0;
|
||||
|
||||
|
||||
vec3 playerPos = feetPlayerPos + cameraPosition;
|
||||
|
||||
float shadow = 0.0;
|
||||
|
||||
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
|
||||
#ifdef Cumulus
|
||||
|
||||
vec3 lowShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max((MaxCumulusHeight - 70) - playerPos.y,0.0) ;
|
||||
shadow += GetCumulusDensity(lowShadowStart, 1)*Cumulus_density;
|
||||
shadow += GetCumulusDensity(lowShadowStart, 1, MinHeight_0, MaxHeight_0)*Cumulus_density;
|
||||
|
||||
vec3 higherShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max((MaxCumulusHeight + 200 - 70) - playerPos.y,0.0) ;
|
||||
shadow += GetCumulusDensity(higherShadowStart, 0, MinHeight_0, MaxHeight_0)*Cumulus_density;
|
||||
#endif
|
||||
|
||||
#ifdef Altostratus
|
||||
vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max(AltostratusHeight - playerPos.y,0.0);
|
||||
shadow += GetAltostratusDensity(highShadowStart) * 0.5;
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// #ifdef Altostratus
|
||||
// vec3 highShadowStart = playerPos + (WsunVec / max(abs(WsunVec.y),0.2)) * max(AltostratusHeight - playerPos.y,0.0);
|
||||
// shadow += GetAltostratusDensity(highShadowStart) * 0.5;
|
||||
// #endif
|
||||
|
||||
shadow = clamp(shadow,0.0,1.0);
|
||||
shadow *= shadow;
|
||||
@ -398,11 +356,19 @@ float GetCloudShadow(vec3 feetPlayerPos){
|
||||
}
|
||||
float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
float MinHeight_0 = Cumulus_height;
|
||||
float MaxHeight_0 = 100 + MinHeight_0;
|
||||
|
||||
float shadow = 0.0;
|
||||
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
|
||||
#ifdef Cumulus
|
||||
vec3 lowShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.2)) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ;
|
||||
shadow += max(GetCumulusDensity(lowShadowStart, 0), 0.0)*Cumulus_density;
|
||||
shadow += max(GetCumulusDensity(lowShadowStart, 0,MinHeight_0,MaxHeight_0), 0.0)*Cumulus_density;
|
||||
|
||||
|
||||
vec3 higherShadowStart = WorldPos + (WorldSpace_sunVec / max(abs(WorldSpace_sunVec.y),0.2)) * max((MaxCumulusHeight + 200 - 60) - WorldPos.y,0.0) ;
|
||||
shadow += max(GetCumulusDensity(higherShadowStart, 0,MinHeight_0,MaxHeight_0), 0.0)*Cumulus_density;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef Altostratus
|
||||
@ -420,26 +386,4 @@ float GetCloudShadow_VLFOG(vec3 WorldPos, vec3 WorldSpace_sunVec){
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}
|
||||
|
||||
float GetCloudSkyOcclusion(vec3 WorldPos){
|
||||
#ifdef CLOUDS_SHADOWS
|
||||
float shadow = 0.0;
|
||||
|
||||
vec3 shadowDir = vec3(0,1,0);
|
||||
|
||||
|
||||
// assume a flat layer of cloud, and stretch the sampled density along the sunvector, starting from some vertical layer in the cloud.
|
||||
#ifdef Cumulus
|
||||
vec3 lowShadowStart = WorldPos + shadowDir/abs(shadowDir.y) * max((MaxCumulusHeight - 60) - WorldPos.y,0.0) ;
|
||||
shadow += GetCumulusDensity(lowShadowStart,0)*Cumulus_density;
|
||||
#endif
|
||||
|
||||
|
||||
shadow = clamp(exp(-shadow*25.0) ,0.0,1.0);
|
||||
|
||||
return shadow;
|
||||
#else
|
||||
return 1.0;
|
||||
#endif
|
||||
}
|
@ -66,7 +66,7 @@ alphaTest.gbuffers_skybasic=false
|
||||
alphaTest.gbuffers_skytextured=false
|
||||
|
||||
|
||||
sliders = WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS R_UPPER_CURVE R_LOWER_CURVE G_UPPER_CURVE G_LOWER_CURVE B_UPPER_CURVE B_LOWER_CURVE UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR CompSky_R CompSky_G CompSky_B ambientsss_brightness SSS_TYPE Cloud_Speed Cumulus_height Cumulus_coverage Cumulus_density Alto_coverage Alto_density ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount ambient_temp Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance FinalR FinalG FinalB Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH
|
||||
sliders = Cumulus2_coverage WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS R_UPPER_CURVE R_LOWER_CURVE G_UPPER_CURVE G_LOWER_CURVE B_UPPER_CURVE B_LOWER_CURVE UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR CompSky_R CompSky_G CompSky_B ambientsss_brightness SSS_TYPE Cloud_Speed Cumulus_height Cumulus_coverage Cumulus_density Alto_coverage Alto_density ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount ambient_temp Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance FinalR FinalG FinalB Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH
|
||||
|
||||
screen.columns=2
|
||||
screen = \
|
||||
@ -181,7 +181,7 @@ PhysicsMod_support [LabPBR]
|
||||
|
||||
### CLOUDS
|
||||
screen.Clouds.columns = 2
|
||||
screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY CLOUDS_SHADOWS Daily_Weather Cloud_Speed Rain_coverage <empty> <empty> Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height
|
||||
screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_QUALITY CLOUDS_SHADOWS Daily_Weather Cloud_Speed Rain_coverage <empty> <empty> Cumulus Altostratus Cumulus_coverage Alto_coverage Cumulus_density Alto_density Cumulus_height <empty> Cumulus2_coverage
|
||||
|
||||
### FOG
|
||||
screen.Fog.columns=2
|
||||
|
Loading…
Reference in New Issue
Block a user