
oldLighting=false
underwaterOverlay = false

#ifdef CLOUDS

clouds=off

#endif
moon=true
sun=true
stars=false
vignette=false
dynamicHandLight=true
shadowTranslucent=true
rain.depth=false
particles.before.deferred=false
separateAo=true

texture.prepare.depthtex1=minecraft:textures/environment/clouds.png
texture.deferred.depthtex1=minecraft:textures/environment/clouds.png
texture.deferred.colortex14=texture/blueNoise.png
texture.prepare.colortex14=texture/blueNoise.png
texture.noise=texture/noises.png
particles.ordering = after


#Get the correct alpha value : S_A*(1-DST_A)+DST_A


blend.gbuffers_terrain_solid=off

blend.gbuffers_terrain_cutout.colortex11=off
blend.gbuffers_terrain_cutout.colortex12=off
blend.gbuffers_terrain_cutout.colortex10=off
blend.gbuffers_terrain_cutout.colortex13=off
blend.gbuffers_entities_translucent.colortex11=off
blend.gbuffers_entities_translucent.colortex12=off
blend.gbuffers_entities_translucent.colortex10=off
blend.gbuffers_entities_translucent.colortex13=off
blend.gbuffers_block_translucent.colortex11=off
blend.gbuffers_block_translucent.colortex12=off
blend.gbuffers_block_translucent.colortex10=off
blend.gbuffers_block_translucent.colortex13=off
#blend.gbuffers_basic= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
#blend.gbuffers_textured= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
#blend.gbuffers_textured_lit= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_weather= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_water= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
#blend.gbuffers_hand_water= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
#blend.gbuffers_entities_translucent = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE
blend.gbuffers_entities=off
blend.gbuffers_entities_solid=off

blend.gbuffers_particles=off
blend.gbuffers_hand = off
#blend.gbuffers_block= off
#blend.gbuffers_basic= off
#blend.gbuffers_damagedblock= SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE


alphaTest.gbuffers_skybasic=off
alphaTest.gbuffers_weather=off
alphaTest.gbuffers_entities=GREATER 0.01
alphaTest.gbuffers_hand=GREATER 0.01
alphaTest.gbuffers_terrain_solid=off





size.buffer.colortex6=256 256

#if CLOUD_QUALITY == 3
size.buffer.colortex8=1.0 1.0
#elif CLOUD_QUALITY == 2
size.buffer.colortex8=0.75 0.75
#elif CLOUD_QUALITY == 1
size.buffer.colortex8=0.5 0.5
#endif

#ifdef HQ_WATER
size.buffer.colortex7=512 512
#else
size.buffer.colortex7=256 256
#endif



program.world0/dh_shadow.enabled=DH_SHADOWMAP
program.world0/deferred5.enabled=SSPT
program.world0/deferred6.enabled=SSPT


#ifndef DISTANT_HORIZONS
program.world0/deferred11.enabled=false
program.world1/deferred11.enabled=false
program.world-1/deferred11.enabled=false
#endif

program.world0/deferred.enabled=CLOUDS

program.world0/deferred20.enabled=PBR_REFLECTIONS
program.world0/deferred21.enabled=PBR_REFLECTIONS
program.world0/composite6.enabled=TAA
program.world0/composite1.enabled=BLOOM
program.world0/composite2.enabled=BLOOM
program.world0/composite3.enabled=BLOOM
program.world0/composite7.enabled=DOF



program.world1/deferred20.enabled=PBR_REFLECTIONS
program.world1/deferred21.enabled=PBR_REFLECTIONS
program.world1/composite6.enabled=TAA
program.world1/composite1.enabled=BLOOM
program.world1/composite2.enabled=BLOOM
program.world1/composite3.enabled=BLOOM
program.world1/composite7.enabled=DOF

program.world-1/deferred20.enabled=PBR_REFLECTIONS
program.world-1/deferred21.enabled=PBR_REFLECTIONS
program.world-1/composite6.enabled=TAA
program.world-1/composite1.enabled=BLOOM
program.world-1/composite2.enabled=BLOOM
program.world-1/composite3.enabled=BLOOM
program.world-1/composite7.enabled=DOF


#program.world0/gbuffers_skybasic.enabled=false
#program.world1/gbuffers_skybasic.enabled=false
#program.world-1/gbuffers_skybasic.enabled=false


#ifdef SHADOWS_ENABLED
shadow.enabled = true
#else
shadow.enabled = false
#endif


sliders= CAMERA_SENSOR_SIZE_MM SSAO_SAMPLES VIBRANCE SATURATION HDR_MAX EXPOSURE CONTRAST SHOULDER MID_IN MID_OUT RSM_SAMPLES DISTORTION_ADJUSTMENT shadowMapResolution CLOUD_QUALITY SHADOW_FILTERING SSAO_SAMPLES CLOUD_SAMPLES VL_SAMPLES EXPOSURE CONTRAST SHOULDER MID_IN MID_OUT SATURATION SSR_QUALITY SHADOW_SAMPLES CLOUDS_QUALITY SSPT_MIX RENDER_SCALE_X RENDER_SCALE_Y TAA_HISTORY_WEIGHT shadowDistance WAVY_SPEED WAVY_STRENGTH REFLECTION_CUTOFF TORCH_COLOR SHARPENING_AMOUNT SKY_COLOR_BLEND MIN_LIGHT TAA_OFFCENTER_REJECTION SSR_STEPS TORCH_AMOUNT ANTI_GHOSTING FLICKER_REDUCTION POM_DEPTH MAX_ITERATIONS sunPathRotation shadowDistanceRenderMul entityShadowDistanceMul MAX_DIST FOCAL APERTURE MANUAL_FOCUS  

screen= <empty> <empty> <profile> <empty>  <empty>  <empty> [Shading] [Atmosphere] [PBR] [Water] [TAA] [DOF] [Tonemapping] [Misc]   <empty>   <empty>  [Debug]

screen.DOF = DOF CAMERA_SENSOR_SIZE_MM APERTURE MANUAL_FOCUS BOKEH_MODE EXCLUDE_MODE DOF_MODE
screen.Shading = shadowMapResolution shadowDistance SHADOW_FILTERING CLOUD_SHADOWS DISTORTION_ADJUSTMENT CONTACT_SHADOWS SHADOW_SAMPLES DH_SHADOWMAP <empty> <empty>  RSM RSM_SAMPLES <empty> <empty> SSAO <empty  RTAO_SAMPLES RTAO_TRACE_SAMPLES
screen.Atmosphere = CLOUDS CLOUD_QUALITY VOLUMETRIC_LIGHTING SKYBLEND  
screen.Tonemap = EXPOSURE CONTRAST SHOULDER MID_IN MID_OUT SATURATION
screen.PBR = PBR <empty> LAB_PBR NORMAL_MAPS PBR_REFLECTIONS POM
screen.Tonemapping = VIBRANCE SATURATION HDR_MAX EXPOSURE CONTRAST SHOULDER MID_IN MID_OUT
screen.TAA = TAA <empty> TAA_CLIP  TAA_HISTORY_WEIGHT TAA_OFFCENTER_REJECTION NO_ENTITY_TAA
screen.Water = SSR_STEPS HQ_WATER VERTEX_WAVES CAUSTICS REFRACTION

screen.Debug = DEBUG_MODE SHADOW_DEBUG RTAO SSPT HIGH_QUALITY [Debug2]
screen.Misc = BLOOM   HQ_NOISE
screen.Debug2 = *

profile.POTATO=         !TAA SSAO=0 !BLOOM !NORMAL_MAPS !VOLUMETRIC_LIGHTING !CLOUDS  !DOF SHADOW_FILTERING=0 shadowMapResolution=1024 shadowDistance=128.0 CLOUD_QUALITY=1 !HQ_WATER !HQ_NOISE !LAB_PBR !PBR  SSR_STEPS=4 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS !SKYBLEND !VERTEX_WAVES !CAUSTICS !REFRACTION !RSM RSM_SAMPLES=1 !CONTACT_SHADOWS
profile.LOW=            !TAA SSAO=0 !BLOOM !NORMAL_MAPS !VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=1 shadowMapResolution=1024 shadowDistance=128.0 CLOUD_QUALITY=1 !HQ_WATER !HQ_NOISE !LAB_PBR !PBR  SSR_STEPS=4 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND !VERTEX_WAVES !CAUSTICS !REFRACTION !RSM RSM_SAMPLES=1 !CONTACT_SHADOWS
profile.MEDIUM_LOW=     TAA SSAO=1 !BLOOM !NORMAL_MAPS !VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=1 shadowMapResolution=2048 shadowDistance=160.0 CLOUD_QUALITY=1 !HQ_WATER !HQ_NOISE !LAB_PBR !PBR  SSR_STEPS=4 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND !VERTEX_WAVES !CAUSTICS !REFRACTION !RSM RSM_SAMPLES=1 !CONTACT_SHADOWS
profile.MEDIUM=         TAA SSAO=1 BLOOM !NORMAL_MAPS !VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=2 shadowMapResolution=2048 shadowDistance=160.0 CLOUD_QUALITY=2 HQ_WATER !HQ_NOISE !LAB_PBR PBR  SSR_STEPS=10 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND !VERTEX_WAVES !CAUSTICS !REFRACTION RSM RSM_SAMPLES=1 !CONTACT_SHADOWS
profile.MEDIUM_HIGH=    TAA SSAO=1 BLOOM !NORMAL_MAPS !VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=2 shadowMapResolution=2048 shadowDistance=160.0 CLOUD_QUALITY=2 HQ_WATER !HQ_NOISE !LAB_PBR PBR  SSR_STEPS=10 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND VERTEX_WAVES CAUSTICS REFRACTION RSM RSM_SAMPLES=1 !CONTACT_SHADOWS
profile.HIGH=           TAA SSAO=1 BLOOM !NORMAL_MAPS VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=2 shadowMapResolution=4096 shadowDistance=256.0 CLOUD_QUALITY=3 HQ_WATER HQ_NOISE !LAB_PBR PBR  SSR_STEPS=15 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND VERTEX_WAVES CAUSTICS REFRACTION RSM RSM_SAMPLES=2 !CONTACT_SHADOWS
profile.ULTRA=     TAA SSAO=2 BLOOM !NORMAL_MAPS VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=2 shadowMapResolution=4096 shadowDistance=256.0 CLOUD_QUALITY=3 HQ_WATER HQ_NOISE !LAB_PBR PBR  SSR_STEPS=15 !SSPT  !NORMAL_MAPS !PBR_REFLECTIONS SKYBLEND VERTEX_WAVES CAUSTICS REFRACTION RSM RSM_SAMPLES=3 !CONTACT_SHADOWS
profile.EXTREME=          TAA SSAO=2 BLOOM !NORMAL_MAPS VOLUMETRIC_LIGHTING CLOUDS  !DOF SHADOW_FILTERING=2 shadowMapResolution=8192 shadowDistance=512.0 CLOUD_QUALITY=3 HQ_WATER HQ_NOISE !LAB_PBR PBR  SSR_STEPS=32 !SSPT NORMAL_MAPS PBR_REFLECTIONS SKYBLEND VERTEX_WAVES CAUSTICS REFRACTION RSM RSM_SAMPLES=4  RTAO_SAMPLES=8 RTAO_TRACE_SAMPLES=8 CONTACT_SHADOWS


variable.float.sunAmount = 75


uniform.vec2.texelSize=vec2(1.0/viewWidth,1.0/viewHeight)
uniform.vec2.texelSize=vec2(1.0/viewWidth,1.0/viewHeight)

uniform.vec2.viewResolution=vec2(viewWidth,viewHeight)

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.0,1.0-exp(angSun))

#




uniform.int.framemod8 = frameCounter%8


uniform.float.far2=far
variable.float.modWT = (worldTime%24000)


# Transform to -1 to 1 range with midnight as 0
uniform.float.scaledTime = (worldTime - 18000.0) / 12000.0 
# Apply a cosine function to map to 0-1 with midnight as 0
uniform.float.normWT =  1.0 - (0.5 - 0.5 * cos(scaledTime * 3.14159265359)) 

variable.float.sunVectorX = gbufferModelViewInverse.0.0 * sunPosition.x + gbufferModelViewInverse.1.0 * sunPosition.y + gbufferModelViewInverse.2.0 * sunPosition.z
variable.float.sunVectorY = gbufferModelViewInverse.0.1 * sunPosition.x + gbufferModelViewInverse.1.1 * sunPosition.y + gbufferModelViewInverse.2.1 * sunPosition.z
variable.float.sunVectorZ = gbufferModelViewInverse.0.2 * sunPosition.x + gbufferModelViewInverse.1.2 * sunPosition.y + gbufferModelViewInverse.2.2 * sunPosition.z

variable.float.moonVectorX = gbufferModelViewInverse.0.0 * moonPosition.x + gbufferModelViewInverse.1.0 * moonPosition.y + gbufferModelViewInverse.2.0 * moonPosition.z
variable.float.moonVectorY = gbufferModelViewInverse.0.1 * moonPosition.x + gbufferModelViewInverse.1.1 * moonPosition.y + gbufferModelViewInverse.2.1 * moonPosition.z
variable.float.moonVectorZ = gbufferModelViewInverse.0.2 * moonPosition.x + gbufferModelViewInverse.1.2 * moonPosition.y + gbufferModelViewInverse.2.2 * moonPosition.z


variable.float.shadowVectorX = gbufferModelViewInverse.0.0 * shadowLightPosition.x + gbufferModelViewInverse.1.0 * shadowLightPosition.y + gbufferModelViewInverse.2.0 * shadowLightPosition.z
variable.float.shadowVectorY = gbufferModelViewInverse.0.1 * shadowLightPosition.x + gbufferModelViewInverse.1.1 * shadowLightPosition.y + gbufferModelViewInverse.2.1 * shadowLightPosition.z
variable.float.shadowVectorZ = gbufferModelViewInverse.0.2 * shadowLightPosition.x + gbufferModelViewInverse.1.2 * shadowLightPosition.y + gbufferModelViewInverse.2.2 * shadowLightPosition.z


uniform.float.sunY =  sunElevation
uniform.float.sunZ =  (sunY / 0.85) * -0.57
variable.float.sunX0 =  asin(sunElevation / 0.82)
variable.float.sunX1 =  (worldTime - 6000.01) / 6000
variable.float.sunX2 =  -(sunX1 / abs(sunX1))
uniform.float.sunX =   cos(sunX0) * sunX2

uniform.vec3.sunPosWorld= vec3(sunVectorX/100,sunVectorY/100,sunVectorZ/100)
uniform.vec3.moonPosWorld= vec3(moonVectorX/100,moonVectorY/100,moonVectorZ/100)
uniform.vec3.shadowPosWorld= vec3(shadowVectorX/100,shadowVectorY/100,shadowVectorZ/100)

uniform.float.biasblend = 1-clamp((sunPosWorld.y -  0.1) / (0.05 -  0.1), 0.0, 1.0)
uniform.float.biasblend2 = 1-clamp((sunPosWorld.y -  0.1) / (0.05 -  0.1), 0.0, 1.0)
uniform.float.biasblend3 = 1-clamp((sunPosWorld.y -  0.2) / (0.05 -  0.2), 0.0, 1.0)

uniform.float.nightblend = 1.0 -  clamp((sunPosWorld.y  / -0.1), 0.0, 1.0)
uniform.float.sunsetBlend = 1-clamp((sunPosWorld.y -  0.05) / (0.01 -  0.05), 0.0, 1.0)
uniform.float.sunsetBlend2 = 1-clamp((sunPosWorld.y -  0.08) / (0.0 -  0.08), 0.0, 1.0)
uniform.float.sunsetBlend3 = 1-clamp((sunPosWorld.y -  0.5) / (0.1 -  0.5), 0.0, 1.0)


uniform.float.nightblend5 = 1-clamp((sunPosWorld.y - 0) / (-0.05 - 0), 0.0, 1.0)
uniform.float.nightblend6 = 1-clamp((sunPosWorld.y - 0) / (-0.05 - 0), 0.0, 1.0)
uniform.float.nightblend5Inv = clamp((sunPosWorld.y - 0) / (-0.05 - 0), 0.0, 1.0)
uniform.float.nightblend3 = 1-clamp((sunPosWorld.y - 0) / (-1 - 0), 0.0, 1.0)

uniform.float.nightblendShadows = clamp(pow(abs(sunPosWorld.y),0.5)*10,0,1)


variable.float.sunRadBlend = 1-clamp((sunPosWorld.y - 0.1) / (0 - 0.1), 0.0, 1.0)
variable.float.moonRadBlend = 1-clamp((sunPosWorld.y - 0) / (-0.01 - 0), 0.0, 1.0)


variable.float.sunRadiance = mix(0.6, 0.99985, sunRadBlend)
variable.float.moonRadiance = mix(0.01, 1.0, moonRadBlend)

uniform.float.lightRadiance = mix(moonRadiance, sunRadiance, nightblend5)
variable.float.lightRadianceLight = mix(0, sunRadiance, nightblend5)



uniform.float.sunpow = mix(2,4,sunsetBlend)
variable.float.sunpowLight = mix(0.25,4,sunRadBlend)

variable.float.lightPosX = clamp(moonPosWorld.x * (1 - nightblend5) + sunPosWorld.x * nightblend5,-1,1)
variable.float.lightPosY = shadowPosWorld.y
variable.float.lightPosZ = clamp(moonPosWorld.z * (1 - nightblend5) + sunPosWorld.z * nightblend5,-1,1)


uniform.vec3.lightPos = vec3(lightPosX, lightPosY, lightPosZ)


variable.float.magnitude = sqrt(lightPos.x * lightPos.x + lightPos.y * lightPos.y + lightPos.z * lightPos.z)


variable.float.shadowangle = clamp(shadowPosWorld.y * shadowPosWorld.y, 0.0, 0.05)

uniform.float.shadowblend = 0 + (shadowangle - 0) * (1.0 - 0) / (0.05 - 0)





variable.float.lightSign = clamp(sunIntensity*pow(10.0,35.0),0.0,1.0)

variable.float.sunElev = pow(clamp(1.0-sunElevation,0.0,1.0),4.0)*1.8


uniform.float.nightmix =  clamp((max(0.0,1.0-exp(angSkyNight)))*10,0,1)
uniform.float.nightmixInv = 1-nightmix




variable.float.eyeSmoothNorm= (eyeBrightnessSmooth.y / 240.0)
uniform.float.darkness = 1 - (blindness + darknessFactor)
uniform.float.darknessEye = (1 - (blindness + darknessFactor))*eyeSmoothNorm
uniform.float.darknessInv = blindness + darknessFactor * 0.75

# Atmosphere
variable.float.atmosphericScale = 50000.0 * 100000.0
variable.vec3.atmosphericScaleV3 = vec3(atmosphericScale,atmosphericScale,atmosphericScale)

variable.vec3.totalCoeff =  vec3(0.000000000005, 0.000000000012, 0.00000000002)
variable.vec3.luminanceCoeff =  vec3(0.299, 0.587, 0.114)
uniform.vec3.rainColorMix =  vec3(0.4, 0.5, 0.6)

variable.float.nightpow = 3
variable.float.nightpow2 = mix(20,0,nightblend3)
uniform.vec3.skyColorNight =  vec3(0.002, 0.005, 0.006) * vec3(nightpow, nightpow, nightpow)
uniform.vec3.skycolnight =  vec3(0.002, 0.005, 0.006) * vec3(nightpow2, nightpow2, nightpow2)

variable.float.opticalDepthLightTemp =  max(sunElevation, 0.01)
variable.float.opticalDepthLightTemp3 =   (3 - 2 * opticalDepthLightTemp)
variable.float.opticalDepthLightTemp4 =   (opticalDepthLightTemp * opticalDepthLightTemp )

variable.float.opticalDepthLight = (atmosphericScale / (opticalDepthLightTemp4 * opticalDepthLightTemp3))

variable.vec3.opticalDepthLightV3 = vec3(opticalDepthLight,opticalDepthLight,opticalDepthLight)

uniform.vec3.scatterLight =  (totalCoeff * opticalDepthLightV3)
variable.vec3.absorbLight0 =  (totalCoeff * -opticalDepthLightV3)


uniform.float.rainStrengthInv =  1.0 - rainStrength
variable.float.absorbLight01X =  exp2( absorbLight0.x)
variable.float.absorbLight01Y =  exp2( absorbLight0.y)
variable.float.absorbLight01Z =  exp2( absorbLight0.z)
uniform.vec3.absorbLight = vec3(absorbLight01X,absorbLight01Y,absorbLight01Z)




# Up Direction
variable.vec3.ambUpPos = vec3(0, 1, 0)
variable.float.plpUp = sqrt(ambUpPos.x * ambUpPos.x + ambUpPos.y * ambUpPos.y + ambUpPos.z * ambUpPos.z)
variable.float.opticalDepthUp0 = atmosphericScale / (max(ambUpPos.y, 0.01) * max(ambUpPos.y, 0.01) * (3.0 - 2.0 * max(ambUpPos.y, 0.01)))
variable.vec3.opticalDepthUp = vec3(opticalDepthUp0, opticalDepthUp0, opticalDepthUp0)
variable.vec3.scatterViewUp = (totalCoeff * opticalDepthUp)
variable.vec3.absorbViewUp0 = (totalCoeff * -opticalDepthUp)
variable.vec3.absorbSunUp = abs(absorbLight - vec3(exp2(absorbViewUp0.x), exp2(absorbViewUp0.y), exp2(absorbViewUp0.z))) / (abs((scatterLight - scatterViewUp) * vec3(0.693147, 0.693147, 0.693147)) + vec3(0.00000001, 0.00000001, 0.00000001))
variable.vec3.scatterSunUp1 = vec3(0.375, 0.375, 0.375)
variable.vec3.scatterSunUp = scatterViewUp * scatterSunUp1
variable.vec3.atmosphereUp0 = (scatterSunUp * absorbSunUp) * vec3(3.1415, 3.1415, 3.1415)

variable.float.atmosphereUpX0 = mix(atmosphereUp0.x, skyColorNight.x*atmosphereUp0.z, nightmix)
variable.float.atmosphereUpY0 = mix(atmosphereUp0.y, skyColorNight.y*atmosphereUp0.z, nightmix)
variable.float.atmosphereUpZ0 = mix(atmosphereUp0.z, skyColorNight.z*atmosphereUp0.z, nightmix)

variable.float.atmosphereUpX = mix(atmosphereUpX0, atmosphereUpZ0 * rainColorMix.x, rainStrength)
variable.float.atmosphereUpY = mix(atmosphereUpY0, atmosphereUpZ0 * rainColorMix.y, rainStrength)
variable.float.atmosphereUpZ = mix(atmosphereUpZ0, atmosphereUpZ0 * rainColorMix.z, rainStrength)



uniform.vec3.atmosphereUp = vec3(atmosphereUpX * 1, atmosphereUpY * 1, atmosphereUpZ * 1) 



# sunlight2

variable.float.lt2= -(6371000.0 * lightPosY) + sqrt(40589641000000.0 * lightPosY * lightPosY + 1284200000000.0)
variable.float.lh2 = 1.0 - 1.0 / (2.0 + lt2 * lt2 * 0.0000000000009)
variable.float.lt = clamp((lightPosY - 1.0) / (-1.4), 0.0, 1.0)
variable.float.lps = pow(lt * lt * (3.0 - 2.0 * lt), 8.0) * lh2
variable.float.lcRed =  lightRadiance * exp(-10.448  * lps)* sunpow
variable.float.lcGreen =  lightRadiance * exp(-19.435  * lps)* sunpow
variable.float.lcBlue = lightRadiance * exp(-37.188  * lps)* sunpow
variable.float.tlcr =  lcRed* 4.0 + 0.01
variable.float.tlcg =  lcGreen* 4.0 + 0.01
variable.float.tlcb =  lcBlue* 4.0 + 0.01
variable.float.dp = (tlcr) * 0.299 + (tlcg) * 0.587 + (tlcb) * 0.114
variable.float.dps = (lcRed) * 0.299 + (lcGreen) * 0.587 + (lcBlue) * 0.114
variable.float.RCR = mix(0.4, 0.016, (1 - nightblend5))
variable.float.RCG = mix(0.5,  0.05, (1 - nightblend5))
variable.float.RCB = mix(0.6,  0.066, (1 - nightblend5))

variable.float.SR = mix(lcRed, dp * 0.04, (1 - nightblend5))
variable.float.SG = mix(lcGreen, dp * 0.1, (1 - nightblend5))
variable.float.SB = mix(lcBlue, dp * 0.11, (1 - nightblend5))

variable.float.SRR = mix(SR, dps * RCR, rainStrength)
variable.float.SGR = mix(SG, dps * RCG, rainStrength)
variable.float.SBR = mix(SB, dps * RCB, rainStrength)



uniform.vec3.sunLight = vec3(SRR,SGR,SBR)



#
