## Profiles
    profile.POTATO = !SHADOW_MAPPING !VOLUMETRIC_LIGHTING !SHADOW_COLOR !SHADOW_FILTER !SSAO !SSR !BLOOM !SHARPEN_FILTER ANTI_ALIASING:1
    profile.LOW = profile.POTATO SHADOW_MAPPING SSR RAYTRACER_STEPS:20 RAYTRACER_BISTEPS:2 BLOOM shadowMapResolution:512 UNDERWATER_CAUSTICS:0
    profile.MEDIUM = profile.LOW SHADOW_COLOR SHADOW_FILTER SSAO VOLUMETRIC_LIGHTING ANTI_ALIASING:2 shadowMapResolution:1024 UNDERWATER_CAUSTICS:1
    profile.HIGH = profile.MEDIUM RAYTRACER_STEPS:24 shadowMapResolution:2048
    profile.ULTRA = profile.HIGH RAYTRACER_STEPS:28 SHARPEN_FILTER shadowMapResolution:4096 UNDERWATER_CAUSTICS:2

## Main shader settings screen
    screen = [DEBUG] <profile> \
        <empty> <empty> \
        [POST] [LIGHTING] \
        [ATMOSPHERICS] [WORLD] \
        [PBR] [CONFIGURATION]

        ## Debug Screen
        screen.DEBUG = COLOR_MODE ENTITY_BLOCK_TRANSPARENCY \
            NOISE_SPEED

        ## Post Screen
        screen.POST = OUTLINES OUTLINE_BRIGHTNESS \
            OUTLINE_PIXEL_SIZE RETRO_FILTER \
            <empty> <empty> \
            ANTI_ALIASING SHARPEN_FILTER \
            <empty> <empty> \
            [CAMERA] [TONEMAP]

            ## Camera Screen
            screen.CAMERA = DOF DOF_STRENGTH \
                <empty> <empty> \
                CHROMATIC_ABERRATION ABERRATION_PIXEL_SIZE \
                <empty> <empty> \
                BLOOM BLOOM_STRENGTH \
                LENS_FLARE LENS_FLARE_STRENGTH \
                VIGNETTE VIGNETTE_STRENGTH \
                <empty> <empty> \
                MOTION_BLUR MOTION_BLUR_STRENGTH

            ## Tonemap Screen
            screen.TONEMAP = CONTRAST SATURATION \
                WHITE_POINT SHOULDER_STRENGTH \
                <empty> <empty> \
                AUTO_EXPOSURE AUTO_EXPOSURE_SPEED \
                EXPOSURE MINIMUM_EXPOSURE \
                <empty> <empty> \
                TINT_R TINT_G \
                TINT_B

        ## Lighting Screen
        screen.LIGHTING = SHADOW_MAPPING SHADOW_COLOR \
            SHADOW_FILTER ENTITY_SHADOWS \
            BLOCK_ENTITY_SHADOWS shadowMapResolution \
            shadowDistance sunPathRotation \
            <empty> <empty> [RAY_TRACING] \
            UNDERWATER_CAUSTICS SSAO \
            AMBIENT_LIGHTING

            ## Ray Tracing Screen
            screen.RAY_TRACING = SSGI SSR \
                RAYTRACER_STEPS RAYTRACER_BISTEPS \
                <empty> <empty> \
                ROUGH_REFLECTIONS PREVIOUS_FRAME

        ## Atmospherics Screen
        screen.ATMOSPHERICS = SUN_MOON_TYPE SUN_MOON_INTENSITY \
            <empty> <empty> \
            VOLUMETRIC_LIGHTING VOLUMETRIC_LIGHTING_STRENGTH \
            BORDER_FOG GROUND_FOG_STRENGTH \
            <empty> <empty> \
            STORY_MODE_CLOUDS DOUBLE_LAYERED_CLOUDS \
            DYNAMIC_CLOUDS FADE_SPEED \
            CLOUD_STEPS CLOUD_DEPTH \
            SECOND_CLOUD_HEIGHT SKYBOX_BRIGHTNESS

        # World Screen
        screen.WORLD = TERRAIN_ANIMATION WATER_ANIMATION \
            WEATHER_ANIMATION TIMELAPSE_MODE \
            <empty> <empty> \
            WIND_SPEED CURRENT_SPEED \
            WIND_FREQUENCY CURRENT_FREQUENCY \
            <empty> <empty> \
            WORLD_CURVATURE WORLD_CURVATURE_SIZE

        # PBR Screen
        screen.PBR = PBR_MODE SPECULAR_HIGHLIGHTS \
            ENVIRONMENT_PBR NORMAL_GENERATION \
            NORMAL_GENERATION_RESOLUTION \
            SUBSURFACE_SCATTERING \
            <empty> <empty> \
            [POM_SETTINGS] EMISSIVE_INTENSITY \
            SLOPE_NORMALS NORMAL_STRENGTH \
            DIRECTIONAL_LIGHTMAPS \
            DIRECTIONAL_LIGHTMAP_STRENGTH \
            <empty> <empty> \
            [WATER_SETTINGS] [LAVA_SETTINGS]

            # POM Settings Screen
            screen.POM_SETTINGS = PARALLAX_OCCLUSION PARALLAX_DEPTH \
                PARALLAX_STEPS <empty> \
                <empty> <empty> \
                PARALLAX_SHADOW PARALLAX_SHADOW_STEPS

            # Water Settings Screen
            screen.WATER_SETTINGS = WATER_NOISE WATER_BRIGHTNESS \
                <empty> <empty> \
                WATER_NORMAL WATER_BLUR_SIZE \
                WATER_DEPTH_SIZE WATER_TILE_SIZE \
                <empty> <empty> \
                WATER_STYLIZE_ABSORPTION WATER_FOAM \
                WATER_FLAT

            # Lava Settings Screen
            screen.LAVA_SETTINGS = LAVA_BRIGHTNESS LAVA_NOISE \
                LAVA_TILE_SIZE

        # Configuration Screen
        screen.CONFIGURATION = [OVERWORLD_SETTINGS] [NETHER_SETTINGS] [END_SETTINGS] <empty> <empty> <empty> [BLOCK_LIGHT_COLOR]

            # Overworld Settings Screen
            screen.OVERWORLD_SETTINGS = [DAY_SETTINGS] [NIGHT_SETTINGS] \
                [TWILIGHT_SETTINGS] [FOG_SETTINGS0]

                # Day Settings Screen
                screen.DAY_SETTINGS = LIGHT0_DR LIGHT0_DG \
                    LIGHT0_DB LIGHT0_DI \
                    <empty> <empty> \
                    SKY0_DR SKY0_DG \
                    SKY0_DB SKY0_DI

                # Night Settings Screen
                screen.NIGHT_SETTINGS = LIGHT0_NR LIGHT0_NG \
                    LIGHT0_NB LIGHT0_NI \
                    <empty> <empty> \
                    SKY0_NR SKY0_NG \
                    SKY0_NB SKY0_NI

                # Twilight Settings Screen
                screen.TWILIGHT_SETTINGS = LIGHT0_TR LIGHT0_TG \
                    LIGHT0_TB LIGHT0_TI \
                    <empty> <empty> \
                    SKY0_TR SKY0_TG \
                    SKY0_TB SKY0_TI

                # Fog Settings Screen
                screen.FOG_SETTINGS0 = FOG0_VERTICAL_DENSITY_D FOG0_VERTICAL_DENSITY_N \
                    FOG0_VERTICAL_DENSITY_T <empty> \
                    <empty> <empty> \
                    FOG0_TOTAL_DENSITY

            # Nether Settings Screen
            screen.NETHER_SETTINGS = FOGn1_VERTICAL_DENSITY FOGn1_TOTAL_DENSITY \
                <empty> <empty> \
                WORLDn1_VANILLA_FOGCOLI

            # End Settings Screen
            screen.END_SETTINGS = LIGHT1_CR LIGHT1_CG \
                LIGHT1_CB LIGHT1_CI \
                <empty> <empty> \
                SKY1_CR SKY1_CG \
                SKY1_CB SKY1_CI \
                <empty> <empty> \
                FOG1_VERTICAL_DENSITY FOG1_TOTAL_DENSITY

            # Overworld block light color Screen
            screen.BLOCK_LIGHT_COLOR = BLOCKLIGHT_R BLOCKLIGHT_G \
                BLOCKLIGHT_B BLOCKLIGHT_I

## Sliders
    sliders = NOISE_SPEED \
        OUTLINE_BRIGHTNESS OUTLINE_PIXEL_SIZE \
        DOF_STRENGTH ABERRATION_PIXEL_SIZE BLOOM_STRENGTH LENS_FLARE_STRENGTH VIGNETTE_STRENGTH MOTION_BLUR_STRENGTH \
        CONTRAST SATURATION WHITE_POINT SHOULDER_STRENGTH AUTO_EXPOSURE_SPEED EXPOSURE MINIMUM_EXPOSURE TINT_R TINT_G TINT_B \
        shadowMapResolution shadowDistance sunPathRotation AMBIENT_LIGHTING \
        RAYTRACER_STEPS RAYTRACER_BISTEPS \
        SUN_MOON_INTENSITY VOLUMETRIC_LIGHTING_STRENGTH GROUND_FOG_STRENGTH FADE_SPEED SECOND_CLOUD_HEIGHT CLOUD_STEPS CLOUD_DEPTH SKYBOX_BRIGHTNESS \
        WIND_SPEED CURRENT_SPEED WIND_FREQUENCY CURRENT_FREQUENCY WORLD_CURVATURE_SIZE \
        NORMAL_GENERATION_RESOLUTION EMISSIVE_INTENSITY NORMAL_STRENGTH DIRECTIONAL_LIGHTMAP_STRENGTH \
        PARALLAX_DEPTH PARALLAX_STEPS PARALLAX_SHADOW_STEPS \
        WATER_BRIGHTNESS WATER_BLUR_SIZE WATER_DEPTH_SIZE WATER_TILE_SIZE \
        LAVA_BRIGHTNESS LAVA_TILE_SIZE \
        LIGHT0_DR LIGHT0_DG LIGHT0_DB LIGHT0_DI SKY0_DR SKY0_DG SKY0_DB SKY0_DI \
        LIGHT0_NR LIGHT0_NG LIGHT0_NB LIGHT0_NI SKY0_NR SKY0_NG SKY0_NB SKY0_NI \
        LIGHT0_TR LIGHT0_TG LIGHT0_TB LIGHT0_TI SKY0_TR SKY0_TG SKY0_TB SKY0_TI \
        FOG0_VERTICAL_DENSITY_D FOG0_VERTICAL_DENSITY_N FOG0_VERTICAL_DENSITY_T FOG0_TOTAL_DENSITY \
        FOGn1_VERTICAL_DENSITY FOGn1_TOTAL_DENSITY WORLDn1_VANILLA_FOGCOLI \
        LIGHT1_CR LIGHT1_CG LIGHT1_CB LIGHT1_CI SKY1_CR SKY1_CG SKY1_CB SKY1_CI FOG1_VERTICAL_DENSITY FOG1_TOTAL_DENSITY \
        BLOCKLIGHT_R BLOCKLIGHT_G BLOCKLIGHT_B BLOCKLIGHT_I

## Set shader settings
    vignette = false
    separateAo = true
    oldLighting = false
    underwaterOverlay = false

    rain.depth = false
    shadow.culling = true
    frustum.culling = true
    beacon.beam.depth = true

    #ifdef STORY_MODE_CLOUDS
        clouds = off
    #endif

    #if SUN_MOON_TYPE != 2
        sun = false
        moon = false
    #endif

    #ifndef BLOCK_ENTITY_SHADOWS
        shadowBlockEntities = false
    #endif

    ## TO DO: need to separate the 2 options
    #ifndef ENTITY_SHADOWS
        shadowEntities = false

        ## Iris
            shadowPlayer = true
    #endif

    ## Iris

    #if defined ENTITY_BLOCK_TRANSPARENCY
        separateEntityDraws = true
    #endif

## Blending settings
## These are set to maximize performance
    blend.gbuffers_basic = off
    blend.gbuffers_entities = off
    blend.gbuffers_hand = off
    blend.gbuffers_line = off
    blend.gbuffers_skybasic = off
    blend.gbuffers_skytextured = off
    blend.gbuffers_spidereyes = off
    blend.gbuffers_terrain = off
    blend.shadow = off

    blend.gbuffers_armor_glint = ONE ONE ZERO ZERO

    ## Iris

    ## Optifine
        blend.gbuffers_entities_glowing = off

    ## Modded (Note to self, the DH program parameters are utterly useless)
        blend.dh_generic = off
        blend.dh_shadow = off
        blend.dh_terrain = off
        blend.dh_water = off

## Per-buffer blending settings
## These are set to maximize performance
    blend.gbuffers_block.colortex1 = off
    blend.gbuffers_block.colortex2 = off
    blend.gbuffers_block.colortex3 = off

    blend.gbuffers_hand_water.colortex1 = off
    blend.gbuffers_hand_water.colortex2 = off
    blend.gbuffers_hand_water.colortex3 = off

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

    blend.gbuffers_clouds.colortex3 = off

    blend.gbuffers_textured.colortex3 = off

    ## Iris
        blend.gbuffers_entities_translucent.colortex1 = off
        blend.gbuffers_entities_translucent.colortex2 = off
        blend.gbuffers_entities_translucent.colortex3 = off
        blend.gbuffers_lightning.colortex3 = off

    ## Modded

## Disable alpha testing completely
    alphaTest.gbuffers_armor_glint = off
    alphaTest.gbuffers_basic = off
    alphaTest.gbuffers_beaconbeam = off
    alphaTest.gbuffers_block = off
    alphaTest.gbuffers_clouds = off
    alphaTest.gbuffers_damagedblock = off
    alphaTest.gbuffers_entities = off
    alphaTest.gbuffers_hand_water = off
    alphaTest.gbuffers_hand = off
    alphaTest.gbuffers_line = off
    alphaTest.gbuffers_skybasic = off
    alphaTest.gbuffers_skytextured = off
    alphaTest.gbuffers_spidereyes = off
    alphaTest.gbuffers_terrain = off
    alphaTest.gbuffers_textured = off
    alphaTest.gbuffers_water = off
    alphaTest.gbuffers_weather = off
    alphaTest.shadow = off

    ## Iris
        alphaTest.gbuffers_entities_translucent = off
        alphaTest.gbuffers_lightning = off

    ## Optifine
        alphaTest.gbuffers_entities_glowing = off

    ## Modded (Note to self, the DH program parameters are utterly useless)
        alphaTest.dh_generic = off
        alphaTest.dh_shadow = off
        alphaTest.dh_terrain = off
        alphaTest.dh_water = off

## gbuffers_beaconbeam and gbuffers_weather are excluded from this list
## Both programs will render as intended

## Custom textures
    texture.noise = textures/noise.png

    ## TO DO: Implement a custom cloud map for maximum optimization
    #ifdef STORY_MODE_CLOUDS
        texture.composite.colortex4 = textures/clouds.png
        texture.deferred.colortex4 = textures/clouds.png
    #endif

## Modded uniforms
    #ifdef DISTANT_HORIZONS
        uniform.float.borderFar = if(isEyeInWater == 0, dhRenderDistance, far)
    #else
        uniform.float.borderFar = far
    #endif

## Custom time uniforms
    ## Apparently using the macro conditional "else if" does not work here so I improvised
    #if TIMELAPSE_MODE == 2
        uniform.float.vertexFrameTime = smooth(worldTime / 24, 30)
        uniform.float.fragmentFrameTime = vertexFrameTime
    #endif

    #if TIMELAPSE_MODE == 1
        uniform.float.vertexFrameTime = frameTimeCounter
        uniform.float.fragmentFrameTime = smooth(worldTime / 24, 30)
    #endif

    #if TIMELAPSE_MODE == 0
        uniform.float.vertexFrameTime = frameTimeCounter
        uniform.float.fragmentFrameTime = frameTimeCounter
    #endif

## Custom day cycle uniforms
    #if TIMELAPSE_MODE != 0
        variable.float.newSunAngle = smooth(sunAngle, 30) * pi * 2
    #else
        variable.float.newSunAngle = sunAngle * pi * 2
    #endif

    uniform.float.celestialSinX = sin(newSunAngle)

    variable.float.absCelestialSinX = abs(celestialSinX)

    ## Rotation translation

    ## variable.vec3.rotationXT = vec3(1, 0, 0)
    ## variable.vec3.rotationYB = vec3(0, 1, 0)
    ## variable.vec3.rotationZN = vec3(0, 0, 1)

    ## Transposed rotation of shadowModelView matrix with rotation

    ## uniform.vec3.newShadowModelViewXT = vec3(shaddowModelView.0.0, shaddowModelView.0.1, shaddowModelView.0.2)
    ## uniform.vec3.newShadowModelViewXT = vec3(shaddowModelView.0.0 * rotationXT.x + shaddowModelView.1.0 * rotationYB.x + shaddowModelView.2.0 * rotationZN.x, shaddowModelView.0.0 * rotationXT.y + shaddowModelView.1.0 * rotationYB.y + shaddowModelView.2.0 * rotationZN.y, shaddowModelView.0.0 * rotationXT.z + shaddowModelView.1.0 * rotationYB.z + shaddowModelView.2.0 * rotationZN.z)

    ## uniform.vec3.newShadowModelViewYB = vec3(shaddowModelView.1.0, shaddowModelView.1.1, shaddowModelView.1.2)
    ## uniform.vec3.newShadowModelViewYB = vec3(shaddowModelView.0.1 * rotationXT.x + shaddowModelView.1.1 * rotationYB.x + shaddowModelView.2.1 * rotationZN.x, shaddowModelView.0.1 * rotationXT.y + shaddowModelView.1.1 * rotationYB.y + shaddowModelView.2.1 * rotationZN.y, shaddowModelView.0.1 * rotationXT.z + shaddowModelView.1.1 * rotationYB.z + shaddowModelView.2.1 * rotationZN.z)

    ## uniform.vec3.newShadowModelViewZN = vec3(shaddowModelView.2.0, shaddowModelView.2.1, shaddowModelView.2.2)
    ## uniform.vec3.newShadowModelViewZN = vec3(shaddowModelView.0.2 * rotationXT.x + shaddowModelView.1.2 * rotationYB.x + shaddowModelView.2.2 * rotationZN.x, shaddowModelView.0.2 * rotationXT.y + shaddowModelView.1.2 * rotationYB.y + shaddowModelView.2.2 * rotationZN.y, shaddowModelView.0.2 * rotationXT.z + shaddowModelView.1.2 * rotationYB.z + shaddowModelView.2.2 * rotationZN.z)

    ## Translation of shadowModelView matrix
    ## uniform.vec3.newShadowModelViewOffset = vec3(shaddowModelView.3.0, shaddowModelView.3.1, shaddowModelView.3.2)

    ## New shadow fade calculation
    uniform.float.shdFade = min(absCelestialSinX * pi * 2, 1)

    ## uniform.float.dayCycle = clamp(1 + celestialSinX, 0, 2)

    uniform.float.dayCycle = 1 + celestialSinX
    uniform.float.dayCycleAdjust = clamp(dayCycle - 0.5, 0, 1)

    uniform.float.twilightPhase = absCelestialSinX * absCelestialSinX * (3 - 2 * absCelestialSinX)

## Environment detection
    uniform.float.isPrecipitationRain = smooth(if(in(biome_precipitation, 1) && cameraPosition.y < 96, 1, 0), 10) * wetness

## Lightning flash calculation for Iris
## No lightning flash uniform for Optifine :C
    #ifdef IS_IRIS
        uniform.float.lightningFlash = lightningBoltPosition.w
    #endif

## Frame Jitter Uniform
    uniform.int.frameMod = frameCounter % 8

    ## 0.125 * 1.61803399
    uniform.float.frameFract = frameMod * 0.20225425

## Other
    uniform.float.pixelWidth = 1 / viewWidth
    uniform.float.pixelHeight = 1 / viewHeight

    uniform.float.eyeSkylight = smooth(eyeBrightness.y / 240, 10)

    ## uniform.float.maxResolution = max(viewWidth, viewHeight)
    ## uniform.float.minResolution = min(viewWidth, viewHeight)