#shaders/shaders.properties
#Minecraft Settings
oldLighting=false
underwaterOverlay = false
sun=false
moon=true
stars=false
vignette=false
dynamicHandLight=true
 

#Profiles
    profile.Skygleam_V3 
#Screen Setup
    screen=<empty> <empty> [INFORMATION] SHADER_STYLE <profile> [Details] <empty> <empty> [Lighting] [Shadows] [Atmospherics] [Subscibe_Baby!] [Download_AIOU_Vibrant] [For_Best_Experience]
	
	screen.Details=<empty> <empty> <empty> <empty> [Made_by_Team_Addoners] [Owner_Mcbugs_Addon] [YT_Mcbugs_Addon] [Insta_mcbugsaddon]
	sliders=EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation SKY_BRIGHTNESS_DAY SKY_BRIGHTNESS_NIGHT shadowDistance ambientOcclusionLevel
    screen.Lighting =<empty> <empty> <empty> <empty> EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT TONEMAP_ACES
    screen.Shadows=<empty> <empty> <empty> <empty> shadowMapResolution SEPARATE_AO ambientOcclusionLevel
    screen.Atmospherics=<empty> <empty> <empty> <empty> SKY_BRIGHTNESS_DAY SKY_BRIGHTNESS_NIGHT CLOUDS STARS DRAW_SUN
    
#define DRAW_SUN




texture.noise=texture/YJsDz.png
separateAo=true

alphaTest.gbuffers_weather=off
alphaTest.gbuffers_armor_glint=off
beacon.beam.depth=true

variable.float.texelSizeX = 1.0/viewWidth
variable.float.texelSizeY = 1.0/viewHeight
uniform.vec2.texelSize=vec2(texelSizeX,texelSizeY)

uniform.int.framemod16 = frameCounter%16

variable.float.normSunVec = sqrt(sunPosition.x*sunPosition.x+sunPosition.y*sunPosition.y+sunPosition.z*sunPosition.z)
variable.float.normUpVec = sqrt(upPosition.x*upPosition.x+upPosition.y*upPosition.y+upPosition.z*upPosition.z)

variable.float.sunPosX = sunPosition.x/normSunVec
variable.float.sunPosY = sunPosition.y/normSunVec
variable.float.sunPosZ = sunPosition.z/normSunVec

uniform.vec3.sunVec=vec3(sunPosX,sunPosY,sunPosZ)

variable.float.upPosX = upPosition.x/normUpVec
variable.float.upPosY = upPosition.y/normUpVec
variable.float.upPosZ = upPosition.z/normUpVec

uniform.vec3.upVec=vec3(upPosX,upPosY,upPosZ)
uniform.float.sunElevation = sunPosX*upPosX+sunPosY*upPosY+sunPosZ*upPosZ


variable.float.angSun= -(( pi * 0.5128205128205128 - acos(sunElevation*1.065-0.065))/1.5)
variable.float.angMoon= -(( pi * 0.5128205128205128 - acos(-sunElevation*1.065-0.065))/1.5)
variable.float.angSky= -(( pi * 0.5128205128205128 - acos(sunElevation*0.95+0.05))/1.5)
variable.float.angSkyNight= -(( pi * 0.5128205128205128 -acos(-sunElevation*0.95+0.05))/1.5)

uniform.float.sunIntensity=max(0.,1.0-exp(angSun))
uniform.float.skyIntensity=max(0.,1.0-exp(angSky))*(1.0-rainStrength*0.4)*clamp(sunElevation+0.095,0.0,0.08)/0.08*clamp(sunElevation+0.095,0.0,0.08)/0.08
uniform.float.moonIntensity=max(0.,1.0-exp(angMoon))
uniform.float.skyIntensityNight=max(0.,1.0-exp(angSkyNight))*(1.0-rainStrength*0.4)

variable.float.sunAmount = 27.
variable.float.ambientAmount = 1.2

variable.float.modWT = (worldTime%24000)*1.0

uniform.float.fogAmount = 1/500.+ 1/90.*(clamp(modWT-11000.,0.,2000.0)/2000.+(1.0-clamp(modWT,0.,3000.0)/3000.))*(clamp(modWT-11000.,0.,2000.0)/2000.+(1.0-clamp(modWT,0.,3000.0)/3000.)) + 1/50.*rainStrength

variable.float.sunlightR0=1.0
variable.float.sunlightG0=(0.42+pow(max(0.0,sunElevation*1.2-0.2),0.35)*0.58)*(1.0-rainStrength*0.8) + rainStrength*0.8
variable.float.sunlightB0=(0.1+pow(max(0.0,sunElevation*1.2-0.2),0.5)*0.65)*(1.0-rainStrength*0.8) + rainStrength*0.8

variable.float.sunlightR=sunlightR0/(sunlightR0+sunlightG0+sunlightB0)
variable.float.sunlightG=sunlightG0/(sunlightR0+sunlightG0+sunlightB0)
variable.float.sunlightB=sunlightB0/(sunlightR0+sunlightG0+sunlightB0)
uniform.vec3.nsunColor=vec3(sunlightR,sunlightG,sunlightB)
uniform.vec3.sunColor=vec3(sunlightR*3.*sunAmount*(1.0-rainStrength*0.95),sunlightG*3.*sunAmount*(1.0-rainStrength*0.95),sunlightB*3.*sunAmount*(1.0-rainStrength*0.95))

variable.float.lightSign = clamp(sunIntensity*pow(10.,35.),0.,1.)
uniform.vec4.lightCol=vec4((sunlightR*3.*sunAmount*sunIntensity+0.16/5.-0.16/5.*lightSign)*(1.0-rainStrength*0.95),(sunlightG*3.*sunAmount*sunIntensity+0.24/5.-0.24/5.*lightSign)*(1.0-rainStrength*0.95),(sunlightB*3.*sunAmount*sunIntensity+0.36/5.-0.36/5.*lightSign)*(1.0-rainStrength*0.95),lightSign*2.0-1.0)

uniform.vec3.cloudCol=vec3(sunlightR*3.*sunAmount*(1.0-rainStrength*0.95)*skyIntensity*2.+0.16*1.5*skyIntensityNight*(1.0-rainStrength*0.95),sunlightG*3.*sunAmount*(1.0-rainStrength*0.95)*skyIntensity*2.+0.24*1.5*skyIntensityNight*(1.0-rainStrength*0.95),sunlightB*3.*sunAmount*(1.0-rainStrength*0.95)*skyIntensity*2.+0.36*1.5*skyIntensityNight*(1.0-rainStrength*0.95))
