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

scale.composite11=0.52
scale.composite12=0.25
scale.composite15=0.5

sliders=EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation SKY_BRIGHTNESS_DAY SKY_BRIGHTNESS_NIGHT SSR_STEPS
screen=[Lighting] [Shadows] [Atmospherics]  [TAA_OPTIONS]
screen.Lighting = Exposure_Speed EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT TONEMAP_ACES
screen.TAA_OPTIONS= TAA <empty> BLEND_FACTOR BICUBIC_RESAMPLING FAST_BICUBIC MOTION_REJECTION FLICKER_REDUCTION CLOSEST_VELOCITY SMOOTHESTSTEP_INTERPOLATION NO_CLIP FAST_TAA
screen.Shadows=shadowMapResolution PCF sunPathRotation SEPARATE_AO SCREENSPACE_REFLECTIONS SSR_STEPS
screen.Atmospherics=SKY_BRIGHTNESS_DAY SKY_BRIGHTNESS_NIGHT CLOUDS STARS

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.framemod8 = frameCounter%8

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