# Pencil Drawing Shader Properties
# Pencil Drawing Shader Properties

# Buffer formats for bloom and effects
colortex1Format = RGBA16F
colortex2Format = RGBA16F
colortex3Format = RGBA16F
colortex4Format = RGB8
texture.noise = blueNoiseR.png
# Use colortex5 for color palette (compatible with both Iris and OptiFine)
colortex5Format = RGB8
colortex6Format = RGB8

# Color palette texture assignments
# colortex5 = 1xN palette strip  (used by Custom 1xN / brute-force path, PALETTE_BRAND == 0)
# colortex6 = LUT                (used by Custom LUT and built-in brands,  PALETTE_BRAND != 0)
#
# PALETTE_BRAND:
#   0 = Custom 1xN   → colortex5 = palettes/CustomPalette.png
#   1 = Custom LUT   → colortex6 = luts/CustomPalette_lut.png
#   2 = Faber-Castell Polychromos 120 (built-in LUT)
#   3 = Prismacolor Premier 150       (built-in LUT)
#ifdef PALETTE_BRAND
    #if PALETTE_BRAND == 0
        texture.composite.colortex5 = palettes/CustomPalette.png
    #elif PALETTE_BRAND == 1
        texture.composite.colortex6 = luts/CustomPalette_lut.png
    #elif PALETTE_BRAND == 2
        texture.composite.colortex6 = luts/FaberCastell_120_lut.png
    #elif PALETTE_BRAND == 3
        texture.composite.colortex6 = luts/Prismacolor_150_lut.png
    #endif
#endif

# Enable composite passes
composite1.enabled = true
composite2.enabled = true

# Main settings screen organization - Added DRAWING_STYLE at the beginning
screen = <profile>  DRAWING_STYLE [Paper] [Outlines] [PencilLines] [Hatching] [TextureStyle] [Shadow] [Bloom] [Godrays] [Sky] [Color] [SpeedLines] [Advanced] [Experimental]

# Paper Settings - Controls the paper background appearance
screen.Paper = PAPER_STYLE PAPER_WHITENESS PAPER_MAX_BRIGHTNESS PAPER_MIN_BRIGHTNESS PAPER_WARMTH PAPER_TEXTURE_STRENGTH PAPER_TEXTURE_SCALE PAPER_TEXTURE_SPEED PAPER_CRINKLE_STRENGTH PAPER_CRINKLE_SCALE DARKNESS_THRESHOLD DARKNESS_SMOOTHNESS GRAYSCALE_STRENGTH ADVANCED_GRAIN_SYSTEM WHITE_VIGNETTE_ENABLED [VignetteSettings] DRAW_ON_ENABLED [PencilGrain]
screen.Paper.columns = 2

# Advanced pencil-paper grain interaction settings
screen.PencilGrain = PENCIL_GRAIN_ENABLED GRAIN_HEIGHT_SCALE GRAIN_INTENSITY GRAIN_DIRECTIONAL_BIAS GRAIN_FINE_DETAIL PRESSURE_SOFTENING GRAIN_L1_SCALE GRAIN_L2_SCALE

screen.VignetteSettings = VIGNETTE_STRENGTH VIGNETTE_RADIUS VIGNETTE_SOFTNESS

# Outline Detection Settings - Controls edge detection methods
screen.Outlines = [GeometricOutlines] [TextureOutlines] COMPOSITE_THICKNESS_BOOST [DistanceSettings]
screen.Outlines.columns = 2

# Geometric outline detection settings
screen.GeometricOutlines = GEOMETRIC_OUTLINES LINE_THRESHOLD_DEPTH LINE_THRESHOLD_NORMAL GEOMETRIC_THICKNESS

# Texture-based outline detection settings  
screen.TextureOutlines = TEXTURE_OUTLINES LINE_THRESHOLD_CONTRAST LIGHTING_ADAPTIVE_THRESHOLD_DARK LIGHTING_ADAPTIVE_THRESHOLD_BRIGHT TEXTURE_THICKNESS TEXTURE_DISTANCE_FADE

# Distance-based outline simplification settings
screen.DistanceSettings = TEXTURE_SIMPLIFY_DISTANCE GEOMETRIC_ONLY_DISTANCE

# Pencil Line Settings - Controls pencil line appearance and variation
screen.PencilLines = PENCIL_LINE_VARIATION ENABLE_SOFT_PENCIL_LINE LINE_THICKNESS_VARIATION LINE_DIRECTION_VARIATION LINE_GRAIN_STRENGTH PAPER_LINE_MASKING LINE_BLUR_RADIUS FINAL_THICKNESS_BOOST OUTLINE_STRENGTH PENCIL_CORE_STRENGTH THIN_LINE_FADE_FACTOR PENCIL_GRAIN_INTENSITY PENCIL_PRESSURE_VARIATION [AdaptivePencil]
screen.PencilLines.columns = 2

screen.AdaptivePencil = COLOR_ADAPTIVE_PENCIL PENCIL_DARKEN_AMOUNT PENCIL_SATURATION_BOOST PENCIL_BRIGHTNESS_BIAS

# Hatching Settings - Controls crosshatching in dark areas
screen.Hatching = HATCHING_ENABLED HATCHING_DARKNESS_THRESHOLD HATCHING_DENSITY MAX_HATCHING_DIRECTIONS HATCHING_DIRECTION_SPACING HATCHING_ANGLE1 HATCHING_ANGLE2 HATCHING_THICKNESS HATCHING_STRENGTH CROSS_HATCHING_THRESHOLD HATCHING_IRREGULARITY HATCHING_THICKNESS_VARIATION HATCHING_SPACING_VARIATION HATCHING_PRESSURE_VARIATION HATCHING_LINE_BREAKS HATCHING_LINE_SKIP_ENABLED HATCHING_LINE_SKIP_BASE_CHANCE HATCHING_LINE_SKIP_INCREMENT HATCHING_LINE_SKIP_MAX_CHANCE
screen.Hatching.columns = 2

# Texture Style Settings - Controls how textures are processed and displayed
screen.TextureStyle = TEXTURE_PAPER_STYLE DISABLE_TEXTURES TEXTURE_PAPER_WHITENESS TEXTURE_GRAYSCALE_STRENGTH GRAY_BIAS_STRENGTH GRAY_BIAS_RANGE_MIN GRAY_BIAS_RANGE_MAX GRAY_BIAS_BRIGHTNESS_LIFT ENABLE_DIRECTIONAL_LIGHTING [Voronoi]
screen.TextureStyle.columns = 2

screen.Voronoi = ENABLE_VORONOI_DISTORTION VORONOI_BLOCK_DISTORTION VORONOI_ENTITY_DISTORTION VORONOI_VIEWMODEL_DISTORTION

# Shadow Settings - Controls shadow rendering and appearance
screen.Shadow = ENABLE_SHADOWS COLORED_SHADOWS SHADOW_BRIGHTNESS BLOCK_LIGHT_INTENSITY CAVE_DARKNESS SOFT_SHADOWS PCF_SAMPLE PCF_BLUR_RADIUS SHADOW_DISTORTION SHADOW_DISTORT_REDUCTION shadowMapResolution shadowDistance [ShadowAdvanced]
screen.Shadow.columns = 2

# Advanced shadow settings
screen.ShadowAdvanced = FAR_DISTANCE_BIAS_START FAR_DISTANCE_BIAS_RANGE FAR_DISTANCE_BIAS_MAX WATER_SHADOW_BIAS_MULTIPLIER WATER_PCF_SAMPLES WATER_SHADOW_SOFTNESS LIGHT_DIRECTION_OFFSET

# Bloom Settings - Controls bloom/glow effects
screen.Bloom = BLOOM_ENABLED PIXEL_BLOOM BLOOM_THRESHOLD BLOOM_INTENSITY BLOOM_RADIUS
screen.Bloom.columns = 1

# Godrays Settings - Volumetric crepuscular rays from the sun
screen.Godrays = GODRAYS_ENABLED GODRAY_SAMPLES GODRAY_INTENSITY GODRAY_DENSITY GODRAY_DECAY GODRAY_WEIGHT GODRAY_WARMTH GODRAY_NIGHT_INTENSITY GODRAY_MOON_WARMTH
screen.Godrays.columns = 2

# Sky Settings - Controls sky and sun/moon rendering
screen.Sky = sunPathRotation ENABLE_SKY_TEXTURE_OUTLINES
screen.Sky.columns = 1

screen.Color = PENCIL_R PENCIL_G PENCIL_B COLOR_GRADING_ENABLED VIBRANCE_AMOUNT SATURATION_AMOUNT CONTRAST_AMOUNT BRIGHTNESS_FACTOR LIFT_AMOUNT GAMMA_AMOUNT GAIN_AMOUNT COLOR_TEMP_AMOUNT PURKINJE_ENABLED PURKINJE_STRENGTH [ColorPalette] [Painterly]
screen.Color.columns = 3

screen.ColorPalette = PALETTE_ENABLED PALETTE_BRAND PALETTE_CUSTOM_1XN_SIZE PALETTE_PRESERVE_LUMINANCE PALETTE_STRENGTH PALETTE_SMOOTHNESS PALETTE_DITHER_STRENGTH
screen.ColorPalette.columns = 2

screen.Painterly = KUWAHARA_RADIUS KUWAHARA_SHARPNESS
screen.Painterly.columns = 2

screen.SpeedLines = SPEED_LINES_ENABLED SPEED_LINE_WHITE SPEED_LINE_COUNT SPEED_LINE_INTENSITY SPEED_LINES_STATIC SPEED_THRESHOLD

# Advanced Settings - Technical and performance settings
screen.Advanced = Shininess [WaterWaves] [VertexDistortion] [EmissiveSettings]
screen.Advanced.columns = 2

# Water wave settings
screen.WaterWaves = WATER_WAVE_AMPLITUDE WATER_WAVE_FREQUENCY WATER_WAVE_SPEED

# Vertex distortion settings
screen.VertexDistortion = Uncube Camera UNCUBE_DISTANCE_SCALING UNCUBE_MIN_DISTANCE UNCUBE_MAX_DISTANCE UNCUBE_MIN_STRENGTH UNCUBE_TIME_SYNC

# Emissive/glowing settings
screen.EmissiveSettings = EMISSIVE_BASE_THRESHOLD EMISSIVE_BOOST_STRENGTH

# Experimental Settings - Fun and experimental effects
screen.Experimental = GENERATE_SURFACE_HATCHING ENABLE_TEXTURE_OUTLINES [LegacyOutlineSettings] COLOR_GRID_ENABLED GRID_COLOR_SATURATION GRID_COLOR_INTENSITY BASE_DESATURATION COLOR_BLEEDING ADAPTIVE_COLOR_STRENGTH
screen.Experimental.columns = 2

screen.LegacyOutlineSettings = TEXTURE_OUTLINE_STRENGTH OUTLINE_THICKNESS

# Define all sliders for smooth value adjustment
sliders = KUWAHARA_RADIUS KUWAHARA_SHARPNESS PAPER_WHITENESS PAPER_MAX_BRIGHTNESS PAPER_MIN_BRIGHTNESS PAPER_WARMTH PAPER_TEXTURE_STRENGTH PAPER_TEXTURE_SCALE PAPER_TEXTURE_SPEED PAPER_CRINKLE_STRENGTH PAPER_CRINKLE_SCALE DARKNESS_THRESHOLD DARKNESS_SMOOTHNESS GRAYSCALE_STRENGTH TEXTURE_GRAYSCALE_STRENGTH LINE_THRESHOLD_DEPTH LINE_THRESHOLD_NORMAL GEOMETRIC_THICKNESS LINE_THRESHOLD_CONTRAST LIGHTING_ADAPTIVE_THRESHOLD_DARK LIGHTING_ADAPTIVE_THRESHOLD_BRIGHT TEXTURE_THICKNESS TEXTURE_DISTANCE_FADE TEXTURE_SIMPLIFY_DISTANCE GEOMETRIC_ONLY_DISTANCE LINE_THICKNESS_VARIATION LINE_DIRECTION_VARIATION LINE_GRAIN_STRENGTH PAPER_LINE_MASKING FINAL_THICKNESS_BOOST LINE_BLUR_RADIUS OUTLINE_STRENGTH PENCIL_GRAIN_INTENSITY PENCIL_PRESSURE_VARIATION PENCIL_CORE_STRENGTH THIN_LINE_FADE_FACTOR COMPOSITE_THICKNESS_BOOST TEXTURE_OUTLINE_STRENGTH OUTLINE_THICKNESS GRAY_BIAS_STRENGTH GRAY_BIAS_RANGE_MIN GRAY_BIAS_RANGE_MAX GRAY_BIAS_BRIGHTNESS_LIFT Shininess HATCHING_THICKNESS_VARIATION HATCHING_SPACING_VARIATION HATCHING_PRESSURE_VARIATION HATCHING_LINE_BREAKS HATCHING_LINE_SKIP_BASE_CHANCE HATCHING_LINE_SKIP_INCREMENT HATCHING_LINE_SKIP_MAX_CHANCE SHADOW_DISTORT_REDUCTION SHADOW_BRIGHTNESS BLOCK_LIGHT_INTENSITY CAVE_DARKNESS shadowMapResolution TEXTURE_PAPER_WHITENESS BLOOM_THRESHOLD BLOOM_INTENSITY BLOOM_RADIUS GODRAY_SAMPLES GODRAY_INTENSITY GODRAY_DENSITY GODRAY_DECAY GODRAY_WEIGHT GODRAY_WARMTH GODRAY_NIGHT_INTENSITY GODRAY_MOON_WARMTH GRAIN_HEIGHT_SCALE GRAIN_INTENSITY GRAIN_DIRECTIONAL_BIAS GRAIN_FINE_DETAIL PRESSURE_SOFTENING GRAIN_L1_SCALE GRAIN_L2_SCALE HATCHING_DARKNESS_THRESHOLD HATCHING_DENSITY MAX_HATCHING_DIRECTIONS HATCHING_DIRECTION_SPACING HATCHING_ANGLE1 HATCHING_ANGLE2 HATCHING_THICKNESS HATCHING_STRENGTH CROSS_HATCHING_THRESHOLD HATCHING_IRREGULARITY FAR_DISTANCE_BIAS_START FAR_DISTANCE_BIAS_RANGE FAR_DISTANCE_BIAS_MAX WATER_SHADOW_BIAS_MULTIPLIER WATER_SHADOW_SOFTNESS WATER_WAVE_AMPLITUDE WATER_WAVE_FREQUENCY WATER_WAVE_SPEED Uncube Camera UNCUBE_MIN_DISTANCE UNCUBE_MAX_DISTANCE UNCUBE_MIN_STRENGTH EMISSIVE_BASE_THRESHOLD EMISSIVE_BOOST_STRENGTH GRID_COLOR_SATURATION GRID_COLOR_INTENSITY BASE_DESATURATION COLOR_BLEEDING LIGHT_DIRECTION_OFFSET sunPathRotation shadowDistance PENCIL_R PENCIL_G PENCIL_B VIBRANCE_AMOUNT SATURATION_AMOUNT CONTRAST_AMOUNT BRIGHTNESS_FACTOR LIFT_AMOUNT GAMMA_AMOUNT GAIN_AMOUNT COLOR_TEMP_AMOUNT PURKINJE_STRENGTH PURKINJE_THRESHOLD PALETTE_CUSTOM_1XN_SIZE PALETTE_STRENGTH PALETTE_SMOOTHNESS PALETTE_DITHER_STRENGTH VIGNETTE_STRENGTH VIGNETTE_RADIUS VIGNETTE_SOFTNESS SPEED_LINE_INTENSITY SPEED_THRESHOLD

# Performance profiles
profile.SCREENSHOT = ENABLE_SHADOWS=1 ADVANCED_GRAIN_SYSTEM=STYLE_ADVANCED_GRAIN_SYSTEM shadowMapResolution=8192 shadowDistance=512.0 BLOOM_ENABLED=1 GODRAYS_ENABLED=1 GODRAY_SAMPLES=64 ENABLE_SOFT_PENCIL_LINE=1 MAX_HATCHING_DIRECTIONS=4 ENABLE_DIRECTIONAL_LIGHTING=1 SHADOW_DISTORT_REDUCTION=0.30 PCF_SAMPLE=64 KUWAHARA_RADIUS=12 PALETTE_CUSTOM_1XN_SIZE=72
profile.ULTRA = ENABLE_SHADOWS=1 ADVANCED_GRAIN_SYSTEM=STYLE_ADVANCED_GRAIN_SYSTEM shadowMapResolution=2048 shadowDistance=384.0 BLOOM_ENABLED=1 GODRAYS_ENABLED=1 GODRAY_SAMPLES=48 ENABLE_SOFT_PENCIL_LINE=1 MAX_HATCHING_DIRECTIONS=4 ENABLE_DIRECTIONAL_LIGHTING=1 SHADOW_DISTORT_REDUCTION=0.15 PCF_SAMPLE=32 KUWAHARA_RADIUS=12 PALETTE_CUSTOM_1XN_SIZE=72
profile.HIGH= ENABLE_SHADOWS=1 ADVANCED_GRAIN_SYSTEM=STYLE_ADVANCED_GRAIN_SYSTEM shadowMapResolution=1024 shadowDistance=256.0 BLOOM_ENABLED=1 GODRAYS_ENABLED=1 GODRAY_SAMPLES=48 ENABLE_SOFT_PENCIL_LINE=1 MAX_HATCHING_DIRECTIONS=4 ENABLE_DIRECTIONAL_LIGHTING=1 SHADOW_DISTORT_REDUCTION=0.15 PCF_SAMPLE=16 KUWAHARA_RADIUS=10 PALETTE_CUSTOM_1XN_SIZE=72
profile.MEDIUM = ENABLE_SHADOWS=1 ADVANCED_GRAIN_SYSTEM=0 shadowMapResolution=512 shadowDistance=128.0 BLOOM_ENABLED=1 GODRAYS_ENABLED=0 GODRAY_SAMPLES=32 ENABLE_SOFT_PENCIL_LINE=1 MAX_HATCHING_DIRECTIONS=3 ENABLE_DIRECTIONAL_LIGHTING=1 SHADOW_DISTORT_REDUCTION=0.15 PCF_SAMPLE=8 KUWAHARA_RADIUS=8 PALETTE_CUSTOM_1XN_SIZE=72
profile.LOW = ENABLE_SHADOWS=0 ADVANCED_GRAIN_SYSTEM=STYLE_ADVANCED_GRAIN_SYSTEM shadowMapResolution=512 shadowDistance=128.0 BLOOM_ENABLED=1 GODRAYS_ENABLED=0 GODRAY_SAMPLES=24 ENABLE_SOFT_PENCIL_LINE=1 MAX_HATCHING_DIRECTIONS=4 ENABLE_DIRECTIONAL_LIGHTING=1 SHADOW_DISTORT_REDUCTION=0.15 KUWAHARA_RADIUS=8 PALETTE_CUSTOM_1XN_SIZE=72
profile.POTATO = ENABLE_SHADOWS=0 ADVANCED_GRAIN_SYSTEM=0  shadowMapResolution=512 shadowDistance=64.0 BLOOM_ENABLED=0 GODRAYS_ENABLED=0 GODRAY_SAMPLES=16 ENABLE_SOFT_PENCIL_LINE=0 MAX_HATCHING_DIRECTIONS=2 ENABLE_DIRECTIONAL_LIGHTING=0 SHADOW_DISTORT_REDUCTION=0.15 KUWAHARA_RADIUS=6