#
#   SETTINGS
#

profile.Performance=!cloudVolumeEnabled CLOUD_RENDER_LOD=3.0 !fogVolumeEnabled !waterVolumeEnabled !END_VolumetricSmoke shadowMapResolution=1024 !shadowVPSEnabled !RTAO_ENABLED ResolutionScale=0.5 !cloudShadowsEnabled
profile.Default=profile.Performance cloudVolumeEnabled cloudShadowsEnabled fogVolumeEnabled END_VolumetricSmoke shadowMapResolution=2048 RTAO_ENABLED
profile.Quality=profile.Default CLOUD_RENDER_LOD=1.0 waterVolumeEnabled shadowMapResolution=4096 shadowVPSEnabled ResolutionScale=0.75

screen=INFO <profile> <empty> [ATMOS] [LIGHT] [TERRAIN] [CAMERA] [POST] [MISC]
screen.columns=1

screen.ATMOS=sunPathRotation volumeWorldTimeAnim <empty> [AIRCOEFF] [CLOUDS] [FOG] [SKY] [WATER] [END]
screen.ATMOS.columns=1

    screen.AIRCOEFF=airRayleighMult airMieMult rayleighRedMult mieRedMult rayleighGreenMult mieGreenMult rayleighBlueMult mieBlueMult <empty> <empty> airOzoneMult airMistMult ozoneRedMult mistRedMult ozoneGreenMult mistGreenMult ozoneBlueMult mistBlueMult

    screen.CLOUDS=CLOUD_RENDER_LOD cloudTemporalUpscaleEnabled cloudReflectionsToggle cloudShadowsEnabled <empty> <empty> [CVOLUME] [CPLANAR]
        screen.CVOLUME=cloudVolumeEnabled cloudVolumeSamples cloudVolumeSunlightDither cloudVolumeSkylightDither cloudCumulusAlt cloudCumulusDepth cloudCumulusScaleMult cloudCumulusCoverageBias cloudLocalCoverage
        screen.CPLANAR=cloudCirrusEnabled cloudCirrusAlt cloudCirrusDepth cloudCirrusCoverageBias

    screen.FOG=fogVolumeEnabled fogMistAdvanced fogAdaptiveSteps fogClipDist fogDensityMult fogSeaLevel fogMistAltitude fogMistFalloff mistMieAnisotropy fogMistLightingSteps <empty> <empty> fogSmoothingEnabled fogSmoothingPassEnabled

    screen.SKY=airScatterIterations airmassIterations <empty> <empty> skyIlluminanceMult skyMultiscatterMult <empty> <empty> airTransmittanceHQ alternateOzoneDistribution ATMOS_BelowHorizon ATMOS_RenderPlanet PLANET_BOUNCELIGHT
    screen.SKY.columns=2

    screen.WATER=waterVolumeEnabled waterDensity waterVolAdaptiveSteps waterVolClipDist <empty> <empty> waterCoeffRed waterCoeffGreen waterCoeffBlue waterCoeffScatter <empty> <empty> waterNormalOctaves

    screen.END=END_VolumetricSmoke endSmokeGlow
    screen.END.columns=1


screen.LIGHT=directionalLMEnabled <empty> [COLORS] [DIRECTLIGHT] [INDIRECTLIGHT]
screen.LIGHT.columns=1

    screen.COLORS=sunlightIllum moonlightIllum sunlightRedMult moonlightRedMult sunlightGreenMult moonlightGreenMult sunlightBlueMult moonlightBlueMult <empty> <empty> skylightIllum blocklightIllum skylightRedMult blocklightRedMult skylightGreenMult blocklightGreenMult skylightBlueMult blocklightBlueMult

    screen.DIRECTLIGHT=shadowMapResolution shadowVPSEnabled shadowPenumbraScale shadowFilterIterations contactShadowsEnabled subsurfaceScatteringEnabled

    screen.INDIRECTLIGHT=RTAO_ENABLED RTAO_SPP SSAO_ENABLED MAT_AO_ENABLED <empty> <empty> SVGF_FILTER SVGF_RAD SVGF_STRICTNESS SVGF_NORMALEXP


screen.TERRAIN=normalmapEnabled normalmapFormat vertexAttributeFix wetnessMode windEffectsEnabled windIntensity <empty> [PARALLAX] [REFLECTIONS]
screen.TERRAIN.columns=1

    screen.PARALLAX=pomEnabled pomSamples pomShadowSamples pomDepth
    screen.PARALLAX.columns=1

    screen.REFLECTIONS=resourcepackReflectionsEnabled <empty> <empty> <empty> roughReflectionsEnabled roughReflectionSamples <empty> <empty> screenspaceReflectionsEnabled reflectionCaptureEnabled <empty> <empty> roughnessThreshold skyOcclusionThreshold
    screen.REFLECTIONS.columns=2


screen.CAMERA=camSensorWidth camFStops anamorphStretch [BLOOM] [DOF] [EXP] [FLARE] [MBLUR] [VIGNETTE]
screen.CAMERA.columns=1

    screen.BLOOM=bloomEnabled bloomIntensity
    screen.BLOOM.columns=1

    screen.DOF=DoFToggle DoFQuality DoFChromaDispersion chromaOffsetScale <empty> camFocus camManFocDis showFocusPlane
    screen.DOF.columns=1

    screen.EXP=exposureDecay exposureBias exposureDarkClamp exposureBrightClamp <empty> <empty> exposureComplexEnabled exposureBrightPercentage exposureDarkPercentage <empty> <empty> <empty> manualExposureEnabled manualExposureValue
    screen.EXP.columns=2

    screen.FLARE=lensFlareToggle lensFlareHaloToggle lensFlareIntensity lensFlareThreshold <empty> <empty> lensFlareGhostCount lensFlareGhostSpace lensFlareHaloRad lensFlareHaloDepth

    screen.MBLUR=motionblurToggle <empty> motionblurSamples motionblurScale
    screen.MBLUR.columns=1

    screen.VIGNETTE=vignetteEnabled <empty> vignetteStart vignetteEnd vignetteIntensity vignetteExponent
    screen.VIGNETTE.columns=1


screen.POST=CAS_Strength ResolutionScale screenBitdepth VIEWPORT_GAMUT <empty> [AA] [CGRADE] [FTOOL]
screen.POST.columns=1

    screen.AA=CONFIDENCE TAAU_FXAA_PostPass <empty> taaBlendWeight taaAntiFlicker taaLumaRejection
    screen.AA.columns=1

    screen.CGRADE=doColorgrading <empty> <empty> <empty> vibranceInt saturationInt gammaCurve brightnessInt constrastInt <empty> colorlumR colorlumG colorlumB

    screen.FTOOL=framingToolEnabled framingThirdsHor framingToAspect framingAspectX framingAspectY framingToAspectCenter
    screen.FTOOL.columns=1


screen.MISC=[INTERNAL] DEBUG_VIEW <empty> <empty> freezeAtmosAnim atmosAnimOffset planetRadiusScale

    screen.INTERNAL=*


sliders=sunPathRotation rayleighRedMult rayleighGreenMult rayleighBlueMult airRayleighMult mieRedMult mieGreenMult mieBlueMult airMieMult \
 ozoneRedMult ozoneGreenMult ozoneBlueMult airOzoneMult mistRedMult mistGreenMult mistBlueMult airMistMult \
 CLOUD_RENDER_LOD cloudVolumeSamples cloudCumulusAlt cloudCumulusDepth cloudCumulusScaleMult cloudCumulusCoverageBias \
 cloudCirrusAlt cloudCirrusDepth cloudCirrusCoverageBias \
 fogAdaptiveSteps fogClipDist fogDensityMult fogSeaLevel fogMistAltitude fogMistFalloff mistMieAnisotropy fogMistLightingSteps \
 airScatterIterations airmassIterations skyIlluminanceMult skyMultiscatterMult \
 waterDensity waterVolAdaptiveSteps waterVolClipDist waterCoeffRed waterCoeffGreen waterCoeffBlue waterCoeffScatter waterNormalOctaves \
 shadowMapResolution shadowPenumbraScale shadowFilterIterations indirectResReduction ssptSPP ssptLightmapBlend ssptEmissionDistance SVGF_STRICTNESS SVGF_NORMALEXP CONFIDENCE \
 sunlightIllum moonlightIllum sunlightRedMult moonlightRedMult sunlightGreenMult moonlightGreenMult sunlightBlueMult moonlightBlueMult skylightIllum blocklightIllum skylightRedMult blocklightRedMult skylightGreenMult blocklightGreenMult skylightBlueMult blocklightBlueMult \
 windIntensity pomSamples pomShadowSamples pomDepth roughReflectionSamples roughnessThreshold skyOcclusionThreshold \
 camSensorWidth camFStops anamorphStretch bloomIntensity DoFQuality chromaOffsetScale \
 exposureDecay exposureBias manualExposureValue exposureDarkClamp exposureBrightClamp exposureBrightPercentage exposureDarkPercentage \
 lensFlareIntensity lensFlareThreshold lensFlareGhostCount lensFlareGhostSpace lensFlareHaloRad lensFlareHaloDepth \
 motionblurSamples motionblurScale vignetteStart vignetteEnd vignetteIntensity vignetteExponent \
 CAS_Strength acesRRTExposureBias acesRRTGammaLift acesRRTGlowGainOffset acesRRTSatOffset acesODTSatOffset \
 taaBlendWeight taaMotionRejection taaAntiGhosting taaAntiFlicker taaLumaRejection taaHueRejection \
 vibranceInt saturationInt gammaCurve brightnessInt constrastInt colorlumR colorlumG colorlumB \
 framingAspectX framingAspectY framingToAspectCenter \
 atmosAnimOffset camManFocDis

#
#   STUFF
#

#version.1.16.5=G7

oldLighting=false
oldHandLight=false
vignette=false
separateAo=true
underwaterOverlay=false
sun=false
moon=true
fog=off
rain.depth=false
clouds=off

blend.gbuffers_basic=off
blend.gbuffers_block=off
blend.gbuffers_terrain=off
blend.gbuffers_entities=off
blend.gbuffers_hand=off
blend.gbuffers_spidereyes=SRC_ALPHA ONE ZERO ONE
blend.gbuffers_armor_glint=SRC_ALPHA ONE ZERO ONE
blend.gbuffers_textured=off
blend.gbuffers_skybasic=off
blend.gbuffers_skytextured=off
blend.gbuffers_textured_lit=off
blend.gbuffers_clouds=off
blend.deferred=off

blend.gbuffers_water.colortex1=off
blend.gbuffers_water.colortex2=off
blend.gbuffers_water.colortex3=off

texture.noise=image/noise2D.png
texture.deferred.depthtex1=image/curl3D.dat TEXTURE_3D RGB8 64 64 64 RGB UNSIGNED_BYTE
texture.prepare.depthtex1=image/curl3D.dat TEXTURE_3D RGB8 64 64 64 RGB UNSIGNED_BYTE

size.buffer.colortex4=256 384

#
#       UNIFORMS
#

uniform.float.worldAnimTime = worldDay % 48 + worldTime / 24000.0

#       TAA OFFSET
variable.int.fmod8 = frameCounter % 8
#uniform.vec2.taaOffset = vec2((if( \
#    fmod8 == 0,  0.125, \
#    fmod8 == 1, -0.125, \
#    fmod8 == 2,  0.625, \
#    fmod8 == 3,  0.375, \
#    fmod8 == 4, -0.625, \
#    fmod8 == 5, -0.875, \
#    fmod8 == 6,  0.375, \
#    fmod8 == 7,  0.875, \
#    0.0)) / viewWidth, \
#    (if( \
#    fmod8 == 0, -0.375, \
#    fmod8 == 1,  0.375, \
#    fmod8 == 2,  0.125, \
#    fmod8 == 3, -0.625, \
#    fmod8 == 4,  0.625, \
#    fmod8 == 5, -0.125, \
#    fmod8 == 6, -0.875, \
#    fmod8 == 7,  0.875, \
#    0.0)) / viewHeight)


#
#   TAA Offsets by Zombye
#

uniform.float.frameR1 = frac(0.5 + frameCounter / 1.61803398874989484820458683436563)
variable.float.frameR2X = frac(0.5 + frameCounter / 1.32471795724474602596090885447809)
variable.float.frameR2Y = frac(0.5 + frameCounter / (1.32471795724474602596090885447809 * 1.32471795724474602596090885447809))
uniform.vec2.frameR2 = vec2(frameR2X, frameR2Y)

# TAA offset
uniform.vec2.taaOffset = vec2((frameR2X * 2.0 - 1.0) / viewWidth, (frameR2Y * 2.0 - 1.0) / viewHeight)

#       RESOLUTION UNIFORMS
uniform.vec2.viewSize = vec2(viewWidth, viewHeight)
uniform.vec2.pixelSize = vec2(1.0 / viewWidth, 1.0 / viewHeight)

variable.float.bloomYres    = min(1080.0, viewHeight)
variable.float.bloomXres    = bloomYres * aspectRatio
uniform.vec2.bloomResolution = vec2(bloomXres, bloomYres)

#       DIRECTIONS
variable.float.upDirNorm    = 1.0 / sqrt((upPosition.x*upPosition.x) + (upPosition.y*upPosition.y) + (upPosition.z*upPosition.z))
uniform.vec3.upDirView      = vec3(upPosition.x*upDirNorm, upPosition.y*upDirNorm, upPosition.z*upDirNorm)
uniform.vec3.upDir          = vec3(0.0, 1.0, 0.0)

variable.float.sunDirNorm   = 1.0 / sqrt((sunPosition.x * sunPosition.x) + (sunPosition.y * sunPosition.y) + (sunPosition.z * sunPosition.z))
variable.float.svecX        = sunPosition.x * sunDirNorm
variable.float.svecY        = sunPosition.y * sunDirNorm
variable.float.svecZ        = sunPosition.z * sunDirNorm
uniform.vec3.sunDirView     = vec3(svecX, svecY, svecZ)
variable.float.sunDirX      = gbufferModelViewInverse.0.0 * sunPosition.x + gbufferModelViewInverse.1.0 * sunPosition.y + gbufferModelViewInverse.2.0 * sunPosition.z
variable.float.sunDirY      = gbufferModelViewInverse.0.1 * sunPosition.x + gbufferModelViewInverse.1.1 * sunPosition.y + gbufferModelViewInverse.2.1 * sunPosition.z
variable.float.sunDirZ      = gbufferModelViewInverse.0.2 * sunPosition.x + gbufferModelViewInverse.1.2 * sunPosition.y + gbufferModelViewInverse.2.2 * sunPosition.z
uniform.vec3.sunDir         = vec3(sunDirX * sunDirNorm, sunDirY * sunDirNorm, sunDirZ * sunDirNorm)

variable.float.moonDirNorm  = 1.0 / sqrt((moonPosition.x * moonPosition.x) + (moonPosition.y * moonPosition.y) + (moonPosition.z * moonPosition.z))
variable.float.mvecX        = moonPosition.x * moonDirNorm
variable.float.mvecY        = moonPosition.y * moonDirNorm
variable.float.mvecZ        = moonPosition.z * moonDirNorm
uniform.vec3.moonDirView    = vec3(mvecX, mvecY, mvecZ)
variable.float.moonDirX     = gbufferModelViewInverse.0.0 * moonPosition.x + gbufferModelViewInverse.1.0 * moonPosition.y + gbufferModelViewInverse.2.0 * moonPosition.z
variable.float.moonDirY     = gbufferModelViewInverse.0.1 * moonPosition.x + gbufferModelViewInverse.1.1 * moonPosition.y + gbufferModelViewInverse.2.1 * moonPosition.z
variable.float.moonDirZ     = gbufferModelViewInverse.0.2 * moonPosition.x + gbufferModelViewInverse.1.2 * moonPosition.y + gbufferModelViewInverse.2.2 * moonPosition.z
uniform.vec3.moonDir        = vec3(moonDirX * moonDirNorm, moonDirY * moonDirNorm, moonDirZ * moonDirNorm)

variable.float.shadowmapLightDirX = shadowModelViewInverse.2.0 * 1.0
variable.float.shadowmapLightDirY = shadowModelViewInverse.2.1 * 1.0
variable.float.shadowmapLightDirZ = shadowModelViewInverse.2.2 * 1.0
uniform.vec3.lightDir = vec3(shadowmapLightDirX, shadowmapLightDirY, shadowmapLightDirZ)
variable.float.shadowmapLightDirViewX = gbufferModelView.0.0 * shadowmapLightDirX + gbufferModelView.1.0 * shadowmapLightDirY + gbufferModelView.2.0 * shadowmapLightDirZ
variable.float.shadowmapLightDirViewY = gbufferModelView.0.1 * shadowmapLightDirX + gbufferModelView.1.1 * shadowmapLightDirY + gbufferModelView.2.1 * shadowmapLightDirZ
variable.float.shadowmapLightDirViewZ = gbufferModelView.0.2 * shadowmapLightDirX + gbufferModelView.1.2 * shadowmapLightDirY + gbufferModelView.2.2 * shadowmapLightDirZ
uniform.vec3.lightDirView = vec3(shadowmapLightDirViewX, shadowmapLightDirViewY, shadowmapLightDirViewZ)

variable.float.timeSunrise  = ((clamp(sunAngle, 0.97, 1.00) - 0.97) / 0.03) + (1.0 - (clamp(sunAngle, 0.01, 0.10) - 0.01) / 0.09)
variable.float.timeNoon_0   = ((clamp(sunAngle, 0.01, 0.10) - 0.01) / 0.09) - ((clamp(sunAngle, 0.40, 0.49) - 0.40) / 0.09)
variable.float.timeSunset   = ((clamp(sunAngle, 0.40, 0.49) - 0.40) / 0.09) - ((clamp(sunAngle, 0.50, 0.53) - 0.50) / 0.03)
variable.float.timeNight    = ((clamp(sunAngle, 0.50, 0.53) - 0.50) / 0.03) - ((clamp(sunAngle, 0.97, 1.00) - 0.97) / 0.03)
uniform.vec4.daytime        = vec4(timeSunrise, timeNoon_0, timeSunset, timeNight)

variable.float.sunY         = sunDirY * sunDirNorm
variable.float.lf1          = (1.0 - ((clamp(-sunY, 0.002, 0.04) - 0.002) / 0.038)) * (1.0 - ((clamp(sunY, 0.002, 0.04) - 0.002) / 0.038))
uniform.float.lightFlip     = clamp(1.0 - lf1, 0.0, 1.0)


variable.float.smoothWorldTime = smooth(sunDirZ, frameTime*8.0, frameTime*8.0)
uniform.int.WorldTimeChange = if(abs(smoothWorldTime - sunDirZ) > 0.9, 1, 0)

variable.float.RW_BIOME_Dry = if(biome_category == CAT_DESERT, 1.0, \
                                    biome_category == CAT_MESA, 0.8, \
                                    biome_category == CAT_SAVANNA, 0.6, \
                                    biome_category == CAT_ICY, 1.0, \
                                    0.0)
uniform.float.RW_BIOME_Dryness = clamp(smooth(72, RW_BIOME_Dry, 32.0, 32.0), 0.0, 1.0)


#
#           DETAILED TIME DEPENDENT STUFF
#

variable.float.timeMorning      = ((clamp(worldTime, 22600.0, 23600.0) - 22600.0) / 1000.0)  + (1.0-((clamp(worldTime, 200.0, 1000.0) - 200.0) / 800.0))
variable.float.timeForenoon     = ((clamp(worldTime,   200.0,  1000.0) -   200.0) /  800.0)  - ((clamp(worldTime,  3500.0,  5500.0) -  3500.0) / 2000.0)
variable.float.timeNoon         = ((clamp(worldTime,  3500.0,  5500.0) -  3500.0) / 2000.0)  - ((clamp(worldTime,  6500.0,  8500.0) -  6500.0) / 2000.0)
variable.float.timeAfternoon    = ((clamp(worldTime,  6500.0,  8500.0) -  6500.0) / 2000.0)  - ((clamp(worldTime, 11000.0, 11800.0) - 11000.0) /  800.0)
variable.float.timeEvening      = ((clamp(worldTime, 11000.0, 11800.0) - 11000.0) /  800.0)  - ((clamp(worldTime, 13000.0, 13600.0) - 13000.0) /  600.0)
variable.float.timeDusk         = ((clamp(worldTime, 13000.0, 13600.0) - 13000.0) /  600.0)  - ((clamp(worldTime, 17000.0, 19000.0) - 17000.0) / 2000.0)
variable.float.timeDawn         = ((clamp(worldTime, 17000.0, 19000.0) - 17000.0) / 2000.0)  - ((clamp(worldTime, 22600.0, 23600.0) - 22600.0) / 1000.0)

variable.float.ctimeForenoon    = ((clamp(worldTime,   200.0,  1000.0) -   200.0) /  800.0)  - ((clamp(worldTime,  4500.0,  7000.0) -  4500.0) / 2500.0)
variable.float.ctimeAfternoon   = ((clamp(worldTime,  4500.0,  7000.0) -  4500.0) / 2500.0)  - ((clamp(worldTime, 11000.0, 11800.0) - 11000.0) /  800.0)


#
#           ATMOSPHERE CONCENTRATION DYNAMICS
#

variable.float.atmosRayleigh   = timeMorning * 1.2 + timeForenoon * 1.1 + timeNoon * 1.0 + timeAfternoon * 1.05 + timeEvening * 1.28 + timeDusk * 1.14 + timeDawn * 1.0 + wetness
variable.float.atmosMie        = timeMorning * 1.0 + timeForenoon * 1.0 + timeNoon * 1.0 + timeAfternoon * 1.1 + timeEvening * 1.22 + timeDusk * 1.15 + timeDawn * 0.9 + wetness * 16.0
variable.float.atmosOzone      = timeMorning * 1.33 + timeForenoon * 1.0 + timeNoon * 1.0 + timeAfternoon * 1.15 + timeEvening * 1.45 + timeDusk * 1.4 + timeDawn * 1.3
uniform.vec3.airDensityCoeff = vec3(atmosRayleigh, atmosMie, atmosOzone)

#
#           CLOUD DYNAMICS
#

variable.bool.isCloudSunlit     = (worldTime>23000 || worldTime<12900)
uniform.vec3.cloudLightDir      = vec3(if(isCloudSunlit, sunDirX, moonDirX)*sunDirNorm, if(isCloudSunlit, sunDirY, moonDirY)*sunDirNorm, if(isCloudSunlit, sunDirZ, moonDirZ)*sunDirNorm)
uniform.vec3.cloudLightDirView  = vec3(if(isCloudSunlit, svecX, mvecX), if(isCloudSunlit, svecY, mvecY), if(isCloudSunlit, svecZ, mvecZ))
variable.float.cloudBackscatterInt = ((clamp(worldTime, 12550.0, 12800.0) - 12550.0) / 250.0) - ((clamp(worldTime, 23250.0, 23600.0) - 23250.0) / 350.0)

variable.float.cloudVolumeCov   = 0.01*timeSunrise - 0.02*timeSunset - 0.01*timeNight - wetness * 0.25
variable.float.cloudVolumeDensity = timeMorning * 0.6 + timeForenoon * 0.9 + timeNoon * 1.0 + timeAfternoon * 1.0 + timeEvening * 0.7 + timeDusk * 0.6 + timeDawn * 0.7

uniform.vec3.volumeCloudData = vec3(cloudVolumeCov, cloudVolumeDensity, if(isCloudSunlit, 1.0-cloudBackscatterInt*0.75, 1.0))

variable.float.cloudCirrusCov   = 0.07*timeSunrise + 0.05 * timeForenoon - 0.035*timeSunset - 0.02*timeNight
variable.float.cloudCirrusDensity = timeMorning * 0.9 + timeForenoon * 1.0 + timeNoon * 1.0 + timeAfternoon * 1.0 + timeEvening * 0.66 + timeDusk * 0.7 + timeDawn * 0.7
uniform.vec2.volumeCirrusData = vec2(cloudCirrusCov, cloudCirrusDensity)


#
#           FOG DYNAMICS
#

variable.float.fogRayleigh  = 0.7 * timeMorning + 0.52 * timeForenoon + 0.5 * timeNoon + 0.41 * timeAfternoon + 0.33 * timeEvening + 0.37 * timeDusk + 0.48 * timeDawn + wetness
variable.float.fogMie       = 1.0 * timeMorning + 0.4 * timeForenoon + 0.3 * timeNoon + 0.26 * timeAfternoon + 0.42 * timeEvening + 0.54 * timeDusk + 0.65 * timeDawn + wetness * 2.5
variable.float.fogMist      = 1.0 * timeMorning + 0.06 * timeForenoon + timeDawn * 0.35 + wetness * 2.0

uniform.vec3.fogDensityCoeff = vec3(fogRayleigh, fogMie, fogMist)