diff --git a/resources/utiltex/apollo.colorgrade.png b/resources/utiltex/apollo.colorgrade.png new file mode 100644 index 0000000..055d07f Binary files /dev/null and b/resources/utiltex/apollo.colorgrade.png differ diff --git a/resources/utiltex/mono.colorgrade.png b/resources/utiltex/mono.colorgrade.png new file mode 100644 index 0000000..3d4bbba Binary files /dev/null and b/resources/utiltex/mono.colorgrade.png differ diff --git a/resources/utiltex/nes.colorgrade.png b/resources/utiltex/nes.colorgrade.png new file mode 100644 index 0000000..1d01621 Binary files /dev/null and b/resources/utiltex/nes.colorgrade.png differ diff --git a/resources/utiltex/neutral.colorgrade.png b/resources/utiltex/neutral.colorgrade.png new file mode 100644 index 0000000..a83b025 Binary files /dev/null and b/resources/utiltex/neutral.colorgrade.png differ diff --git a/resources/utiltex/pico.colorgrade.png b/resources/utiltex/pico.colorgrade.png new file mode 100644 index 0000000..c42ad01 Binary files /dev/null and b/resources/utiltex/pico.colorgrade.png differ diff --git a/resources/utiltex/retro.colorgrade.png b/resources/utiltex/retro.colorgrade.png new file mode 100644 index 0000000..bae560c Binary files /dev/null and b/resources/utiltex/retro.colorgrade.png differ diff --git a/src/editor/textureDebugger.jai b/src/editor/textureDebugger.jai index 9924117..e1eb1bf 100644 --- a/src/editor/textureDebugger.jai +++ b/src/editor/textureDebugger.jai @@ -59,6 +59,12 @@ draw_subwindow_post_process :: (state: *GR.Subwindow_State, r: GR.Rect, data: *v file.write_entire_file("./game/resources/postprocess.json", json); } } + r3.y += r3.h; + r2.h -= r3.h; + r2.y += r3.h; + + + GR.dropdown(r3, LUT_name_list, *g_current_lut_texture_index, *theme_ptr.dropdown_theme); autoedit(r2, *current_post_process, *theme_ptr); } diff --git a/src/main.jai b/src/main.jai index fde890c..9e853d0 100644 --- a/src/main.jai +++ b/src/main.jai @@ -121,6 +121,7 @@ init_after_asset_pack :: () { lworlds(); init_spritesheets(); init_rendering(); + load_color_lut_images(); load_post_process_from_pack(); // We want to do this last. diff --git a/src/rendering/backend_sokol.jai b/src/rendering/backend_sokol.jai index f465bfa..0db5906 100644 --- a/src/rendering/backend_sokol.jai +++ b/src/rendering/backend_sokol.jai @@ -327,16 +327,10 @@ backend_process_command_buckets :: () { // Draw the render texture and do post processing: sg_apply_pipeline(gPipelines.postprocess.pipeline); gPipelines.postprocess.bind.images[0] = g_postprocess_a; + gPipelines.postprocess.bind.images[1] = LUT_list[g_current_lut_texture_index].image; sg_apply_bindings(*gPipelines.postprocess.bind); post_process_config_uniform : Post_Process_Config; fill_uniform_with_engine_data(*post_process_config_uniform , *current_post_process); - post_process_config_uniform.vignette_intensity = current_post_process.vignette_intensity; - post_process_config_uniform.vignette_radius = current_post_process.vignette_radius; - post_process_config_uniform.scanlines_intensity = current_post_process.scanlines_intensity; - post_process_config_uniform.scanlines_density = current_post_process.scanlines_density; - post_process_config_uniform.chromatic_aberration_intensity = current_post_process.chromatic_aberration_intensity; - post_process_config_uniform.film_grain_intensity = current_post_process.film_grain_intensity; - post_process_config_uniform.barrel_distortion_intensity = current_post_process.barrel_distortion_intensity; sg_apply_uniforms(UB_post_process_config, *(sg_range.{ ptr = *post_process_config_uniform, size = size_of(type_of(post_process_config_uniform)) })); sg_draw(0, 6, 1); diff --git a/src/rendering/pipelines.jai b/src/rendering/pipelines.jai index 93f9ee2..9afd5f9 100644 --- a/src/rendering/pipelines.jai +++ b/src/rendering/pipelines.jai @@ -690,6 +690,13 @@ create_postprocess_pipeline :: () { mag_filter = .NEAREST, })); + gPipelines.postprocess.bind.samplers[1] = sg_make_sampler(*(sg_sampler_desc.{ + wrap_u = .CLAMP_TO_EDGE, + wrap_v = .CLAMP_TO_EDGE, + min_filter = .LINEAR, + mag_filter = .LINEAR, + })); + } // Takes in a texture, manipulates it and outputs it. diff --git a/src/rendering/post_processing.jai b/src/rendering/post_processing.jai index d5d2c64..7562d8c 100644 --- a/src/rendering/post_processing.jai +++ b/src/rendering/post_processing.jai @@ -1,8 +1,8 @@ Post_Process :: struct { - exposure : float = 0.0; @Slider,-1,1,0.1; - contrast : float = 1.0; @Slider,0.1,4.0,0.1; + exposure : float = 0.0; @Slider,0,3,0.1; + contrast : float = 1.0; @Slider,0,6,0.1; saturation : float = 1.0; @Slider,0.0,2.0,0.1; - gamma : float = 1.0; @Slider,0.3,3.0,0.1; + gamma : float = 2.2; @Slider,0.3,3.0,0.1; tonemap : float = 1.0; @Slider,0,1,1; ssao : float = 1.0; @Slider,0,5,0.1; ssao_size : s32 = 1; @Slider,0,5,1; @@ -16,8 +16,9 @@ Post_Process :: struct { dof_point : float = 5.0; @Slider,0,30,1; bloom_size : s32 = 5; @Slider,0,10,1; bloom_separation : float = 3.0; @Slider,0,10,1; - bloom_treshold : float = 0.4; @Slider,0,1,0.1; + bloom_treshold : float = 0.4; @Slider,0,1,0.1; bloom_amount : float = 1.0; @Slider,0,5,0.1; + vignette_intensity: float = 0.5; @Slider,0,1,0.1; vignette_radius: float = 0.5; @Slider,0,1,0.1; scanlines_intensity: float = 0.1; @Slider,0,1,0.1; @@ -25,8 +26,10 @@ Post_Process :: struct { chromatic_aberration_intensity: float = 0.0; @Slider,0,0.05,0.001; film_grain_intensity: float = 0.0; @Slider,0,0.5,0.001; barrel_distortion_intensity: float = 0.0; @Slider,-2,2,0.1; + lut_mode: s32 = 0; @Slider,0,2,1; // 0 -> no LUT, 1 -> LUT with interpolation 2 -> LUT no iterpolate } + current_post_process : Post_Process; load_post_process_from_pack :: () { @@ -40,3 +43,29 @@ load_post_process_from_pack :: () { reset_post_process :: () { load_post_process_from_pack(); } @Command + +Color_LUT :: struct { + name: string; + image: sg_image; +} + +LUT_list : [..]Color_LUT; +LUT_name_list : [..]string; +g_current_lut_texture_index : s32 = 0; + +load_color_lut_images :: () { + for v : g_asset_pack.lookup { + isSpritesheet := String.contains(v.name, ".colorgrade.png"); + noop, remainder := String.contains(v.name, "/resources/"); + if isSpritesheet { + print("Adding LUT: %\n", remainder); + img, w, h := create_texture_from_pack(v.name); + newSheet := Color_LUT.{ + name = remainder, + image = img, + }; + array_add(*LUT_list, newSheet); + array_add(*LUT_name_list, newSheet.name); + } + } +} diff --git a/src/shaders/jai/shader_post_process_main.jai b/src/shaders/jai/shader_post_process_main.jai index 61d4aea..441bb43 100644 --- a/src/shaders/jai/shader_post_process_main.jai +++ b/src/shaders/jai/shader_post_process_main.jai @@ -24,15 +24,25 @@ Sample type: .FLOAT Multisampled: false Bind slot: IMG_pptex => 0 + Image 'lut': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_lut => 1 Sampler 'ppsmp': Type: .FILTERING Bind slot: SMP_ppsmp => 0 + Sampler 'lut_linear': + Type: .FILTERING + Bind slot: SMP_lut_linear => 1 */ ATTR_postprocess_position :: 0; ATTR_postprocess_uv :: 1; UB_post_process_config :: 0; IMG_pptex :: 0; +IMG_lut :: 1; SMP_ppsmp :: 0; +SMP_lut_linear :: 1; Post_Process_Config :: struct { exposure: float; contrast: float; @@ -46,6 +56,8 @@ Post_Process_Config :: struct { chromatic_aberration_intensity: float; film_grain_intensity: float; barrel_distortion_intensity: float; + lut_mode: s32; + _: [12]u8; }; /* #version 430 @@ -80,8 +92,28 @@ vs_pp_source_glsl430 := u8.[ /* #version 430 - uniform vec4 post_process_config[3]; + struct post_process_config + { + float exposure; + float contrast; + float saturation; + float gamma; + float tonemap; + float vignette_intensity; + float vignette_radius; + float scanlines_intensity; + float scanlines_density; + float chromatic_aberration_intensity; + float film_grain_intensity; + float barrel_distortion_intensity; + int lut_mode; + }; + + uniform post_process_config _75; + layout(binding = 16) uniform sampler2D pptex_ppsmp; + layout(binding = 17) uniform sampler2D lut_ppsmp; + layout(binding = 18) uniform sampler2D lut_lut_linear; layout(location = 0) in vec2 texcoord; layout(location = 0) out vec4 frag_color; @@ -100,8 +132,8 @@ vs_pp_source_glsl430 := u8.[ { vec2 _66 = texcoord - vec2(0.5); float _67 = length(_66); - vec2 _86 = (_66 * (1.0 + (_67 * post_process_config[2].w))) + vec2(0.5); - if (post_process_config[2].w > 0.0) + vec2 _86 = (_66 * (1.0 + (_67 * _75.barrel_distortion_intensity))) + vec2(0.5); + if (_75.barrel_distortion_intensity > 0.0) { float _96 = _86.x; bool _97 = _96 < 0.0; @@ -138,373 +170,128 @@ vs_pp_source_glsl430 := u8.[ return; } } - vec2 _145 = vec2(post_process_config[2].y, 0.0); - vec4 _147 = texture(pptex_ppsmp, _86 + _145); - vec4 _154 = texture(pptex_ppsmp, _86); - vec4 _165 = texture(pptex_ppsmp, _86 - _145); - vec3 _175 = vec4(_147.x, _154.y, _165.z, 1.0).xyz; - vec3 param = _175; - vec3 tonemapped = aces(param); - if (post_process_config[1].x > 0.5) + vec2 _142 = vec2(_75.chromatic_aberration_intensity, 0.0); + vec4 _144 = texture(pptex_ppsmp, _86 + _142); + vec4 _151 = texture(pptex_ppsmp, _86); + vec4 _162 = texture(pptex_ppsmp, _86 - _142); + vec3 _176 = vec4(_144.x, _151.y, _162.z, 1.0).xyz * _75.exposure; + vec3 color_ldr_linear; + if (_75.tonemap > 0.5) { - vec3 param_1 = _175; - tonemapped = aces(param_1); + vec3 param = _176; + color_ldr_linear = aces(param); } else { - tonemapped = _175; + color_ldr_linear = _176; } - vec3 _213 = (((pow(tonemapped, vec3(1.0 / post_process_config[0].w)) - vec3(0.5)) * max(post_process_config[0].y, 0.0)) + vec3(0.5)) + vec3(post_process_config[0].x); - vec3 gammaCorrected = (mix(vec3(((0.2125000059604644775390625 * _213.x) + (0.7153999805450439453125 * _213.y)) + (0.07209999859333038330078125 * _213.z)), _213, vec3(post_process_config[0].z)) * (1.0 - (smoothstep(0.0, post_process_config[1].z, _67) * post_process_config[1].y))) * (1.0 - (((sin((texcoord.y * float(textureSize(pptex_ppsmp, 0).y)) * post_process_config[2].x) * 0.5) + 0.5) * post_process_config[1].w)); - vec2 param_2 = texcoord; - vec3 _294 = gammaCorrected; - vec3 _296 = _294 + vec3((rand(param_2) - 0.5) * post_process_config[2].z); - gammaCorrected = _296; - frag_color = vec4(_296, 1.0); + vec3 _198 = ((color_ldr_linear - vec3(0.5)) * max(_75.contrast, 0.0)) + vec3(0.5); + color_ldr_linear = clamp(mix(vec3(dot(_198, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _198, vec3(_75.saturation)), vec3(0.0), vec3(1.0)); + if (_75.lut_mode != 0) + { + if (_75.lut_mode == 2) + { + color_ldr_linear = texture(lut_ppsmp, vec2((floor(color_ldr_linear.z * 15.0) * 0.0625) + (floor(color_ldr_linear.x * 15.0) * 0.00390625), floor(color_ldr_linear.y * 15.0) * 0.0625)).xyz; + } + else + { + float _269 = color_ldr_linear.z * 15.0; + float _272 = floor(_269); + float _283 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + float _289 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_272 * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, texture(lut_lut_linear, vec2((((min(_272 + 1.0, 15.0) * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, vec3(_269 - _272)); + } + } + vec3 color_srgb = (pow(color_ldr_linear, vec3(1.0 / _75.gamma)) * (1.0 - (smoothstep(0.0, _75.vignette_radius, _67) * _75.vignette_intensity))) * (1.0 - (((sin((texcoord.y * float(textureSize(pptex_ppsmp, 0).y)) * _75.scanlines_density) * 0.5) + 0.5) * _75.scanlines_intensity)); + vec2 param_1 = texcoord; + vec3 _394 = color_srgb; + vec3 _396 = _394 + vec3((rand(param_1) - 0.5) * _75.film_grain_intensity); + color_srgb = _396; + frag_color = vec4(clamp(_396, vec3(0.0), vec3(1.0)), 1.0); } */ fs_pp_source_glsl430 := u8.[ - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x75,0x6e, - 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x6f,0x73,0x74,0x5f, - 0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x33, - 0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e, - 0x67,0x20,0x3d,0x20,0x31,0x36,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, - 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x70,0x70,0x74,0x65,0x78,0x5f, - 0x70,0x70,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, - 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20, - 0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c, - 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, - 0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x61, - 0x63,0x65,0x73,0x28,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28, - 0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39,0x39, - 0x39,0x39,0x39,0x39,0x30,0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39,0x33, - 0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x32,0x39, - 0x39,0x39,0x39,0x39,0x39,0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36,0x32, - 0x37,0x36,0x38,0x35,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f,0x20, - 0x28,0x28,0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34,0x33, - 0x30,0x30,0x30,0x30,0x30,0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34,0x38, - 0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35, - 0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39, - 0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63, - 0x33,0x28,0x30,0x2e,0x31,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x35,0x39,0x36, - 0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x29, - 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63, - 0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x76,0x65,0x63,0x32,0x20,0x63,0x6f,0x29,0x0a, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61, - 0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x2c,0x20,0x76, - 0x65,0x63,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30,0x30,0x34,0x35,0x33, - 0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x37,0x38,0x2e, - 0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x29, - 0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35,0x34,0x36,0x38,0x37, - 0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e, - 0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36, - 0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2d,0x20,0x76, - 0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68, - 0x28,0x5f,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20, - 0x5f,0x38,0x36,0x20,0x3d,0x20,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x28,0x31,0x2e, - 0x30,0x20,0x2b,0x20,0x28,0x5f,0x36,0x37,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f, - 0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32, - 0x5d,0x2e,0x77,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e, - 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x70,0x6f,0x73,0x74, - 0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b, - 0x32,0x5d,0x2e,0x77,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x5f,0x39,0x36,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20, - 0x5f,0x39,0x36,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x39,0x37,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39,0x36, - 0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39,0x37,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x30,0x34,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20,0x5f,0x38, - 0x36,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, - 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20,0x5f, - 0x31,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x39, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f, - 0x31,0x31,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x39,0x20, - 0x3d,0x20,0x5f,0x38,0x36,0x2e,0x79,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x39, - 0x20,0x3d,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, - 0x31,0x31,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x30,0x2e,0x30, - 0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f, - 0x31,0x34,0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x70,0x6f,0x73,0x74,0x5f, - 0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32, - 0x5d,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x34,0x20,0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, - 0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20, - 0x5f,0x38,0x36,0x20,0x2b,0x20,0x5f,0x31,0x34,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,0x20,0x74,0x65,0x78, - 0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70, - 0x2c,0x20,0x5f,0x38,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34, - 0x20,0x5f,0x31,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, - 0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36, - 0x20,0x2d,0x20,0x5f,0x31,0x34,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x5f,0x31,0x37,0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f, - 0x31,0x34,0x37,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x34,0x2e,0x79,0x2c,0x20,0x5f, - 0x31,0x36,0x35,0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2e,0x78,0x79,0x7a,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, - 0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63, - 0x65,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f, - 0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x30,0x2e, - 0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, - 0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f, - 0x6e,0x65,0x6d,0x61,0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70,0x65, - 0x64,0x20,0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x31,0x33,0x20,0x3d,0x20, - 0x28,0x28,0x28,0x70,0x6f,0x77,0x28,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70,0x65, - 0x64,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2f,0x20,0x70,0x6f, - 0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69, - 0x67,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28, - 0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x70,0x6f,0x73,0x74, - 0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b, - 0x30,0x5d,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2b,0x20,0x76,0x65, - 0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28, - 0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e, - 0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74, - 0x65,0x64,0x20,0x3d,0x20,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x28, - 0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34, - 0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x20,0x2a,0x20,0x5f, - 0x32,0x31,0x33,0x2e,0x78,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x37,0x31,0x35,0x33, - 0x39,0x39,0x39,0x38,0x30,0x35,0x34,0x35,0x30,0x34,0x33,0x39,0x34,0x35,0x33,0x31, - 0x32,0x35,0x20,0x2a,0x20,0x5f,0x32,0x31,0x33,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20, - 0x28,0x30,0x2e,0x30,0x37,0x32,0x30,0x39,0x39,0x39,0x39,0x38,0x35,0x39,0x33,0x33, - 0x33,0x30,0x33,0x38,0x33,0x33,0x30,0x30,0x37,0x38,0x31,0x32,0x35,0x20,0x2a,0x20, - 0x5f,0x32,0x31,0x33,0x2e,0x7a,0x29,0x29,0x2c,0x20,0x5f,0x32,0x31,0x33,0x2c,0x20, - 0x76,0x65,0x63,0x33,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73, - 0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x7a,0x29,0x29,0x20, - 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68, - 0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70, - 0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d, - 0x2e,0x7a,0x2c,0x20,0x5f,0x36,0x37,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f, - 0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31, - 0x5d,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20, - 0x28,0x28,0x28,0x73,0x69,0x6e,0x28,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, - 0x2e,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x74,0x65,0x78,0x74,0x75, - 0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73, - 0x6d,0x70,0x2c,0x20,0x30,0x29,0x2e,0x79,0x29,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73, - 0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67, - 0x5b,0x32,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20, - 0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63, - 0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d,0x2e,0x77,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x32,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x39,0x34,0x20,0x3d,0x20, - 0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65,0x64,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x39,0x36,0x20,0x3d,0x20, - 0x5f,0x32,0x39,0x34,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x72,0x61,0x6e, - 0x64,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35, - 0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73, - 0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65, - 0x64,0x20,0x3d,0x20,0x5f,0x32,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28, - 0x5f,0x32,0x39,0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, - -]; -/* - #version 300 es - - layout(location = 0) in vec2 position; - out vec2 texcoord; - layout(location = 1) in vec2 uv; - - void main() - { - gl_Position = vec4(position, 0.5, 1.0); - texcoord = uv; - } - -*/ -vs_pp_source_glsl300es := u8.[ - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, - 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, - 0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32, - 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, - 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20, - 0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,0x0a,0x76,0x6f,0x69, - 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67, - 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63, - 0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x35,0x2c, - 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x63,0x6f, - 0x6f,0x72,0x64,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, -]; -/* - #version 300 es - precision mediump float; - precision highp int; - - uniform highp vec4 post_process_config[3]; - uniform highp sampler2D pptex_ppsmp; - - in highp vec2 texcoord; - layout(location = 0) out highp vec4 frag_color; - - highp vec3 aces(highp vec3 x) - { - return clamp((x * ((x * 2.5099999904632568359375) + vec3(0.02999999932944774627685546875))) / ((x * ((x * 2.4300000667572021484375) + vec3(0.589999973773956298828125))) + vec3(0.14000000059604644775390625)), vec3(0.0), vec3(1.0)); - } - - highp float rand(highp vec2 co) - { - return fract(sin(dot(co, vec2(12.98980045318603515625, 78.233001708984375))) * 43758.546875); - } - - void main() - { - highp vec2 _66 = texcoord - vec2(0.5); - highp float _67 = length(_66); - highp vec2 _86 = (_66 * (1.0 + (_67 * post_process_config[2].w))) + vec2(0.5); - if (post_process_config[2].w > 0.0) - { - highp float _96 = _86.x; - bool _97 = _96 < 0.0; - bool _104; - if (!_97) - { - _104 = _96 > 1.0; - } - else - { - _104 = _97; - } - bool _112; - if (!_104) - { - _112 = _86.y < 0.0; - } - else - { - _112 = _104; - } - bool _119; - if (!_112) - { - _119 = _86.y > 1.0; - } - else - { - _119 = _112; - } - if (_119) - { - frag_color = vec4(0.0, 0.0, 0.0, 1.0); - return; - } - } - highp vec2 _145 = vec2(post_process_config[2].y, 0.0); - highp vec4 _147 = texture(pptex_ppsmp, _86 + _145); - highp vec4 _154 = texture(pptex_ppsmp, _86); - highp vec4 _165 = texture(pptex_ppsmp, _86 - _145); - highp vec3 _175 = vec4(_147.x, _154.y, _165.z, 1.0).xyz; - highp vec3 param = _175; - highp vec3 tonemapped = aces(param); - if (post_process_config[1].x > 0.5) - { - highp vec3 param_1 = _175; - tonemapped = aces(param_1); - } - else - { - tonemapped = _175; - } - highp vec3 _213 = (((pow(tonemapped, vec3(1.0 / post_process_config[0].w)) - vec3(0.5)) * max(post_process_config[0].y, 0.0)) + vec3(0.5)) + vec3(post_process_config[0].x); - highp vec3 gammaCorrected = (mix(vec3(((0.2125000059604644775390625 * _213.x) + (0.7153999805450439453125 * _213.y)) + (0.07209999859333038330078125 * _213.z)), _213, vec3(post_process_config[0].z)) * (1.0 - (smoothstep(0.0, post_process_config[1].z, _67) * post_process_config[1].y))) * (1.0 - (((sin((texcoord.y * float(textureSize(pptex_ppsmp, 0).y)) * post_process_config[2].x) * 0.5) + 0.5) * post_process_config[1].w)); - highp vec2 param_2 = texcoord; - highp vec3 _294 = gammaCorrected; - highp vec3 _296 = _294 + vec3((rand(param_2) - 0.5) * post_process_config[2].z); - gammaCorrected = _296; - frag_color = vec4(_296, 1.0); - } - -*/ -fs_pp_source_glsl300es := u8.[ - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, - 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, - 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x75, - 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, - 0x34,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63, - 0x6f,0x6e,0x66,0x69,0x67,0x5b,0x33,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72, - 0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32, - 0x44,0x20,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x3b,0x0a,0x0a, - 0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65, - 0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, - 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x61,0x63,0x65,0x73,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x78,0x20,0x2a,0x20,0x28, - 0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x30, - 0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39,0x33,0x37,0x35,0x29,0x20,0x2b, - 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x32,0x39,0x39,0x39,0x39,0x39,0x39, - 0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36,0x32,0x37,0x36,0x38,0x35,0x35, - 0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f,0x20,0x28,0x28,0x78,0x20,0x2a, - 0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34,0x33,0x30,0x30,0x30,0x30,0x30, - 0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x29, - 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x38,0x39,0x39,0x39,0x39, - 0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38,0x38,0x32,0x38,0x31, - 0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31, - 0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34, - 0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x76,0x65,0x63, - 0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30, - 0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x32,0x20,0x63,0x6f,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f, - 0x74,0x28,0x63,0x6f,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x32,0x2e,0x39,0x38, - 0x39,0x38,0x30,0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36, - 0x32,0x35,0x2c,0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38, - 0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35, - 0x38,0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f, - 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x36,0x20,0x3d, - 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2d,0x20,0x76,0x65,0x63,0x32, - 0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e, - 0x67,0x74,0x68,0x28,0x5f,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, - 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38,0x36,0x20,0x3d,0x20,0x28, - 0x5f,0x36,0x36,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x36, - 0x37,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73, - 0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x77,0x29,0x29,0x29,0x20, - 0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73, - 0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x77,0x20,0x3e,0x20, - 0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x73,0x74, + 0x72,0x75,0x63,0x74,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73, + 0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x6e,0x74,0x72,0x61,0x73, + 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x61,0x74, + 0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x67,0x61,0x6d,0x6d,0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f, + 0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61, + 0x64,0x69,0x75,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73, + 0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73, + 0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x64,0x65,0x6e,0x73,0x69,0x74,0x79, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x68,0x72,0x6f, + 0x6d,0x61,0x74,0x69,0x63,0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74,0x69,0x6f,0x6e, + 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x69,0x6c,0x6d,0x5f,0x67,0x72,0x61,0x69,0x6e, + 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73, + 0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x6c,0x75,0x74,0x5f,0x6d, + 0x6f,0x64,0x65,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, + 0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f, + 0x6e,0x66,0x69,0x67,0x20,0x5f,0x37,0x35,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x31,0x36,0x29,0x20, + 0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32, + 0x44,0x20,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20, + 0x31,0x37,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x32,0x44,0x20,0x6c,0x75,0x74,0x5f,0x70,0x70,0x73,0x6d,0x70,0x3b, + 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20, + 0x3d,0x20,0x31,0x38,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x6c,0x75,0x74,0x5f,0x6c,0x75,0x74,0x5f, + 0x6c,0x69,0x6e,0x65,0x61,0x72,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e, + 0x20,0x76,0x65,0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a, + 0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x30,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20, + 0x61,0x63,0x65,0x73,0x28,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28, + 0x28,0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39, + 0x39,0x39,0x39,0x39,0x39,0x30,0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39, + 0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x32, + 0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36, + 0x32,0x37,0x36,0x38,0x35,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f, + 0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34, + 0x33,0x30,0x30,0x30,0x30,0x30,0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34, + 0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32, + 0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x31,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x35,0x39, + 0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29, + 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x76,0x65,0x63,0x32,0x20,0x63,0x6f,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72, + 0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x2c,0x20, + 0x76,0x65,0x63,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30,0x30,0x34,0x35, + 0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x37,0x38, + 0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35, + 0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35,0x34,0x36,0x38, + 0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f, + 0x36,0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2d,0x20, + 0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74, + 0x68,0x28,0x5f,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32, + 0x20,0x5f,0x38,0x36,0x20,0x3d,0x20,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x28,0x31, + 0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x36,0x37,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e, + 0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f, + 0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64, + 0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73, + 0x69,0x74,0x79,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, 0x39,0x36,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20,0x5f, 0x39,0x36,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, @@ -542,91 +329,546 @@ fs_pp_source_glsl300es := u8.[ 0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74, 0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x32,0x20,0x5f,0x31,0x34,0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28, - 0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e, - 0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f, - 0x31,0x34,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70, - 0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x20,0x2b, - 0x20,0x5f,0x31,0x34,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,0x20,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d, - 0x70,0x2c,0x20,0x5f,0x38,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x36,0x35,0x20,0x3d,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73, - 0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x20,0x2d,0x20,0x5f,0x31,0x34,0x35,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, - 0x5f,0x31,0x37,0x35,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x34,0x37, - 0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x31,0x36,0x35, - 0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61, - 0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70,0x61,0x72,0x61, - 0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x70,0x6f,0x73,0x74, - 0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b, - 0x31,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f, - 0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x6e, - 0x65,0x6d,0x61,0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70,0x65,0x64, - 0x20,0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32, - 0x31,0x33,0x20,0x3d,0x20,0x28,0x28,0x28,0x70,0x6f,0x77,0x28,0x74,0x6f,0x6e,0x65, - 0x6d,0x61,0x70,0x70,0x65,0x64,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30, - 0x20,0x2f,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f, - 0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x29,0x20,0x2d,0x20, - 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x6d,0x61,0x78, - 0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f, - 0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29, - 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20, - 0x76,0x65,0x63,0x33,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73, - 0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x67, - 0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65,0x64,0x20,0x3d,0x20, - 0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x30,0x2e,0x32,0x31, - 0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37, - 0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x20,0x2a,0x20,0x5f,0x32,0x31,0x33,0x2e,0x78, - 0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x37,0x31,0x35,0x33,0x39,0x39,0x39,0x38,0x30, - 0x35,0x34,0x35,0x30,0x34,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x20,0x2a,0x20, - 0x5f,0x32,0x31,0x33,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x30,0x37, - 0x32,0x30,0x39,0x39,0x39,0x39,0x38,0x35,0x39,0x33,0x33,0x33,0x30,0x33,0x38,0x33, - 0x33,0x30,0x30,0x37,0x38,0x31,0x32,0x35,0x20,0x2a,0x20,0x5f,0x32,0x31,0x33,0x2e, - 0x7a,0x29,0x29,0x2c,0x20,0x5f,0x32,0x31,0x33,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, - 0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e, - 0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31, + 0x34,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x37,0x35,0x2e,0x63,0x68, + 0x72,0x6f,0x6d,0x61,0x74,0x69,0x63,0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74,0x69, + 0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x34, + 0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65, + 0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x20,0x2b,0x20,0x5f, + 0x31,0x34,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f, + 0x31,0x35,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70, + 0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x36,0x32,0x20,0x3d, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70, + 0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x20,0x2d,0x20,0x5f,0x31,0x34,0x32, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x37,0x36, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x34,0x34,0x2e,0x78,0x2c,0x20, + 0x5f,0x31,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x31,0x36,0x32,0x2e,0x7a,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x65, + 0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e, + 0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x20,0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64, + 0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x39, + 0x38,0x20,0x3d,0x20,0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f, + 0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x35,0x29,0x29,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x5f,0x37,0x35,0x2e,0x63,0x6f, + 0x6e,0x74,0x72,0x61,0x73,0x74,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2b,0x20, + 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20, + 0x3d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33, + 0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x39,0x38,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, + 0x30,0x2e,0x32,0x31,0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36, + 0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37, + 0x31,0x35,0x33,0x39,0x39,0x39,0x38,0x30,0x35,0x34,0x35,0x30,0x34,0x33,0x39,0x34, + 0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x30,0x39,0x39,0x39, + 0x39,0x38,0x35,0x39,0x33,0x33,0x33,0x30,0x33,0x38,0x33,0x33,0x30,0x30,0x37,0x38, + 0x31,0x32,0x35,0x29,0x29,0x29,0x2c,0x20,0x5f,0x31,0x39,0x38,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x5f,0x37,0x35,0x2e,0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f, + 0x6e,0x29,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20, + 0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x6c,0x75,0x74,0x5f,0x6d,0x6f,0x64,0x65, + 0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x6c,0x75,0x74, + 0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x6c,0x75,0x74, + 0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x28,0x66,0x6c, + 0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69, + 0x6e,0x65,0x61,0x72,0x2e,0x7a,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x2e,0x78,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x36,0x32,0x35,0x29,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, + 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x32,0x36,0x39,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72, + 0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x7a,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72, + 0x28,0x5f,0x32,0x36,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x33,0x20,0x3d, + 0x20,0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e, + 0x65,0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20,0x2b,0x20, + 0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x32,0x38,0x39,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64, + 0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x78,0x20,0x2a,0x20,0x31,0x35,0x2e, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20, + 0x3d,0x20,0x6d,0x69,0x78,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x6c,0x75, + 0x74,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x76,0x65, + 0x63,0x32,0x28,0x28,0x28,0x28,0x5f,0x32,0x37,0x32,0x20,0x2a,0x20,0x31,0x36,0x2e, + 0x30,0x29,0x20,0x2b,0x20,0x5f,0x32,0x38,0x39,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20, + 0x5f,0x32,0x38,0x33,0x29,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x6c,0x75,0x74,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x28,0x28,0x28,0x6d,0x69,0x6e,0x28, + 0x5f,0x32,0x37,0x32,0x20,0x2b,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x35,0x2e,0x30, + 0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x32,0x38,0x39, + 0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33, + 0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x32,0x38,0x33,0x29,0x29,0x2e,0x78,0x79, + 0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x32,0x36,0x39,0x20,0x2d,0x20,0x5f, + 0x32,0x37,0x32,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x28,0x70,0x6f, + 0x77,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2f,0x20,0x5f, + 0x37,0x35,0x2e,0x67,0x61,0x6d,0x6d,0x61,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e, 0x30,0x20,0x2d,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28, - 0x30,0x2e,0x30,0x2c,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73, - 0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d,0x2e,0x7a,0x2c,0x20,0x5f, - 0x36,0x37,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65, - 0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d,0x2e,0x79,0x29,0x29, - 0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x28,0x73,0x69, - 0x6e,0x28,0x28,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a, - 0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x30, - 0x29,0x2e,0x79,0x29,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f, - 0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x78, - 0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20, - 0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63, - 0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,0x5d,0x2e,0x77,0x29,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b, + 0x30,0x2e,0x30,0x2c,0x20,0x5f,0x37,0x35,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74, + 0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x5f,0x36,0x37,0x29,0x20,0x2a, + 0x20,0x5f,0x37,0x35,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x69,0x6e, + 0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e, + 0x30,0x20,0x2d,0x20,0x28,0x28,0x28,0x73,0x69,0x6e,0x28,0x28,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x70,0x70,0x74,0x65,0x78, + 0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x2e,0x79,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x64, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b, + 0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,0x6e, + 0x6c,0x69,0x6e,0x65,0x73,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x72,0x61,0x6e,0x64,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20, + 0x5f,0x37,0x35,0x2e,0x66,0x69,0x6c,0x6d,0x5f,0x67,0x72,0x61,0x69,0x6e,0x5f,0x69, + 0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x33, + 0x39,0x36,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 300 es + + layout(location = 0) in vec2 position; + out vec2 texcoord; + layout(location = 1) in vec2 uv; + + void main() + { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; + } + +*/ +vs_pp_source_glsl300es := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, + 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x30,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x32, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20, + 0x69,0x6e,0x20,0x76,0x65,0x63,0x32,0x20,0x75,0x76,0x3b,0x0a,0x0a,0x76,0x6f,0x69, + 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x67, + 0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x34,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x30,0x2e,0x35,0x2c, + 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x74,0x65,0x78,0x63,0x6f, + 0x6f,0x72,0x64,0x20,0x3d,0x20,0x75,0x76,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 300 es + precision mediump float; + precision highp int; + + struct post_process_config + { + highp float exposure; + highp float contrast; + highp float saturation; + highp float gamma; + highp float tonemap; + highp float vignette_intensity; + highp float vignette_radius; + highp float scanlines_intensity; + highp float scanlines_density; + highp float chromatic_aberration_intensity; + highp float film_grain_intensity; + highp float barrel_distortion_intensity; + int lut_mode; + }; + + uniform post_process_config _75; + + uniform highp sampler2D pptex_ppsmp; + uniform highp sampler2D lut_ppsmp; + uniform highp sampler2D lut_lut_linear; + + in highp vec2 texcoord; + layout(location = 0) out highp vec4 frag_color; + + highp vec3 aces(highp vec3 x) + { + return clamp((x * ((x * 2.5099999904632568359375) + vec3(0.02999999932944774627685546875))) / ((x * ((x * 2.4300000667572021484375) + vec3(0.589999973773956298828125))) + vec3(0.14000000059604644775390625)), vec3(0.0), vec3(1.0)); + } + + highp float rand(highp vec2 co) + { + return fract(sin(dot(co, vec2(12.98980045318603515625, 78.233001708984375))) * 43758.546875); + } + + void main() + { + highp vec2 _66 = texcoord - vec2(0.5); + highp float _67 = length(_66); + highp vec2 _86 = (_66 * (1.0 + (_67 * _75.barrel_distortion_intensity))) + vec2(0.5); + if (_75.barrel_distortion_intensity > 0.0) + { + highp float _96 = _86.x; + bool _97 = _96 < 0.0; + bool _104; + if (!_97) + { + _104 = _96 > 1.0; + } + else + { + _104 = _97; + } + bool _112; + if (!_104) + { + _112 = _86.y < 0.0; + } + else + { + _112 = _104; + } + bool _119; + if (!_112) + { + _119 = _86.y > 1.0; + } + else + { + _119 = _112; + } + if (_119) + { + frag_color = vec4(0.0, 0.0, 0.0, 1.0); + return; + } + } + highp vec2 _142 = vec2(_75.chromatic_aberration_intensity, 0.0); + highp vec4 _144 = texture(pptex_ppsmp, _86 + _142); + highp vec4 _151 = texture(pptex_ppsmp, _86); + highp vec4 _162 = texture(pptex_ppsmp, _86 - _142); + highp vec3 _176 = vec4(_144.x, _151.y, _162.z, 1.0).xyz * _75.exposure; + highp vec3 color_ldr_linear; + if (_75.tonemap > 0.5) + { + highp vec3 param = _176; + color_ldr_linear = aces(param); + } + else + { + color_ldr_linear = _176; + } + highp vec3 _198 = ((color_ldr_linear - vec3(0.5)) * max(_75.contrast, 0.0)) + vec3(0.5); + color_ldr_linear = clamp(mix(vec3(dot(_198, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _198, vec3(_75.saturation)), vec3(0.0), vec3(1.0)); + if (_75.lut_mode != 0) + { + if (_75.lut_mode == 2) + { + color_ldr_linear = texture(lut_ppsmp, vec2((floor(color_ldr_linear.z * 15.0) * 0.0625) + (floor(color_ldr_linear.x * 15.0) * 0.00390625), floor(color_ldr_linear.y * 15.0) * 0.0625)).xyz; + } + else + { + highp float _269 = color_ldr_linear.z * 15.0; + highp float _272 = floor(_269); + highp float _283 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + highp float _289 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_272 * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, texture(lut_lut_linear, vec2((((min(_272 + 1.0, 15.0) * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, vec3(_269 - _272)); + } + } + highp vec3 color_srgb = (pow(color_ldr_linear, vec3(1.0 / _75.gamma)) * (1.0 - (smoothstep(0.0, _75.vignette_radius, _67) * _75.vignette_intensity))) * (1.0 - (((sin((texcoord.y * float(textureSize(pptex_ppsmp, 0).y)) * _75.scanlines_density) * 0.5) + 0.5) * _75.scanlines_intensity)); + highp vec2 param_1 = texcoord; + highp vec3 _394 = color_srgb; + highp vec3 _396 = _394 + vec3((rand(param_1) - 0.5) * _75.film_grain_intensity); + color_srgb = _396; + frag_color = vec4(clamp(_396, vec3(0.0), vec3(1.0)), 1.0); + } + +*/ +fs_pp_source_glsl300es := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, + 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, + 0x6f,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x69,0x6e,0x74,0x3b,0x0a,0x0a,0x73, + 0x74,0x72,0x75,0x63,0x74,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65, + 0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x65,0x78,0x70,0x6f, + 0x73,0x75,0x72,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x67,0x61,0x6d,0x6d, + 0x61,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x69,0x67,0x6e, + 0x65,0x74,0x74,0x65,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x69,0x6e,0x74,0x65,0x6e, + 0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f, + 0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x68,0x72,0x6f,0x6d,0x61,0x74, + 0x69,0x63,0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e, + 0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x69,0x6c,0x6d,0x5f,0x67,0x72, + 0x61,0x69,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62, + 0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e, + 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x6e,0x74,0x20,0x6c,0x75,0x74,0x5f,0x6d,0x6f,0x64,0x65,0x3b,0x0a,0x7d,0x3b, + 0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70, + 0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x20,0x5f,0x37, + 0x35,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x70,0x70,0x74,0x65, + 0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44, + 0x20,0x6c,0x75,0x74,0x5f,0x70,0x70,0x73,0x6d,0x70,0x3b,0x0a,0x75,0x6e,0x69,0x66, + 0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x72,0x32,0x44,0x20,0x6c,0x75,0x74,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x3b,0x0a,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x6c,0x61,0x79, + 0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30, + 0x29,0x20,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x0a,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x63,0x65,0x73,0x28,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28, + 0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39,0x39, + 0x39,0x39,0x39,0x39,0x30,0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39,0x33, + 0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x32,0x39, + 0x39,0x39,0x39,0x39,0x39,0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36,0x32, + 0x37,0x36,0x38,0x35,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f,0x20, + 0x28,0x28,0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34,0x33, + 0x30,0x30,0x30,0x30,0x30,0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34,0x38, + 0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35, + 0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39, + 0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x31,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x35,0x39,0x36, + 0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x29, + 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x63,0x6f,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x73, + 0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x2c,0x20,0x76,0x65,0x63,0x32,0x28, + 0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30,0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30, + 0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c,0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30, + 0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20, + 0x5f,0x36,0x36,0x20,0x3d,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2d, + 0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20, + 0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x36,0x36,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x38, + 0x36,0x20,0x3d,0x20,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20, + 0x2b,0x20,0x28,0x5f,0x36,0x37,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x62,0x61,0x72, + 0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69, + 0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2b,0x20,0x76,0x65, + 0x63,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x37,0x35,0x2e,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74, + 0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79, + 0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x39,0x36,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x78,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x39,0x37,0x20, + 0x3d,0x20,0x5f,0x39,0x36,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x39,0x37, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f, + 0x39,0x36,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x30, + 0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20, + 0x5f,0x38,0x36,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, + 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d, + 0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31, + 0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x21,0x5f,0x31,0x31,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31, + 0x39,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x79,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31, + 0x31,0x39,0x20,0x3d,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x31,0x31,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x32,0x28,0x5f,0x37,0x35,0x2e,0x63,0x68,0x72,0x6f,0x6d,0x61,0x74,0x69,0x63, + 0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65, + 0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x34,0x34, + 0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78, + 0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x20,0x2b,0x20,0x5f,0x31, + 0x34,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x34,0x20,0x5f,0x31,0x35,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x38,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x36,0x32,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c, + 0x20,0x5f,0x38,0x36,0x20,0x2d,0x20,0x5f,0x31,0x34,0x32,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x37, + 0x36,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x31,0x34,0x34,0x2e,0x78,0x2c, + 0x20,0x5f,0x31,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x31,0x36,0x32,0x2e,0x7a,0x2c, + 0x20,0x31,0x2e,0x30,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e, + 0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c, + 0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x20,0x3e, + 0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65, + 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x20,0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, - 0x5f,0x32,0x39,0x34,0x20,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72, - 0x65,0x63,0x74,0x65,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x39,0x36,0x20,0x3d,0x20,0x5f,0x32,0x39, - 0x34,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x72,0x61,0x6e,0x64,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a, - 0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f, - 0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65,0x64,0x20,0x3d, - 0x20,0x5f,0x32,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32,0x39, - 0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x5f,0x31,0x39,0x38,0x20,0x3d,0x20,0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c, + 0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x2d,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x5f,0x37,0x35, + 0x2e,0x63,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x20,0x3d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76, + 0x65,0x63,0x33,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x39,0x38,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36, + 0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20, + 0x30,0x2e,0x37,0x31,0x35,0x33,0x39,0x39,0x39,0x38,0x30,0x35,0x34,0x35,0x30,0x34, + 0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x30, + 0x39,0x39,0x39,0x39,0x38,0x35,0x39,0x33,0x33,0x33,0x30,0x33,0x38,0x33,0x33,0x30, + 0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x2c,0x20,0x5f,0x31,0x39,0x38,0x2c, + 0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x37,0x35,0x2e,0x73,0x61,0x74,0x75,0x72,0x61, + 0x74,0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x6c,0x75,0x74,0x5f,0x6d, + 0x6f,0x64,0x65,0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e, + 0x6c,0x75,0x74,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x6c,0x75,0x74,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x28, + 0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72, + 0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x7a,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x20,0x2b,0x20,0x28,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x2e,0x78,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x36,0x39,0x20,0x3d,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72, + 0x2e,0x7a,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x32,0x37,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x5f,0x32,0x36,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x32,0x38,0x33,0x20,0x3d,0x20,0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64, + 0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31,0x35,0x2e, + 0x30,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36, + 0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x39, + 0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e, + 0x65,0x61,0x72,0x2e,0x78,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, + 0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78, + 0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x6c,0x75,0x74,0x5f,0x6c,0x75,0x74, + 0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x28,0x28, + 0x28,0x5f,0x32,0x37,0x32,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20, + 0x5f,0x32,0x38,0x39,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x32,0x38,0x33,0x29, + 0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x6c, + 0x75,0x74,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x76, + 0x65,0x63,0x32,0x28,0x28,0x28,0x28,0x6d,0x69,0x6e,0x28,0x5f,0x32,0x37,0x32,0x20, + 0x2b,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,0x31, + 0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x32,0x38,0x39,0x29,0x20,0x2b,0x20,0x30, + 0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35, + 0x2c,0x20,0x5f,0x32,0x38,0x33,0x29,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x5f,0x32,0x36,0x39,0x20,0x2d,0x20,0x5f,0x32,0x37,0x32,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x28,0x70, + 0x6f,0x77,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e, + 0x65,0x61,0x72,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2f,0x20, + 0x5f,0x37,0x35,0x2e,0x67,0x61,0x6d,0x6d,0x61,0x29,0x29,0x20,0x2a,0x20,0x28,0x31, + 0x2e,0x30,0x20,0x2d,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x37,0x35,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74, + 0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x5f,0x36,0x37,0x29,0x20, + 0x2a,0x20,0x5f,0x37,0x35,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x69, + 0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x31, + 0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x28,0x73,0x69,0x6e,0x28,0x28,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x70,0x70,0x74,0x65, + 0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x2e,0x79,0x29,0x29,0x20, + 0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f, + 0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20, + 0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61, + 0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20,0x63,0x6f,0x6c, + 0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f, + 0x33,0x39,0x34,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x72,0x61,0x6e,0x64, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29, + 0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x66,0x69,0x6c,0x6d,0x5f,0x67,0x72,0x61,0x69, + 0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x5f, + 0x33,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6c,0x61,0x6d,0x70, + 0x28,0x5f,0x33,0x39,0x36,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29, + 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #include @@ -707,6 +949,7 @@ vs_pp_source_metal_macos := u8.[ float chromatic_aberration_intensity; float film_grain_intensity; float barrel_distortion_intensity; + int lut_mode; }; struct main0_out @@ -731,13 +974,13 @@ vs_pp_source_metal_macos := u8.[ return fract(sin(dot(co, float2(12.98980045318603515625, 78.233001708984375))) * 43758.546875); } - fragment main0_out main0(main0_in in [[stage_in]], constant post_process_config& _74 [[buffer(0)]], texture2d pptex [[texture(0)]], sampler ppsmp [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], constant post_process_config& _75 [[buffer(0)]], texture2d pptex [[texture(0)]], texture2d lut [[texture(1)]], sampler ppsmp [[sampler(0)]], sampler lut_linear [[sampler(1)]]) { main0_out out = {}; float2 _66 = in.texcoord - float2(0.5); float _67 = length(_66); - float2 _86 = (_66 * (1.0 + (_67 * _74.barrel_distortion_intensity))) + float2(0.5); - if (_74.barrel_distortion_intensity > 0.0) + float2 _86 = (_66 * (1.0 + (_67 * _75.barrel_distortion_intensity))) + float2(0.5); + if (_75.barrel_distortion_intensity > 0.0) { float _96 = _86.x; bool _97 = _96 < 0.0; @@ -774,29 +1017,44 @@ vs_pp_source_metal_macos := u8.[ return out; } } - float2 _145 = float2(_74.chromatic_aberration_intensity, 0.0); - float4 _147 = pptex.sample(ppsmp, (_86 + _145)); - float4 _154 = pptex.sample(ppsmp, _86); - float4 _165 = pptex.sample(ppsmp, (_86 - _145)); - float3 _175 = float4(_147.x, _154.y, _165.z, 1.0).xyz; - float3 param = _175; - float3 tonemapped = aces(param); - if (_74.tonemap > 0.5) + float2 _142 = float2(_75.chromatic_aberration_intensity, 0.0); + float4 _144 = pptex.sample(ppsmp, (_86 + _142)); + float4 _151 = pptex.sample(ppsmp, _86); + float4 _162 = pptex.sample(ppsmp, (_86 - _142)); + float3 _176 = float4(_144.x, _151.y, _162.z, 1.0).xyz * _75.exposure; + float3 color_ldr_linear; + if (_75.tonemap > 0.5) { - float3 param_1 = _175; - tonemapped = aces(param_1); + float3 param = _176; + color_ldr_linear = aces(param); } else { - tonemapped = _175; + color_ldr_linear = _176; } - float3 _213 = (((powr(tonemapped, float3(1.0 / _74.gamma)) - float3(0.5)) * fast::max(_74.contrast, 0.0)) + float3(0.5)) + float3(_74.exposure); - float3 gammaCorrected = (mix(float3(((0.2125000059604644775390625 * _213.x) + (0.7153999805450439453125 * _213.y)) + (0.07209999859333038330078125 * _213.z)), _213, float3(_74.saturation)) * (1.0 - (smoothstep(0.0, _74.vignette_radius, _67) * _74.vignette_intensity))) * (1.0 - (((sin((in.texcoord.y * float(int2(pptex.get_width(), pptex.get_height()).y)) * _74.scanlines_density) * 0.5) + 0.5) * _74.scanlines_intensity)); - float2 param_2 = in.texcoord; - float3 _294 = gammaCorrected; - float3 _296 = _294 + float3((rand(param_2) - 0.5) * _74.film_grain_intensity); - gammaCorrected = _296; - out.frag_color = float4(_296, 1.0); + float3 _198 = ((color_ldr_linear - float3(0.5)) * fast::max(_75.contrast, 0.0)) + float3(0.5); + color_ldr_linear = fast::clamp(mix(float3(dot(_198, float3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _198, float3(_75.saturation)), float3(0.0), float3(1.0)); + if (_75.lut_mode != 0) + { + if (_75.lut_mode == 2) + { + color_ldr_linear = lut.sample(ppsmp, float2((floor(color_ldr_linear.z * 15.0) * 0.0625) + (floor(color_ldr_linear.x * 15.0) * 0.00390625), floor(color_ldr_linear.y * 15.0) * 0.0625)).xyz; + } + else + { + float _269 = color_ldr_linear.z * 15.0; + float _272 = floor(_269); + float _283 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + float _289 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(lut.sample(lut_linear, float2((((_272 * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, lut.sample(lut_linear, float2((((fast::min(_272 + 1.0, 15.0) * 16.0) + _289) + 0.5) * 0.00390625, _283)).xyz, float3(_269 - _272)); + } + } + float3 color_srgb = (powr(color_ldr_linear, float3(1.0 / _75.gamma)) * (1.0 - (smoothstep(0.0, _75.vignette_radius, _67) * _75.vignette_intensity))) * (1.0 - (((sin((in.texcoord.y * float(int2(pptex.get_width(), pptex.get_height()).y)) * _75.scanlines_density) * 0.5) + 0.5) * _75.scanlines_intensity)); + float2 param_1 = in.texcoord; + float3 _394 = color_srgb; + float3 _396 = _394 + float3((rand(param_1) - 0.5) * _75.film_grain_intensity); + color_srgb = _396; + out.frag_color = float4(fast::clamp(_396, float3(0.0), float3(1.0)), 1.0); return out; } @@ -832,193 +1090,252 @@ fs_pp_source_metal_macos := u8.[ 0x61,0x69,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f, 0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e, - 0x73,0x69,0x74,0x79,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74, - 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d,0x5d,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e, - 0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75,0x73,0x65, - 0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a, - 0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f,0x5f, - 0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c,0x77, - 0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x61,0x63,0x65,0x73,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x78,0x29, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x61, - 0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x78,0x20,0x2a,0x20,0x28, - 0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x30, - 0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39,0x33,0x37,0x35,0x29,0x20,0x2b, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x32,0x39,0x39,0x39,0x39, - 0x39,0x39,0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36,0x32,0x37,0x36,0x38, - 0x35,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f,0x20,0x28,0x28,0x78, - 0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34,0x33,0x30,0x30,0x30, - 0x30,0x30,0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34,0x38,0x34,0x33,0x37, - 0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x38, - 0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32,0x39,0x38, - 0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x30,0x2e,0x31,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x35,0x39, - 0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x29, - 0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a, - 0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20,0x5f, - 0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61,0x6c, - 0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, - 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x63,0x6f, - 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66, - 0x72,0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63,0x6f,0x2c, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39,0x38,0x30, - 0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32,0x35,0x2c, - 0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39,0x38,0x34, - 0x33,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38,0x2e,0x35, - 0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61,0x67,0x6d, - 0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6d,0x61, - 0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69,0x6e,0x20, - 0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20,0x63,0x6f, - 0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72,0x6f,0x63, - 0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x37,0x34,0x20, - 0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20, - 0x70,0x70,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, - 0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x70,0x70, - 0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29, - 0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f, - 0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x69, - 0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2d,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68, - 0x28,0x5f,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x32,0x20,0x5f,0x38,0x36,0x20,0x3d,0x20,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x28, - 0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x36,0x37,0x20,0x2a,0x20,0x5f,0x37,0x34, - 0x2e,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69, - 0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20, - 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x34,0x2e,0x62,0x61,0x72,0x72,0x65, + 0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x6c,0x75, + 0x74,0x5f,0x6d,0x6f,0x64,0x65,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, + 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x63,0x6f,0x6c,0x6f,0x72,0x28,0x30,0x29,0x5d, + 0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61, + 0x69,0x6e,0x30,0x5f,0x69,0x6e,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b, + 0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x20, + 0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28,0x61, + 0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x63,0x65,0x73,0x28,0x74,0x68,0x72,0x65,0x61, + 0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20, + 0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x78,0x20,0x2a, + 0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x35,0x30,0x39,0x39,0x39,0x39,0x39, + 0x39,0x30,0x34,0x36,0x33,0x32,0x35,0x36,0x38,0x33,0x35,0x39,0x33,0x37,0x35,0x29, + 0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x32,0x39,0x39, + 0x39,0x39,0x39,0x39,0x39,0x33,0x32,0x39,0x34,0x34,0x37,0x37,0x34,0x36,0x32,0x37, + 0x36,0x38,0x35,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2f,0x20,0x28, + 0x28,0x78,0x20,0x2a,0x20,0x28,0x28,0x78,0x20,0x2a,0x20,0x32,0x2e,0x34,0x33,0x30, + 0x30,0x30,0x30,0x30,0x36,0x36,0x37,0x35,0x37,0x32,0x30,0x32,0x31,0x34,0x38,0x34, + 0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e, + 0x35,0x38,0x39,0x39,0x39,0x39,0x39,0x37,0x33,0x37,0x37,0x33,0x39,0x35,0x36,0x32, + 0x39,0x38,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x31,0x34,0x30,0x30,0x30,0x30,0x30,0x30,0x30, + 0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32, + 0x35,0x29,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69,0x63,0x20,0x69,0x6e,0x6c,0x69,0x6e,0x65, + 0x20,0x5f,0x5f,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x5f,0x5f,0x28,0x28, + 0x61,0x6c,0x77,0x61,0x79,0x73,0x5f,0x69,0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x61,0x6e,0x64,0x28,0x74,0x68,0x72,0x65,0x61, + 0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20, + 0x63,0x6f,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x73,0x69,0x6e,0x28,0x64,0x6f,0x74,0x28,0x63, + 0x6f,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x32,0x2e,0x39,0x38,0x39, + 0x38,0x30,0x30,0x34,0x35,0x33,0x31,0x38,0x36,0x30,0x33,0x35,0x31,0x35,0x36,0x32, + 0x35,0x2c,0x20,0x37,0x38,0x2e,0x32,0x33,0x33,0x30,0x30,0x31,0x37,0x30,0x38,0x39, + 0x38,0x34,0x33,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x34,0x33,0x37,0x35,0x38, + 0x2e,0x35,0x34,0x36,0x38,0x37,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x72,0x61, + 0x67,0x6d,0x65,0x6e,0x74,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20, + 0x6d,0x61,0x69,0x6e,0x30,0x28,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x69,0x6e,0x20,0x69, + 0x6e,0x20,0x5b,0x5b,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x5d,0x5d,0x2c,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x72, + 0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x37, + 0x35,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74, + 0x3e,0x20,0x70,0x70,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x6c,0x75,0x74,0x20,0x5b,0x5b,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x20,0x70,0x70,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x20,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x5b,0x5b, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75, + 0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36, + 0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x36,0x36,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x38,0x36,0x20, + 0x3d,0x20,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20, + 0x28,0x5f,0x36,0x37,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x62,0x61,0x72,0x72,0x65, 0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74, - 0x65,0x6e,0x73,0x69,0x74,0x79,0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x39,0x36,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x78,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x39,0x37,0x20, - 0x3d,0x20,0x5f,0x39,0x36,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x39,0x37, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f, - 0x39,0x36,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39, - 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x30, - 0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20, - 0x5f,0x38,0x36,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65, - 0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d, - 0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31, - 0x31,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x21,0x5f,0x31,0x31,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31, - 0x39,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x79,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x37,0x35,0x2e,0x62,0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74, + 0x6f,0x72,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79, + 0x20,0x3e,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x36,0x20, + 0x3d,0x20,0x5f,0x38,0x36,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x39,0x37,0x20,0x3d,0x20,0x5f,0x39,0x36,0x20, + 0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39,0x36,0x20,0x3e,0x20,0x31, + 0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x5f,0x31,0x30,0x34,0x20,0x3d,0x20,0x5f,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x30,0x34,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20,0x5f,0x38,0x36,0x2e,0x79,0x20, + 0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x32,0x20,0x3d,0x20,0x5f,0x31,0x30,0x34,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31, - 0x31,0x39,0x20,0x3d,0x20,0x5f,0x31,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x5f,0x31,0x31,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, - 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x34,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30, - 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34, - 0x35,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x37,0x34,0x2e,0x63, - 0x68,0x72,0x6f,0x6d,0x61,0x74,0x69,0x63,0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74, - 0x69,0x6f,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x30, - 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, - 0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x38,0x36,0x20, - 0x2b,0x20,0x5f,0x31,0x34,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x35,0x34,0x20,0x3d,0x20,0x70,0x70,0x74,0x65, - 0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20, - 0x5f,0x38,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, - 0x20,0x5f,0x31,0x36,0x35,0x20,0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x38,0x36, - 0x20,0x2d,0x20,0x5f,0x31,0x34,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x37,0x35,0x20,0x3d,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x34,0x28,0x5f,0x31,0x34,0x37,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x34, - 0x2e,0x79,0x2c,0x20,0x5f,0x31,0x36,0x35,0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29, - 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61, - 0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70,0x61,0x72,0x61, - 0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x34,0x2e, - 0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x20,0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x31, - 0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x6e,0x65, - 0x6d,0x61,0x70,0x70,0x65,0x64,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70,0x65,0x64,0x20, - 0x3d,0x20,0x5f,0x31,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x31,0x33,0x20,0x3d,0x20, - 0x28,0x28,0x28,0x70,0x6f,0x77,0x72,0x28,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x70, - 0x65,0x64,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x20,0x2f, - 0x20,0x5f,0x37,0x34,0x2e,0x67,0x61,0x6d,0x6d,0x61,0x29,0x29,0x20,0x2d,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x66,0x61, - 0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x37,0x34,0x2e,0x63,0x6f,0x6e,0x74, - 0x72,0x61,0x73,0x74,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x28,0x5f,0x37,0x34,0x2e,0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x67,0x61, - 0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65,0x64,0x20,0x3d,0x20,0x28, - 0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x28,0x28,0x30,0x2e,0x32, - 0x31,0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37, - 0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x20,0x2a,0x20,0x5f,0x32,0x31,0x33,0x2e, - 0x78,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x37,0x31,0x35,0x33,0x39,0x39,0x39,0x38, - 0x30,0x35,0x34,0x35,0x30,0x34,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x20,0x2a, - 0x20,0x5f,0x32,0x31,0x33,0x2e,0x79,0x29,0x29,0x20,0x2b,0x20,0x28,0x30,0x2e,0x30, - 0x37,0x32,0x30,0x39,0x39,0x39,0x39,0x38,0x35,0x39,0x33,0x33,0x33,0x30,0x33,0x38, - 0x33,0x33,0x30,0x30,0x37,0x38,0x31,0x32,0x35,0x20,0x2a,0x20,0x5f,0x32,0x31,0x33, - 0x2e,0x7a,0x29,0x29,0x2c,0x20,0x5f,0x32,0x31,0x33,0x2c,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x5f,0x37,0x34,0x2e,0x73,0x61,0x74,0x75,0x72,0x61,0x74,0x69,0x6f, - 0x6e,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x73,0x6d, - 0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x37, - 0x34,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75, - 0x73,0x2c,0x20,0x5f,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f,0x37,0x34,0x2e,0x76,0x69, - 0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79, - 0x29,0x29,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x28, - 0x73,0x69,0x6e,0x28,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, - 0x2e,0x79,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x32,0x28, - 0x70,0x70,0x74,0x65,0x78,0x2e,0x67,0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28, - 0x29,0x2c,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x67,0x65,0x74,0x5f,0x68,0x65,0x69, - 0x67,0x68,0x74,0x28,0x29,0x29,0x2e,0x79,0x29,0x29,0x20,0x2a,0x20,0x5f,0x37,0x34, - 0x2e,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x64,0x65,0x6e,0x73,0x69, - 0x74,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35, - 0x29,0x20,0x2a,0x20,0x5f,0x37,0x34,0x2e,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65, - 0x73,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x32,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x39,0x34, - 0x20,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x43,0x6f,0x72,0x72,0x65,0x63,0x74,0x65, - 0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32, - 0x39,0x36,0x20,0x3d,0x20,0x5f,0x32,0x39,0x34,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x28,0x72,0x61,0x6e,0x64,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, - 0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x5f,0x37,0x34,0x2e,0x66, - 0x69,0x6c,0x6d,0x5f,0x67,0x72,0x61,0x69,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73, - 0x69,0x74,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x61,0x6d,0x6d,0x61,0x43, - 0x6f,0x72,0x72,0x65,0x63,0x74,0x65,0x64,0x20,0x3d,0x20,0x5f,0x32,0x39,0x36,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x39, - 0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x31,0x39,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x31,0x32,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x39,0x20,0x3d,0x20,0x5f,0x38, + 0x36,0x2e,0x79,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, + 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x31,0x31,0x39,0x20,0x3d,0x20,0x5f, + 0x31,0x31,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x31,0x39,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x28,0x5f,0x37,0x35,0x2e,0x63,0x68,0x72,0x6f,0x6d,0x61,0x74, + 0x69,0x63,0x5f,0x61,0x62,0x65,0x72,0x72,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x69,0x6e, + 0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x34,0x34,0x20,0x3d, + 0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70, + 0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x38,0x36,0x20,0x2b,0x20,0x5f,0x31,0x34,0x32, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f, + 0x31,0x35,0x31,0x20,0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x36,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x36,0x32,0x20, + 0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70, + 0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x38,0x36,0x20,0x2d,0x20,0x5f,0x31,0x34, + 0x32,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, + 0x5f,0x31,0x37,0x36,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x31, + 0x34,0x34,0x2e,0x78,0x2c,0x20,0x5f,0x31,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x31, + 0x36,0x32,0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a, + 0x20,0x5f,0x37,0x35,0x2e,0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f, + 0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x74,0x6f,0x6e,0x65,0x6d,0x61,0x70,0x20, + 0x3e,0x20,0x30,0x2e,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x20,0x3d,0x20,0x61,0x63,0x65,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20, + 0x3d,0x20,0x5f,0x31,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x39,0x38,0x20,0x3d,0x20, + 0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29, + 0x29,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x37, + 0x35,0x2e,0x63,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x2c,0x20,0x30,0x2e,0x30,0x29, + 0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c, + 0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c, + 0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x64, + 0x6f,0x74,0x28,0x5f,0x31,0x39,0x38,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x30,0x2e,0x32,0x31,0x32,0x35,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36, + 0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37, + 0x31,0x35,0x33,0x39,0x39,0x39,0x38,0x30,0x35,0x34,0x35,0x30,0x34,0x33,0x39,0x34, + 0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x30,0x39,0x39,0x39, + 0x39,0x38,0x35,0x39,0x33,0x33,0x33,0x30,0x33,0x38,0x33,0x33,0x30,0x30,0x37,0x38, + 0x31,0x32,0x35,0x29,0x29,0x29,0x2c,0x20,0x5f,0x31,0x39,0x38,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x37,0x35,0x2e,0x73,0x61,0x74,0x75,0x72,0x61,0x74, + 0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e, + 0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x37,0x35,0x2e,0x6c,0x75, + 0x74,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x37,0x35,0x2e,0x6c,0x75,0x74,0x5f,0x6d,0x6f,0x64,0x65,0x20,0x3d,0x3d,0x20,0x32, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64, + 0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x6c,0x75,0x74,0x2e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x28,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72, + 0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x7a,0x20,0x2a,0x20, + 0x31,0x35,0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x20, + 0x2b,0x20,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c, + 0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x78,0x20,0x2a,0x20,0x31,0x35, + 0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35, + 0x29,0x2c,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c, + 0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31,0x35, + 0x2e,0x30,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x36,0x39,0x20,0x3d,0x20,0x63,0x6f, + 0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x7a, + 0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x37,0x32,0x20, + 0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x32,0x36,0x39,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x32,0x38,0x33,0x20,0x3d,0x20,0x28,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, + 0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e,0x79,0x20,0x2a,0x20,0x31, + 0x35,0x2e,0x30,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e, + 0x30,0x36,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x39,0x20,0x3d,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2e, + 0x78,0x20,0x2a,0x20,0x31,0x35,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f, + 0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x6c,0x75,0x74, + 0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65, + 0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x28,0x28,0x28,0x5f,0x32, + 0x37,0x32,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x32,0x38, + 0x39,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30, + 0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x32,0x38,0x33,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x2c,0x20,0x6c,0x75,0x74,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x6c, + 0x75,0x74,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x28,0x28,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x5f, + 0x32,0x37,0x32,0x20,0x2b,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x35,0x2e,0x30,0x29, + 0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x32,0x38,0x39,0x29, + 0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39, + 0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x32,0x38,0x33,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x36,0x39,0x20,0x2d,0x20, + 0x5f,0x32,0x37,0x32,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20, + 0x28,0x70,0x6f,0x77,0x72,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f, + 0x6c,0x69,0x6e,0x65,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31, + 0x2e,0x30,0x20,0x2f,0x20,0x5f,0x37,0x35,0x2e,0x67,0x61,0x6d,0x6d,0x61,0x29,0x29, + 0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x73,0x6d,0x6f,0x6f,0x74, + 0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x37,0x35,0x2e,0x76, + 0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20, + 0x5f,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x76,0x69,0x67,0x6e,0x65, + 0x74,0x74,0x65,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29, + 0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x28,0x28,0x28,0x73,0x69,0x6e, + 0x28,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20, + 0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x6e,0x74,0x32,0x28,0x70,0x70,0x74, + 0x65,0x78,0x2e,0x67,0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29,0x2c,0x20, + 0x70,0x70,0x74,0x65,0x78,0x2e,0x67,0x65,0x74,0x5f,0x68,0x65,0x69,0x67,0x68,0x74, + 0x28,0x29,0x29,0x2e,0x79,0x29,0x29,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x73,0x63, + 0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, + 0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a, + 0x20,0x5f,0x37,0x35,0x2e,0x73,0x63,0x61,0x6e,0x6c,0x69,0x6e,0x65,0x73,0x5f,0x69, + 0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d, + 0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f,0x33, + 0x39,0x34,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x28,0x72,0x61,0x6e, + 0x64,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35, + 0x29,0x20,0x2a,0x20,0x5f,0x37,0x35,0x2e,0x66,0x69,0x6c,0x6d,0x5f,0x67,0x72,0x61, + 0x69,0x6e,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20, + 0x5f,0x33,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x34,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x33, + 0x39,0x36,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x29,0x2c,0x20,0x31, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc: sg_shader_desc; @@ -1035,20 +1352,70 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.attrs[1].glsl_name = "uv"; desc.uniform_blocks[0].stage = .FRAGMENT; desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 48; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 3; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "post_process_config"; + desc.uniform_blocks[0].size = 64; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "_75.exposure"; + desc.uniform_blocks[0].glsl_uniforms[1].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[1].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[1].glsl_name = "_75.contrast"; + desc.uniform_blocks[0].glsl_uniforms[2].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[2].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[2].glsl_name = "_75.saturation"; + desc.uniform_blocks[0].glsl_uniforms[3].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[3].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[3].glsl_name = "_75.gamma"; + desc.uniform_blocks[0].glsl_uniforms[4].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[4].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[4].glsl_name = "_75.tonemap"; + desc.uniform_blocks[0].glsl_uniforms[5].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[5].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[5].glsl_name = "_75.vignette_intensity"; + desc.uniform_blocks[0].glsl_uniforms[6].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[6].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[6].glsl_name = "_75.vignette_radius"; + desc.uniform_blocks[0].glsl_uniforms[7].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[7].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[7].glsl_name = "_75.scanlines_intensity"; + desc.uniform_blocks[0].glsl_uniforms[8].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[8].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[8].glsl_name = "_75.scanlines_density"; + desc.uniform_blocks[0].glsl_uniforms[9].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[9].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[9].glsl_name = "_75.chromatic_aberration_intensity"; + desc.uniform_blocks[0].glsl_uniforms[10].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[10].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[10].glsl_name = "_75.film_grain_intensity"; + desc.uniform_blocks[0].glsl_uniforms[11].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[11].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[11].glsl_name = "_75.barrel_distortion_intensity"; + desc.uniform_blocks[0].glsl_uniforms[12].type = .INT; + desc.uniform_blocks[0].glsl_uniforms[12].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[12].glsl_name = "_75.lut_mode"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; desc.images[0].sample_type = .FLOAT; + desc.images[1].stage = .FRAGMENT; + desc.images[1].multisampled = false; + desc.images[1].image_type = ._2D; + desc.images[1].sample_type = .FLOAT; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; + desc.samplers[1].stage = .FRAGMENT; + desc.samplers[1].sampler_type = .FILTERING; desc.image_sampler_pairs[0].stage = .FRAGMENT; desc.image_sampler_pairs[0].image_slot = 0; desc.image_sampler_pairs[0].sampler_slot = 0; desc.image_sampler_pairs[0].glsl_name = "pptex_ppsmp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 1; + desc.image_sampler_pairs[1].sampler_slot = 0; + desc.image_sampler_pairs[1].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 1; + desc.image_sampler_pairs[2].sampler_slot = 1; + desc.image_sampler_pairs[2].glsl_name = "lut_lut_linear"; case .GLES3; desc.vertex_func.source = xx *vs_pp_source_glsl300es; desc.vertex_func.entry = "main"; @@ -1060,20 +1427,70 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.attrs[1].glsl_name = "uv"; desc.uniform_blocks[0].stage = .FRAGMENT; desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 48; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 3; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "post_process_config"; + desc.uniform_blocks[0].size = 64; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "_75.exposure"; + desc.uniform_blocks[0].glsl_uniforms[1].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[1].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[1].glsl_name = "_75.contrast"; + desc.uniform_blocks[0].glsl_uniforms[2].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[2].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[2].glsl_name = "_75.saturation"; + desc.uniform_blocks[0].glsl_uniforms[3].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[3].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[3].glsl_name = "_75.gamma"; + desc.uniform_blocks[0].glsl_uniforms[4].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[4].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[4].glsl_name = "_75.tonemap"; + desc.uniform_blocks[0].glsl_uniforms[5].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[5].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[5].glsl_name = "_75.vignette_intensity"; + desc.uniform_blocks[0].glsl_uniforms[6].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[6].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[6].glsl_name = "_75.vignette_radius"; + desc.uniform_blocks[0].glsl_uniforms[7].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[7].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[7].glsl_name = "_75.scanlines_intensity"; + desc.uniform_blocks[0].glsl_uniforms[8].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[8].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[8].glsl_name = "_75.scanlines_density"; + desc.uniform_blocks[0].glsl_uniforms[9].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[9].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[9].glsl_name = "_75.chromatic_aberration_intensity"; + desc.uniform_blocks[0].glsl_uniforms[10].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[10].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[10].glsl_name = "_75.film_grain_intensity"; + desc.uniform_blocks[0].glsl_uniforms[11].type = .FLOAT; + desc.uniform_blocks[0].glsl_uniforms[11].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[11].glsl_name = "_75.barrel_distortion_intensity"; + desc.uniform_blocks[0].glsl_uniforms[12].type = .INT; + desc.uniform_blocks[0].glsl_uniforms[12].array_count = 0; + desc.uniform_blocks[0].glsl_uniforms[12].glsl_name = "_75.lut_mode"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; desc.images[0].sample_type = .FLOAT; + desc.images[1].stage = .FRAGMENT; + desc.images[1].multisampled = false; + desc.images[1].image_type = ._2D; + desc.images[1].sample_type = .FLOAT; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; + desc.samplers[1].stage = .FRAGMENT; + desc.samplers[1].sampler_type = .FILTERING; desc.image_sampler_pairs[0].stage = .FRAGMENT; desc.image_sampler_pairs[0].image_slot = 0; desc.image_sampler_pairs[0].sampler_slot = 0; desc.image_sampler_pairs[0].glsl_name = "pptex_ppsmp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 1; + desc.image_sampler_pairs[1].sampler_slot = 0; + desc.image_sampler_pairs[1].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 1; + desc.image_sampler_pairs[2].sampler_slot = 1; + desc.image_sampler_pairs[2].glsl_name = "lut_lut_linear"; case .METAL_MACOS; desc.vertex_func.source = xx *vs_pp_source_metal_macos; desc.vertex_func.entry = "main0"; @@ -1083,19 +1500,33 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.attrs[1].base_type = .FLOAT; desc.uniform_blocks[0].stage = .FRAGMENT; desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 48; + desc.uniform_blocks[0].size = 64; desc.uniform_blocks[0].msl_buffer_n = 0; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; desc.images[0].sample_type = .FLOAT; desc.images[0].msl_texture_n = 0; + desc.images[1].stage = .FRAGMENT; + desc.images[1].multisampled = false; + desc.images[1].image_type = ._2D; + desc.images[1].sample_type = .FLOAT; + desc.images[1].msl_texture_n = 1; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; desc.samplers[0].msl_sampler_n = 0; + desc.samplers[1].stage = .FRAGMENT; + desc.samplers[1].sampler_type = .FILTERING; + desc.samplers[1].msl_sampler_n = 1; desc.image_sampler_pairs[0].stage = .FRAGMENT; desc.image_sampler_pairs[0].image_slot = 0; desc.image_sampler_pairs[0].sampler_slot = 0; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 1; + desc.image_sampler_pairs[1].sampler_slot = 0; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 1; + desc.image_sampler_pairs[2].sampler_slot = 1; } return desc; } diff --git a/src/shaders/shader_post_process_main.glsl b/src/shaders/shader_post_process_main.glsl index 4a77de1..0f92a1b 100644 --- a/src/shaders/shader_post_process_main.glsl +++ b/src/shaders/shader_post_process_main.glsl @@ -16,6 +16,8 @@ out vec4 frag_color; layout(binding = 0) uniform texture2D pptex; layout(binding = 0) uniform sampler ppsmp; +layout(binding = 1) uniform texture2D lut; +layout(binding = 1) uniform sampler lut_linear; layout(binding=0) uniform post_process_config { float exposure; @@ -30,6 +32,7 @@ layout(binding=0) uniform post_process_config { float chromatic_aberration_intensity; float film_grain_intensity; float barrel_distortion_intensity; + int lut_mode; }; vec3 aces(vec3 x) { @@ -59,37 +62,66 @@ void main() { } } - vec4 sampled = vec4(0.0); float r = texture(sampler2D(pptex, ppsmp), distorted_texcoord + vec2(chromatic_aberration_intensity, 0.0)).r; float g = texture(sampler2D(pptex, ppsmp), distorted_texcoord).g; float b = texture(sampler2D(pptex, ppsmp), distorted_texcoord - vec2(chromatic_aberration_intensity, 0.0)).b; - sampled = vec4(r, g, b, 1.0); + vec3 sampled_color_hdr = vec4(r, g, b, 1.0).rgb; - vec3 tonemapped = aces(sampled.xyz); + + vec3 color_hdr = sampled_color_hdr * exposure; + + vec3 color_ldr_linear; if(tonemap > 0.5) { - tonemapped = aces(sampled.xyz); + color_ldr_linear = aces(color_hdr); } else { - tonemapped = sampled.xyz; + color_ldr_linear = color_hdr; } - // tonemapped *= pow(2.0, exposure); - vec3 gammaCorrected = pow(tonemapped, vec3(1.0/gamma)); - gammaCorrected.rgb = ((gammaCorrected.rgb - 0.5f) * max(contrast, 0)) + 0.5f; - gammaCorrected.rgb += exposure; - float lum = (0.2125 * gammaCorrected.r) + (0.7154 * gammaCorrected.g) + (0.0721 * gammaCorrected.b); + color_ldr_linear = ((color_ldr_linear - 0.5f) * max(contrast, 0)) + 0.5f; + + float lum = dot(color_ldr_linear, vec3(0.2125, 0.7154, 0.0721)); vec3 brtColor = vec3(lum, lum, lum); - gammaCorrected.rgb = mix(brtColor, gammaCorrected.rgb, saturation); + color_ldr_linear = mix(brtColor, color_ldr_linear, saturation); + color_ldr_linear = clamp(color_ldr_linear, 0.0, 1.0); + + if(lut_mode != 0) { + if(lut_mode == 2) { + float u = floor(color_ldr_linear.b * 15.0) * (1.0/16.0); + u = u + floor(color_ldr_linear.r * 15.0) * (1.0/256.0); + float v = floor(color_ldr_linear.g * 15.0) * (1.0 / 16.0); + vec3 left = texture(sampler2D(lut, ppsmp), vec2(u, v)).rgb; + color_ldr_linear = left; + } else { + float b_scaled = color_ldr_linear.b * 15.0; + float b_floor = floor(b_scaled); + float b_fract = b_scaled - b_floor; // fract(b_scaled) + + float v = (color_ldr_linear.g * 15.0 + 0.5) / 16.0; + + float u1 = (b_floor * 16.0 + color_ldr_linear.r * 15.0 + 0.5) / 256.0; + vec3 sample1 = texture(sampler2D(lut, lut_linear), vec2(u1, v)).rgb; + + float b_ceil = min(b_floor + 1.0, 15.0); // Clamp to last slice + float u2 = (b_ceil * 16.0 + color_ldr_linear.r * 15.0 + 0.5) / 256.0; + vec3 sample2 = texture(sampler2D(lut, lut_linear), vec2(u2, v)).rgb; + + color_ldr_linear = mix(sample1, sample2, b_fract); + } + } + + vec3 color_srgb = pow(color_ldr_linear, vec3(1.0 / gamma)); + float vignette = 1.0 - smoothstep(0.0, vignette_radius, length(texcoord - vec2(0.5))) * vignette_intensity; - gammaCorrected.rgb *= vignette; + color_srgb *= vignette; float scanline = 1.0 - (sin(texcoord.y * textureSize(sampler2D(pptex, ppsmp), 0).y * scanlines_density) * 0.5 + 0.5) * scanlines_intensity; - gammaCorrected.rgb *= scanline; + color_srgb *= scanline; float grain = (rand(texcoord) - 0.5) * film_grain_intensity; - gammaCorrected.rgb += grain; + color_srgb += grain; - frag_color = vec4(gammaCorrected, 1.0); + frag_color = vec4(clamp(color_srgb, 0.0, 1.0), 1.0); } @end diff --git a/src/world.jai b/src/world.jai index 0279382..54c81f0 100644 --- a/src/world.jai +++ b/src/world.jai @@ -81,6 +81,9 @@ World_Config :: struct { planeType : s32 = 1; @Slider,0,1,1 waterColor : Vector3 = .{1.0, 1.0, 1.0}; @Color // @ToDo: sensible default values. deepColor : Vector3 = .{1.0, 1.0, 1.0}; @Color // @ToDo: sensible default values. + + // ambientColor : Vector3 = .{1.0, 1.0, 1.0}; @Color + // ambientIntensity : float = 0.3; @Slider,0,3,0.1 }