###############################################
#        Copyright (C) NobleRT - 2022         #
#   Belmu | GNU General Public License V3.0   #
#                                             #
# By downloading this content you have agreed #
#     to the license and its terms of use.    #
###############################################

##-----------#  Minecraft Miscellaneous Settings  #-----------##

sun    = false
moon   = false
clouds = off

separateAo        = false
vignette          = false
oldLighting       = false
oldHandLight      = false
underwaterOverlay = false
dynamicHandLight  = true

##-------------------#  Custom Uniforms  #--------------------##

uniform.int.framemod   = frameCounter % 8
uniform.vec2.viewSize  = vec2(viewWidth, viewHeight)
uniform.vec2.pixelSize = vec2(1.0 / viewWidth, 1.0 / viewHeight)

uniform.vec3.shadowVec = vec3(shadowLightPosition.x * 0.01, shadowLightPosition.y * 0.01, shadowLightPosition.z * 0.01)

# World space celestial vectors uniforms from Zombye#7365 (Spectrum - https://github.com/zombye/spectrum)

variable.float.sunVectorNorm = 1.0 / sqrt((sunPosition.x * sunPosition.x) + (sunPosition.y * sunPosition.y) + (sunPosition.z * sunPosition.z))
uniform.vec3.sunVectorView   = vec3(sunPosition.x * sunVectorNorm, sunPosition.y * sunVectorNorm, sunPosition.z * sunVectorNorm)
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
uniform.vec3.sunVector       = vec3(sunVectorX * sunVectorNorm, sunVectorY * sunVectorNorm, sunVectorZ * sunVectorNorm)

variable.float.moonVectorNorm = 1.0 / sqrt((moonPosition.x * moonPosition.x) + (moonPosition.y * moonPosition.y) + (moonPosition.z * moonPosition.z))
uniform.vec3.moonVectorView   = vec3(moonPosition.x * moonVectorNorm, moonPosition.y * moonVectorNorm, moonPosition.z * moonVectorNorm)
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
uniform.vec3.moonVector       = vec3(moonVectorX * moonVectorNorm, moonVectorY * moonVectorNorm, moonVectorZ * moonVectorNorm)

variable.float.shadowLightVectorNorm = 1.0 / sqrt((shadowLightPosition.x * shadowLightPosition.x) + (shadowLightPosition.y * shadowLightPosition.y) + (shadowLightPosition.z * shadowLightPosition.z))
uniform.vec3.shadowLightVectorView   = vec3(shadowLightPosition.x * shadowLightVectorNorm, shadowLightPosition.y * shadowLightVectorNorm, shadowLightPosition.z * shadowLightVectorNorm)
variable.float.shadowLightVectorX    = gbufferModelViewInverse.0.0 * shadowLightPosition.x + gbufferModelViewInverse.1.0 * shadowLightPosition.y + gbufferModelViewInverse.2.0 * shadowLightPosition.z
variable.float.shadowLightVectorY    = gbufferModelViewInverse.0.1 * shadowLightPosition.x + gbufferModelViewInverse.1.1 * shadowLightPosition.y + gbufferModelViewInverse.2.1 * shadowLightPosition.z
variable.float.shadowLightVectorZ    = gbufferModelViewInverse.0.2 * shadowLightPosition.x + gbufferModelViewInverse.1.2 * shadowLightPosition.y + gbufferModelViewInverse.2.2 * shadowLightPosition.z
uniform.vec3.shadowLightVector       = vec3(shadowLightVectorX * shadowLightVectorNorm, shadowLightVectorY * shadowLightVectorNorm, shadowLightVectorZ * shadowLightVectorNorm)

##-------------------#  Custom Textures  #--------------------##

#if LUT == 1
    texture.composite.colortex7 = image/lut/lut0.png
#elif LUT == 2
    texture.composite.colortex7 = image/lut/lut1.png
#elif LUT == 3
    texture.composite.colortex7 = image/lut/lut2.png
#elif LUT == 4
    texture.composite.colortex7 = image/lut/lut3.png
#elif LUT == 5
    texture.composite.colortex7 = image/lut/lut4.png
#elif LUT == 6
    texture.composite.colortex7 = image/lut/lut5.png
#elif LUT == 7
    texture.composite.colortex7 = image/lut/lut6.png
#elif LUT == 8
    texture.composite.colortex7 = image/lut/lut7.png
#elif LUT == 9
    texture.composite.colortex7 = image/lut/lut8.png
#elif LUT == 10
    texture.composite.colortex7 = image/lut/lut9.png
#elif LUT == 11
    texture.composite.colortex7 = image/lut/lut10.png
#elif LUT == 12
    texture.composite.colortex7 = image/lut/lut11.png
#elif LUT == 13
    texture.composite.colortex7 = image/lut/lut12.png
#elif LUT == 14
    texture.composite.colortex7 = image/lut/lut13.png
#elif LUT == 15
    texture.composite.colortex7 = image/lut/lut14.png
#elif LUT == 16
    texture.composite.colortex7 = image/lut/lut15.png
#elif LUT == 17
    texture.composite.colortex7 = image/lut/lut16.png
#elif LUT == 18
    texture.composite.colortex7 = image/lut/lut17.png
#elif LUT == 19
    texture.composite.colortex7 = image/lut/lut18.png
#elif LUT == 20
    texture.composite.colortex7 = image/lut/lut19.png
#endif

# Clouds noise textures
texture.deferred.depthtex2 = image/shapeNoise.dat TEXTURE_3D RGBA8 128 128 128 RGBA UNSIGNED_BYTE
texture.deferred.noisetex  = image/curl.dat TEXTURE_3D RGB8 32 32 32 RGB UNSIGNED_BYTE

##--------------------#  Alpha Testing  #---------------------##

alphaTest.gbuffers_block      = off
alphaTest.gbuffers_entities   = off
alphaTest.gbuffers_hand       = off
alphaTest.gbuffers_hand_water = off
alphaTest.gbuffers_skybasic   = off
alphaTest.gbuffers_terrain    = off
alphaTest.gbuffers_textured   = off
alphaTest.gbuffers_water      = off
alphaTest.gbuffers_weather    = off
alphaTest.shadow              = off

##--------------------#  Alpha Blending  #--------------------##

blend.gbuffers_block    = off
blend.gbuffers_entities = off
blend.gbuffers_hand     = off
blend.gbuffers_terrain  = off
blend.gbuffers_textured = off
blend.shadow            = off

# Translucents
blend.gbuffers_basic                 = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
blend.gbuffers_weather               = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
blend.gbuffers_water                 = off
blend.gbuffers_water.colortex13      = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO
blend.gbuffers_hand_water            = off
blend.gbuffers_hand_water.colortex13 = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE ZERO

##--------------# Settings Menu Configuration #---------------##

# Profiles
profile.DEFAULT = BINARY_COUNT=6  ACCUMULATION_VELOCITY_WEIGHT=0 GI_STEPS=64  GI=0 GI_FILTER=1                            DISCARD_HAND=0
profile.RENDER  = BINARY_COUNT=10 ACCUMULATION_VELOCITY_WEIGHT=1 GI_STEPS=128 GI=1 GI_FILTER=0 GI_TEMPORAL_ACCUMULATION=1 DISCARD_HAND=1

# Screens
screen = ABOUT <profile> <empty> [LIGHTING] [ATMOSPHERICS] [TERRAIN] [POST_PROCESSING]

screen.LIGHTING          = [RAYTRACING] [AMBIENT_OCCLUSION] DIRECTIONAL_LIGHTMAP BLOCKLIGHT_TEMPERATURE <empty> <empty> SUBSURFACE_SCATTERING MATERIAL_AO SHADOWS SPECULAR <empty> <empty> SHADOW_TYPE shadowMapResolution SHADOW_SAMPLES shadowDistance
screen.AMBIENT_OCCLUSION = AO AO_TYPE AO_FILTER AO_SCALE <empty> <empty> SSAO_SAMPLES SSAO_RADIUS RTAO_SAMPLES RTAO_STEPS GTAO_SLICES GTAO_RADIUS
screen.RAYTRACING        = REFLECTIONS REFRACTIONS REFLECTIONS_TYPE REFLECTIONS_SCALE <empty> <empty> GI [FILTER] SKY_CONTRIBUTION GI_SCALE GI_SAMPLES GI_BOUNCES <empty> <empty> BINARY_REFINEMENT SSR_REPROJECTION
screen.FILTER            = GI_FILTER GI_TEMPORAL_ACCUMULATION ATROUS_STEP_SIZE <empty> NORMAL_WEIGHT_SIGMA DEPTH_WEIGHT_SIGMA LUMA_WEIGHT_SIGMA
screen.ATMOSPHERICS      = sunPathRotation CELESTIAL_SIZE_MULTIPLIER <empty> <empty> ATMOSPHERE_SCALE [CLOUDS] SCATTERING_STEPS TRANSMITTANCE_STEPS <empty> <empty> AIR_FOG VL_SCATTERING_STEPS FOG_ALTITUDE FOG_THICKNESS FOG_DENSITY
screen.CLOUDS            = PRIMARY_CLOUDS SECONDARY_CLOUDS CLOUDS_SCALE CLOUDS_SCATTERING_STEPS <empty> <empty> CLOUDS_LAYER0_ALTITUDE CLOUDS_LAYER0_THICKNESS CLOUDS_LAYER0_COVERAGE CLOUDS_LAYER0_SWIRL <empty> <empty> CLOUDS_SHADOWS CLOUDS_SHADOWS_RESOLUTION
screen.TERRAIN           = WHITE_WORLD [WATER] <empty> <empty> RAIN_PUDDLES RAIN_PUDDLES_SIZE <empty> <empty> POM POM_LAYERS POM_DEPTH
screen.WATER             = WATER_CAUSTICS WATER_CAUSTICS_STRENGTH <empty> <empty> WATER_OCTAVES WAVE_STEEPNESS WAVE_AMPLITUDE WAVE_SPEED <empty> <empty> WATER_FOG WATER_FOG_STEPS [WATER_ABSORPTION] [WATER_SCATTERING]
screen.WATER_ABSORPTION  = WATER_ABSORPTION_R WATER_ABSORPTION_G WATER_ABSORPTION_B
screen.WATER_SCATTERING  = WATER_SCATTERING_R WATER_SCATTERING_G WATER_SCATTERING_B
screen.POST_PROCESSING   = [CAMERA_SETTINGS] [DEPTH_OF_FIELD] [COLOR_GRADING] [ANTI_ALIASING] <empty> <empty> BLOOM BLOOM_STRENGTH VIGNETTE VIGNETTE_STRENGTH FILM_GRAIN FILM_GRAIN_STRENGTH SHARPEN SHARPEN_STRENGTH
screen.CAMERA_SETTINGS   = EXPOSURE PURKINJE <empty> FOCAL APERTURE ISO SHUTTER_SPEED
screen.DEPTH_OF_FIELD    = DOF <empty> DOF_RADIUS DOF_DEPTH
screen.COLOR_GRADING     = TONEMAP LUT <empty> <empty> WHITE_BALANCE <empty> VIBRANCE SATURATION CONTRAST GAMMA GAIN LIFT
screen.ANTI_ALIASING     = TAA <empty> TAA_OFFCENTER_REJECTION

# Sliders
sliders = BLOCKLIGHT_TEMPERATURE shadowMapResolution SHADOW_SAMPLES shadowDistance AO_SCALE SSAO_SAMPLES SSAO_RADIUS RTAO_SAMPLES RTAO_STEPS GTAO_SLICES GTAO_RADIUS \
          REFLECTIONS_SCALE ATROUS_STEP_SIZE NORMAL_WEIGHT_SIGMA DEPTH_WEIGHT_SIGMA LUMA_WEIGHT_SIGMA GI_SAMPLES GI_BOUNCES GI_SCALE \
          sunPathRotation CELESTIAL_SIZE_MULTIPLIER ATMOSPHERE_SCALE SCATTERING_STEPS TRANSMITTANCE_STEPS CLOUDS_SCALE CLOUDS_SCATTERING_STEPS CLOUDS_LAYER0_ALTITUDE CLOUDS_LAYER0_THICKNESS CLOUDS_LAYER0_COVERAGE CLOUDS_LAYER0_SWIRL CLOUDS_SHADOWS_RESOLUTION VL_SCATTERING_STEPS FOG_ALTITUDE FOG_THICKNESS FOG_DENSITY \
          RAIN_PUDDLES_SIZE POM_LAYERS POM_DEPTH WATER_CAUSTICS_STRENGTH WATER_OCTAVES WAVE_STEEPNESS WAVE_AMPLITUDE WAVE_SPEED WATER_FOG_STEPS WATER_ABSORPTION_R WATER_ABSORPTION_G WATER_ABSORPTION_B WATER_SCATTERING_R WATER_SCATTERING_G WATER_SCATTERING_B \
          FOCAL APERTURE ISO SHUTTER_SPEED DOF_RADIUS DOF_DEPTH LUT WHITE_BALANCE VIBRANCE SATURATION CONTRAST GAMMA GAIN LIFT TAA_OFFCENTER_REJECTION BLOOM_STRENGTH VIGNETTE_STRENGTH FILM_GRAIN_STRENGTH SHARPEN_STRENGTH

# Columns
screen.columns                  = 1
screen.FILTER.columns           = 1
screen.WATER_ABSORPTION.columns = 3
screen.WATER_SCATTERING.columns = 3
screen.CAMERA_SETTINGS.columns  = 1
screen.DEPTH_OF_FIELD.columns   = 1
screen.ANTI_ALIASING.columns    = 1

##-------------------#  Custom Buffers Sizes  #--------------------##

######################################
##                AO                ##
######################################

#if AO_SCALE == 10 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.10 0.10
#elif AO_SCALE == 15 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.15 0.15
#elif AO_SCALE == 20 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.20 0.20
#elif AO_SCALE == 25 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.25 0.25
#elif AO_SCALE == 30 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.30 0.30
#elif AO_SCALE == 35 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.35 0.35
#elif AO_SCALE == 40 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.40 0.40
#elif AO_SCALE == 45 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.45 0.45
#elif AO_SCALE == 50 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.50 0.50
#elif AO_SCALE == 55 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.55 0.55
#elif AO_SCALE == 60 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.60 0.60
#elif AO_SCALE == 65 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.65 0.65
#elif AO_SCALE == 70 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.70 0.70
#elif AO_SCALE == 75 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.75 0.75
#elif AO_SCALE == 80 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.80 0.80
#elif AO_SCALE == 85 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.85 0.85
#elif AO_SCALE == 90 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.90 0.90
#elif AO_SCALE == 95 && GI == 0 && AO == 1
    size.buffer.colortex10 = 0.95 0.95
#endif

######################################
##            ATMOSPHERE            ##
######################################

#if ATMOSPHERE_SCALE == 10
    size.buffer.colortex12 = 0.10 0.10
#elif ATMOSPHERE_SCALE == 15
    size.buffer.colortex12 = 0.15 0.15
#elif ATMOSPHERE_SCALE == 20
    size.buffer.colortex12 = 0.20 0.20
#elif ATMOSPHERE_SCALE == 25
    size.buffer.colortex12 = 0.25 0.25
#elif ATMOSPHERE_SCALE == 30
    size.buffer.colortex12 = 0.30 0.30
#elif ATMOSPHERE_SCALE == 35
    size.buffer.colortex12 = 0.35 0.35
#elif ATMOSPHERE_SCALE == 40
    size.buffer.colortex12 = 0.40 0.40
#elif ATMOSPHERE_SCALE == 45
    size.buffer.colortex12 = 0.45 0.45
#elif ATMOSPHERE_SCALE == 50
    size.buffer.colortex12 = 0.50 0.50
#elif ATMOSPHERE_SCALE == 55
    size.buffer.colortex12 = 0.55 0.55
#elif ATMOSPHERE_SCALE == 60
    size.buffer.colortex12 = 0.60 0.60
#elif ATMOSPHERE_SCALE == 65
    size.buffer.colortex12 = 0.65 0.65
#elif ATMOSPHERE_SCALE == 70
    size.buffer.colortex12 = 0.70 0.70
#elif ATMOSPHERE_SCALE == 75
    size.buffer.colortex12 = 0.75 0.75
#elif ATMOSPHERE_SCALE == 80
    size.buffer.colortex12 = 0.80 0.80
#elif ATMOSPHERE_SCALE == 85
    size.buffer.colortex12 = 0.85 0.85
#elif ATMOSPHERE_SCALE == 90
    size.buffer.colortex12 = 0.90 0.90
#elif ATMOSPHERE_SCALE == 95
    size.buffer.colortex12 = 0.95 0.95
#endif

######################################
##              CLOUDS              ##
######################################

#if CLOUDS_SCALE == 10
    size.buffer.colortex0 = 0.10 0.10
#elif CLOUDS_SCALE == 15
    size.buffer.colortex0 = 0.15 0.15
#elif CLOUDS_SCALE == 20
    size.buffer.colortex0 = 0.20 0.20
#elif CLOUDS_SCALE == 25
    size.buffer.colortex0 = 0.25 0.25
#elif CLOUDS_SCALE == 30
    size.buffer.colortex0 = 0.30 0.30
#elif CLOUDS_SCALE == 35
    size.buffer.colortex0 = 0.35 0.35
#elif CLOUDS_SCALE == 40
    size.buffer.colortex0 = 0.40 0.40
#elif CLOUDS_SCALE == 45
    size.buffer.colortex0 = 0.45 0.45
#elif CLOUDS_SCALE == 50
    size.buffer.colortex0 = 0.50 0.50
#elif CLOUDS_SCALE == 55
    size.buffer.colortex0 = 0.55 0.55
#elif CLOUDS_SCALE == 60
    size.buffer.colortex0 = 0.60 0.60
#elif CLOUDS_SCALE == 65
    size.buffer.colortex0 = 0.65 0.65
#elif CLOUDS_SCALE == 70
    size.buffer.colortex0 = 0.70 0.70
#elif CLOUDS_SCALE == 75
    size.buffer.colortex0 = 0.75 0.75
#elif CLOUDS_SCALE == 80
    size.buffer.colortex0 = 0.80 0.80
#elif CLOUDS_SCALE == 85
    size.buffer.colortex0 = 0.85 0.85
#elif CLOUDS_SCALE == 90
    size.buffer.colortex0 = 0.90 0.90
#elif CLOUDS_SCALE == 95
    size.buffer.colortex0 = 0.95 0.95
#endif

######################################
##           REFLECTIONS            ##
######################################

#if REFLECTIONS_SCALE == 10
    size.buffer.colortex2 = 0.10 0.10
#elif REFLECTIONS_SCALE == 15
    size.buffer.colortex2 = 0.15 0.15
#elif REFLECTIONS_SCALE == 20
    size.buffer.colortex2 = 0.20 0.20
#elif REFLECTIONS_SCALE == 25
    size.buffer.colortex2 = 0.25 0.25
#elif REFLECTIONS_SCALE == 30
    size.buffer.colortex2 = 0.30 0.30
#elif REFLECTIONS_SCALE == 35
    size.buffer.colortex2 = 0.35 0.35
#elif REFLECTIONS_SCALE == 40
    size.buffer.colortex2 = 0.40 0.40
#elif REFLECTIONS_SCALE == 45
    size.buffer.colortex2 = 0.45 0.45
#elif REFLECTIONS_SCALE == 50
    size.buffer.colortex2 = 0.50 0.50
#elif REFLECTIONS_SCALE == 55
    size.buffer.colortex2 = 0.55 0.55
#elif REFLECTIONS_SCALE == 60
    size.buffer.colortex2 = 0.60 0.60
#elif REFLECTIONS_SCALE == 65
    size.buffer.colortex2 = 0.65 0.65
#elif REFLECTIONS_SCALE == 70
    size.buffer.colortex2 = 0.70 0.70
#elif REFLECTIONS_SCALE == 75
    size.buffer.colortex2 = 0.75 0.75
#elif REFLECTIONS_SCALE == 80
    size.buffer.colortex2 = 0.80 0.80
#elif REFLECTIONS_SCALE == 85
    size.buffer.colortex2 = 0.85 0.85
#elif REFLECTIONS_SCALE == 90
    size.buffer.colortex2 = 0.90 0.90
#elif REFLECTIONS_SCALE == 95
    size.buffer.colortex2 = 0.95 0.95
#endif
