particles.ordering=mixed
shadow.culling=true
occlusion.culling=true
allowConcurrentCompute=true
supportsColorCorrection=true

# DH shadow is still broken on fabric
dhShadow.enabled=false

# -------------------------------------------------- Vanilla Stuff ---------------------------------------------------
underwaterOverlay=false
clouds=off
moon=false
sun=false
sky=false
stars=false
vignette=false

# --------------------------------------------------- Iris Features ---------------------------------------------------
iris.features.required=SSBO CUSTOM_IMAGES SEPARATE_HARDWARE_SAMPLERS HIGHER_SHADOWCOLOR


# -------------------------------------------------- Custom Textures --------------------------------------------------
texture.noise=textures/noisetex.png

customTexture.usam_waveNoise=textures/noise_5.bin TEXTURE_2D R16 2048 2048 RED UNSIGNED_SHORT
customTexture.usam_waveHFCurl=textures/water_hf_curl.bin TEXTURE_2D RG16_SNORM 512 512 RG SHORT

customTexture.usam_blueNoise3D=textures/blue_noise_64x64x64.bin TEXTURE_3D RGBA16 64 64 64 RGBA UNSIGNED_SHORT
customTexture.usam_whiteNoise3D=textures/white_noise_64x64x64.bin TEXTURE_3D RGBA16 64 64 64 RGBA UNSIGNED_SHORT
customTexture.usam_stbnVec1=textures/stbn_vec1_2Dx1D_128x128x64.bin TEXTURE_3D R8 128 128 64 RED UNSIGNED_BYTE
customTexture.usam_stbnUnitVec2=textures/stbn_unitvec2_2Dx1D_128x128x64.bin TEXTURE_3D RG8 128 128 64 RG UNSIGNED_BYTE
customTexture.usam_stbnVec2=textures/stbn_vec2_2Dx1D_128x128x64.bin TEXTURE_3D RG8 128 128 64 RG UNSIGNED_BYTE

#if SETTING_STARMAP_INTENSITY
customTexture.usam_starmap=textures/starmap_2020_4k_logluv32.png
#endif
#ifdef SETTING_CONSTELLATIONS
customTexture.usam_constellations=textures/constellation_figures_32k_4k.bin TEXTURE_2D R8 4096 2048 RED UNSIGNED_BYTE
#endif
customTexture.usam_cloudPhases=textures/opac_cloud_phases.bin TEXTURE_2D RGBA16F 256 3 RGBA HALF_FLOAT
customTexture.usam_cirrus=textures/cirrus_20.png
customTexture.usam_cumulusDetail1=textures/cumulus_detail1.bin TEXTURE_3D R8 128 128 128 RED UNSIGNED_BYTE
customTexture.usam_cumulusDetail2=textures/cumulus_detail2.bin TEXTURE_3D R8 128 128 128 RED UNSIGNED_BYTE
customTexture.usam_cumulusCurl=textures/cumulus_curl.bin TEXTURE_3D RGBA8_SNORM 64 64 64 RGBA BYTE
customTexture.usam_cumulusBase=textures/cumulus_base.bin TEXTURE_2D R8 1024 1024 RED UNSIGNED_BYTE

# --------------------------------------------------- Custom Images ---------------------------------------------------
image.uimg_csr32f=usam_csr32f RED R32F FLOAT false true 2.0 2.0

image.uimg_frgba16f=usam_frgba16f RGBA RGBA16F FLOAT false false 1024 832
image.uimg_fr32f=usam_fr32f RED R32F FLOAT false false 256 262
image.uimg_frgba16=usam_frgba16 RGBA RGBA16 UNSIGNED_SHORT false false 256 256

image.uimg_rgba32ui=usam_rgba32ui RGBA_INTEGER RGBA32UI UNSIGNED_INT false true 2.0 3.0
image.uimg_rgba16f=usam_rgba16f RGBA RGBA16F HALF_FLOAT false true 4.0 4.0
image.uimg_rgb10_a2=usam_rgb10_a2 RGBA RGB10_A2 UNSIGNED_INT_2_10_10_10_REV false true 2.0 3.0
image.uimg_rgba8=usam_rgba8 RGBA RGBA8 UNSIGNED_BYTE false true 2.0 3.0
image.uimg_rg32ui=usam_rg32ui RG_INTEGER RG32UI UNSIGNED_INT false true 2.0 2.0
image.uimg_r32f=usam_r32f RED R32F FLOAT false true 2.0 2.0

#if SETTING_SLICE_SAMPLES == 128
#define EPIPOLAR_DATA_Y_SIZE 385
#elif SETTING_SLICE_SAMPLES == 256
#define EPIPOLAR_DATA_Y_SIZE 769
#elif SETTING_SLICE_SAMPLES == 512
#define EPIPOLAR_DATA_Y_SIZE 1537
#elif SETTING_SLICE_SAMPLES == 1024
#define EPIPOLAR_DATA_Y_SIZE 3073
#endif

#if SETTING_SKYVIEW_RES == 128
#define SETTING_SKYVIEW_X_SIZE 64
#elif SETTING_SKYVIEW_RES == 256
#define SETTING_SKYVIEW_X_SIZE 128
#elif SETTING_SKYVIEW_RES == 512
#define SETTING_SKYVIEW_X_SIZE 256
#elif SETTING_SKYVIEW_RES == 1024
#define SETTING_SKYVIEW_X_SIZE 512
#endif
image.uimg_skyViewLUT=usam_skyViewLUT RGBA RGBA16F FLOAT false false SETTING_SKYVIEW_X_SIZE SETTING_SKYVIEW_RES 12

image.uimg_epipolarData=usam_epipolarData RGBA_INTEGER RGBA32UI UNSIGNED_INT false false SETTING_EPIPOLAR_SLICES EPIPOLAR_DATA_Y_SIZE
image.uimg_cloudsAmbLUT=usam_cloudsAmbLUT RGBA RGBA16F FLOAT false false 32 32 6
image.uimg_envProbe=usam_envProbe RGBA_INTEGER RGBA32UI UNSIGNED_INT false false 1024 768

image.uimg_hiz=usam_hiz RG RG32F FLOAT false true 1.0 2.0

# ------------------------------------------------- Ping-pong Buffers -------------------------------------------------
size.buffer.colortex14=1.0 2.0

# -------------------------------------------------------- SSBO --------------------------------------------------------
bufferObject.0=16384
bufferObject.1=4 true 1.0 1.0
bufferObject.2=32768
#ifdef SETTING_DEBUG_SST_STEPS
bufferObject.3=65536
#endif
bufferObject.4=16384 true 0.033 0.033
bufferObject.5=4096 true 0.033 0.033

bufferObject.7=16 true 0.0625 0.0625


# ---------------------------------------------- Indirect Compute Passes ----------------------------------------------
indirect.composite35=0 0
indirect.deferred59=0 16

# ------------------------------------------------------ Enabling ------------------------------------------------------
#if !defined(SETTING_DOF) || defined(SETTING_DOF_MANUAL_FOCUS)
program.deferred25.enabled=false
#endif
program.deferred10.enabled=SETTING_CLOUDS_CU

program.deferred15.enabled=SETTING_WATER_CAUSTICS
program.deferred16.enabled=SETTING_WATER_CAUSTICS
program.deferred17.enabled=SETTING_WATER_CAUSTICS
program.deferred18.enabled=SETTING_WATER_CAUSTICS


program.deferred19.enabled=SETTING_CLOUDS_CU
program.deferred20.enabled=SETTING_CLOUDS_CU

#if SETTING_GI_INITIAL_SST_STEPS < 64
program.deferred46.enabled=false
program.deferred47.enabled=false
#endif

program.deferred98.enabled=SETTING_DEBUG_SST
program.deferred99.enabled=SETTING_DEBUG_SST_STEPS

program.composite35.enabled=SETTING_DEPTH_BREAK_CORRECTION
program.composite38.enabled=SETTING_DOF

#if SETTING_BLOOM_PASS > 1
#define BLOOM_PASS_2 SETTING_BLOOM
#else
#define BLOOM_PASS_2 false
#endif
#if SETTING_BLOOM_PASS > 2
#define BLOOM_PASS_3 SETTING_BLOOM
#else
#define BLOOM_PASS_3 false
#endif
#if SETTING_BLOOM_PASS > 3
#define BLOOM_PASS_4 SETTING_BLOOM
#else
#define BLOOM_PASS_4 false
#endif
#if SETTING_BLOOM_PASS > 4
#define BLOOM_PASS_5 SETTING_BLOOM
#else
#define BLOOM_PASS_5 false
#endif
#if SETTING_BLOOM_PASS > 5
#define BLOOM_PASS_6 SETTING_BLOOM
#else
#define BLOOM_PASS_6 false
#endif
#if SETTING_BLOOM_PASS > 6
#define BLOOM_PASS_7 SETTING_BLOOM
#else
#define BLOOM_PASS_7 false
#endif
#if SETTING_BLOOM_PASS > 7
#define BLOOM_PASS_8 SETTING_BLOOM
#else
#define BLOOM_PASS_8 false
#endif
#if SETTING_BLOOM_PASS > 8
#define BLOOM_PASS_9 SETTING_BLOOM
#else
#define BLOOM_PASS_9 false
#endif
#if SETTING_BLOOM_PASS > 9
#define BLOOM_PASS_10 SETTING_BLOOM
#else
#define BLOOM_PASS_10 false
#endif
program.composite50.enabled=SETTING_BLOOM
program.composite51.enabled=BLOOM_PASS_2
program.composite52.enabled=BLOOM_PASS_3
program.composite53.enabled=BLOOM_PASS_4
program.composite54.enabled=BLOOM_PASS_5
program.composite55.enabled=BLOOM_PASS_6
program.composite56.enabled=BLOOM_PASS_7
program.composite57.enabled=BLOOM_PASS_8
program.composite58.enabled=BLOOM_PASS_9
program.composite59.enabled=BLOOM_PASS_10

program.composite66.enabled=BLOOM_PASS_10
program.composite67.enabled=BLOOM_PASS_9
program.composite68.enabled=BLOOM_PASS_8
program.composite69.enabled=BLOOM_PASS_7
program.composite70.enabled=BLOOM_PASS_6
program.composite71.enabled=BLOOM_PASS_5
program.composite72.enabled=BLOOM_PASS_4
program.composite73.enabled=BLOOM_PASS_3
program.composite74.enabled=BLOOM_PASS_2

# ------------------------------------------------------ Blending ------------------------------------------------------
blend.shadow.colortex0=off
blend.shadow.colortex1=off
blend.shadow.colortex2=SRC_ALPHA SRC_COLOR ONE ONE
blend.shadow.colortex3=off

blend.gbuffers_armor_glint=SRC_ALPHA SRC_COLOR ONE ZERO

blend.gbuffers_entities=off
blend.gbuffers_entities_translucent=off

blend.gbuffers_block.colortex8=off
blend.gbuffers_block.colortex9=off
blend.gbuffers_particles.colortex8=off
blend.gbuffers_particles.colortex9=off
blend.gbuffers_hand=off
blend.gbuffers_terrain=off
blend.gbuffers_terrain_cutout=off
blend.gbuffers_terrain_solid=off

blend.gbuffers_hand_water.colortex8=off
blend.gbuffers_hand_water.colortex9=off
blend.gbuffers_hand_water.colortex11=SRC_ALPHA SRC_COLOR ONE ONE
blend.dh_water.colortex8=off
blend.dh_water.colortex9=off
blend.dh_water.colortex11=SRC_ALPHA SRC_COLOR ONE ONE
blend.gbuffers_water.colortex8=off
blend.gbuffers_water.colortex9=off
blend.gbuffers_water.colortex11=SRC_ALPHA SRC_COLOR ONE ONE
blend.gbuffers_particles_translucent.colortex8=off
blend.gbuffers_particles_translucent.colortex9=off
blend.gbuffers_particles_translucent.colortex11=ZERO SRC_COLOR ONE ONE


# -------------------------------------------------- Custom Uniforms --------------------------------------------------
uniform.vec2.uval_mainImageSize=vec2(viewWidth, viewHeight)
uniform.vec2.uval_mainImageSizeRcp=vec2(1.0 / viewWidth, 1.0 / viewHeight)
uniform.int.uval_mainImageSizeIX=floor(viewWidth)
uniform.int.uval_mainImageSizeIY=floor(viewHeight)

variable.int.cameraDeltaIntX=cameraPositionInt.x - previousCameraPositionInt.x
variable.int.cameraDeltaIntY=cameraPositionInt.y - previousCameraPositionInt.y
variable.int.cameraDeltaIntZ=cameraPositionInt.z - previousCameraPositionInt.z
uniform.vec3.uval_cameraDelta=vec3(cameraDeltaIntX, cameraDeltaIntY, cameraDeltaIntZ) + cameraPositionFract - previousCameraPositionFract

variable.float.sunAngleWrapped=frac(sunAngle + 0.25)
uniform.float.uval_dayNightTransition=exp2(-1024.0*pow(16.0*(sunAngleWrapped-0.25),2.0))+exp2(-1024.0*pow((sunAngleWrapped-0.75),2.0))

uniform.vec2.uval_rtwsmMin=vec2(exp2(SETTING_RTWSM_F_MIN), exp2(SETTING_RTWSM_B_MIN))

variable.float.sunLength=sqrt(sunPosition.x * sunPosition.x + sunPosition.y * sunPosition.y + sunPosition.z * sunPosition.z)
uniform.vec3.uval_sunDirView=sunPosition / vec3(sunLength, sunLength, sunLength)
variable.vec3.sunDirWorldTemp=vec3(gbufferModelViewInverse.0.0 * uval_sunDirView.x + gbufferModelViewInverse.1.0 * uval_sunDirView.y + gbufferModelViewInverse.2.0 * uval_sunDirView.z, \
    gbufferModelViewInverse.0.1 * uval_sunDirView.x + gbufferModelViewInverse.1.1 * uval_sunDirView.y + gbufferModelViewInverse.2.1 * uval_sunDirView.z, \
    gbufferModelViewInverse.0.2 * uval_sunDirView.x + gbufferModelViewInverse.1.2 * uval_sunDirView.y + gbufferModelViewInverse.2.2 * uval_sunDirView.z)
variable.float.sunDirWorldLength=sqrt(sunDirWorldTemp.x * sunDirWorldTemp.x + sunDirWorldTemp.y * sunDirWorldTemp.y + sunDirWorldTemp.z * sunDirWorldTemp.z)
uniform.vec3.uval_sunDirWorld=sunDirWorldTemp / vec3(sunDirWorldLength, sunDirWorldLength, sunDirWorldLength)

variable.float.moonLength=sqrt(moonPosition.x * moonPosition.x + moonPosition.y * moonPosition.y + moonPosition.z * moonPosition.z)
uniform.vec3.uval_moonDirView=moonPosition / vec3(moonLength, moonLength, moonLength)
variable.vec3.moonDirWorldTemp=vec3(gbufferModelViewInverse.0.0 * uval_moonDirView.x + gbufferModelViewInverse.1.0 * uval_moonDirView.y + gbufferModelViewInverse.2.0 * uval_moonDirView.z, \
    gbufferModelViewInverse.0.1 * uval_moonDirView.x + gbufferModelViewInverse.1.1 * uval_moonDirView.y + gbufferModelViewInverse.2.1 * uval_moonDirView.z, \
    gbufferModelViewInverse.0.2 * uval_moonDirView.x + gbufferModelViewInverse.1.2 * uval_moonDirView.y + gbufferModelViewInverse.2.2 * uval_moonDirView.z)
variable.float.moonDirWorldLength=sqrt(moonDirWorldTemp.x * moonDirWorldTemp.x + moonDirWorldTemp.y * moonDirWorldTemp.y + moonDirWorldTemp.z * moonDirWorldTemp.z)
uniform.vec3.uval_moonDirWorld=moonDirWorldTemp / vec3(moonDirWorldLength, moonDirWorldLength, moonDirWorldLength)

variable.float.shadowLightLength=sqrt(shadowLightPosition.x * shadowLightPosition.x + shadowLightPosition.y * shadowLightPosition.y + shadowLightPosition.z * shadowLightPosition.z)
uniform.vec3.uval_shadowLightDirView=shadowLightPosition / vec3(shadowLightLength, shadowLightLength, shadowLightLength)
variable.vec3.shadowLightDirWorldTemp=vec3(gbufferModelViewInverse.0.0 * uval_shadowLightDirView.x + gbufferModelViewInverse.1.0 * uval_shadowLightDirView.y + gbufferModelViewInverse.2.0 * uval_shadowLightDirView.z, \
    gbufferModelViewInverse.0.1 * uval_shadowLightDirView.x + gbufferModelViewInverse.1.1 * uval_shadowLightDirView.y + gbufferModelViewInverse.2.1 * uval_shadowLightDirView.z, \
    gbufferModelViewInverse.0.2 * uval_shadowLightDirView.x + gbufferModelViewInverse.1.2 * uval_shadowLightDirView.y + gbufferModelViewInverse.2.2 * uval_shadowLightDirView.z)
variable.float.shadowLightDirWorldLength=sqrt(shadowLightDirWorldTemp.x * shadowLightDirWorldTemp.x + shadowLightDirWorldTemp.y * shadowLightDirWorldTemp.y + shadowLightDirWorldTemp.z * shadowLightDirWorldTemp.z)
uniform.vec3.uval_shadowLightDirWorld=shadowLightDirWorldTemp / vec3(shadowLightDirWorldLength, shadowLightDirWorldLength, shadowLightDirWorldLength)

variable.float.upLength=sqrt(upPosition.x * upPosition.x + upPosition.y * upPosition.y + upPosition.z * upPosition.z)
uniform.vec3.uval_upDirView=upPosition / vec3(upLength, upLength, upLength)

variable.vec4.sunClipPos=vec4(gbufferProjection.0.0 * uval_sunDirView.x + gbufferProjection.1.0 * uval_sunDirView.y + gbufferProjection.2.0 * uval_sunDirView.z + gbufferProjection.3.0, \
    gbufferProjection.0.1 * uval_sunDirView.x + gbufferProjection.1.1 * uval_sunDirView.y + gbufferProjection.2.1 * uval_sunDirView.z + gbufferProjection.3.1, \
    gbufferProjection.0.2 * uval_sunDirView.x + gbufferProjection.1.2 * uval_sunDirView.y + gbufferProjection.2.2 * uval_sunDirView.z + gbufferProjection.3.2, \
    gbufferProjection.0.3 * uval_sunDirView.x + gbufferProjection.1.3 * uval_sunDirView.y + gbufferProjection.2.3 * uval_sunDirView.z + gbufferProjection.3.3)
uniform.bool.uval_sunVisible=sunClipPos.w > 0.0 && abs(sunClipPos.x) < sunClipPos.w && abs(sunClipPos.y) < sunClipPos.w && abs(sunClipPos.z) < sunClipPos.w
variable.vec2.sunNdcPos=vec2(sunClipPos.x / sunClipPos.w, sunClipPos.y / sunClipPos.w)
variable.float.sunNdcDist=sqrt(sunNdcPos.x * sunNdcPos.x + sunNdcPos.y * sunNdcPos.y)
uniform.vec2.uval_sunNdcPos=vec2(if(sunNdcDist > 100.0, sunNdcPos.x * (100.0 / sunNdcDist), sunNdcPos.x), if(sunNdcDist > 100.0, sunNdcPos.y * (100.0 / sunNdcDist), sunNdcPos.y))
variable.vec4.moonClipPos=vec4(gbufferProjection.0.0 * uval_moonDirView.x + gbufferProjection.1.0 * uval_moonDirView.y + gbufferProjection.2.0 * uval_moonDirView.z + gbufferProjection.3.0, \
    gbufferProjection.0.1 * uval_moonDirView.x + gbufferProjection.1.1 * uval_moonDirView.y + gbufferProjection.2.1 * uval_moonDirView.z + gbufferProjection.3.1, \
    gbufferProjection.0.2 * uval_moonDirView.x + gbufferProjection.1.2 * uval_moonDirView.y + gbufferProjection.2.2 * uval_moonDirView.z + gbufferProjection.3.2, \
    gbufferProjection.0.3 * uval_moonDirView.x + gbufferProjection.1.3 * uval_moonDirView.y + gbufferProjection.2.3 * uval_moonDirView.z + gbufferProjection.3.3)
uniform.bool.uval_moonVisible=moonClipPos.w > 0.0 && abs(moonClipPos.x) < moonClipPos.w && abs(moonClipPos.y) < moonClipPos.w && abs(moonClipPos.z) < moonClipPos.w
variable.vec2.moonNdcPos=vec2(moonClipPos.x / moonClipPos.w, moonClipPos.y / moonClipPos.w)
variable.float.moonNdcDist=sqrt(moonNdcPos.x * moonNdcPos.x + moonNdcPos.y * moonNdcPos.y)
uniform.vec2.uval_moonNdcPos=vec2(if(moonNdcDist > 100.0, moonNdcPos.x * (100.0 / moonNdcDist), moonNdcPos.x), if(moonNdcDist > 100.0, moonNdcPos.y * (100.0 / moonNdcDist), moonNdcPos.y))

variable.float.cuDetailWindSpeedMultiplier=exp2(SETTING_CLOUDS_CU_WIND_SPEED)
variable.float.cuDetailWindTime1=frameTimeCounter * 0.008 * cuDetailWindSpeedMultiplier
variable.float.cuDetailWindTime2=sin(frameTimeCounter * 0.6 + 0.5) * 0.006 * cuDetailWindSpeedMultiplier
variable.float.cuDetailWindTime3=sin(frameTimeCounter * 0.4 + 0.2) * 0.009 * cuDetailWindSpeedMultiplier
variable.vec3.cuDetailWind1=vec3(1.0 * cuDetailWindTime1, 0.1 * cuDetailWindTime1, 0.7 * cuDetailWindTime1)
variable.vec3.cuDetailWind2=vec3(-0.15 * cuDetailWindTime2, 0.05 * cuDetailWindTime2, 0.09 * cuDetailWindTime2)
variable.vec3.cuDetailWind3=vec3(0.23 * cuDetailWindTime3, -0.06 * cuDetailWindTime3, 0.12 * cuDetailWindTime3)
uniform.vec3.uval_cuDetailWind=cuDetailWind1 + cuDetailWind2 + cuDetailWind3
