From dcad1dbe7f01605731ce1562bfa5f698d2430896 Mon Sep 17 00:00:00 2001 From: Katajisto Date: Thu, 30 Apr 2026 22:45:04 +0300 Subject: [PATCH] rendering improvements --- first.jai | 33 +- src/assets/sh_loader.jai | 4 + src/audio/backend.jai | 11 +- src/editor/iprof.jai | 25 +- src/editor/level_editor.jai | 24 +- src/editor/rdm_disk.jai | 6 +- src/editor/textureDebugger.jai | 2 +- src/editor/trile_editor.jai | 5 + src/main.jai | 9 +- src/platform_specific/common.jai | 2 - src/rendering/backend.jai | 5 +- src/rendering/backend_sokol.jai | 134 +- src/rendering/backend_sokol_helpers.jai | 129 +- src/rendering/helpers.jai | 51 +- src/rendering/lodgen.jai | 153 + src/rendering/meshgen.jai | 8 +- src/rendering/pipelines.jai | 286 +- src/rendering/post_processing.jai | 2 +- src/rendering/rendering.jai | 1 + src/rendering/tasks.jai | 2 + src/shaders/jai/shader_bloom.jai | 423 --- src/shaders/jai/shader_bloom_downsample.jai | 491 +++ src/shaders/jai/shader_bloom_prefilter.jai | 552 +++ src/shaders/jai/shader_bloom_upsample.jai | 563 +++ src/shaders/jai/shader_dof_blur.jai | 566 +++ ...ader_dof.jai => shader_dof_downsample.jai} | 263 +- src/shaders/jai/shader_gbuffer_billboard.jai | 12 +- src/shaders/jai/shader_post_process_main.jai | 1814 ++++----- src/shaders/jai/shader_sh_deferred.jai | 210 +- src/shaders/jai/shader_trile.jai | 3291 +++++++++-------- src/shaders/jai/shader_trile_lod.jai | 1491 ++++++++ src/shaders/shader_bloom.glsl | 32 - src/shaders/shader_bloom_downsample.glsl | 35 + src/shaders/shader_bloom_prefilter.glsl | 39 + src/shaders/shader_bloom_upsample.glsl | 39 + src/shaders/shader_dof.glsl | 32 - src/shaders/shader_dof_blur.glsl | 48 + src/shaders/shader_dof_downsample.glsl | 25 + src/shaders/shader_gbuffer_billboard.glsl | 2 +- src/shaders/shader_post_process_main.glsl | 20 +- src/shaders/shader_sh_deferred.glsl | 10 +- src/shaders/shader_trile.glsl | 10 +- src/shaders/shader_trile_lod.glsl | 97 + src/trile.jai | 37 +- src/world.jai | 105 + 45 files changed, 7638 insertions(+), 3461 deletions(-) create mode 100644 src/rendering/lodgen.jai delete mode 100644 src/shaders/jai/shader_bloom.jai create mode 100644 src/shaders/jai/shader_bloom_downsample.jai create mode 100644 src/shaders/jai/shader_bloom_prefilter.jai create mode 100644 src/shaders/jai/shader_bloom_upsample.jai create mode 100644 src/shaders/jai/shader_dof_blur.jai rename src/shaders/jai/{shader_dof.jai => shader_dof_downsample.jai} (50%) create mode 100644 src/shaders/jai/shader_trile_lod.jai delete mode 100644 src/shaders/shader_bloom.glsl create mode 100644 src/shaders/shader_bloom_downsample.glsl create mode 100644 src/shaders/shader_bloom_prefilter.glsl create mode 100644 src/shaders/shader_bloom_upsample.glsl delete mode 100644 src/shaders/shader_dof.glsl create mode 100644 src/shaders/shader_dof_blur.glsl create mode 100644 src/shaders/shader_dof_downsample.glsl create mode 100644 src/shaders/shader_trile_lod.glsl diff --git a/first.jai b/first.jai index fc070ef..0a5dd81 100644 --- a/first.jai +++ b/first.jai @@ -125,11 +125,11 @@ wasm_copy_assets :: () { } } -metaprogramming_loop :: (trueno_opts: Trueno_Build_Options, w: *Workspace) { +metaprogramming_loop :: (trueno_opts: Trueno_Build_Options, w: *Workspace, iprof_plugin: *Iprof.My_Plugin = null) { while true { message := compiler_wait_for_message(); - // @ToDo: add iprof to this refactored metaprogram - // if trueno_opts.iprof_enabled then iprof_plugin.message(iprof_plugin, message) + // Fixed iprof integration + if iprof_plugin then iprof_plugin.message(iprof_plugin, message); custom_message_handler(message, w); if message.kind == .COMPLETE then break; } @@ -152,26 +152,27 @@ native_build :: (opts: Build_Options, trueno_opts: Trueno_Build_Options) { set_build_options(opts, w); iprof_plugin: *Iprof.My_Plugin; + intercept_flags: Intercept_Flags; - // profile := iprof; + if trueno_opts.iprof_enabled { + iprof_plugin = cast(*Iprof.My_Plugin) Iprof.get_plugin(); + iprof_plugin.workspace = w; + // Instrumenting all modules creates >65536 unique (parent,zone) hash entries, + // which trips Iprof's MAX_HASH_SIZE assert. Limit to our own files. + iprof_plugin.instrument_modules = false; + iprof_plugin.before_intercept(iprof_plugin, *intercept_flags); + } - // if profile { - // iprof_plugin = cast(*Iprof.My_Plugin) Iprof.get_plugin(); - // iprof_plugin.workspace = w; - - // // Set options - // iprof_plugin.instrument_modules = true; - - // iprof_plugin.before_intercept(iprof_plugin, null); - // } - - compiler_begin_intercept(w); + compiler_begin_intercept(w, intercept_flags); + if trueno_opts.iprof_enabled { + iprof_plugin.add_source(iprof_plugin); + } add_trueno_opts_to_compiler_strings(trueno_opts, w); add_asset_buffer_sizes_to_compiler_strings(trueno_opts, w); add_build_file("src/platform_specific/main_native.jai", w); add_shaders_to_workspace(w); - metaprogramming_loop(trueno_opts, *w); + metaprogramming_loop(trueno_opts, *w, iprof_plugin); if trueno_opts.iprof_enabled { iprof_plugin.finish(iprof_plugin); diff --git a/src/assets/sh_loader.jai b/src/assets/sh_loader.jai index 2c0e969..4882445 100644 --- a/src/assets/sh_loader.jai +++ b/src/assets/sh_loader.jai @@ -57,6 +57,10 @@ sh_loader_handle_completed :: (req: *Fetch_Request, data: []u8) { return; } n := sh_header.probe_n; + if n != SH_PROBE_N { + log_error("SH: probe_n mismatch for chunk % (file=%, expected=%) — re-bake required", req.chunk_key, n, SH_PROBE_N); + return; + } total_values := cast(s64) n * n * n * 12; bytes_per_val := ifx sh_header.version >= 2 then size_of(u16) else size_of(float); if data.count < header_size + total_values * bytes_per_val { diff --git a/src/audio/backend.jai b/src/audio/backend.jai index 4d6a378..ee3a8b1 100644 --- a/src/audio/backend.jai +++ b/src/audio/backend.jai @@ -7,10 +7,13 @@ audio_thread_context : #Context; audio_init_thread_context :: () { audio_thread_context = default_context; audio_thread_context.temporary_storage = *audio_thread_temp_storage; - audio_thread_temp_storage.data = audio_thread_temp_storage_data.data; - audio_thread_temp_storage.size = audio_thread_temp_storage_data.count; - audio_thread_temp_storage.original_data = audio_thread_temp_storage_data.data; - audio_thread_temp_storage.original_size = audio_thread_temp_storage_data.count; + audio_thread_temp_storage.data = audio_thread_temp_storage_data.data; + audio_thread_temp_storage.size = audio_thread_temp_storage_data.count; + // Iprof's zone stack/hash are global. The audio callback runs on a separate + // thread, so any instrumented call from inside it races with the main thread + // and corrupts those globals. Mark this context as "inside profiler runtime" + // so Automatic_Zone_Guarded skips the begin/end on this thread. + audio_thread_context.already_inside_profiler_runtime = true; audio_thread_context_ready = true; } diff --git a/src/editor/iprof.jai b/src/editor/iprof.jai index a43da71..880464e 100644 --- a/src/editor/iprof.jai +++ b/src/editor/iprof.jai @@ -23,12 +23,16 @@ Profiler_Mode :: enum { profiler_mode : Profiler_Mode = .CLOSED; draw_text :: (x: float, y: float, text: string, color: Vector4) { + _, h := get_window_size(); + half_height := cast(float) iprof_font.character_height * 0.5; prepare_text(*iprof_font, text); - draw_prepared_text(*iprof_font, xx x, xx y, color); + draw_prepared_text(*iprof_font, xx x, xx (cast(float) h - y - half_height), color); } draw_line :: (p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, color: Vector4) { - immediate_quad(p0, p1, p2, p3, color); + _, h := get_window_size(); + hf := cast(float) h; + immediate_quad(.{p0.x, hf - p0.y}, .{p1.x, hf - p1.y}, .{p2.x, hf - p2.y}, .{p3.x, hf - p3.y}, color); } text_width :: (text: string) -> float { @@ -43,7 +47,9 @@ text_width :: (text: string) -> float { } draw_rectangle_prof :: (x0: float, y0: float, x1: float, y1: float, color: Vector4) { - r := GR.Rect.{x0,y0,x1-x0,y1-y0}; + _, h := get_window_size(); + hf := cast(float) h; + r := GR.Rect.{x0, hf - y0, x1 - x0, (hf - y1) - (hf - y0)}; draw_rectangle(r, color); } @@ -85,11 +91,17 @@ init_profiler :: () { draw_profiler :: () { if profiler_mode == .CLOSED then return; + + // Prevent recursive profiler calls during drawing + old_value := context.already_inside_profiler_runtime; + context.already_inside_profiler_runtime = true; + defer context.already_inside_profiler_runtime = old_value; + w,h := get_window_size(); draw_rectangle(.{xx(w-700), 0, 700, xx(h) }, .{0,0,0,1}); - __Iprof.draw(xx (w - 700), 20,699,xx h, *iprof_conf); + __Iprof.draw(xx (w - 700), 20, 699, xx h, *iprof_conf); if profiler_mode == .FULL { - __Iprof.draw_graph(0,xx h,xx(w-700),200, *iprof_conf); + __Iprof.draw_graph(0, 100, xx(w-700), 100, *iprof_conf); } } @@ -127,6 +139,7 @@ tick_profiler :: () { __Iprof.graph_select_sample(); } - __Iprof.set_cursor_screen_coordinates(xx input_mouse_x, xx input_mouse_y); + _, h := get_window_size(); + __Iprof.set_cursor_screen_coordinates(xx input_mouse_x, xx (cast(float) h - input_mouse_y)); } } diff --git a/src/editor/level_editor.jai b/src/editor/level_editor.jai index 0ee7c8a..2039a85 100644 --- a/src/editor/level_editor.jai +++ b/src/editor/level_editor.jai @@ -465,16 +465,21 @@ add_trile :: (name: string, x: s32, y: s32, z: s32, orientation: u8 = 0) { inst := Trile_Instance.{x = lx, y = ly, z = lz, orientation = orientation}; // Find existing group for this trile type, or create one. + added := false; for *group: chunk.groups { if group.trile_name == name { array_add(*group.instances, inst); - return; + added = true; + break; } } - group: Chunk_Trile_Group; - group.trile_name = sprint("%", name); - array_add(*group.instances, inst); - array_add(*chunk.groups, group); + if !added { + group: Chunk_Trile_Group; + group.trile_name = sprint("%", name); + array_add(*group.instances, inst); + array_add(*chunk.groups, group); + } + invalidate_buried_around(*curworld.world, x, y, z); } @Command remove_trile :: (x: s32, y: s32, z: s32) { @@ -486,14 +491,21 @@ remove_trile :: (x: s32, y: s32, z: s32) { lx, ly, lz := world_to_local(x, y, z); + removed := false; for *group: chunk.groups { for inst, idx: group.instances { if inst.x == lx && inst.y == ly && inst.z == lz { array_unordered_remove_by_index(*group.instances, idx); - return; + if group.is_buried.count > idx { + array_unordered_remove_by_index(*group.is_buried, idx); + } + removed = true; + break; } } + if removed break; } + if removed invalidate_buried_around(*curworld.world, x, y, z); } @Command diff --git a/src/editor/rdm_disk.jai b/src/editor/rdm_disk.jai index c7ea157..c43fa9d 100644 --- a/src/editor/rdm_disk.jai +++ b/src/editor/rdm_disk.jai @@ -17,11 +17,11 @@ rdm_global_manifest_filename :: (world_name: string) -> string { return sprint("%/worlds/%/rdm_manifest.json", GAME_RESOURCES_DIR, world_name); } -// SH probe grid (2 probes per trile per axis = 64x64x64 per 32x32x32 chunk) +// SH probe grid (1 probe per trile per axis = 32x32x32 per 32x32x32 chunk) SH_FILE_MAGIC :: u32.[0x44475348][0]; // "SHGD" as little-endian u32 -SH_PROBE_N :: 64; // probes per axis (2 per trile in a 32-trile chunk) -SH_TEX_W :: SH_PROBE_N * 3; // 192 — 3 RGBA texels per probe along X +SH_PROBE_N :: 32; // probes per axis (1 per trile in a 32-trile chunk) +SH_TEX_W :: SH_PROBE_N * 3; // 96 — 3 RGBA texels per probe along X SH_Grid_File_Header :: struct { magic: u32; diff --git a/src/editor/textureDebugger.jai b/src/editor/textureDebugger.jai index edf1af0..503bbd7 100644 --- a/src/editor/textureDebugger.jai +++ b/src/editor/textureDebugger.jai @@ -36,7 +36,7 @@ draw_subwindow_texture_debug :: (state: *GR.Subwindow_State, r: GR.Rect, data: * case 3; image = g_gbuf_position; case 4; image = g_gbuf_normal; case 5; image = g_ssaobuf; - case 6; image = g_bloom_tex; + case 6; image = g_bloom_up_1; case 7; image = g_dof_tex; case 8; image = g_rdm_atlas; } diff --git a/src/editor/trile_editor.jai b/src/editor/trile_editor.jai index 99251db..09d0c1e 100644 --- a/src/editor/trile_editor.jai +++ b/src/editor/trile_editor.jai @@ -574,6 +574,11 @@ draw_meta_tab :: (theme: *GR.Overall_Theme, area: GR.Rect) { } r.y += row_h * 2; + r.h = row_h; + changed := GR.base_checkbox(r, "Opaque (occludes neighbors)", editor_current_trile.is_opaque, *theme.checkbox_theme); + if changed editor_current_trile.is_opaque = !editor_current_trile.is_opaque; + r.y += row_h * 2; + r.h = row_h; if GR.button(r, "Delete trile", *theme.button_theme) { name_copy := copy_string(editor_current_trile.name,, temp); diff --git a/src/main.jai b/src/main.jai index 17f936a..e801ce6 100644 --- a/src/main.jai +++ b/src/main.jai @@ -90,8 +90,10 @@ debug_font : *Font; init :: () { sg_setup(*(sg_desc.{ - environment = cast,force(sg_environment) sglue_environment(), - logger = .{ func = slog_func }, + environment = cast,force(sg_environment) sglue_environment(), + logger = .{ func = slog_func }, + attachments_pool_size = 64, + buffer_pool_size = 1024, })); sgl_setup(*(sgl_desc_t.{ logger = .{ func = slog_func }, @@ -257,7 +259,6 @@ frame :: () { tick_ui(); add_frame_profiling_point("After UI tick"); - // This populates our render task queue. if should_tick_game then game_draw(); add_frame_profiling_point("After game draw"); @@ -270,7 +271,7 @@ frame :: () { draw_prepared_text(debug_font, 10, 10, .{0.0, 1.0, 0.0, 1.0}); draw_editor(); } - + add_particle_render_tasks(); add_frame_profiling_point("After editor draw"); render(); diff --git a/src/platform_specific/common.jai b/src/platform_specific/common.jai index e2059e8..0bc87bb 100644 --- a/src/platform_specific/common.jai +++ b/src/platform_specific/common.jai @@ -22,8 +22,6 @@ sapp_init :: () { default_context.temporary_storage = *temporary_storage; temporary_storage.data = temporary_storage_data.data; temporary_storage.size = temporary_storage_data.count; - temporary_storage.original_data = temporary_storage_data.data; - temporary_storage.original_size = temporary_storage_data.count; default_allocator = default_context.allocator; push_context default_context { diff --git a/src/rendering/backend.jai b/src/rendering/backend.jai index e080163..9efacfa 100644 --- a/src/rendering/backend.jai +++ b/src/rendering/backend.jai @@ -57,8 +57,9 @@ Render_Command_Draw_Trile_Positions :: struct { chunk_key : Chunk_Key; amount : s32; conf : *World_Config; - preview_mode : s32 = 0; // 0=normal, 1=add preview (blue), 2=delete preview (red) - offset_index : s32 = 0; // index into trile_offsets, assigned at task-conversion time + preview_mode : s32 = 0; // 0=normal, 1=add preview (blue), 2=delete preview (red) + offset_index : s32 = 0; // index into trile_offsets, assigned at task-conversion time + lod_index : s32 = 0; } Render_Command_Add_Trile_RDM_Position :: struct { diff --git a/src/rendering/backend_sokol.jai b/src/rendering/backend_sokol.jai index cb26708..c60f2c8 100644 --- a/src/rendering/backend_sokol.jai +++ b/src/rendering/backend_sokol.jai @@ -24,7 +24,7 @@ backend_handle_command :: (cmd: *Render_Command) { backend_add_trile_positions(add_command.positions); case .DRAW_TRILE_POSITIONS; draw_command := cast(*Render_Command_Draw_Trile_Positions)cmd; - backend_draw_trile_positions(draw_command.trile, draw_command.amount, draw_command.conf, draw_command.chunk_key, draw_command.preview_mode, draw_command.offset_index); + backend_draw_trile_positions(draw_command.trile, draw_command.amount, draw_command.conf, draw_command.chunk_key, draw_command.preview_mode, draw_command.offset_index, draw_command.lod_index); case .ADD_TRILE_RDM_POSITION; add_command := cast(*Render_Command_Add_Trile_RDM_Position)cmd; backend_add_trile_rdm_position(add_command.position); @@ -141,15 +141,15 @@ backend_add_trile_positions :: (positions : []Vector4) { array_add(*trile_offsets, offset); } -backend_draw_trile_positions :: (trile : string, amount : s32, worldConf: *World_Config, chunk_key: Chunk_Key, preview_mode: s32 = 0, offset_index: s32 = 0) { +backend_draw_trile_positions :: (trile : string, amount : s32, worldConf: *World_Config, chunk_key: Chunk_Key, preview_mode: s32 = 0, offset_index: s32 = 0, lod_index: s32 = 0) { if in_gbuffer_pass { - backend_draw_trile_positions_gbuffer(trile, amount, worldConf, offset_index); + backend_draw_trile_positions_gbuffer(trile, amount, worldConf, offset_index, lod_index); } else { - backend_draw_trile_positions_main(trile, amount, worldConf, chunk_key, preview_mode, offset_index); + backend_draw_trile_positions_main(trile, amount, worldConf, chunk_key, preview_mode, offset_index, lod_index); } } -backend_draw_trile_positions_gbuffer :: (trile : string, amount : s32, worldConf: *World_Config, offset_index: s32) { +backend_draw_trile_positions_gbuffer :: (trile : string, amount : s32, worldConf: *World_Config, offset_index: s32, lod_index: s32 = 0) { if offset_index >= trile_offsets.count then return; mvp := create_viewproj(*camera); view := create_lookat(*camera); @@ -163,10 +163,27 @@ backend_draw_trile_positions_gbuffer :: (trile : string, amount : s32, worldConf offset := trile_offsets[offset_index]; trilegfx := get_trile_gfx(trile); + + vbuf, nbuf, cbuf : sg_buffer; + vcount : s64; + if lod_index == 0 { + vbuf = trilegfx.vertex_buffer; + nbuf = trilegfx.normal_buffer; + cbuf = trilegfx.centre_buffer; + vcount = trilegfx.vertex_count; + } else { + lod := ifx lod_index == 1 then *trilegfx.lod_4 else *trilegfx.lod_2; + if lod.vertex_count == 0 return; + vbuf = lod.vertex_buffer; + nbuf = lod.normal_buffer; + cbuf = lod.color_buffer; // unused by gbuffer shader; bound to satisfy pipeline layout + vcount = lod.vertex_count; + } + bindings : sg_bindings; - bindings.vertex_buffers[0] = trilegfx.vertex_buffer; - bindings.vertex_buffers[1] = trilegfx.normal_buffer; - bindings.vertex_buffers[2] = trilegfx.centre_buffer; + bindings.vertex_buffers[0] = vbuf; + bindings.vertex_buffers[1] = nbuf; + bindings.vertex_buffers[2] = cbuf; bindings.vertex_buffers[3] = gPipelines.trile.bind.vertex_buffers[3]; bindings.vertex_buffer_offsets[3] = offset; bindings.samplers[0] = gPipelines.trile.bind.samplers[0]; @@ -174,10 +191,10 @@ backend_draw_trile_positions_gbuffer :: (trile : string, amount : s32, worldConf sg_apply_bindings(*bindings); sg_apply_uniforms(UB_gbuffer_vs_params, *(sg_range.{ ptr = *vs_params, size = size_of(type_of(vs_params))})); - sg_draw(0, cast(s32) trilegfx.vertex_count, amount); + sg_draw(0, cast(s32) vcount, amount); } -backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: *World_Config, chunk_key: Chunk_Key, preview_mode: s32 = 0, offset_index: s32 = 0) { +backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: *World_Config, chunk_key: Chunk_Key, preview_mode: s32 = 0, offset_index: s32 = 0, lod_index: s32 = 0) { start_frame_profiling_group("Draw trile positions"); if offset_index >= trile_offsets.count { end_frame_profiling_group("Draw trile positions"); @@ -187,24 +204,84 @@ backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: * trilegfx := get_trile_gfx(trile); offset := trile_offsets[offset_index]; + // Pick mesh source based on LOD level. For shadow + gbuffer we keep the original pipeline + // and just swap which buffers feed it; the shader's centre attribute is unused so we bind + // the LOD color buffer as a placeholder to satisfy the pipeline layout. + vbuf, nbuf, cbuf : sg_buffer; + vcount : s64; + if lod_index == 0 { + vbuf = trilegfx.vertex_buffer; + nbuf = trilegfx.normal_buffer; + cbuf = trilegfx.centre_buffer; + vcount = trilegfx.vertex_count; + } else { + lod := ifx lod_index == 1 then *trilegfx.lod_4 else *trilegfx.lod_2; + if lod.vertex_count == 0 { + end_frame_profiling_group("Draw trile positions"); + return; + } + vbuf = lod.vertex_buffer; + nbuf = lod.normal_buffer; + cbuf = lod.color_buffer; + vcount = lod.vertex_count; + } + if in_shadowmap_pass { vs_params : Trile_Shadow_Vs_Params; vs_params.mvp = shadow_mvp.floats; bindings : sg_bindings; - bindings.vertex_buffers[0] = trilegfx.vertex_buffer; - bindings.vertex_buffers[1] = trilegfx.normal_buffer; - bindings.vertex_buffers[2] = trilegfx.centre_buffer; + bindings.vertex_buffers[0] = vbuf; + bindings.vertex_buffers[1] = nbuf; + bindings.vertex_buffers[2] = cbuf; bindings.vertex_buffers[3] = gPipelines.trile.bind.vertex_buffers[3]; bindings.vertex_buffer_offsets[3] = offset; sg_apply_pipeline(gPipelines.trile_shadow.pipeline); sg_apply_bindings(*bindings); sg_apply_uniforms(UB_trile_shadow_vs_params, *(sg_range.{ ptr = *vs_params, size = size_of(type_of(vs_params)) })); - sg_draw(0, cast(s32) trilegfx.vertex_count, amount); + sg_draw(0, cast(s32) vcount, amount); end_frame_profiling_group("Draw trile positions"); return; } mvp := create_viewproj(*camera); + + if lod_index >= 1 { + // LOD path: dedicated shader, vertex color, no ray-march/SSAO/shadow/SH/BRDF. + sg_apply_pipeline(gPipelines.trile_lod.pipeline); + + lod_vs : Trile_Lod_Vs_Params; + lod_vs.mvp = mvp.floats; + lod_vs.camera = camera.position.component; + + lod_fs : Trile_Lod_Fs_Params; + lod_fs.skyBase = worldConf.skyBase.component; + lod_fs.sunPosition = worldConf.sunPosition.component; + lod_fs.sunLightColor = worldConf.sunLightColor.component; + lod_fs.sunIntensity = worldConf.sunIntensity; + lc := *current_lighting_config; + lod_fs.ambient_color = lc.ambient_color.component; + lod_fs.ambient_intensity = lc.ambient_intensity; + lod_fs.planeHeight = effective_plane_height(worldConf); + lod_fs.deepColor = worldConf.deepColor.component; + lod_fs.is_reflection = ifx in_reflection_pass then cast(s32)1 else cast(s32)0; + lod_fs.fog_start = FOG_START; + lod_fs.fog_end = FOG_END; + + bindings : sg_bindings; + bindings.vertex_buffers[0] = vbuf; + bindings.vertex_buffers[1] = nbuf; + bindings.vertex_buffers[2] = cbuf; + bindings.vertex_buffers[3] = gPipelines.trile.bind.vertex_buffers[3]; + bindings.vertex_buffer_offsets[3] = offset; + + sg_apply_bindings(*bindings); + sg_apply_uniforms(UB_trile_lod_vs_params, *(sg_range.{ ptr = *lod_vs, size = size_of(type_of(lod_vs)) })); + sg_apply_uniforms(UB_trile_lod_fs_params, *(sg_range.{ ptr = *lod_fs, size = size_of(type_of(lod_fs)) })); + sg_draw(0, cast(s32) vcount, amount); + end_frame_profiling_group("Draw trile positions"); + return; + } + vs_params : Trile_Vs_Params; vs_params.mvp = mvp.floats; vs_params.mvp_shadow = shadow_mvp.floats; @@ -215,9 +292,9 @@ backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: * world_conf.planeHeight = effective_plane_height(worldConf); bindings : sg_bindings; - bindings.vertex_buffers[0] = trilegfx.vertex_buffer; - bindings.vertex_buffers[1] = trilegfx.normal_buffer; - bindings.vertex_buffers[2] = trilegfx.centre_buffer; + bindings.vertex_buffers[0] = vbuf; + bindings.vertex_buffers[1] = nbuf; + bindings.vertex_buffers[2] = cbuf; bindings.vertex_buffers[3] = gPipelines.trile.bind.vertex_buffers[3]; bindings.vertex_buffer_offsets[3] = offset; bindings.samplers[0] = gPipelines.trile.bind.samplers[0]; @@ -247,13 +324,15 @@ backend_draw_trile_positions_main :: (trile : string, amount : s32, worldConf: * fs_params.is_preview = preview_mode; fs_params.indirect_tint = lc.indirect_tint.component; fs_params.sh_enabled = ifx (chunk != null && chunk.sh_valid && !in_reflection_pass) then cast(s32)1 else cast(s32)0; + fs_params.fog_start = FOG_START; + fs_params.fog_end = FOG_END; sg_apply_bindings(*bindings); sg_apply_uniforms(UB_trile_fs_params, *(sg_range.{ ptr = *fs_params, size = size_of(type_of(fs_params)) })); sg_apply_uniforms(UB_trile_vs_params, *(sg_range.{ ptr = *vs_params, size = size_of(type_of(vs_params))})); sg_apply_uniforms(UB_trile_world_config, *(sg_range.{ptr = *world_conf, size = size_of(type_of(world_conf))})); add_frame_profiling_point("After drawing setup"); - sg_draw(0, cast(s32) trilegfx.vertex_count, amount); + sg_draw(0, cast(s32) vcount, amount); end_frame_profiling_group("Draw trile positions"); } backend_add_trile_rdm_position :: (position: Vector4) { @@ -600,7 +679,8 @@ backend_process_command_buckets :: () { start_frame_profiling_group("Postprocess pass"); if !bypass_postprocess { bloom_process(); - dof_process(); + dof_downsample_process(); + dof_bokeh_process(); } end_frame_profiling_group("Postprocess pass"); @@ -613,29 +693,23 @@ backend_process_command_buckets :: () { sg_apply_pipeline(gPipelines.postprocess.pipeline); gPipelines.postprocess.bind.images[0] = g_rendertex; gPipelines.postprocess.bind.images[1] = LUT_list[g_current_lut_texture_index].image; - gPipelines.postprocess.bind.images[2] = g_bloom_tex; + gPipelines.postprocess.bind.images[2] = g_bloom_up_1; gPipelines.postprocess.bind.images[3] = g_dof_tex; gPipelines.postprocess.bind.images[4] = g_gbuf_position; sg_apply_bindings(*gPipelines.postprocess.bind); post_process_config_uniform : Post_Process_Config; - post_process_dof_config_uniform : Dof_Config; if bypass_postprocess { neutral : Post_Process; neutral.tonemap = current_post_process.tonemap; fill_uniform_with_engine_data(*post_process_config_uniform, *neutral); } else { fill_uniform_with_engine_data(*post_process_config_uniform, *current_post_process); - w,h := get_render_size(); - - post_process_dof_config_uniform.dof_tex_width = cast(float)w/2; - post_process_dof_config_uniform.dof_tex_height = cast(float)h/2; - post_process_dof_config_uniform.dof_point = current_post_process.dof_point; - post_process_dof_config_uniform.dof_min = current_post_process.dof_min; - post_process_dof_config_uniform.dof_max = current_post_process.dof_max; - } sg_apply_uniforms(UB_post_process_config, *(sg_range.{ ptr = *post_process_config_uniform, size = size_of(type_of(post_process_config_uniform)) })); - sg_apply_uniforms(UB_dof_config, *(sg_range.{ ptr = *post_process_dof_config_uniform, size = size_of(type_of(post_process_dof_config_uniform)) })); + dof_config_uniform : Dof_Config; + dof_config_uniform.dof_max = current_post_process.dof_max; + dof_config_uniform.dof_point = current_post_process.dof_point; + sg_apply_uniforms(UB_dof_config, *(sg_range.{ ptr = *dof_config_uniform, size = size_of(type_of(dof_config_uniform)) })); sg_draw(0, 6, 1); sgl_defaults(); diff --git a/src/rendering/backend_sokol_helpers.jai b/src/rendering/backend_sokol_helpers.jai index 4885862..104a2b0 100644 --- a/src/rendering/backend_sokol_helpers.jai +++ b/src/rendering/backend_sokol_helpers.jai @@ -1,66 +1,81 @@ bloom_process :: () { - sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_bloom_attach })); - sg_apply_pipeline(gPipelines.bloom.pipeline); - params : Bloom_Params; - params.bloom_treshold = current_post_process.bloom_treshold; - gPipelines.bloom.bind.images[IMG_bloom_src] = g_rendertex; - sg_apply_uniforms(UB_bloom_params, *(sg_range.{ ptr = *params, size = size_of(type_of(params)) })); - sg_apply_bindings(*gPipelines.bloom.bind); + w, h := get_render_size(); + fw := cast(float)w; + fh := cast(float)h; + + // Prefilter: threshold + downsample full-res → down_1 (w/2) + { + sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_bloom_down_1_attach })); + sg_apply_pipeline(gPipelines.bloom_prefilter.pipeline); + p : Bloom_Prefilter_Params; + p.src_texel_x = 1.0 / fw; + p.src_texel_y = 1.0 / fh; + p.threshold = current_post_process.bloom_treshold; + gPipelines.bloom_prefilter.bind.images[IMG_bloom_prefilter_src] = g_rendertex; + sg_apply_uniforms(UB_bloom_prefilter_params, *(sg_range.{ ptr = *p, size = size_of(type_of(p)) })); + sg_apply_bindings(*gPipelines.bloom_prefilter.bind); + sg_draw(0, 6, 1); + sg_end_pass(); + } + + // Downsample chain + bloom_downsample :: (src: sg_image, dst_attach: sg_attachments, src_w: float, src_h: float) { + sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = dst_attach })); + sg_apply_pipeline(gPipelines.bloom_downsample.pipeline); + p : Bloom_Downsample_Params; + p.src_texel_x = 1.0 / src_w; + p.src_texel_y = 1.0 / src_h; + gPipelines.bloom_downsample.bind.images[IMG_bloom_downsample_src] = src; + sg_apply_uniforms(UB_bloom_downsample_params, *(sg_range.{ ptr = *p, size = size_of(type_of(p)) })); + sg_apply_bindings(*gPipelines.bloom_downsample.bind); + sg_draw(0, 6, 1); + sg_end_pass(); + } + bloom_downsample(g_bloom_down_1, g_bloom_down_2_attach, fw/2, fh/2); + bloom_downsample(g_bloom_down_2, g_bloom_down_3_attach, fw/4, fh/4); + bloom_downsample(g_bloom_down_3, g_bloom_down_4_attach, fw/8, fh/8); + + // Upsample chain: tent(small) + large → dest + bloom_upsample :: (small: sg_image, large: sg_image, dst_attach: sg_attachments, small_w: float, small_h: float) { + sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = dst_attach })); + sg_apply_pipeline(gPipelines.bloom_upsample.pipeline); + p : Bloom_Upsample_Params; + p.src_texel_x = 1.0 / small_w; + p.src_texel_y = 1.0 / small_h; + gPipelines.bloom_upsample.bind.images[IMG_bloom_upsample_small] = small; + gPipelines.bloom_upsample.bind.images[IMG_bloom_upsample_large] = large; + sg_apply_uniforms(UB_bloom_upsample_params, *(sg_range.{ ptr = *p, size = size_of(type_of(p)) })); + sg_apply_bindings(*gPipelines.bloom_upsample.bind); + sg_draw(0, 6, 1); + sg_end_pass(); + } + bloom_upsample(g_bloom_down_4, g_bloom_down_3, g_bloom_up_3_attach, fw/16, fh/16); + bloom_upsample(g_bloom_up_3, g_bloom_down_2, g_bloom_up_2_attach, fw/8, fh/8); + bloom_upsample(g_bloom_up_2, g_bloom_down_1, g_bloom_up_1_attach, fw/4, fh/4); +} + +dof_downsample_process :: () { + sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_dof_downsample_attach })); + sg_apply_pipeline(gPipelines.dof_downsample.pipeline); + gPipelines.dof_downsample.bind.images[IMG_dof_downsample_src] = g_rendertex; + sg_apply_bindings(*gPipelines.dof_downsample.bind); sg_draw(0, 6, 1); sg_end_pass(); } -dof_process :: () { +dof_bokeh_process :: () { + w, h := get_render_size(); + half_w := cast(float)(w / 2); + half_h := cast(float)(h / 2); + radius := current_post_process.dof_blur_size * 3.0; sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_dof_attach })); - sg_apply_pipeline(gPipelines.dof.pipeline); - params : Dof_Params; - // params.dof_treshold = current_post_process.dof_treshold; - gPipelines.dof.bind.images[IMG_dof_src] = g_rendertex; - sg_apply_uniforms(UB_dof_params, *(sg_range.{ ptr = *params, size = size_of(type_of(params)) })); - sg_apply_bindings(*gPipelines.dof.bind); + sg_apply_pipeline(gPipelines.dof_blur.pipeline); + params : Dof_Blur_Params; + params.bokeh_radius_x = radius / half_w; + params.bokeh_radius_y = radius / half_h; + gPipelines.dof_blur.bind.images[IMG_dof_blur_src] = g_dof_downsample_tex; + sg_apply_uniforms(UB_dof_blur_params, *(sg_range.{ ptr = *params, size = size_of(type_of(params)) })); + sg_apply_bindings(*gPipelines.dof_blur.bind); sg_draw(0, 6, 1); sg_end_pass(); } - -// dof_process :: () { -// sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_postprocess_attach_a })); -// sg_apply_pipeline(gPipelines.op.pipeline); -// op_uniform_dilate : Op_Fs_Params; -// op_uniform_dilate.blur_size = current_post_process.dof_blur_size; -// op_uniform_dilate.op=2; -// gPipelines.op.bind.images[0] = g_postprocess_b; -// sg_apply_uniforms(UB_op_fs_params, *(sg_range.{ ptr = *op_uniform_dilate, size = size_of(type_of(op_uniform_dilate)) })); -// sg_apply_bindings(*gPipelines.op.bind); -// sg_draw(0, 6, 1); -// sg_end_pass(); - -// sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_rendertex_attachments })); -// sg_apply_pipeline(gPipelines.op.pipeline); -// op_uniform_dof_blur : Op_Fs_Params; -// op_uniform_dof_blur.blur_size = current_post_process.dilate_size; -// op_uniform_dof_blur.separation = current_post_process.dilate_separation; -// op_uniform_dof_blur.dilate_min = current_post_process.dilate_min; -// op_uniform_dof_blur.dilate_max = current_post_process.dilate_max; -// op_uniform_dof_blur.op=1; -// gPipelines.op.bind.images[0] = g_postprocess_a; -// sg_apply_uniforms(UB_op_fs_params, *(sg_range.{ ptr = *op_uniform_dof_blur, size = size_of(type_of(op_uniform_dof_blur)) })); -// sg_apply_bindings(*gPipelines.op.bind); -// sg_draw(0, 6, 1); -// sg_end_pass(); - -// sg_begin_pass(*(sg_pass.{ action = state.pass_action_clear, attachments = g_postprocess_attach_a })); -// sg_apply_pipeline(gPipelines.mix.pipeline); -// mix_uniform : Mix_Fs_Params; -// mix_uniform.op = 0; -// mix_uniform.dof_min = current_post_process.dof_min; -// mix_uniform.dof_max = current_post_process.dof_max; -// mix_uniform.dof_point = current_post_process.dof_point; -// gPipelines.mix.bind.images[0] = g_rendertex; -// gPipelines.mix.bind.images[1] = g_postprocess_b; -// gPipelines.mix.bind.images[2] = g_gbuf_position; -// sg_apply_uniforms(UB_op_fs_params, *(sg_range.{ ptr = *mix_uniform, size = size_of(type_of(mix_uniform)) })); -// sg_apply_bindings(*gPipelines.mix.bind); -// sg_draw(0, 6, 1); -// sg_end_pass(); -// } - diff --git a/src/rendering/helpers.jai b/src/rendering/helpers.jai index 3474d75..96b564e 100644 --- a/src/rendering/helpers.jai +++ b/src/rendering/helpers.jai @@ -45,6 +45,18 @@ aabb_in_frustum :: (planes: [6]Vector4, bmin: Vector3, bmax: Vector3) -> bool { return true; } +LOD_NEAR_DIST :: 40.0; +LOD_FAR_DIST :: 80.0; + +// 3-band LOD selection: instances closer than LOD_DISTANCES[i] use LOD level i. +// i = 0 → full detail +// i = 1 → 4^3 cube grid +// i = 2 → 2^3 cube grid +// beyond LOD_DISTANCES[2] → culled. +LOD_DISTANCES :: float.[50.0, 100.0, 200.0]; +FOG_START :: 60.0; +FOG_END :: 195.0; + create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: float = 0) { create_sky_rendering_task(*world.conf); create_set_light_rendering_task(*world.conf); @@ -64,8 +76,8 @@ create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: fl // Gather positions for camera-visible instances (all passes) and // shadow-only instances (chunks visible from sun but not camera). - gathered : [..]Gathered_Positions; - gathered.allocator = temp; + gathered_per_lod : [3][..]Gathered_Positions; + for i: 0..2 gathered_per_lod[i].allocator = temp; shad_gathered : [..]Gathered_Positions; shad_gathered.allocator = temp; rdm_extra : [..]Gathered_Positions; // RDM-flagged instances visible to camera; shadow/gbuffer/reflection use base pipeline @@ -93,7 +105,8 @@ create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: fl if !in_cam && !in_reflect && !in_shad continue; for group: chunk.groups { - for inst: group.instances { + for inst, idx: group.instances { + if idx < group.is_buried.count && group.is_buried[idx] continue; wx, wy, wz := chunk_local_to_world(chunk.coord, inst.x, inst.y, inst.z); imin := Vector3.{cast(float)wx, cast(float)wy, cast(float)wz}; imax := imin + .{1, 1, 1}; @@ -103,6 +116,17 @@ create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: fl inst_shad := in_shad && aabb_in_frustum(shadow_planes, imin, imax); if !inst_cam && !inst_reflect && !inst_shad continue; + dist := length(imin + .{0.5, 0.5, 0.5} - camera.position); + + lod_idx : s32 = -1; + for i: 0..2 { + if dist < LOD_DISTANCES[i] { + lod_idx = cast(s32) i; + break; + } + } + if lod_idx < 0 continue; // beyond cull distance + pos := Vector4.{cast(float)wx, cast(float)wy, cast(float)wz, cast(float)inst.orientation}; is_rdm := is_rdm_instance_enabled(world, wx, wy, wz); if inst_cam || inst_reflect { @@ -113,7 +137,7 @@ create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: fl array_add(*rdm_main, .{name = group.trile_name, position = pos}); } } else { - target := find_or_create(*gathered, group.trile_name, chunk.coord); + target := find_or_create(*gathered_per_lod[lod_idx], group.trile_name, chunk.coord); array_add(*target.positions, pos); } } else { @@ -124,14 +148,17 @@ create_world_rendering_tasks :: (world: *World, camera: Camera, plane_height: fl } } - for g: gathered { - if g.positions.count < 1 continue; - triletask : Rendering_Task_Trile; - triletask.trile = g.name; - triletask.chunk_key = g.chunk_key; - triletask.positions = g.positions; - triletask.worldConf = *world.conf; - add_rendering_task(triletask); + for lod_idx: 0..2 { + for g: gathered_per_lod[lod_idx] { + if g.positions.count < 1 continue; + triletask : Rendering_Task_Trile; + triletask.trile = g.name; + triletask.chunk_key = g.chunk_key; + triletask.positions = g.positions; + triletask.worldConf = *world.conf; + triletask.lod_index = cast(s32) lod_idx; + add_rendering_task(triletask); + } } for g: shad_gathered { if g.positions.count < 1 continue; diff --git a/src/rendering/lodgen.jai b/src/rendering/lodgen.jai new file mode 100644 index 0000000..75c48c0 --- /dev/null +++ b/src/rendering/lodgen.jai @@ -0,0 +1,153 @@ +// LOD bake for triles. Independent of meshgen.jai's quad-mesh path. +// +// Approach: +// 1. Downsample the 16^3 source trixels into a smaller N^3 grid of LOD voxels +// (avg color across non-empty source trixels in each block, empty if all empty). +// 2. Bake a cube-grid mesh: one cube per non-empty LOD voxel, only emit faces whose +// neighbor in the LOD grid is empty (or out of bounds). Color is baked into the +// vertex color buffer. +// 3. The result feeds a separate trile_lod pipeline that uses vertex color and skips +// texture sampling, ray-march, SSAO, shadow, SH, etc. + +LOD_Voxel :: struct { + color : Vector3; + empty : bool; +} + +downsample_trile :: (src: *Trile, target_size: int) -> []LOD_Voxel { + block := 16 / target_size; // source trixels per LOD voxel along one axis + out := NewArray(target_size * target_size * target_size, LOD_Voxel,, temp); + for lx: 0..target_size-1 { + for ly: 0..target_size-1 { + for lz: 0..target_size-1 { + sum_r, sum_g, sum_b : float; + count : int = 0; + for dx: 0..block-1 { + for dy: 0..block-1 { + for dz: 0..block-1 { + sx := lx * block + dx; + sy := ly * block + dy; + sz := lz * block + dz; + if src.trixels[sx][sy][sz].empty continue; + c := src.trixels[sx][sy][sz].material.color; + sum_r += c.x; + sum_g += c.y; + sum_b += c.z; + count += 1; + } + } + } + idx := (lx * target_size + ly) * target_size + lz; + if count == 0 { + out[idx].empty = true; + } else { + out[idx].color = .{ sum_r / count, sum_g / count, sum_b / count }; + out[idx].empty = false; + } + } + } + } + return out; +} + +bake_lod_cube_mesh :: (lod: []LOD_Voxel, target_size: int) -> Trile_GFX_LOD { + inv_n := 1.0 / cast(float)target_size; + + verts : [..]float; + norms : [..]float; + colors : [..]float; + verts.allocator = temp; + norms.allocator = temp; + colors.allocator = temp; + + voxel_at :: (lod: []LOD_Voxel, n: int, x: int, y: int, z: int) -> LOD_Voxel #expand { + idx := (x * n + y) * n + z; + return lod[idx]; + } + + // Each face: 4 corners (offsets in [0,1] within a unit voxel) + outward normal. + Face :: struct { + nx, ny, nz : float; + ax, ay, az : float; + bx, by, bz : float; + cx, cy, cz : float; + dx, dy, dz : float; + } + // Order: -X, +X, -Y, +Y, -Z, +Z. CCW winding when viewed from outside. + faces :: Face.[ + .{ -1, 0, 0, 0,0,0, 0,0,1, 0,1,1, 0,1,0 }, + .{ 1, 0, 0, 1,0,0, 1,1,0, 1,1,1, 1,0,1 }, + .{ 0,-1, 0, 0,0,0, 1,0,0, 1,0,1, 0,0,1 }, + .{ 0, 1, 0, 0,1,0, 0,1,1, 1,1,1, 1,1,0 }, + .{ 0, 0,-1, 0,0,0, 0,1,0, 1,1,0, 1,0,0 }, + .{ 0, 0, 1, 1,0,1, 1,1,1, 0,1,1, 0,0,1 }, + ]; + neighbor_offsets :: int.[ -1, 1, -1, 1, -1, 1 ]; + neighbor_axes :: int.[ 0, 0, 1, 1, 2, 2 ]; // 0=x, 1=y, 2=z + + for lx: 0..target_size-1 { + for ly: 0..target_size-1 { + for lz: 0..target_size-1 { + v := voxel_at(lod, target_size, lx, ly, lz); + if v.empty continue; + + base_x := cast(float)lx * inv_n; + base_y := cast(float)ly * inv_n; + base_z := cast(float)lz * inv_n; + + for f: 0..5 { + nx, ny, nz := lx, ly, lz; + if neighbor_axes[f] == 0 nx += neighbor_offsets[f]; + else if neighbor_axes[f] == 1 ny += neighbor_offsets[f]; + else nz += neighbor_offsets[f]; + + visible := false; + if nx < 0 || nx >= target_size || ny < 0 || ny >= target_size || nz < 0 || nz >= target_size { + visible = true; + } else { + if voxel_at(lod, target_size, nx, ny, nz).empty visible = true; + } + if !visible continue; + + face := faces[f]; + push_vert :: (px: float, py: float, pz: float) #expand { + array_add(*verts, base_x + px * inv_n); + array_add(*verts, base_y + py * inv_n); + array_add(*verts, base_z + pz * inv_n); + array_add(*norms, face.nx); + array_add(*norms, face.ny); + array_add(*norms, face.nz); + array_add(*colors, v.color.x); + array_add(*colors, v.color.y); + array_add(*colors, v.color.z); + } + // tri 1: a b c + push_vert(face.ax, face.ay, face.az); + push_vert(face.bx, face.by, face.bz); + push_vert(face.cx, face.cy, face.cz); + // tri 2: a c d + push_vert(face.ax, face.ay, face.az); + push_vert(face.cx, face.cy, face.cz); + push_vert(face.dx, face.dy, face.dz); + } + } + } + } + + out : Trile_GFX_LOD; + out.vertex_count = verts.count / 3; + if out.vertex_count == 0 return out; + + out.vertex_buffer = sg_make_buffer(*(sg_buffer_desc.{ data = .{ ptr = verts.data, size = xx (verts.count * 4) } })); + out.normal_buffer = sg_make_buffer(*(sg_buffer_desc.{ data = .{ ptr = norms.data, size = xx (norms.count * 4) } })); + out.color_buffer = sg_make_buffer(*(sg_buffer_desc.{ data = .{ ptr = colors.data, size = xx (colors.count * 4) } })); + return out; +} + +destroy_trile_gfx_lod :: (lod: *Trile_GFX_LOD) { + if lod.vertex_count == 0 return; + sg_destroy_buffer(lod.vertex_buffer); + sg_destroy_buffer(lod.normal_buffer); + sg_destroy_buffer(lod.color_buffer); + lod.vertex_count = 0; +} diff --git a/src/rendering/meshgen.jai b/src/rendering/meshgen.jai index 939d1bc..3df3d1b 100644 --- a/src/rendering/meshgen.jai +++ b/src/rendering/meshgen.jai @@ -498,6 +498,12 @@ generate_trile_gfx_matias :: (trileptr : *Trile) -> Trile_GFX { context.allocator = old_alloc; vecsCopy := array_copy(triangleVecs); Pool.reset(*meshgenpool); - return .{ img, trile_vert_buffer, trile_normal_buffer, trile_centre_buffer, vecsCopy, triangleVecs.count / 3 }; + + lod4_voxels := downsample_trile(trileptr, 4); + lod_4 := bake_lod_cube_mesh(lod4_voxels, 4); + lod2_voxels := downsample_trile(trileptr, 2); + lod_2 := bake_lod_cube_mesh(lod2_voxels, 2); + + return .{ img, trile_vert_buffer, trile_normal_buffer, trile_centre_buffer, vecsCopy, triangleVecs.count / 3, lod_4, lod_2 }; } } diff --git a/src/rendering/pipelines.jai b/src/rendering/pipelines.jai index b3e719f..5a964e2 100644 --- a/src/rendering/pipelines.jai +++ b/src/rendering/pipelines.jai @@ -43,11 +43,18 @@ g_postprocess_b_depth : sg_image; g_postprocess_attach_a : sg_attachments; g_postprocess_attach_b : sg_attachments; -g_bloom_tex : sg_image; -g_bloom_attach : sg_attachments; +g_bloom_down_1 : sg_image; g_bloom_down_1_attach : sg_attachments; +g_bloom_down_2 : sg_image; g_bloom_down_2_attach : sg_attachments; +g_bloom_down_3 : sg_image; g_bloom_down_3_attach : sg_attachments; +g_bloom_down_4 : sg_image; g_bloom_down_4_attach : sg_attachments; +g_bloom_up_3 : sg_image; g_bloom_up_3_attach : sg_attachments; +g_bloom_up_2 : sg_image; g_bloom_up_2_attach : sg_attachments; +g_bloom_up_1 : sg_image; g_bloom_up_1_attach : sg_attachments; -g_dof_tex : sg_image; -g_dof_attach : sg_attachments; +g_dof_tex : sg_image; +g_dof_attach : sg_attachments; +g_dof_downsample_tex : sg_image; +g_dof_downsample_attach: sg_attachments; gPipelines : struct { @@ -74,6 +81,9 @@ gPipelines : struct { // Depth-only shadow pass for triles (no lighting/RDM) trile_shadow : Pipeline_Binding; + // Cube-grid LOD pipeline for distant triles (vertex color, no ray-march) + trile_lod : Pipeline_Binding; + // Renders the ground plane. (just water) plane : Pipeline_Binding; @@ -84,8 +94,12 @@ gPipelines : struct { mix : Pipeline_Binding; - bloom : Pipeline_Binding; - dof: Pipeline_Binding; + bloom_prefilter : Pipeline_Binding; + bloom_downsample : Pipeline_Binding; + bloom_upsample : Pipeline_Binding; + + dof_downsample : Pipeline_Binding; + dof_blur : Pipeline_Binding; billboard : Pipeline_Binding; @@ -169,14 +183,18 @@ create_pipelines :: () { create_trile_pipeline(); create_trile_rdm_pipeline(); create_trile_shadow_pipeline(); + create_trile_lod_pipeline(); create_sky_pipeline(); create_plane_pipeline(); create_postprocess_pipeline(); create_ssao_pipeline(); create_op_pipeline(); create_mix_pipeline(); - create_bloom_pipeline(); - create_dof_pipeline(); + create_bloom_prefilter_pipeline(); + create_bloom_downsample_pipeline(); + create_bloom_upsample_pipeline(); + create_dof_downsample_pipeline(); + create_dof_blur_pipeline(); create_billboard_pipeline(); create_gbuffer_billboard_pipeline(); create_particle_pipeline(); @@ -518,6 +536,39 @@ create_trile_shadow_pipeline :: () { gPipelines.trile_shadow.pipeline = sg_make_pipeline(*pipeline); } +create_trile_lod_pipeline :: () { + pipeline: sg_pipeline_desc; + shader_desc := trile_lod_shader_desc(sg_query_backend()); + pipeline.shader = sg_make_shader(*shader_desc); + pipeline.layout.buffers[0].stride = 4*3; + pipeline.layout.buffers[1].stride = 4*3; + pipeline.layout.buffers[2].stride = 4*3; + pipeline.layout.buffers[3].step_func = .PER_INSTANCE; + + pipeline.layout.attrs[ATTR_trile_lod_position] = .{ format = .FLOAT3, buffer_index = 0 }; + pipeline.layout.attrs[ATTR_trile_lod_normal] = .{ format = .FLOAT3, buffer_index = 1 }; + pipeline.layout.attrs[ATTR_trile_lod_color] = .{ format = .FLOAT3, buffer_index = 2 }; + pipeline.layout.attrs[ATTR_trile_lod_instance] = .{ format = .FLOAT4, buffer_index = 3 }; + + pipeline.depth = .{ + write_enabled = true, + compare = .LESS_EQUAL, + pixel_format = .DEPTH, + }; + + pipeline.color_count = 1; + pipeline.colors[0] = sg_color_target_state.{ + pixel_format = .RGBA16F, + blend = .{ + enabled = true, + src_factor_rgb = .SRC_ALPHA, + dst_factor_rgb = .ONE_MINUS_SRC_ALPHA, + }, + }; + + gPipelines.trile_lod.pipeline = sg_make_pipeline(*pipeline); +} + create_sky_pipeline :: () { pipeline: sg_pipeline_desc; shader_desc := sky_shader_desc(sg_query_backend()); @@ -829,6 +880,13 @@ create_postprocess_pipeline :: () { mag_filter = .LINEAR, })); + gPipelines.postprocess.bind.samplers[4] = sg_make_sampler(*(sg_sampler_desc.{ + wrap_u = .CLAMP_TO_EDGE, + wrap_v = .CLAMP_TO_EDGE, + min_filter = .NEAREST, + mag_filter = .NEAREST, + })); + } // Takes in a texture, manipulates it and outputs it. @@ -1065,68 +1123,92 @@ create_mix_pipeline :: () { } -create_bloom_pipeline :: () { - platconf := get_plat_conf(); - pipeline: sg_pipeline_desc; - shader_desc := bloom_shader_desc(sg_query_backend()); - pipeline.shader = sg_make_shader(*shader_desc); - - pipeline.layout.attrs[ATTR_bloom_position] = .{ format = .FLOAT2 }; - pipeline.layout.attrs[ATTR_bloom_uv] = .{ format = .FLOAT2 }; - pipeline.index_type = .UINT16; - pipeline.depth.pixel_format = .NONE; - - pipeline.color_count = 1; - pipeline.colors[0] = .{ pixel_format = .RGBA16F }; - - gPipelines.bloom.pipeline = sg_make_pipeline(*pipeline); +bloom_quad_vbuffer : sg_buffer; +bloom_quad_ibuffer : sg_buffer; +create_bloom_quad_buffers :: () { quad_vertices : [16]float = .[ -1.0, 1.0, 0.0, flip_if_plat(1.0), -1.0, -1.0, 0.0, flip_if_plat(0.0), 1.0, -1.0, 1.0, flip_if_plat(0.0), 1.0, 1.0, 1.0, flip_if_plat(1.0), ]; - quad_indices : [6]u16 = .[ - 0, 1, 2, 0, 2, 3 - ]; + quad_indices : [6]u16 = .[ 0, 1, 2, 0, 2, 3 ]; + bloom_quad_vbuffer = sg_make_buffer(*(sg_buffer_desc.{ size = size_of(float) * 16, data = .{ ptr = quad_vertices.data, size = 16 * 4 }})); + bloom_quad_ibuffer = sg_make_buffer(*(sg_buffer_desc.{ size = size_of(u16) * 6, data = .{ ptr = quad_indices.data, size = 6 * 2 }, type = .INDEXBUFFER })); +} - vbuffer := sg_buffer_desc.{ size = size_of(float) * 16, data = .{ - ptr = quad_vertices.data, - size = 16 * 4 - }}; - ibuffer := sg_buffer_desc.{ size = size_of(u16) * 6, data = .{ - ptr = quad_indices.data, - size = 6 * 2 - }, - type = .INDEXBUFFER, - }; - - gPipelines.bloom.bind.vertex_buffers[0] = sg_make_buffer(*vbuffer); - gPipelines.bloom.bind.index_buffer = sg_make_buffer(*ibuffer); - gPipelines.bloom.bind.samplers[0] = sg_make_sampler(*(sg_sampler_desc.{ +linear_clamp_sampler :: () -> sg_sampler { + return sg_make_sampler(*(sg_sampler_desc.{ wrap_u = .CLAMP_TO_EDGE, wrap_v = .CLAMP_TO_EDGE, - min_filter = .NEAREST, - mag_filter = .NEAREST, + min_filter = .LINEAR, + mag_filter = .LINEAR, })); } -create_dof_pipeline :: () { +create_bloom_prefilter_pipeline :: () { + create_bloom_quad_buffers(); + pipeline: sg_pipeline_desc; + pipeline.shader = sg_make_shader(*bloom_prefilter_shader_desc(sg_query_backend())); + pipeline.layout.attrs[ATTR_bloom_prefilter_position] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_bloom_prefilter_uv] = .{ format = .FLOAT2 }; + pipeline.index_type = .UINT16; + pipeline.depth.pixel_format = .NONE; + pipeline.color_count = 1; + pipeline.colors[0] = .{ pixel_format = .RGBA16F }; + gPipelines.bloom_prefilter.pipeline = sg_make_pipeline(*pipeline); + gPipelines.bloom_prefilter.bind.vertex_buffers[0] = bloom_quad_vbuffer; + gPipelines.bloom_prefilter.bind.index_buffer = bloom_quad_ibuffer; + gPipelines.bloom_prefilter.bind.samplers[SMP_bloom_prefilter_src_smp] = linear_clamp_sampler(); +} + +create_bloom_downsample_pipeline :: () { + pipeline: sg_pipeline_desc; + pipeline.shader = sg_make_shader(*bloom_downsample_shader_desc(sg_query_backend())); + pipeline.layout.attrs[ATTR_bloom_downsample_position] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_bloom_downsample_uv] = .{ format = .FLOAT2 }; + pipeline.index_type = .UINT16; + pipeline.depth.pixel_format = .NONE; + pipeline.color_count = 1; + pipeline.colors[0] = .{ pixel_format = .RGBA16F }; + gPipelines.bloom_downsample.pipeline = sg_make_pipeline(*pipeline); + gPipelines.bloom_downsample.bind.vertex_buffers[0] = bloom_quad_vbuffer; + gPipelines.bloom_downsample.bind.index_buffer = bloom_quad_ibuffer; + gPipelines.bloom_downsample.bind.samplers[SMP_bloom_downsample_src_smp] = linear_clamp_sampler(); +} + +create_bloom_upsample_pipeline :: () { + pipeline: sg_pipeline_desc; + pipeline.shader = sg_make_shader(*bloom_upsample_shader_desc(sg_query_backend())); + pipeline.layout.attrs[ATTR_bloom_upsample_position] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_bloom_upsample_uv] = .{ format = .FLOAT2 }; + pipeline.index_type = .UINT16; + pipeline.depth.pixel_format = .NONE; + pipeline.color_count = 1; + pipeline.colors[0] = .{ pixel_format = .RGBA16F }; + gPipelines.bloom_upsample.pipeline = sg_make_pipeline(*pipeline); + gPipelines.bloom_upsample.bind.vertex_buffers[0] = bloom_quad_vbuffer; + gPipelines.bloom_upsample.bind.index_buffer = bloom_quad_ibuffer; + gPipelines.bloom_upsample.bind.samplers[SMP_bloom_upsample_small_smp] = linear_clamp_sampler(); + gPipelines.bloom_upsample.bind.samplers[SMP_bloom_upsample_large_smp] = linear_clamp_sampler(); +} + +create_dof_downsample_pipeline :: () { platconf := get_plat_conf(); pipeline: sg_pipeline_desc; - shader_desc := dof_shader_desc(sg_query_backend()); + shader_desc := dof_downsample_shader_desc(sg_query_backend()); pipeline.shader = sg_make_shader(*shader_desc); - pipeline.layout.attrs[ATTR_dof_position] = .{ format = .FLOAT2 }; - pipeline.layout.attrs[ATTR_dof_uv] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_dof_downsample_position] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_dof_downsample_uv] = .{ format = .FLOAT2 }; pipeline.index_type = .UINT16; pipeline.depth.pixel_format = .NONE; pipeline.color_count = 1; pipeline.colors[0] = .{ pixel_format = .RGBA16F }; - gPipelines.dof.pipeline = sg_make_pipeline(*pipeline); + gPipelines.dof_downsample.pipeline = sg_make_pipeline(*pipeline); quad_vertices : [16]float = .[ -1.0, 1.0, 0.0, flip_if_plat(1.0), @@ -1149,13 +1231,60 @@ create_dof_pipeline :: () { type = .INDEXBUFFER, }; - gPipelines.dof.bind.vertex_buffers[0] = sg_make_buffer(*vbuffer); - gPipelines.dof.bind.index_buffer = sg_make_buffer(*ibuffer); - gPipelines.dof.bind.samplers[0] = sg_make_sampler(*(sg_sampler_desc.{ + gPipelines.dof_downsample.bind.vertex_buffers[0] = sg_make_buffer(*vbuffer); + gPipelines.dof_downsample.bind.index_buffer = sg_make_buffer(*ibuffer); + gPipelines.dof_downsample.bind.samplers[SMP_dof_downsample_src_smp] = sg_make_sampler(*(sg_sampler_desc.{ wrap_u = .CLAMP_TO_EDGE, wrap_v = .CLAMP_TO_EDGE, - min_filter = .NEAREST, - mag_filter = .NEAREST, + min_filter = .LINEAR, + mag_filter = .LINEAR, + })); +} + +create_dof_blur_pipeline :: () { + platconf := get_plat_conf(); + pipeline: sg_pipeline_desc; + shader_desc := dof_blur_shader_desc(sg_query_backend()); + pipeline.shader = sg_make_shader(*shader_desc); + + pipeline.layout.attrs[ATTR_dof_blur_position] = .{ format = .FLOAT2 }; + pipeline.layout.attrs[ATTR_dof_blur_uv] = .{ format = .FLOAT2 }; + pipeline.index_type = .UINT16; + pipeline.depth.pixel_format = .NONE; + + pipeline.color_count = 1; + pipeline.colors[0] = .{ pixel_format = .RGBA16F }; + + gPipelines.dof_blur.pipeline = sg_make_pipeline(*pipeline); + + quad_vertices : [16]float = .[ + -1.0, 1.0, 0.0, flip_if_plat(1.0), + -1.0, -1.0, 0.0, flip_if_plat(0.0), + 1.0, -1.0, 1.0, flip_if_plat(0.0), + 1.0, 1.0, 1.0, flip_if_plat(1.0), + ]; + quad_indices : [6]u16 = .[ + 0, 1, 2, 0, 2, 3 + ]; + + vbuffer := sg_buffer_desc.{ size = size_of(float) * 16, data = .{ + ptr = quad_vertices.data, + size = 16 * 4 + }}; + ibuffer := sg_buffer_desc.{ size = size_of(u16) * 6, data = .{ + ptr = quad_indices.data, + size = 6 * 2 + }, + type = .INDEXBUFFER, + }; + + gPipelines.dof_blur.bind.vertex_buffers[0] = sg_make_buffer(*vbuffer); + gPipelines.dof_blur.bind.index_buffer = sg_make_buffer(*ibuffer); + gPipelines.dof_blur.bind.samplers[SMP_dof_blur_src_smp] = sg_make_sampler(*(sg_sampler_desc.{ + wrap_u = .CLAMP_TO_EDGE, + wrap_v = .CLAMP_TO_EDGE, + min_filter = .LINEAR, + mag_filter = .LINEAR, })); } @@ -1257,35 +1386,44 @@ create_ssao_images :: () { sg_destroy_attachments(g_postprocess_attach_b); g_postprocess_attach_b = sg_make_attachments(*attachmentsDescB); - if g_bloom_tex.id != INVALID_ID then sg_destroy_image(g_bloom_tex); - bloom_img_desc := sg_image_desc.{ - width = w/8, - height = h/8, - pixel_format = .RGBA16F, - render_target = true, - sample_count = 1, - }; - g_bloom_tex = sg_make_image(*bloom_img_desc); - bloom_attach_desc := sg_attachments_desc.{ - colors[0].image = g_bloom_tex, - }; - sg_destroy_attachments(g_bloom_attach); - g_bloom_attach = sg_make_attachments(*bloom_attach_desc); + bloom_levels := sg_image.[g_bloom_down_1, g_bloom_down_2, g_bloom_down_3, g_bloom_down_4, g_bloom_up_3, g_bloom_up_2, g_bloom_up_1]; + for * bloom_levels { if it.id != INVALID_ID then sg_destroy_image(< 0 - ATTR_bloom_uv => 1 - Bindings: - Uniform block 'bloom_params': - Jai struct: Bloom_Params - Bind slot: UB_bloom_params => 0 - Image 'bloom_src': - Image type: ._2D - Sample type: .FLOAT - Multisampled: false - Bind slot: IMG_bloom_src => 0 - Sampler 'bloom_src_smp': - Type: .FILTERING - Bind slot: SMP_bloom_src_smp => 0 -*/ -ATTR_bloom_position :: 0; -ATTR_bloom_uv :: 1; -UB_bloom_params :: 0; -IMG_bloom_src :: 0; -SMP_bloom_src_smp :: 0; -Bloom_Params :: struct { - bloom_treshold: float; - _: [12]u8; -}; -/* - #version 430 - - layout(location = 0) in vec2 position; - layout(location = 0) out vec2 texcoord; - layout(location = 1) in vec2 uv; - - void main() - { - gl_Position = vec4(position, 0.5, 1.0); - texcoord = uv; - } - -*/ -vs_bloom_source_glsl430 := u8.[ - 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,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,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 430 - - uniform vec4 bloom_params[1]; - layout(binding = 16) uniform sampler2D bloom_src_bloom_src_smp; - - layout(location = 0) in vec2 texcoord; - layout(location = 0) out vec4 frag_color; - - void main() - { - vec4 _24 = texture(bloom_src_bloom_src_smp, texcoord); - vec4 color = _24; - if (max(_24.x, max(_24.y, _24.z)) < bloom_params[0].x) - { - color = vec4(0.0, 0.0, 0.0, 1.0); - } - frag_color = vec4(color.xyz, 1.0); - } - -*/ -fs_bloom_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,0x62,0x6c,0x6f,0x6f,0x6d, - 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f, - 0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,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, - 0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, - 0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c, - 0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78, - 0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34, - 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x28,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x78,0x2c, - 0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x34,0x2e, - 0x7a,0x29,0x29,0x20,0x3c,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,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,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, - 0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,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_bloom_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 bloom_params[1]; - uniform highp sampler2D bloom_src_bloom_src_smp; - - in highp vec2 texcoord; - layout(location = 0) out highp vec4 frag_color; - - void main() - { - highp vec4 _24 = texture(bloom_src_bloom_src_smp, texcoord); - highp vec4 color = _24; - if (max(_24.x, max(_24.y, _24.z)) < bloom_params[0].x) - { - color = vec4(0.0, 0.0, 0.0, 1.0); - } - frag_color = vec4(color.xyz, 1.0); - } - -*/ -fs_bloom_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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31, - 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,0x62,0x6c,0x6f,0x6f,0x6d, - 0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,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,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d, - 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73, - 0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70, - 0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x78,0x2c,0x20,0x6d,0x61,0x78,0x28, - 0x5f,0x32,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x34,0x2e,0x7a,0x29,0x29,0x20,0x3c, - 0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d, - 0x2e,0x78,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28, - 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, - 0x0a,0x7d,0x0a,0x0a,0x00, -]; -/* - #include - #include - - using namespace metal; - - struct main0_out - { - float2 texcoord [[user(locn0)]]; - float4 gl_Position [[position]]; - }; - - struct main0_in - { - float2 position [[attribute(0)]]; - float2 uv [[attribute(1)]]; - }; - - vertex main0_out main0(main0_in in [[stage_in]]) - { - main0_out out = {}; - out.gl_Position = float4(in.position, 0.5, 1.0); - out.texcoord = in.uv; - return out; - } - -*/ -vs_bloom_source_metal_macos := u8.[ - 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, - 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, - 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, - 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, - 0x6d,0x65,0x74,0x61,0x6c,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,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, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,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,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, - 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x5b, - 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b, - 0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,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,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e, - 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,0x6f,0x75,0x74,0x2e,0x74,0x65,0x78, - 0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, -]; -/* - #include - #include - - using namespace metal; - - struct bloom_params - { - float bloom_treshold; - }; - - struct main0_out - { - float4 frag_color [[color(0)]]; - }; - - struct main0_in - { - float2 texcoord [[user(locn0)]]; - }; - - fragment main0_out main0(main0_in in [[stage_in]], constant bloom_params& _42 [[buffer(0)]], texture2d bloom_src [[texture(0)]], sampler bloom_src_smp [[sampler(0)]]) - { - main0_out out = {}; - float4 _24 = bloom_src.sample(bloom_src_smp, in.texcoord); - float4 color = _24; - if (fast::max(_24.x, fast::max(_24.y, _24.z)) < _42.bloom_treshold) - { - color = float4(0.0, 0.0, 0.0, 1.0); - } - out.frag_color = float4(color.xyz, 1.0); - return out; - } - -*/ -fs_bloom_source_metal_macos := u8.[ - 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, - 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, - 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, - 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, - 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x62, - 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x72, - 0x65,0x73,0x68,0x6f,0x6c,0x64,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,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,0x62,0x6c, - 0x6f,0x6f,0x6d,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x34,0x32,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, - 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x72,0x63,0x5f,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x62,0x6c,0x6f,0x6f,0x6d, - 0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f, - 0x6d,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x74,0x65, - 0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d, - 0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x78,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a, - 0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x34,0x2e,0x7a, - 0x29,0x29,0x20,0x3c,0x20,0x5f,0x34,0x32,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74, - 0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,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,0x7d, - 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,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x78,0x79,0x7a,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, -]; -bloom_shader_desc :: (backend: sg_backend) -> sg_shader_desc { - desc: sg_shader_desc; - desc.label = "bloom_shader"; - if backend == { - case .GLCORE; - desc.vertex_func.source = xx *vs_bloom_source_glsl430; - desc.vertex_func.entry = "main"; - desc.fragment_func.source = xx *fs_bloom_source_glsl430; - desc.fragment_func.entry = "main"; - desc.attrs[0].base_type = .FLOAT; - desc.attrs[0].glsl_name = "position"; - desc.attrs[1].base_type = .FLOAT; - desc.attrs[1].glsl_name = "uv"; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_params"; - desc.images[0].stage = .FRAGMENT; - desc.images[0].multisampled = false; - desc.images[0].image_type = ._2D; - desc.images[0].sample_type = .FLOAT; - desc.samplers[0].stage = .FRAGMENT; - desc.samplers[0].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 = "bloom_src_bloom_src_smp"; - case .GLES3; - desc.vertex_func.source = xx *vs_bloom_source_glsl300es; - desc.vertex_func.entry = "main"; - desc.fragment_func.source = xx *fs_bloom_source_glsl300es; - desc.fragment_func.entry = "main"; - desc.attrs[0].base_type = .FLOAT; - desc.attrs[0].glsl_name = "position"; - desc.attrs[1].base_type = .FLOAT; - desc.attrs[1].glsl_name = "uv"; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_params"; - desc.images[0].stage = .FRAGMENT; - desc.images[0].multisampled = false; - desc.images[0].image_type = ._2D; - desc.images[0].sample_type = .FLOAT; - desc.samplers[0].stage = .FRAGMENT; - desc.samplers[0].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 = "bloom_src_bloom_src_smp"; - case .METAL_MACOS; - desc.vertex_func.source = xx *vs_bloom_source_metal_macos; - desc.vertex_func.entry = "main0"; - desc.fragment_func.source = xx *fs_bloom_source_metal_macos; - desc.fragment_func.entry = "main0"; - desc.attrs[0].base_type = .FLOAT; - desc.attrs[1].base_type = .FLOAT; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - 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.samplers[0].stage = .FRAGMENT; - desc.samplers[0].sampler_type = .FILTERING; - desc.samplers[0].msl_sampler_n = 0; - desc.image_sampler_pairs[0].stage = .FRAGMENT; - desc.image_sampler_pairs[0].image_slot = 0; - desc.image_sampler_pairs[0].sampler_slot = 0; - } - return desc; -} diff --git a/src/shaders/jai/shader_bloom_downsample.jai b/src/shaders/jai/shader_bloom_downsample.jai new file mode 100644 index 0000000..d4f5bc7 --- /dev/null +++ b/src/shaders/jai/shader_bloom_downsample.jai @@ -0,0 +1,491 @@ +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc -i shader_bloom_downsample.glsl -o ./jai/shader_bloom_downsample.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + + Overview: + ========= + Shader program: 'bloom_downsample': + Get shader desc: bloom_downsample_shader_desc(sg_query_backend()) + Vertex Shader: vs_bloom_downsample + Fragment Shader: fs_bloom_downsample + Attributes: + ATTR_bloom_downsample_position => 0 + ATTR_bloom_downsample_uv => 1 + Bindings: + Uniform block 'bloom_downsample_params': + Jai struct: Bloom_Downsample_Params + Bind slot: UB_bloom_downsample_params => 0 + Image 'bloom_downsample_src': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_bloom_downsample_src => 0 + Sampler 'bloom_downsample_src_smp': + Type: .FILTERING + Bind slot: SMP_bloom_downsample_src_smp => 0 +*/ +ATTR_bloom_downsample_position :: 0; +ATTR_bloom_downsample_uv :: 1; +UB_bloom_downsample_params :: 0; +IMG_bloom_downsample_src :: 0; +SMP_bloom_downsample_src_smp :: 0; +Bloom_Downsample_Params :: struct { + src_texel_x: float; + src_texel_y: float; + _: [8]u8; +}; +/* + #version 430 + + layout(location = 0) in vec2 position; + layout(location = 0) out vec2 texcoord; + layout(location = 1) in vec2 uv; + + void main() + { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; + } + +*/ +vs_bloom_downsample_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,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,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 430 + + uniform vec4 bloom_downsample_params[1]; + layout(binding = 16) uniform sampler2D bloom_downsample_src_bloom_downsample_src_smp; + + layout(location = 0) in vec2 texcoord; + layout(location = 0) out vec4 frag_color; + + void main() + { + vec2 _23 = vec2(bloom_downsample_params[0].x, bloom_downsample_params[0].y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + frag_color = vec4((((texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + _23).xyz) * 0.25, 1.0); + } + +*/ +fs_bloom_downsample_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,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x31,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,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,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,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x32,0x33,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x32,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x34,0x34,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20, + 0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f, + 0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f, + 0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72, + 0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20, + 0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39,0x29, + 0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28, + 0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x32,0x35,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_bloom_downsample_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 bloom_downsample_params[1]; + uniform highp sampler2D bloom_downsample_src_bloom_downsample_src_smp; + + in highp vec2 texcoord; + layout(location = 0) out highp vec4 frag_color; + + void main() + { + highp vec2 _23 = vec2(bloom_downsample_params[0].x, bloom_downsample_params[0].y) * 0.5; + highp float _44 = _23.x; + highp float _45 = -_44; + highp float _48 = _23.y; + highp float _49 = -_48; + frag_color = vec4((((texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_downsample_src_bloom_downsample_src_smp, texcoord + _23).xyz) * 0.25, 1.0); + } + +*/ +fs_bloom_downsample_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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f, + 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,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,0x32,0x33,0x20, + 0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77, + 0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30, + 0x5d,0x2e,0x78,0x2c,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e, + 0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20, + 0x5f,0x32,0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34, + 0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x34,0x39,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x34,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72, + 0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x35,0x2c, + 0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73, + 0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x35, + 0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77, + 0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b, + 0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32, + 0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float2 texcoord [[user(locn0)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float2 position [[attribute(0)]]; + float2 uv [[attribute(1)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]]) + { + main0_out out = {}; + out.gl_Position = float4(in.position, 0.5, 1.0); + out.texcoord = in.uv; + return out; + } + +*/ +vs_bloom_downsample_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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,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, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,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,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,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,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e, + 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,0x6f,0x75,0x74,0x2e,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct bloom_downsample_params + { + float src_texel_x; + float src_texel_y; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 texcoord [[user(locn0)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], constant bloom_downsample_params& _12 [[buffer(0)]], texture2d bloom_downsample_src [[texture(0)]], sampler bloom_downsample_src_smp [[sampler(0)]]) + { + main0_out out = {}; + float2 _23 = float2(_12.src_texel_x, _12.src_texel_y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + out.frag_color = float4((((bloom_downsample_src.sample(bloom_downsample_src_smp, (in.texcoord + float2(_45, _49))).xyz + bloom_downsample_src.sample(bloom_downsample_src_smp, (in.texcoord + float2(_44, _49))).xyz) + bloom_downsample_src.sample(bloom_downsample_src_smp, (in.texcoord + float2(_45, _48))).xyz) + bloom_downsample_src.sample(bloom_downsample_src_smp, (in.texcoord + _23)).xyz) * 0.25, 1.0); + return out; + } + +*/ +fs_bloom_downsample_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c,0x5f,0x78,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x72,0x63,0x5f,0x74,0x65, + 0x78,0x65,0x6c,0x5f,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,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,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77, + 0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,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,0x32,0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c,0x5f, + 0x78,0x2c,0x20,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c, + 0x5f,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35,0x20, + 0x3d,0x20,0x2d,0x5f,0x34,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x2d, + 0x5f,0x34,0x38,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,0x28,0x28,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, + 0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20, + 0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x34, + 0x34,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72, + 0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f, + 0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x34,0x35, + 0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x35,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, +]; +bloom_downsample_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "bloom_downsample_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_bloom_downsample_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_downsample_source_glsl430; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_downsample_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "bloom_downsample_src_bloom_downsample_src_smp"; + case .GLES3; + desc.vertex_func.source = xx *vs_bloom_downsample_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_downsample_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_downsample_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "bloom_downsample_src_bloom_downsample_src_smp"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_bloom_downsample_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_bloom_downsample_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[1].base_type = .FLOAT; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + 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.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .FILTERING; + desc.samplers[0].msl_sampler_n = 0; + desc.image_sampler_pairs[0].stage = .FRAGMENT; + desc.image_sampler_pairs[0].image_slot = 0; + desc.image_sampler_pairs[0].sampler_slot = 0; + } + return desc; +} diff --git a/src/shaders/jai/shader_bloom_prefilter.jai b/src/shaders/jai/shader_bloom_prefilter.jai new file mode 100644 index 0000000..1e706f8 --- /dev/null +++ b/src/shaders/jai/shader_bloom_prefilter.jai @@ -0,0 +1,552 @@ +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc -i shader_bloom_prefilter.glsl -o ./jai/shader_bloom_prefilter.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + + Overview: + ========= + Shader program: 'bloom_prefilter': + Get shader desc: bloom_prefilter_shader_desc(sg_query_backend()) + Vertex Shader: vs_bloom_prefilter + Fragment Shader: fs_bloom_prefilter + Attributes: + ATTR_bloom_prefilter_position => 0 + ATTR_bloom_prefilter_uv => 1 + Bindings: + Uniform block 'bloom_prefilter_params': + Jai struct: Bloom_Prefilter_Params + Bind slot: UB_bloom_prefilter_params => 0 + Image 'bloom_prefilter_src': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_bloom_prefilter_src => 0 + Sampler 'bloom_prefilter_src_smp': + Type: .FILTERING + Bind slot: SMP_bloom_prefilter_src_smp => 0 +*/ +ATTR_bloom_prefilter_position :: 0; +ATTR_bloom_prefilter_uv :: 1; +UB_bloom_prefilter_params :: 0; +IMG_bloom_prefilter_src :: 0; +SMP_bloom_prefilter_src_smp :: 0; +Bloom_Prefilter_Params :: struct { + src_texel_x: float; + src_texel_y: float; + threshold: float; + _: [4]u8; +}; +/* + #version 430 + + layout(location = 0) in vec2 position; + layout(location = 0) out vec2 texcoord; + layout(location = 1) in vec2 uv; + + void main() + { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; + } + +*/ +vs_bloom_prefilter_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,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,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 430 + + uniform vec4 bloom_prefilter_params[1]; + layout(binding = 16) uniform sampler2D bloom_prefilter_src_bloom_prefilter_src_smp; + + layout(location = 0) in vec2 texcoord; + layout(location = 0) out vec4 frag_color; + + void main() + { + vec2 _23 = vec2(bloom_prefilter_params[0].x, bloom_prefilter_params[0].y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + vec3 _105 = (((texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + _23).xyz) * 0.25; + vec3 color = _105; + if (dot(_105, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)) < bloom_prefilter_params[0].z) + { + color = vec3(0.0); + } + frag_color = vec4(color, 1.0); + } + +*/ +fs_bloom_prefilter_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,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x31,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,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63, + 0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x73,0x72,0x63,0x5f,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,0x6f,0x69, + 0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76, + 0x65,0x63,0x32,0x20,0x5f,0x32,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20, + 0x5f,0x32,0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33, + 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34, + 0x39,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x33,0x20,0x5f,0x31,0x30,0x35,0x20,0x3d,0x20,0x28,0x28,0x28,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69, + 0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70, + 0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70, + 0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x32,0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73, + 0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39, + 0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65, + 0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f, + 0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70, + 0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b, + 0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32, + 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x5f,0x31,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x30,0x35,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30, + 0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35, + 0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37, + 0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30, + 0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37, + 0x35,0x29,0x29,0x20,0x3c,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e, + 0x7a,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28, + 0x63,0x6f,0x6c,0x6f,0x72,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_bloom_prefilter_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 bloom_prefilter_params[1]; + uniform highp sampler2D bloom_prefilter_src_bloom_prefilter_src_smp; + + in highp vec2 texcoord; + layout(location = 0) out highp vec4 frag_color; + + void main() + { + highp vec2 _23 = vec2(bloom_prefilter_params[0].x, bloom_prefilter_params[0].y) * 0.5; + highp float _44 = _23.x; + highp float _45 = -_44; + highp float _48 = _23.y; + highp float _49 = -_48; + highp vec3 _105 = (((texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_prefilter_src_bloom_prefilter_src_smp, texcoord + _23).xyz) * 0.25; + highp vec3 color = _105; + if (dot(_105, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)) < bloom_prefilter_params[0].z) + { + color = vec3(0.0); + } + frag_color = vec4(color, 1.0); + } + +*/ +fs_bloom_prefilter_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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65, + 0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69, + 0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70, + 0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,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,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,0x32,0x33,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x32,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c, + 0x74,0x65,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c, + 0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34, + 0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x20,0x3d, + 0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x30,0x35,0x20,0x3d,0x20,0x28,0x28,0x28, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72, + 0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f, + 0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20, + 0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e, + 0x78,0x79,0x7a,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72, + 0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65, + 0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f, + 0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20, + 0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69, + 0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70, + 0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70, + 0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x32,0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f, + 0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x30, + 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74,0x28,0x5f, + 0x31,0x30,0x35,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35, + 0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31, + 0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39, + 0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20, + 0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30, + 0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x20,0x3c,0x20,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x7a,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float2 texcoord [[user(locn0)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float2 position [[attribute(0)]]; + float2 uv [[attribute(1)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]]) + { + main0_out out = {}; + out.gl_Position = float4(in.position, 0.5, 1.0); + out.texcoord = in.uv; + return out; + } + +*/ +vs_bloom_prefilter_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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,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, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,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,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,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,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e, + 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,0x6f,0x75,0x74,0x2e,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct bloom_prefilter_params + { + float src_texel_x; + float src_texel_y; + float threshold; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 texcoord [[user(locn0)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], constant bloom_prefilter_params& _12 [[buffer(0)]], texture2d bloom_prefilter_src [[texture(0)]], sampler bloom_prefilter_src_smp [[sampler(0)]]) + { + main0_out out = {}; + float2 _23 = float2(_12.src_texel_x, _12.src_texel_y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + float3 _105 = (((bloom_prefilter_src.sample(bloom_prefilter_src_smp, (in.texcoord + float2(_45, _49))).xyz + bloom_prefilter_src.sample(bloom_prefilter_src_smp, (in.texcoord + float2(_44, _49))).xyz) + bloom_prefilter_src.sample(bloom_prefilter_src_smp, (in.texcoord + float2(_45, _48))).xyz) + bloom_prefilter_src.sample(bloom_prefilter_src_smp, (in.texcoord + _23)).xyz) * 0.25; + float3 color = _105; + if (dot(_105, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)) < _12.threshold) + { + color = float3(0.0); + } + out.frag_color = float4(color, 1.0); + return out; + } + +*/ +fs_bloom_prefilter_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c,0x5f,0x78,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x72,0x63,0x5f,0x74,0x65,0x78, + 0x65,0x6c,0x5f,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x74,0x68,0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,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,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,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,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63, + 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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70, + 0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,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,0x32,0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x28,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c, + 0x5f,0x78,0x2c,0x20,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65, + 0x6c,0x5f,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35, + 0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x20,0x3d,0x20, + 0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x5f,0x31,0x30,0x35,0x20,0x3d,0x20,0x28,0x28,0x28,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x2e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66, + 0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28, + 0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29, + 0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65, + 0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65, + 0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x29,0x20,0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c, + 0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73, + 0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x34, + 0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72, + 0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x70,0x72,0x65,0x66,0x69,0x6c,0x74,0x65,0x72,0x5f,0x73,0x72,0x63,0x5f, + 0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72, + 0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x31,0x30,0x35,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x30,0x35, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39, + 0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36, + 0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30, + 0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32, + 0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x20,0x3c,0x20,0x5f,0x31, + 0x32,0x2e,0x74,0x68,0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,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,0x63,0x6f,0x6c,0x6f,0x72,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, +]; +bloom_prefilter_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "bloom_prefilter_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_bloom_prefilter_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_prefilter_source_glsl430; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_prefilter_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "bloom_prefilter_src_bloom_prefilter_src_smp"; + case .GLES3; + desc.vertex_func.source = xx *vs_bloom_prefilter_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_prefilter_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_prefilter_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "bloom_prefilter_src_bloom_prefilter_src_smp"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_bloom_prefilter_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_bloom_prefilter_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[1].base_type = .FLOAT; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + 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.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .FILTERING; + desc.samplers[0].msl_sampler_n = 0; + desc.image_sampler_pairs[0].stage = .FRAGMENT; + desc.image_sampler_pairs[0].image_slot = 0; + desc.image_sampler_pairs[0].sampler_slot = 0; + } + return desc; +} diff --git a/src/shaders/jai/shader_bloom_upsample.jai b/src/shaders/jai/shader_bloom_upsample.jai new file mode 100644 index 0000000..ffff8c6 --- /dev/null +++ b/src/shaders/jai/shader_bloom_upsample.jai @@ -0,0 +1,563 @@ +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc -i shader_bloom_upsample.glsl -o ./jai/shader_bloom_upsample.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + + Overview: + ========= + Shader program: 'bloom_upsample': + Get shader desc: bloom_upsample_shader_desc(sg_query_backend()) + Vertex Shader: vs_bloom_upsample + Fragment Shader: fs_bloom_upsample + Attributes: + ATTR_bloom_upsample_position => 0 + ATTR_bloom_upsample_uv => 1 + Bindings: + Uniform block 'bloom_upsample_params': + Jai struct: Bloom_Upsample_Params + Bind slot: UB_bloom_upsample_params => 0 + Image 'bloom_upsample_small': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_bloom_upsample_small => 0 + Image 'bloom_upsample_large': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_bloom_upsample_large => 1 + Sampler 'bloom_upsample_small_smp': + Type: .FILTERING + Bind slot: SMP_bloom_upsample_small_smp => 0 + Sampler 'bloom_upsample_large_smp': + Type: .FILTERING + Bind slot: SMP_bloom_upsample_large_smp => 1 +*/ +ATTR_bloom_upsample_position :: 0; +ATTR_bloom_upsample_uv :: 1; +UB_bloom_upsample_params :: 0; +IMG_bloom_upsample_small :: 0; +IMG_bloom_upsample_large :: 1; +SMP_bloom_upsample_small_smp :: 0; +SMP_bloom_upsample_large_smp :: 1; +Bloom_Upsample_Params :: struct { + src_texel_x: float; + src_texel_y: float; + _: [8]u8; +}; +/* + #version 430 + + layout(location = 0) in vec2 position; + layout(location = 0) out vec2 texcoord; + layout(location = 1) in vec2 uv; + + void main() + { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; + } + +*/ +vs_bloom_upsample_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,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,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 430 + + uniform vec4 bloom_upsample_params[1]; + layout(binding = 16) uniform sampler2D bloom_upsample_small_bloom_upsample_small_smp; + layout(binding = 17) uniform sampler2D bloom_upsample_large_bloom_upsample_large_smp; + + layout(location = 0) in vec2 texcoord; + layout(location = 0) out vec4 frag_color; + + void main() + { + vec2 _23 = vec2(bloom_upsample_params[0].x, bloom_upsample_params[0].y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + frag_color = vec4(((((texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + _23).xyz) * 0.25) + texture(bloom_upsample_large_bloom_upsample_large_smp, texcoord).xyz, 1.0); + } + +*/ +fs_bloom_upsample_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,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x5b,0x31,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,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c, + 0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x73,0x6d,0x61,0x6c,0x6c,0x5f,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,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,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x32,0x33,0x20,0x3d, + 0x20,0x76,0x65,0x63,0x32,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78, + 0x2c,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x34,0x34,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20, + 0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, + 0x76,0x65,0x63,0x34,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28, + 0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75, + 0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61, + 0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39, + 0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32, + 0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29, + 0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x32,0x35,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x6c,0x61,0x72,0x67,0x65,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x2e,0x78,0x79,0x7a,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_bloom_upsample_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 bloom_upsample_params[1]; + uniform highp sampler2D bloom_upsample_small_bloom_upsample_small_smp; + uniform highp sampler2D bloom_upsample_large_bloom_upsample_large_smp; + + in highp vec2 texcoord; + layout(location = 0) out highp vec4 frag_color; + + void main() + { + highp vec2 _23 = vec2(bloom_upsample_params[0].x, bloom_upsample_params[0].y) * 0.5; + highp float _44 = _23.x; + highp float _45 = -_44; + highp float _48 = _23.y; + highp float _49 = -_48; + frag_color = vec4(((((texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_45, _49)).xyz + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_44, _49)).xyz) + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + vec2(_45, _48)).xyz) + texture(bloom_upsample_small_bloom_upsample_small_smp, texcoord + _23).xyz) * 0.25) + texture(bloom_upsample_large_bloom_upsample_large_smp, texcoord).xyz, 1.0); + } + +*/ +fs_bloom_upsample_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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75, + 0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,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,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c, + 0x61,0x72,0x67,0x65,0x5f,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,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,0x32,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d, + 0x2e,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d, + 0x20,0x5f,0x32,0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f, + 0x34,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x34,0x39,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x38,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x34,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d, + 0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34, + 0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29, + 0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x76,0x65,0x63,0x32,0x28,0x5f, + 0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75, + 0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61, + 0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, + 0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x32,0x35,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61, + 0x72,0x67,0x65,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30, + 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float2 texcoord [[user(locn0)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float2 position [[attribute(0)]]; + float2 uv [[attribute(1)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]]) + { + main0_out out = {}; + out.gl_Position = float4(in.position, 0.5, 1.0); + out.texcoord = in.uv; + return out; + } + +*/ +vs_bloom_upsample_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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,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, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,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,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,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,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e, + 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,0x6f,0x75,0x74,0x2e,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct bloom_upsample_params + { + float src_texel_x; + float src_texel_y; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 texcoord [[user(locn0)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], constant bloom_upsample_params& _12 [[buffer(0)]], texture2d bloom_upsample_small [[texture(0)]], texture2d bloom_upsample_large [[texture(1)]], sampler bloom_upsample_small_smp [[sampler(0)]], sampler bloom_upsample_large_smp [[sampler(1)]]) + { + main0_out out = {}; + float2 _23 = float2(_12.src_texel_x, _12.src_texel_y) * 0.5; + float _44 = _23.x; + float _45 = -_44; + float _48 = _23.y; + float _49 = -_48; + out.frag_color = float4(((((bloom_upsample_small.sample(bloom_upsample_small_smp, (in.texcoord + float2(_45, _49))).xyz + bloom_upsample_small.sample(bloom_upsample_small_smp, (in.texcoord + float2(_44, _49))).xyz) + bloom_upsample_small.sample(bloom_upsample_small_smp, (in.texcoord + float2(_45, _48))).xyz) + bloom_upsample_small.sample(bloom_upsample_small_smp, (in.texcoord + _23)).xyz) * 0.25) + bloom_upsample_large.sample(bloom_upsample_large_smp, in.texcoord).xyz, 1.0); + return out; + } + +*/ +fs_bloom_upsample_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65,0x6c,0x5f,0x78,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x72,0x63,0x5f,0x74,0x65,0x78,0x65, + 0x6c,0x5f,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,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,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x26,0x20,0x5f,0x31,0x32,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,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,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65, + 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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75, + 0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,0x73, + 0x6d,0x70,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,0x32,0x33,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x28,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65,0x78, + 0x65,0x6c,0x5f,0x78,0x2c,0x20,0x5f,0x31,0x32,0x2e,0x73,0x72,0x63,0x5f,0x74,0x65, + 0x78,0x65,0x6c,0x5f,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x34,0x20,0x3d,0x20,0x5f,0x32, + 0x33,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x34,0x35,0x20,0x3d,0x20,0x2d,0x5f,0x34,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x32,0x33,0x2e,0x79, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x20, + 0x3d,0x20,0x2d,0x5f,0x34,0x38,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,0x28,0x28,0x28,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x2e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69, + 0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x32,0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29,0x2e, + 0x78,0x79,0x7a,0x20,0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e, + 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x32,0x28,0x5f,0x34,0x34,0x2c,0x20,0x5f,0x34,0x39,0x29,0x29,0x29,0x2e,0x78,0x79, + 0x7a,0x29,0x20,0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x73,0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x5f,0x34,0x35,0x2c,0x20,0x5f,0x34,0x38,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x29,0x20,0x2b,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x6d,0x61,0x6c,0x6c,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73, + 0x6d,0x61,0x6c,0x6c,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e,0x2e,0x74,0x65, + 0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x5f,0x32,0x33,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x35,0x29,0x20,0x2b,0x20,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72, + 0x67,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x75,0x70,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x6c,0x61,0x72,0x67,0x65,0x5f,0x73, + 0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29, + 0x2e,0x78,0x79,0x7a,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, + +]; +bloom_upsample_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "bloom_upsample_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_bloom_upsample_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_upsample_source_glsl430; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_upsample_params"; + 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 = "bloom_upsample_small_bloom_upsample_small_smp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 1; + desc.image_sampler_pairs[1].sampler_slot = 1; + desc.image_sampler_pairs[1].glsl_name = "bloom_upsample_large_bloom_upsample_large_smp"; + case .GLES3; + desc.vertex_func.source = xx *vs_bloom_upsample_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_bloom_upsample_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "bloom_upsample_params"; + 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 = "bloom_upsample_small_bloom_upsample_small_smp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 1; + desc.image_sampler_pairs[1].sampler_slot = 1; + desc.image_sampler_pairs[1].glsl_name = "bloom_upsample_large_bloom_upsample_large_smp"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_bloom_upsample_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_bloom_upsample_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[1].base_type = .FLOAT; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + 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 = 1; + } + return desc; +} diff --git a/src/shaders/jai/shader_dof_blur.jai b/src/shaders/jai/shader_dof_blur.jai new file mode 100644 index 0000000..7c06738 --- /dev/null +++ b/src/shaders/jai/shader_dof_blur.jai @@ -0,0 +1,566 @@ +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc -i shader_dof_blur.glsl -o ./jai/shader_dof_blur.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + + Overview: + ========= + Shader program: 'dof_blur': + Get shader desc: dof_blur_shader_desc(sg_query_backend()) + Vertex Shader: vs_dof_blur + Fragment Shader: fs_dof_blur + Attributes: + ATTR_dof_blur_position => 0 + ATTR_dof_blur_uv => 1 + Bindings: + Uniform block 'dof_blur_params': + Jai struct: Dof_Blur_Params + Bind slot: UB_dof_blur_params => 0 + Image 'dof_blur_src': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_dof_blur_src => 0 + Sampler 'dof_blur_src_smp': + Type: .FILTERING + Bind slot: SMP_dof_blur_src_smp => 0 +*/ +ATTR_dof_blur_position :: 0; +ATTR_dof_blur_uv :: 1; +UB_dof_blur_params :: 0; +IMG_dof_blur_src :: 0; +SMP_dof_blur_src_smp :: 0; +Dof_Blur_Params :: struct { + bokeh_radius_x: float; + bokeh_radius_y: float; + _: [8]u8; +}; +/* + #version 430 + + layout(location = 0) in vec2 position; + layout(location = 0) out vec2 texcoord; + layout(location = 1) in vec2 uv; + + void main() + { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; + } + +*/ +vs_dof_blur_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,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,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 430 + + uniform vec4 dof_blur_params[1]; + layout(binding = 16) uniform sampler2D dof_blur_src_dof_blur_src_smp; + + layout(location = 0) in vec2 texcoord; + layout(location = 0) out vec4 frag_color; + + void main() + { + vec4 _24 = texture(dof_blur_src_dof_blur_src_smp, texcoord); + vec4 best = _24; + float best_lum = dot(_24.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + for (int i = 0; i < 32; i++) + { + float _50 = float(i); + float _52 = _50 * 2.3999631404876708984375; + vec4 _88 = texture(dof_blur_src_dof_blur_src_smp, texcoord + ((vec2(cos(_52), sin(_52)) * sqrt((_50 * 0.0322580635547637939453125) + 0.001000000047497451305389404296875)) * vec2(dof_blur_params[0].x, dof_blur_params[0].y))); + float _92 = dot(_88.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + if (_92 > best_lum) + { + best = _88; + best_lum = _92; + } + } + frag_color = best; + } + +*/ +fs_dof_blur_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,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73, + 0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f, + 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,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f, + 0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f,0x66, + 0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x62,0x6c, + 0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63, + 0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20, + 0x62,0x65,0x73,0x74,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x20,0x3d, + 0x20,0x64,0x6f,0x74,0x28,0x5f,0x32,0x34,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35, + 0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37, + 0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30, + 0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30, + 0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31, + 0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28, + 0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20,0x33, + 0x32,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20, + 0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x32,0x20,0x3d,0x20, + 0x5f,0x35,0x30,0x20,0x2a,0x20,0x32,0x2e,0x33,0x39,0x39,0x39,0x36,0x33,0x31,0x34, + 0x30,0x34,0x38,0x37,0x36,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x38,0x38, + 0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72, + 0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x20,0x2b,0x20,0x28,0x28,0x76,0x65,0x63,0x32,0x28,0x63,0x6f,0x73,0x28, + 0x5f,0x35,0x32,0x29,0x2c,0x20,0x73,0x69,0x6e,0x28,0x5f,0x35,0x32,0x29,0x29,0x20, + 0x2a,0x20,0x73,0x71,0x72,0x74,0x28,0x28,0x5f,0x35,0x30,0x20,0x2a,0x20,0x30,0x2e, + 0x30,0x33,0x32,0x32,0x35,0x38,0x30,0x36,0x33,0x35,0x35,0x34,0x37,0x36,0x33,0x37, + 0x39,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x20,0x2b,0x20,0x30,0x2e,0x30, + 0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35, + 0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35, + 0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x28,0x64,0x6f,0x66,0x5f,0x62,0x6c, + 0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20, + 0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x30,0x5d,0x2e,0x79,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x32,0x20,0x3d,0x20,0x64,0x6f,0x74, + 0x28,0x5f,0x38,0x38,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35, + 0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30, + 0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35, + 0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30, + 0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x39,0x32,0x20,0x3e,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x65,0x73,0x74,0x20,0x3d,0x20,0x5f,0x38,0x38,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x65,0x73, + 0x74,0x5f,0x6c,0x75,0x6d,0x20,0x3d,0x20,0x5f,0x39,0x32,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x62,0x65, + 0x73,0x74,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_dof_blur_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 dof_blur_params[1]; + uniform highp sampler2D dof_blur_src_dof_blur_src_smp; + + in highp vec2 texcoord; + layout(location = 0) out highp vec4 frag_color; + + void main() + { + highp vec4 _24 = texture(dof_blur_src_dof_blur_src_smp, texcoord); + highp vec4 best = _24; + highp float best_lum = dot(_24.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + for (int i = 0; i < 32; i++) + { + highp float _50 = float(i); + highp float _52 = _50 * 2.3999631404876708984375; + highp vec4 _88 = texture(dof_blur_src_dof_blur_src_smp, texcoord + ((vec2(cos(_52), sin(_52)) * sqrt((_50 * 0.0322580635547637939453125) + 0.001000000047497451305389404296875)) * vec2(dof_blur_params[0].x, dof_blur_params[0].y))); + highp float _92 = dot(_88.xyz, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + if (_92 > best_lum) + { + best = _88; + best_lum = _92; + } + } + frag_color = best; + } + +*/ +fs_dof_blur_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,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x31,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,0x64,0x6f, + 0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,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,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x64, + 0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x62,0x65,0x73,0x74,0x20, + 0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x20, + 0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x32,0x34,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32,0x37, + 0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32,0x35, + 0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32,0x32, + 0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39,0x32, + 0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, + 0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20, + 0x33,0x32,0x3b,0x20,0x69,0x2b,0x2b,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,0x35,0x30,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x32,0x20,0x3d,0x20,0x5f,0x35,0x30, + 0x20,0x2a,0x20,0x32,0x2e,0x33,0x39,0x39,0x39,0x36,0x33,0x31,0x34,0x30,0x34,0x38, + 0x37,0x36,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20, + 0x5f,0x38,0x38,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f, + 0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x28,0x28,0x76,0x65,0x63,0x32,0x28,0x63, + 0x6f,0x73,0x28,0x5f,0x35,0x32,0x29,0x2c,0x20,0x73,0x69,0x6e,0x28,0x5f,0x35,0x32, + 0x29,0x29,0x20,0x2a,0x20,0x73,0x71,0x72,0x74,0x28,0x28,0x5f,0x35,0x30,0x20,0x2a, + 0x20,0x30,0x2e,0x30,0x33,0x32,0x32,0x35,0x38,0x30,0x36,0x33,0x35,0x35,0x34,0x37, + 0x36,0x33,0x37,0x39,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x20,0x2b,0x20, + 0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39, + 0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36, + 0x38,0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x32,0x28,0x64,0x6f,0x66, + 0x5f,0x62,0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e, + 0x78,0x2c,0x20,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x39,0x32,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x38,0x38,0x2e,0x78,0x79, + 0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39, + 0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35, + 0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31, + 0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32, + 0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x39,0x32,0x20,0x3e,0x20,0x62,0x65, + 0x73,0x74,0x5f,0x6c,0x75,0x6d,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x65, + 0x73,0x74,0x20,0x3d,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x20,0x3d, + 0x20,0x5f,0x39,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x62,0x65,0x73,0x74,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x00, +]; +/* + #include + #include + + using namespace metal; + + struct main0_out + { + float2 texcoord [[user(locn0)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float2 position [[attribute(0)]]; + float2 uv [[attribute(1)]]; + }; + + vertex main0_out main0(main0_in in [[stage_in]]) + { + main0_out out = {}; + out.gl_Position = float4(in.position, 0.5, 1.0); + out.texcoord = in.uv; + return out; + } + +*/ +vs_dof_blur_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,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,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, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,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,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x75,0x76,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,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,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x69,0x6e,0x2e, + 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,0x6f,0x75,0x74,0x2e,0x74,0x65,0x78, + 0x63,0x6f,0x6f,0x72,0x64,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x75,0x76,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct dof_blur_params + { + float bokeh_radius_x; + float bokeh_radius_y; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float2 texcoord [[user(locn0)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], constant dof_blur_params& _72 [[buffer(0)]], texture2d dof_blur_src [[texture(0)]], sampler dof_blur_src_smp [[sampler(0)]]) + { + main0_out out = {}; + float4 _24 = dof_blur_src.sample(dof_blur_src_smp, in.texcoord); + float4 best = _24; + float best_lum = dot(_24.xyz, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + for (int i = 0; i < 32; i++) + { + float _50 = float(i); + float _52 = _50 * 2.3999631404876708984375; + float4 _88 = dof_blur_src.sample(dof_blur_src_smp, (in.texcoord + ((float2(cos(_52), sin(_52)) * sqrt((_50 * 0.0322580635547637939453125) + 0.001000000047497451305389404296875)) * float2(_72.bokeh_radius_x, _72.bokeh_radius_y)))); + float _92 = dot(_88.xyz, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875)); + if (_92 > best_lum) + { + best = _88; + best_lum = _92; + } + } + out.frag_color = best; + return out; + } + +*/ +fs_dof_blur_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x64, + 0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x6f,0x6b,0x65,0x68, + 0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x5f,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x62,0x6f,0x6b,0x65,0x68,0x5f,0x72,0x61,0x64,0x69,0x75, + 0x73,0x5f,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,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,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x37,0x32,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, + 0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,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,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72, + 0x63,0x5f,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d, + 0x20,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x28,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f,0x73,0x72, + 0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x62,0x65,0x73,0x74,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x20,0x3d, + 0x20,0x64,0x6f,0x74,0x28,0x5f,0x32,0x34,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39,0x39,0x39,0x39,0x32, + 0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32,0x35,0x2c,0x20,0x30, + 0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36,0x31,0x38,0x32,0x32, + 0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x37,0x32, + 0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32,0x32,0x39,0x34,0x39, + 0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72, + 0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c, + 0x20,0x33,0x32,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35, + 0x30,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x69,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x32,0x20, + 0x3d,0x20,0x5f,0x35,0x30,0x20,0x2a,0x20,0x32,0x2e,0x33,0x39,0x39,0x39,0x36,0x33, + 0x31,0x34,0x30,0x34,0x38,0x37,0x36,0x37,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x5f,0x38,0x38,0x20,0x3d,0x20,0x64,0x6f,0x66,0x5f,0x62,0x6c,0x75,0x72,0x5f, + 0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x64,0x6f,0x66,0x5f,0x62, + 0x6c,0x75,0x72,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x69,0x6e, + 0x2e,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x20,0x2b,0x20,0x28,0x28,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x28,0x63,0x6f,0x73,0x28,0x5f,0x35,0x32,0x29,0x2c,0x20,0x73, + 0x69,0x6e,0x28,0x5f,0x35,0x32,0x29,0x29,0x20,0x2a,0x20,0x73,0x71,0x72,0x74,0x28, + 0x28,0x5f,0x35,0x30,0x20,0x2a,0x20,0x30,0x2e,0x30,0x33,0x32,0x32,0x35,0x38,0x30, + 0x36,0x33,0x35,0x35,0x34,0x37,0x36,0x33,0x37,0x39,0x33,0x39,0x34,0x35,0x33,0x31, + 0x32,0x35,0x29,0x20,0x2b,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30, + 0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39, + 0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x32,0x28,0x5f,0x37,0x32,0x2e,0x62,0x6f,0x6b,0x65,0x68,0x5f,0x72, + 0x61,0x64,0x69,0x75,0x73,0x5f,0x78,0x2c,0x20,0x5f,0x37,0x32,0x2e,0x62,0x6f,0x6b, + 0x65,0x68,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x5f,0x79,0x29,0x29,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x39,0x32,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x38,0x38,0x2e,0x78,0x79,0x7a, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x32,0x31,0x32,0x35,0x39, + 0x39,0x39,0x39,0x32,0x37,0x35,0x32,0x30,0x37,0x35,0x31,0x39,0x35,0x33,0x31,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x37,0x31,0x35,0x32,0x30,0x30,0x30,0x30,0x36,0x39,0x36, + 0x31,0x38,0x32,0x32,0x35,0x30,0x39,0x37,0x36,0x35,0x36,0x32,0x35,0x2c,0x20,0x30, + 0x2e,0x30,0x37,0x32,0x32,0x30,0x30,0x30,0x30,0x30,0x32,0x38,0x36,0x31,0x30,0x32, + 0x32,0x39,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x39,0x32,0x20,0x3e,0x20,0x62, + 0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x65,0x73,0x74,0x20,0x3d,0x20,0x5f,0x38,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x65,0x73,0x74,0x5f,0x6c,0x75,0x6d,0x20, + 0x3d,0x20,0x5f,0x39,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x62,0x65,0x73,0x74, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +dof_blur_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "dof_blur_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_dof_blur_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_dof_blur_source_glsl430; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "dof_blur_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "dof_blur_src_dof_blur_src_smp"; + case .GLES3; + desc.vertex_func.source = xx *vs_dof_blur_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_dof_blur_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "uv"; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "dof_blur_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].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 = "dof_blur_src_dof_blur_src_smp"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_dof_blur_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_dof_blur_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[1].base_type = .FLOAT; + desc.uniform_blocks[0].stage = .FRAGMENT; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 16; + 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.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .FILTERING; + desc.samplers[0].msl_sampler_n = 0; + desc.image_sampler_pairs[0].stage = .FRAGMENT; + desc.image_sampler_pairs[0].image_slot = 0; + desc.image_sampler_pairs[0].sampler_slot = 0; + } + return desc; +} diff --git a/src/shaders/jai/shader_dof.jai b/src/shaders/jai/shader_dof_downsample.jai similarity index 50% rename from src/shaders/jai/shader_dof.jai rename to src/shaders/jai/shader_dof_downsample.jai index fd3cb5e..0728c3d 100644 --- a/src/shaders/jai/shader_dof.jai +++ b/src/shaders/jai/shader_dof_downsample.jai @@ -4,39 +4,31 @@ Generated by sokol-shdc (https://github.com/floooh/sokol-tools) Cmdline: - sokol-shdc -i shader_dof.glsl -o ./jai/shader_dof.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + sokol-shdc -i shader_dof_downsample.glsl -o ./jai/shader_dof_downsample.jai -l glsl430:glsl300es:metal_macos -f sokol_jai Overview: ========= - Shader program: 'dof': - Get shader desc: dof_shader_desc(sg_query_backend()) - Vertex Shader: vs_dof - Fragment Shader: fs_dof + Shader program: 'dof_downsample': + Get shader desc: dof_downsample_shader_desc(sg_query_backend()) + Vertex Shader: vs_dof_downsample + Fragment Shader: fs_dof_downsample Attributes: - ATTR_dof_position => 0 - ATTR_dof_uv => 1 + ATTR_dof_downsample_position => 0 + ATTR_dof_downsample_uv => 1 Bindings: - Uniform block 'dof_params': - Jai struct: Dof_Params - Bind slot: UB_dof_params => 0 - Image 'dof_src': + Image 'dof_downsample_src': Image type: ._2D Sample type: .FLOAT Multisampled: false - Bind slot: IMG_dof_src => 0 - Sampler 'dof_src_smp': + Bind slot: IMG_dof_downsample_src => 0 + Sampler 'dof_downsample_src_smp': Type: .FILTERING - Bind slot: SMP_dof_src_smp => 0 + Bind slot: SMP_dof_downsample_src_smp => 0 */ -ATTR_dof_position :: 0; -ATTR_dof_uv :: 1; -UB_dof_params :: 0; -IMG_dof_src :: 0; -SMP_dof_src_smp :: 0; -Dof_Params :: struct { - dof_treshold: float; - _: [12]u8; -}; +ATTR_dof_downsample_position :: 0; +ATTR_dof_downsample_uv :: 1; +IMG_dof_downsample_src :: 0; +SMP_dof_downsample_src_smp :: 0; /* #version 430 @@ -51,7 +43,7 @@ Dof_Params :: struct { } */ -vs_dof_source_glsl430 := u8.[ +vs_dof_downsample_source_glsl430 := u8.[ 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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, @@ -70,52 +62,37 @@ vs_dof_source_glsl430 := u8.[ /* #version 430 - uniform vec4 dof_params[1]; - layout(binding = 16) uniform sampler2D dof_src_dof_src_smp; + layout(binding = 16) uniform sampler2D dof_downsample_src_dof_downsample_src_smp; - layout(location = 0) in vec2 texcoord; layout(location = 0) out vec4 frag_color; + layout(location = 0) in vec2 texcoord; void main() { - vec4 _24 = texture(dof_src_dof_src_smp, texcoord); - vec4 color = _24; - if (max(_24.x, max(_24.y, _24.z)) < dof_params[0].x) - { - color = vec4(0.0, 0.0, 0.0, 1.0); - } - frag_color = vec4(color.xyz, 1.0); + frag_color = vec4(texture(dof_downsample_src_dof_downsample_src_smp, texcoord).xyz, 1.0); } */ -fs_dof_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,0x64,0x6f,0x66,0x5f,0x70, - 0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63, - 0x5f,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,0x6f,0x69,0x64,0x20,0x6d,0x61, - 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20, - 0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f, - 0x66,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d, - 0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f, - 0x32,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6d,0x61,0x78,0x28, - 0x5f,0x32,0x34,0x2e,0x78,0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x79, - 0x2c,0x20,0x5f,0x32,0x34,0x2e,0x7a,0x29,0x29,0x20,0x3c,0x20,0x64,0x6f,0x66,0x5f, - 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78, - 0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +fs_dof_downsample_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,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,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,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,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,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,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64, + 0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72, + 0x63,0x5f,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f, + 0x72,0x64,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, ]; /* #version 300 es @@ -131,7 +108,7 @@ fs_dof_source_glsl430 := u8.[ } */ -vs_dof_source_glsl300es := u8.[ +vs_dof_downsample_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, @@ -150,55 +127,38 @@ vs_dof_source_glsl300es := u8.[ precision mediump float; precision highp int; - uniform highp vec4 dof_params[1]; - uniform highp sampler2D dof_src_dof_src_smp; + uniform highp sampler2D dof_downsample_src_dof_downsample_src_smp; - in highp vec2 texcoord; layout(location = 0) out highp vec4 frag_color; + in highp vec2 texcoord; void main() { - highp vec4 _24 = texture(dof_src_dof_src_smp, texcoord); - highp vec4 color = _24; - if (max(_24.x, max(_24.y, _24.z)) < dof_params[0].x) - { - color = vec4(0.0, 0.0, 0.0, 1.0); - } - frag_color = vec4(color.xyz, 1.0); + frag_color = vec4(texture(dof_downsample_src_dof_downsample_src_smp, texcoord).xyz, 1.0); } */ -fs_dof_source_glsl300es := u8.[ +fs_dof_downsample_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,0x64,0x6f,0x66,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,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,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63, - 0x5f,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x5f,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,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, - 0x72,0x65,0x28,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x73, - 0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, - 0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x32,0x34,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x78, - 0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x34, - 0x2e,0x7a,0x29,0x29,0x20,0x3c,0x20,0x64,0x6f,0x66,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,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,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76, - 0x65,0x63,0x34,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x64,0x6f, + 0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,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,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,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32, + 0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64, + 0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x64,0x6f,0x66,0x5f,0x64, + 0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d, + 0x70,0x2c,0x20,0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x2e,0x78,0x79,0x7a, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #include @@ -227,7 +187,7 @@ fs_dof_source_glsl300es := u8.[ } */ -vs_dof_source_metal_macos := u8.[ +vs_dof_downsample_source_metal_macos := u8.[ 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -263,11 +223,6 @@ vs_dof_source_metal_macos := u8.[ using namespace metal; - struct dof_params - { - float dof_treshold; - }; - struct main0_out { float4 frag_color [[color(0)]]; @@ -278,29 +233,20 @@ vs_dof_source_metal_macos := u8.[ float2 texcoord [[user(locn0)]]; }; - fragment main0_out main0(main0_in in [[stage_in]], constant dof_params& _42 [[buffer(0)]], texture2d dof_src [[texture(0)]], sampler dof_src_smp [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], texture2d dof_downsample_src [[texture(0)]], sampler dof_downsample_src_smp [[sampler(0)]]) { main0_out out = {}; - float4 _24 = dof_src.sample(dof_src_smp, in.texcoord); - float4 color = _24; - if (fast::max(_24.x, fast::max(_24.y, _24.z)) < _42.dof_treshold) - { - color = float4(0.0, 0.0, 0.0, 1.0); - } - out.frag_color = float4(color.xyz, 1.0); + out.frag_color = float4(dof_downsample_src.sample(dof_downsample_src_smp, in.texcoord).xyz, 1.0); return out; } */ -fs_dof_source_metal_macos := u8.[ +fs_dof_downsample_source_metal_macos := u8.[ 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, - 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x64, - 0x6f,0x66,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66,0x5f,0x74,0x72,0x65,0x73,0x68,0x6f, - 0x6c,0x64,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d, + 0x6d,0x65,0x74,0x61,0x6c,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, @@ -311,53 +257,36 @@ fs_dof_source_metal_macos := u8.[ 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,0x64,0x6f,0x66,0x5f,0x70,0x61, - 0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x34,0x32,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,0x64,0x6f,0x66,0x5f,0x73,0x72, - 0x63,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,0x64,0x6f,0x66,0x5f,0x73,0x72, - 0x63,0x5f,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,0x34,0x20,0x5f,0x32,0x34,0x20,0x3d, - 0x20,0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, - 0x64,0x6f,0x66,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e, - 0x74,0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x5f,0x32, - 0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x66,0x61,0x73,0x74,0x3a, - 0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x78,0x2c,0x20,0x66,0x61,0x73,0x74, - 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x34,0x2e,0x79,0x2c,0x20,0x5f,0x32,0x34, - 0x2e,0x7a,0x29,0x29,0x20,0x3c,0x20,0x5f,0x34,0x32,0x2e,0x64,0x6f,0x66,0x5f,0x74, - 0x72,0x65,0x73,0x68,0x6f,0x6c,0x64,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,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,0x7d, - 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,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x78,0x79,0x7a,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74, + 0x3e,0x20,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x73,0x72,0x63,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,0x64,0x6f,0x66, + 0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f, + 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,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x64,0x6f,0x66,0x5f,0x64,0x6f, + 0x77,0x6e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x73,0x72,0x63,0x2e,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x64,0x6f,0x66,0x5f,0x64,0x6f,0x77,0x6e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x73,0x72,0x63,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x74, + 0x65,0x78,0x63,0x6f,0x6f,0x72,0x64,0x29,0x2e,0x78,0x79,0x7a,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, ]; -dof_shader_desc :: (backend: sg_backend) -> sg_shader_desc { +dof_downsample_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc: sg_shader_desc; - desc.label = "dof_shader"; + desc.label = "dof_downsample_shader"; if backend == { case .GLCORE; - desc.vertex_func.source = xx *vs_dof_source_glsl430; + desc.vertex_func.source = xx *vs_dof_downsample_source_glsl430; desc.vertex_func.entry = "main"; - desc.fragment_func.source = xx *fs_dof_source_glsl430; + desc.fragment_func.source = xx *fs_dof_downsample_source_glsl430; desc.fragment_func.entry = "main"; desc.attrs[0].base_type = .FLOAT; desc.attrs[0].glsl_name = "position"; desc.attrs[1].base_type = .FLOAT; desc.attrs[1].glsl_name = "uv"; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "dof_params"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; @@ -367,22 +296,16 @@ dof_shader_desc :: (backend: sg_backend) -> sg_shader_desc { 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 = "dof_src_dof_src_smp"; + desc.image_sampler_pairs[0].glsl_name = "dof_downsample_src_dof_downsample_src_smp"; case .GLES3; - desc.vertex_func.source = xx *vs_dof_source_glsl300es; + desc.vertex_func.source = xx *vs_dof_downsample_source_glsl300es; desc.vertex_func.entry = "main"; - desc.fragment_func.source = xx *fs_dof_source_glsl300es; + desc.fragment_func.source = xx *fs_dof_downsample_source_glsl300es; desc.fragment_func.entry = "main"; desc.attrs[0].base_type = .FLOAT; desc.attrs[0].glsl_name = "position"; desc.attrs[1].base_type = .FLOAT; desc.attrs[1].glsl_name = "uv"; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[0].glsl_uniforms[0].array_count = 1; - desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "dof_params"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; @@ -392,18 +315,14 @@ dof_shader_desc :: (backend: sg_backend) -> sg_shader_desc { 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 = "dof_src_dof_src_smp"; + desc.image_sampler_pairs[0].glsl_name = "dof_downsample_src_dof_downsample_src_smp"; case .METAL_MACOS; - desc.vertex_func.source = xx *vs_dof_source_metal_macos; + desc.vertex_func.source = xx *vs_dof_downsample_source_metal_macos; desc.vertex_func.entry = "main0"; - desc.fragment_func.source = xx *fs_dof_source_metal_macos; + desc.fragment_func.source = xx *fs_dof_downsample_source_metal_macos; desc.fragment_func.entry = "main0"; desc.attrs[0].base_type = .FLOAT; desc.attrs[1].base_type = .FLOAT; - desc.uniform_blocks[0].stage = .FRAGMENT; - desc.uniform_blocks[0].layout = .STD140; - desc.uniform_blocks[0].size = 16; - desc.uniform_blocks[0].msl_buffer_n = 0; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; diff --git a/src/shaders/jai/shader_gbuffer_billboard.jai b/src/shaders/jai/shader_gbuffer_billboard.jai index b4c96d8..84b513d 100644 --- a/src/shaders/jai/shader_gbuffer_billboard.jai +++ b/src/shaders/jai/shader_gbuffer_billboard.jai @@ -58,7 +58,7 @@ Gbuffer_Billboard_Vs_Params :: struct { vec3 _53 = gbuffer_billboard_vs_params[5].xyz - gbuffer_billboard_vs_params[7].xyz; _53.y = 0.0; vec3 look_dir = normalize(_53); - if (gbuffer_billboard_vs_params[12].x < (-10.0)) + if (gbuffer_billboard_vs_params[12].x > (-10.0)) { look_dir = gbuffer_billboard_vs_params[12].xyz; } @@ -98,7 +98,7 @@ vs_gbuffer_billboard_source_glsl430 := u8.[ 0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x33, 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x67,0x62,0x75,0x66,0x66, 0x65,0x72,0x5f,0x62,0x69,0x6c,0x6c,0x62,0x6f,0x61,0x72,0x64,0x5f,0x76,0x73,0x5f, - 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2e,0x78,0x20,0x3c,0x20,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x28, 0x2d,0x31,0x30,0x2e,0x30,0x29,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x6f,0x6b,0x5f,0x64,0x69,0x72,0x20,0x3d, 0x20,0x67,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x62,0x69,0x6c,0x6c,0x62,0x6f,0x61, @@ -236,7 +236,7 @@ fs_gbuffer_billboard_source_glsl430 := u8.[ vec3 _53 = gbuffer_billboard_vs_params[5].xyz - gbuffer_billboard_vs_params[7].xyz; _53.y = 0.0; vec3 look_dir = normalize(_53); - if (gbuffer_billboard_vs_params[12].x < (-10.0)) + if (gbuffer_billboard_vs_params[12].x > (-10.0)) { look_dir = gbuffer_billboard_vs_params[12].xyz; } @@ -273,7 +273,7 @@ vs_gbuffer_billboard_source_glsl300es := u8.[ 0x28,0x5f,0x35,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x67, 0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x62,0x69,0x6c,0x6c,0x62,0x6f,0x61,0x72,0x64, 0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x32,0x5d,0x2e,0x78, - 0x20,0x3c,0x20,0x28,0x2d,0x31,0x30,0x2e,0x30,0x29,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x3e,0x20,0x28,0x2d,0x31,0x30,0x2e,0x30,0x29,0x29,0x0a,0x20,0x20,0x20,0x20, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x6f,0x6f,0x6b,0x5f,0x64, 0x69,0x72,0x20,0x3d,0x20,0x67,0x62,0x75,0x66,0x66,0x65,0x72,0x5f,0x62,0x69,0x6c, 0x6c,0x62,0x6f,0x61,0x72,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, @@ -434,7 +434,7 @@ fs_gbuffer_billboard_source_glsl300es := u8.[ float3 _53 = _24.offset - _24.cam; _53.y = 0.0; float3 look_dir = fast::normalize(_53); - if (_24.faceDir.x < (-10.0)) + if (_24.faceDir.x > (-10.0)) { look_dir = _24.faceDir; } @@ -494,7 +494,7 @@ vs_gbuffer_billboard_source_metal_macos := u8.[ 0x6f,0x6f,0x6b,0x5f,0x64,0x69,0x72,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a, 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x33,0x29,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x2e,0x66,0x61,0x63,0x65, - 0x44,0x69,0x72,0x2e,0x78,0x20,0x3c,0x20,0x28,0x2d,0x31,0x30,0x2e,0x30,0x29,0x29, + 0x44,0x69,0x72,0x2e,0x78,0x20,0x3e,0x20,0x28,0x2d,0x31,0x30,0x2e,0x30,0x29,0x29, 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c, 0x6f,0x6f,0x6b,0x5f,0x64,0x69,0x72,0x20,0x3d,0x20,0x5f,0x32,0x34,0x2e,0x66,0x61, 0x63,0x65,0x44,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, diff --git a/src/shaders/jai/shader_post_process_main.jai b/src/shaders/jai/shader_post_process_main.jai index 0af8c0d..fa6ef9d 100644 --- a/src/shaders/jai/shader_post_process_main.jai +++ b/src/shaders/jai/shader_post_process_main.jai @@ -27,6 +27,16 @@ Sample type: .FLOAT Multisampled: false Bind slot: IMG_pptex => 0 + Image 'pos_buf': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_pos_buf => 4 + Image 'dof_tex': + Image type: ._2D + Sample type: .FLOAT + Multisampled: false + Bind slot: IMG_dof_tex => 3 Image 'bloom_tex': Image type: ._2D Sample type: .FLOAT @@ -40,6 +50,12 @@ Sampler 'ppsmp': Type: .FILTERING Bind slot: SMP_ppsmp => 0 + Sampler 'pos_smp': + Type: .FILTERING + Bind slot: SMP_pos_smp => 4 + Sampler 'dof_smp': + Type: .FILTERING + Bind slot: SMP_dof_smp => 3 Sampler 'bloom_smp': Type: .FILTERING Bind slot: SMP_bloom_smp => 2 @@ -52,9 +68,13 @@ ATTR_postprocess_uv :: 1; UB_post_process_config :: 0; UB_dof_config :: 1; IMG_pptex :: 0; +IMG_pos_buf :: 4; +IMG_dof_tex :: 3; IMG_bloom_tex :: 2; IMG_lut :: 1; SMP_ppsmp :: 0; +SMP_pos_smp :: 4; +SMP_dof_smp :: 3; SMP_bloom_smp :: 2; SMP_lut_linear :: 1; Post_Process_Config :: struct { @@ -76,12 +96,9 @@ Post_Process_Config :: struct { _: [4]u8; }; Dof_Config :: struct { - dof_min: float; dof_max: float; dof_point: float; - dof_tex_width: float; - dof_tex_height: float; - _: [12]u8; + _: [8]u8; }; /* #version 430 @@ -139,11 +156,13 @@ vs_pp_source_glsl430 := u8.[ uniform post_process_config _174; - uniform vec4 dof_config[2]; + uniform vec4 dof_config[1]; layout(binding = 16) uniform sampler2D pptex_ppsmp; - layout(binding = 17) uniform sampler2D bloom_tex_bloom_smp; - layout(binding = 18) uniform sampler2D lut_ppsmp; - layout(binding = 19) uniform sampler2D lut_lut_linear; + layout(binding = 17) uniform sampler2D pos_buf_pos_smp; + layout(binding = 18) uniform sampler2D dof_tex_dof_smp; + layout(binding = 19) uniform sampler2D bloom_tex_bloom_smp; + layout(binding = 20) uniform sampler2D lut_ppsmp; + layout(binding = 21) uniform sampler2D lut_lut_linear; layout(location = 0) in vec2 texcoord; layout(location = 0) out vec4 frag_color; @@ -210,26 +229,31 @@ vs_pp_source_glsl430 := u8.[ if (_174.chromatic_aberration_intensity > 0.00999999977648258209228515625) { vec2 _242 = vec2(_174.chromatic_aberration_intensity, 0.0); - sampled_color_hdr = vec3(texture(pptex_ppsmp, _184 + _242).x, texture(pptex_ppsmp, _184).y, texture(pptex_ppsmp, _184 - _242).z + (dof_config[0].x * 9.9999998245167004418121337039338e-15)); + sampled_color_hdr = vec3(texture(pptex_ppsmp, _184 + _242).x, texture(pptex_ppsmp, _184).y, texture(pptex_ppsmp, _184 - _242).z); } else { sampled_color_hdr = texture(pptex_ppsmp, _184).xyz; } - vec4 _292 = texture(bloom_tex_bloom_smp, _184); - vec3 _303 = (sampled_color_hdr + (_292.xyz * _174.bloom_amount)) * _174.exposure; + vec4 _284 = texture(pos_buf_pos_smp, _184); + vec4 _311 = texture(dof_tex_dof_smp, _184); + vec3 _313 = sampled_color_hdr; + vec3 _317 = mix(_313, _311.xyz, vec3(smoothstep(0.0, 1.0, abs(abs(_284.z) - dof_config[0].y) / max(dof_config[0].x, 9.9999997473787516355514526367188e-05)))); + sampled_color_hdr = _317; + vec4 _325 = texture(bloom_tex_bloom_smp, _184); + vec3 _336 = (_317 + (_325.xyz * _174.bloom_amount)) * _174.exposure; vec3 color_ldr_linear; if (_174.tonemap > 0.5) { - vec3 param = _303; + vec3 param = _336; color_ldr_linear = aces(param); } else { - color_ldr_linear = _303; + color_ldr_linear = _336; } - vec3 _323 = ((color_ldr_linear - vec3(0.5)) * max(_174.contrast, 0.0)) + vec3(0.5); - color_ldr_linear = clamp(mix(vec3(dot(_323, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _323, vec3(_174.saturation)), vec3(0.0), vec3(1.0)); + vec3 _356 = ((color_ldr_linear - vec3(0.5)) * max(_174.contrast, 0.0)) + vec3(0.5); + color_ldr_linear = clamp(mix(vec3(dot(_356, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _356, vec3(_174.saturation)), vec3(0.0), vec3(1.0)); if (_174.dither_intensity > 0.0) { vec2 param_1 = gl_FragCoord.xy; @@ -243,19 +267,19 @@ vs_pp_source_glsl430 := u8.[ } else { - float _416 = color_ldr_linear.z * 15.0; - float _419 = floor(_416); - float _430 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; - float _436 = color_ldr_linear.x * 15.0; - color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_419 * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, texture(lut_lut_linear, vec2((((min(_419 + 1.0, 15.0) * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, vec3(_416 - _419)); + float _449 = color_ldr_linear.z * 15.0; + float _452 = floor(_449); + float _463 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + float _469 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_452 * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, texture(lut_lut_linear, vec2((((min(_452 + 1.0, 15.0) * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, vec3(_449 - _452)); } } vec3 color_srgb = (pow(color_ldr_linear, vec3(1.0 / _174.gamma)) * (1.0 - (smoothstep(0.0, _174.vignette_radius, _167) * _174.vignette_intensity))) * (1.0 - (((sin(gl_FragCoord.y * _174.scanlines_density) * 0.5) + 0.5) * _174.scanlines_intensity)); vec2 param_2 = texcoord; - vec3 _526 = color_srgb; - vec3 _528 = _526 + vec3((rand(param_2) - 0.5) * _174.film_grain_intensity); - color_srgb = _528; - frag_color = vec4(clamp(_528, vec3(0.0), vec3(1.0)), 1.0); + vec3 _559 = color_srgb; + vec3 _561 = _559 + vec3((rand(param_2) - 0.5) * _174.film_grain_intensity); + color_srgb = _561; + frag_color = vec4(clamp(_561, vec3(0.0), vec3(1.0)), 1.0); } */ @@ -308,19 +332,26 @@ fs_pp_source_glsl430 := u8.[ 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,0x31,0x37,0x34, 0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20, - 0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x3b,0x0a,0x6c, + 0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,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,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,0x70,0x6f,0x73,0x5f,0x62,0x75, + 0x66,0x5f,0x70,0x6f,0x73,0x5f,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,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x5f,0x64,0x6f,0x66,0x5f,0x73,0x6d, + 0x70,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e, + 0x67,0x20,0x3d,0x20,0x31,0x39,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, 0x74,0x65,0x78,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,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, + 0x32,0x30,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,0x39,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61, + 0x3d,0x20,0x32,0x31,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, @@ -432,148 +463,164 @@ fs_pp_source_glsl430 := u8.[ 0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x2e,0x79, 0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f, 0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x20,0x2d,0x20,0x5f,0x32, - 0x34,0x32,0x29,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e, - 0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x2a,0x20,0x39,0x2e,0x39,0x39,0x39, - 0x39,0x39,0x39,0x38,0x32,0x34,0x35,0x31,0x36,0x37,0x30,0x30,0x34,0x34,0x31,0x38, - 0x31,0x32,0x31,0x33,0x33,0x37,0x30,0x33,0x39,0x33,0x33,0x38,0x65,0x2d,0x31,0x35, - 0x29,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,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68, - 0x64,0x72,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,0x31,0x38,0x34,0x29,0x2e, - 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x34,0x20,0x5f,0x32,0x39,0x32,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, - 0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78,0x5f,0x62,0x6c,0x6f, - 0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x28, - 0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64, - 0x72,0x20,0x2b,0x20,0x28,0x5f,0x32,0x39,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20, - 0x5f,0x31,0x37,0x34,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75,0x6e, - 0x74,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,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,0x31,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,0x76,0x65,0x63,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x33,0x30,0x33,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,0x33,0x30,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x32,0x33,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,0x31,0x37,0x34,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, + 0x34,0x32,0x29,0x2e,0x7a,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,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x5f,0x68,0x64,0x72,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,0x31, + 0x38,0x34,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x38,0x34,0x20,0x3d,0x20,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x6f,0x73,0x5f,0x62,0x75,0x66,0x5f,0x70, + 0x6f,0x73,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x5f,0x64, + 0x6f,0x66,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x31,0x33,0x20,0x3d,0x20,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x31,0x37,0x20, + 0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x33,0x31,0x33,0x2c,0x20,0x5f,0x33,0x31,0x31, + 0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74, + 0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20, + 0x61,0x62,0x73,0x28,0x61,0x62,0x73,0x28,0x5f,0x32,0x38,0x34,0x2e,0x7a,0x29,0x20, + 0x2d,0x20,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e, + 0x79,0x29,0x20,0x2f,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e, + 0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x78,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35, + 0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29, + 0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x5f,0x33,0x31, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x32,0x35, + 0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x74,0x65,0x78,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x5f,0x33,0x33,0x36,0x20,0x3d,0x20,0x28,0x5f,0x33,0x31,0x37,0x20,0x2b,0x20,0x28, + 0x5f,0x33,0x32,0x35,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75,0x6e,0x74,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x31,0x37,0x34,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,0x31,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,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, + 0x3d,0x20,0x5f,0x33,0x33,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, - 0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x64, - 0x6f,0x74,0x28,0x5f,0x33,0x32,0x33,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,0x33,0x32,0x33,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72,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,0x76,0x65, - 0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x67,0x6c,0x5f, - 0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,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,0x63,0x6c,0x61,0x6d,0x70,0x28,0x63, - 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20, - 0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x62,0x61,0x79,0x65,0x72,0x38,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x64, - 0x69,0x74,0x68,0x65,0x72,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, - 0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x31,0x34, - 0x33,0x36,0x30,0x34,0x32,0x37,0x38,0x35,0x36,0x34,0x34,0x35,0x33,0x31,0x32,0x35, - 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,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x34,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,0x31, - 0x37,0x34,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,0x34,0x31,0x36,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,0x34,0x31,0x39,0x20,0x3d, - 0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x31,0x36,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x5f,0x34,0x33,0x30,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,0x34,0x33,0x36,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,0x34,0x31,0x39, - 0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x34,0x33,0x36,0x29, - 0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39, - 0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x34,0x33,0x30,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,0x34,0x31,0x39,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,0x34,0x33,0x36,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a, - 0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x34,0x33, - 0x30,0x29,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x34, - 0x31,0x36,0x20,0x2d,0x20,0x5f,0x34,0x31,0x39,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,0x31,0x37,0x34,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,0x31,0x37,0x34, - 0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73, - 0x2c,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f,0x31,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,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72, - 0x64,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x31,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,0x31, - 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,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,0x35,0x32,0x36,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,0x35,0x32,0x38, - 0x20,0x3d,0x20,0x5f,0x35,0x32,0x36,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,0x5f,0x31,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,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67, - 0x62,0x20,0x3d,0x20,0x5f,0x35,0x32,0x38,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,0x35,0x32,0x38,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, + 0x5f,0x33,0x33,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x35,0x36,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,0x31,0x37,0x34,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,0x33, + 0x35,0x36,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,0x33,0x35,0x36,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37,0x34, + 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,0x31, + 0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72,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,0x76,0x65,0x63,0x32,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43, + 0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,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,0x63,0x6c,0x61,0x6d,0x70,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f, + 0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x33,0x28,0x28,0x62,0x61,0x79,0x65,0x72,0x38,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72, + 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e, + 0x30,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x31,0x34,0x33,0x36,0x30,0x34,0x32, + 0x37,0x38,0x35,0x36,0x34,0x34,0x35,0x33,0x31,0x32,0x35,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,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,0x34,0x34,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,0x34,0x35,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x5f,0x34,0x34,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x36,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,0x34,0x36,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,0x34,0x35,0x32,0x20,0x2a,0x20,0x31,0x36, + 0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x34,0x36,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,0x34,0x36,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,0x34,0x35,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,0x34,0x36, + 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,0x34,0x36,0x33,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x34,0x34,0x39,0x20,0x2d,0x20, + 0x5f,0x34,0x35,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,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x76,0x69,0x67,0x6e, + 0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x5f,0x31,0x36, + 0x37,0x29,0x20,0x2a,0x20,0x5f,0x31,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, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a, + 0x20,0x5f,0x31,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,0x31,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,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,0x35,0x35,0x39,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,0x35,0x36,0x31,0x20,0x3d,0x20,0x5f,0x35, + 0x35,0x39,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,0x5f,0x31,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,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x5f, + 0x35,0x36,0x31,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,0x35,0x36,0x31,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 @@ -631,8 +678,10 @@ vs_pp_source_glsl300es := u8.[ uniform post_process_config _174; - uniform highp vec4 dof_config[2]; + uniform highp vec4 dof_config[1]; uniform highp sampler2D pptex_ppsmp; + uniform highp sampler2D pos_buf_pos_smp; + uniform highp sampler2D dof_tex_dof_smp; uniform highp sampler2D bloom_tex_bloom_smp; uniform highp sampler2D lut_ppsmp; uniform highp sampler2D lut_lut_linear; @@ -702,26 +751,31 @@ vs_pp_source_glsl300es := u8.[ if (_174.chromatic_aberration_intensity > 0.00999999977648258209228515625) { highp vec2 _242 = vec2(_174.chromatic_aberration_intensity, 0.0); - sampled_color_hdr = vec3(texture(pptex_ppsmp, _184 + _242).x, texture(pptex_ppsmp, _184).y, texture(pptex_ppsmp, _184 - _242).z + (dof_config[0].x * 9.9999998245167004418121337039338e-15)); + sampled_color_hdr = vec3(texture(pptex_ppsmp, _184 + _242).x, texture(pptex_ppsmp, _184).y, texture(pptex_ppsmp, _184 - _242).z); } else { sampled_color_hdr = texture(pptex_ppsmp, _184).xyz; } - highp vec4 _292 = texture(bloom_tex_bloom_smp, _184); - highp vec3 _303 = (sampled_color_hdr + (_292.xyz * _174.bloom_amount)) * _174.exposure; + highp vec4 _284 = texture(pos_buf_pos_smp, _184); + highp vec4 _311 = texture(dof_tex_dof_smp, _184); + highp vec3 _313 = sampled_color_hdr; + highp vec3 _317 = mix(_313, _311.xyz, vec3(smoothstep(0.0, 1.0, abs(abs(_284.z) - dof_config[0].y) / max(dof_config[0].x, 9.9999997473787516355514526367188e-05)))); + sampled_color_hdr = _317; + highp vec4 _325 = texture(bloom_tex_bloom_smp, _184); + highp vec3 _336 = (_317 + (_325.xyz * _174.bloom_amount)) * _174.exposure; highp vec3 color_ldr_linear; if (_174.tonemap > 0.5) { - highp vec3 param = _303; + highp vec3 param = _336; color_ldr_linear = aces(param); } else { - color_ldr_linear = _303; + color_ldr_linear = _336; } - highp vec3 _323 = ((color_ldr_linear - vec3(0.5)) * max(_174.contrast, 0.0)) + vec3(0.5); - color_ldr_linear = clamp(mix(vec3(dot(_323, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _323, vec3(_174.saturation)), vec3(0.0), vec3(1.0)); + highp vec3 _356 = ((color_ldr_linear - vec3(0.5)) * max(_174.contrast, 0.0)) + vec3(0.5); + color_ldr_linear = clamp(mix(vec3(dot(_356, vec3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _356, vec3(_174.saturation)), vec3(0.0), vec3(1.0)); if (_174.dither_intensity > 0.0) { highp vec2 param_1 = gl_FragCoord.xy; @@ -735,19 +789,19 @@ vs_pp_source_glsl300es := u8.[ } else { - highp float _416 = color_ldr_linear.z * 15.0; - highp float _419 = floor(_416); - highp float _430 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; - highp float _436 = color_ldr_linear.x * 15.0; - color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_419 * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, texture(lut_lut_linear, vec2((((min(_419 + 1.0, 15.0) * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, vec3(_416 - _419)); + highp float _449 = color_ldr_linear.z * 15.0; + highp float _452 = floor(_449); + highp float _463 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + highp float _469 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(texture(lut_lut_linear, vec2((((_452 * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, texture(lut_lut_linear, vec2((((min(_452 + 1.0, 15.0) * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, vec3(_449 - _452)); } } highp vec3 color_srgb = (pow(color_ldr_linear, vec3(1.0 / _174.gamma)) * (1.0 - (smoothstep(0.0, _174.vignette_radius, _167) * _174.vignette_intensity))) * (1.0 - (((sin(gl_FragCoord.y * _174.scanlines_density) * 0.5) + 0.5) * _174.scanlines_intensity)); highp vec2 param_2 = texcoord; - highp vec3 _526 = color_srgb; - highp vec3 _528 = _526 + vec3((rand(param_2) - 0.5) * _174.film_grain_intensity); - color_srgb = _528; - frag_color = vec4(clamp(_528, vec3(0.0), vec3(1.0)), 1.0); + highp vec3 _559 = color_srgb; + highp vec3 _561 = _559 + vec3((rand(param_2) - 0.5) * _174.film_grain_intensity); + color_srgb = _561; + frag_color = vec4(clamp(_561, vec3(0.0), vec3(1.0)), 1.0); } */ @@ -809,277 +863,300 @@ fs_pp_source_glsl300es := u8.[ 0x74,0x5f,0x70,0x72,0x6f,0x63,0x65,0x73,0x73,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67, 0x20,0x5f,0x31,0x37,0x34,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x64,0x6f,0x66,0x5f,0x63, - 0x6f,0x6e,0x66,0x69,0x67,0x5b,0x32,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72, + 0x6f,0x6e,0x66,0x69,0x67,0x5b,0x31,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,0x75, 0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78, - 0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,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,0x62,0x61,0x79,0x65,0x72, - 0x38,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70,0x6f,0x73, - 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x32,0x20,0x5f,0x36, - 0x38,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x70,0x6f,0x73,0x29,0x20,0x25, - 0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x31,0x34, - 0x35,0x5b,0x5f,0x36,0x38,0x2e,0x78,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38,0x2e,0x79, - 0x20,0x2a,0x20,0x38,0x29,0x5d,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x35,0x36, - 0x32,0x35,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,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,0x31,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, - 0x31,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f,0x31,0x36, - 0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x32,0x20,0x5f,0x31,0x38,0x34,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x36,0x20, - 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a, - 0x20,0x5f,0x31,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,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x35,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x34,0x2e,0x62, - 0x61,0x72,0x72,0x65,0x6c,0x5f,0x64,0x69,0x73,0x74,0x6f,0x72,0x74,0x69,0x6f,0x6e, + 0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x70,0x6f,0x73,0x5f,0x62,0x75,0x66,0x5f,0x70, + 0x6f,0x73,0x5f,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, + 0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x5f,0x64,0x6f,0x66,0x5f,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74, + 0x65,0x78,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,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,0x62,0x61,0x79, + 0x65,0x72,0x38,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x70, + 0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x32,0x20, + 0x5f,0x36,0x38,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x70,0x6f,0x73,0x29, + 0x20,0x25,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f, + 0x31,0x34,0x35,0x5b,0x5f,0x36,0x38,0x2e,0x78,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38, + 0x2e,0x79,0x20,0x2a,0x20,0x38,0x29,0x5d,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31, + 0x35,0x36,0x32,0x35,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,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,0x31,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,0x31,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x5f, + 0x31,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x32,0x20,0x5f,0x31,0x38,0x34,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36, + 0x36,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x31,0x36,0x37, + 0x20,0x2a,0x20,0x5f,0x31,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,0x76,0x65,0x63,0x32,0x28,0x30,0x2e, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,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,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,0x31, + 0x39,0x32,0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x39,0x33,0x20,0x3d, + 0x20,0x5f,0x31,0x39,0x32,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x39, + 0x33,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,0x32,0x30,0x30,0x20,0x3d,0x20, + 0x5f,0x31,0x39,0x32,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,0x32,0x30,0x30,0x20,0x3d,0x20, + 0x5f,0x31,0x39,0x33,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,0x32,0x30, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21, + 0x5f,0x32,0x30,0x30,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,0x32,0x30,0x37, + 0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,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,0x32, + 0x30,0x37,0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,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,0x32,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x21,0x5f,0x32,0x30,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,0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,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,0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x37,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,0x32,0x31,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,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,0x33,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,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,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,0x31,0x39,0x32, - 0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x39,0x33,0x20,0x3d,0x20,0x5f, - 0x31,0x39,0x32,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x39,0x33,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,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31, - 0x39,0x32,0x20,0x3e,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38, + 0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,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,0x32,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x32,0x28,0x5f,0x31,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,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73, + 0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x20,0x2b,0x20,0x5f,0x32,0x34,0x32,0x29, + 0x2e,0x78,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65, + 0x78,0x5f,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x2e,0x79, + 0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f, + 0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x20,0x2d,0x20,0x5f,0x32, + 0x34,0x32,0x29,0x2e,0x7a,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,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x5f,0x68,0x64,0x72,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,0x31, + 0x38,0x34,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32, + 0x38,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x6f,0x73, + 0x5f,0x62,0x75,0x66,0x5f,0x70,0x6f,0x73,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31, + 0x38,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x34,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x5f,0x64,0x6f,0x66,0x5f,0x73, + 0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x31,0x33,0x20,0x3d, + 0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68, + 0x64,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x5f,0x33,0x31,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x33, + 0x31,0x33,0x2c,0x20,0x5f,0x33,0x31,0x31,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x61,0x62,0x73,0x28,0x61,0x62,0x73,0x28, + 0x5f,0x32,0x38,0x34,0x2e,0x7a,0x29,0x20,0x2d,0x20,0x64,0x6f,0x66,0x5f,0x63,0x6f, + 0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2f,0x20,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x5b,0x30,0x5d,0x2e,0x78, + 0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38, + 0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37, + 0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68, + 0x64,0x72,0x20,0x3d,0x20,0x5f,0x33,0x31,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x32,0x35,0x20,0x3d, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74, + 0x65,0x78,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31, + 0x38,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x5f,0x33,0x33,0x36,0x20,0x3d,0x20,0x28,0x5f,0x33,0x31,0x37, + 0x20,0x2b,0x20,0x28,0x5f,0x33,0x32,0x35,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f, + 0x31,0x37,0x34,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75,0x6e,0x74, + 0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,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,0x31,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,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, + 0x3d,0x20,0x5f,0x33,0x33,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,0x33,0x33,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,0x33,0x35,0x36,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,0x31,0x37,0x34,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,0x33,0x35,0x36,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,0x33,0x35,0x36,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72,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,0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64, + 0x2e,0x78,0x79,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, + 0x63,0x6c,0x61,0x6d,0x70,0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f, + 0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x62, + 0x61,0x79,0x65,0x72,0x38,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a, + 0x20,0x5f,0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72,0x5f,0x69,0x6e,0x74, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x36,0x36, + 0x36,0x36,0x36,0x37,0x30,0x31,0x34,0x33,0x36,0x30,0x34,0x32,0x37,0x38,0x35,0x36, + 0x34,0x34,0x35,0x33,0x31,0x32,0x35,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x31,0x37,0x34,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,0x31,0x37,0x34,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,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31, - 0x39,0x33,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,0x32,0x30,0x37,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x32, - 0x30,0x30,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,0x32,0x30,0x37,0x20,0x3d, - 0x20,0x5f,0x31,0x38,0x34,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,0x32,0x30,0x37, - 0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,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,0x32,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x28,0x21,0x5f,0x32,0x30,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, - 0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,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,0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x37,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,0x32,0x31,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, - 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,0x33,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65, - 0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x5f,0x31,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,0x20,0x3e,0x20,0x30,0x2e,0x30,0x30,0x39, - 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30, - 0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,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,0x32,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x32, - 0x28,0x5f,0x31,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, - 0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x74,0x65,0x78, - 0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70,0x73,0x6d,0x70, - 0x2c,0x20,0x5f,0x31,0x38,0x34,0x20,0x2b,0x20,0x5f,0x32,0x34,0x32,0x29,0x2e,0x78, - 0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f, - 0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x2e,0x79,0x2c,0x20, - 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x70,0x70,0x74,0x65,0x78,0x5f,0x70,0x70, - 0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x20,0x2d,0x20,0x5f,0x32,0x34,0x32, - 0x29,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69, - 0x67,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x2a,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39, - 0x39,0x38,0x32,0x34,0x35,0x31,0x36,0x37,0x30,0x30,0x34,0x34,0x31,0x38,0x31,0x32, - 0x31,0x33,0x33,0x37,0x30,0x33,0x39,0x33,0x33,0x38,0x65,0x2d,0x31,0x35,0x29,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,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72, - 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,0x31,0x38,0x34,0x29,0x2e,0x78,0x79, - 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x32,0x39,0x32,0x20,0x3d,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78, - 0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, - 0x33,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65, - 0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x20,0x2b,0x20,0x28,0x5f, - 0x32,0x39,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x62, - 0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75,0x6e,0x74,0x29,0x29,0x20,0x2a,0x20, - 0x5f,0x31,0x37,0x34,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,0x31,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,0x68,0x69,0x67,0x68,0x70,0x20, - 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x33,0x30, - 0x33,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,0x33,0x30,0x33,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x32,0x33,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,0x31,0x37,0x34,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, - 0x33,0x32,0x33,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,0x33,0x32,0x33,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x31,0x37, - 0x34,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, - 0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68,0x65,0x72,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, - 0x76,0x65,0x63,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x67, - 0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,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,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61, - 0x72,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x62,0x61,0x79,0x65,0x72,0x38, - 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34, - 0x2e,0x64,0x69,0x74,0x68,0x65,0x72,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, - 0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30, - 0x31,0x34,0x33,0x36,0x30,0x34,0x32,0x37,0x38,0x35,0x36,0x34,0x34,0x35,0x33,0x31, - 0x32,0x35,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, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,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,0x34, - 0x31,0x36,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,0x34,0x31,0x39,0x20,0x3d,0x20,0x66, - 0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x31,0x36,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,0x34,0x33,0x30,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,0x34,0x33,0x36,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,0x34,0x31,0x39,0x20,0x2a,0x20,0x31,0x36,0x2e, - 0x30,0x29,0x20,0x2b,0x20,0x5f,0x34,0x33,0x36,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35, - 0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20, - 0x5f,0x34,0x33,0x30,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,0x34,0x31,0x39,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,0x34,0x33,0x36, - 0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x33, - 0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x34,0x33,0x30,0x29,0x29,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x34,0x31,0x36,0x20,0x2d,0x20,0x5f, - 0x34,0x31,0x39,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,0x31,0x37,0x34,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,0x31,0x37,0x34, - 0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69,0x75,0x73, - 0x2c,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f,0x31,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,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72, - 0x64,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x31,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,0x31, - 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,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,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x32,0x36, - 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,0x35, - 0x32,0x38,0x20,0x3d,0x20,0x5f,0x35,0x32,0x36,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,0x5f,0x31,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,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73, - 0x72,0x67,0x62,0x20,0x3d,0x20,0x5f,0x35,0x32,0x38,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,0x35,0x32,0x38,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, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x34,0x34,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,0x34,0x35, + 0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x34,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,0x34,0x36,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,0x34,0x36,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,0x34,0x35,0x32,0x20, + 0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f,0x34,0x36,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,0x34,0x36,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,0x34,0x35,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,0x34,0x36,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,0x34,0x36,0x33, + 0x29,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x34,0x34, + 0x39,0x20,0x2d,0x20,0x5f,0x34,0x35,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,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72, + 0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f, + 0x31,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,0x67,0x6c,0x5f,0x46,0x72,0x61, + 0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x31,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,0x31,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,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,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, + 0x20,0x5f,0x35,0x35,0x39,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,0x35,0x36,0x31,0x20,0x3d,0x20,0x5f,0x35,0x35,0x39,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,0x5f,0x31, + 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,0x63,0x6f, + 0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d,0x20,0x5f,0x35,0x36,0x31,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,0x35,0x36, + 0x31,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 @@ -1206,11 +1283,8 @@ vs_pp_source_metal_macos := u8.[ struct dof_config { - float dof_min; float dof_max; float dof_point; - float dof_tex_width; - float dof_tex_height; }; constant spvUnsafeArray _145 = spvUnsafeArray({ 0, 32, 8, 40, 2, 34, 10, 42, 48, 16, 56, 24, 50, 18, 58, 26, 12, 44, 4, 36, 14, 46, 6, 38, 60, 28, 52, 20, 62, 30, 54, 22, 3, 35, 11, 43, 1, 33, 9, 41, 51, 19, 59, 27, 49, 17, 57, 25, 15, 47, 7, 39, 13, 45, 5, 37, 63, 31, 55, 23, 61, 29, 53, 21 }); @@ -1244,7 +1318,7 @@ 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& _174 [[buffer(0)]], constant dof_config& _271 [[buffer(1)]], texture2d pptex [[texture(0)]], texture2d bloom_tex [[texture(1)]], texture2d lut [[texture(2)]], sampler ppsmp [[sampler(0)]], sampler bloom_smp [[sampler(1)]], sampler lut_linear [[sampler(2)]], float4 gl_FragCoord [[position]]) + fragment main0_out main0(main0_in in [[stage_in]], constant post_process_config& _174 [[buffer(0)]], constant dof_config& _293 [[buffer(1)]], texture2d pptex [[texture(0)]], texture2d pos_buf [[texture(1)]], texture2d dof_tex [[texture(2)]], texture2d bloom_tex [[texture(3)]], texture2d lut [[texture(4)]], sampler ppsmp [[sampler(0)]], sampler pos_smp [[sampler(1)]], sampler dof_smp [[sampler(2)]], sampler bloom_smp [[sampler(3)]], sampler lut_linear [[sampler(4)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; float2 _166 = in.texcoord - float2(0.5); @@ -1291,26 +1365,31 @@ vs_pp_source_metal_macos := u8.[ if (_174.chromatic_aberration_intensity > 0.00999999977648258209228515625) { float2 _242 = float2(_174.chromatic_aberration_intensity, 0.0); - sampled_color_hdr = float3(pptex.sample(ppsmp, (_184 + _242)).x, pptex.sample(ppsmp, _184).y, pptex.sample(ppsmp, (_184 - _242)).z + (_271.dof_min * 9.9999998245167004418121337039338e-15)); + sampled_color_hdr = float3(pptex.sample(ppsmp, (_184 + _242)).x, pptex.sample(ppsmp, _184).y, pptex.sample(ppsmp, (_184 - _242)).z); } else { sampled_color_hdr = pptex.sample(ppsmp, _184).xyz; } - float4 _292 = bloom_tex.sample(bloom_smp, _184); - float3 _303 = (sampled_color_hdr + (_292.xyz * _174.bloom_amount)) * _174.exposure; + float4 _284 = pos_buf.sample(pos_smp, _184); + float4 _311 = dof_tex.sample(dof_smp, _184); + float3 _313 = sampled_color_hdr; + float3 _317 = mix(_313, _311.xyz, float3(smoothstep(0.0, 1.0, abs(abs(_284.z) - _293.dof_point) / fast::max(_293.dof_max, 9.9999997473787516355514526367188e-05)))); + sampled_color_hdr = _317; + float4 _325 = bloom_tex.sample(bloom_smp, _184); + float3 _336 = (_317 + (_325.xyz * _174.bloom_amount)) * _174.exposure; float3 color_ldr_linear; if (_174.tonemap > 0.5) { - float3 param = _303; + float3 param = _336; color_ldr_linear = aces(param); } else { - color_ldr_linear = _303; + color_ldr_linear = _336; } - float3 _323 = ((color_ldr_linear - float3(0.5)) * fast::max(_174.contrast, 0.0)) + float3(0.5); - color_ldr_linear = fast::clamp(mix(float3(dot(_323, float3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _323, float3(_174.saturation)), float3(0.0), float3(1.0)); + float3 _356 = ((color_ldr_linear - float3(0.5)) * fast::max(_174.contrast, 0.0)) + float3(0.5); + color_ldr_linear = fast::clamp(mix(float3(dot(_356, float3(0.2125000059604644775390625, 0.7153999805450439453125, 0.07209999859333038330078125))), _356, float3(_174.saturation)), float3(0.0), float3(1.0)); if (_174.dither_intensity > 0.0) { float2 param_1 = gl_FragCoord.xy; @@ -1324,19 +1403,19 @@ vs_pp_source_metal_macos := u8.[ } else { - float _416 = color_ldr_linear.z * 15.0; - float _419 = floor(_416); - float _430 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; - float _436 = color_ldr_linear.x * 15.0; - color_ldr_linear = mix(lut.sample(lut_linear, float2((((_419 * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, lut.sample(lut_linear, float2((((fast::min(_419 + 1.0, 15.0) * 16.0) + _436) + 0.5) * 0.00390625, _430)).xyz, float3(_416 - _419)); + float _449 = color_ldr_linear.z * 15.0; + float _452 = floor(_449); + float _463 = ((color_ldr_linear.y * 15.0) + 0.5) * 0.0625; + float _469 = color_ldr_linear.x * 15.0; + color_ldr_linear = mix(lut.sample(lut_linear, float2((((_452 * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, lut.sample(lut_linear, float2((((fast::min(_452 + 1.0, 15.0) * 16.0) + _469) + 0.5) * 0.00390625, _463)).xyz, float3(_449 - _452)); } } float3 color_srgb = (powr(color_ldr_linear, float3(1.0 / _174.gamma)) * (1.0 - (smoothstep(0.0, _174.vignette_radius, _167) * _174.vignette_intensity))) * (1.0 - (((sin(gl_FragCoord.y * _174.scanlines_density) * 0.5) + 0.5) * _174.scanlines_intensity)); float2 param_2 = in.texcoord; - float3 _526 = color_srgb; - float3 _528 = _526 + float3((rand(param_2) - 0.5) * _174.film_grain_intensity); - color_srgb = _528; - out.frag_color = float4(fast::clamp(_528, float3(0.0), float3(1.0)), 1.0); + float3 _559 = color_srgb; + float3 _561 = _559 + float3((rand(param_2) - 0.5) * _174.film_grain_intensity); + color_srgb = _561; + out.frag_color = float4(fast::clamp(_561, float3(0.0), float3(1.0)), 1.0); return out; } @@ -1434,333 +1513,354 @@ fs_pp_source_metal_macos := u8.[ 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, 0x61,0x6d,0x6f,0x75,0x6e,0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75, 0x63,0x74,0x20,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x0a,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66,0x5f,0x6d,0x69, - 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66, - 0x5f,0x6d,0x61,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x64,0x6f,0x66,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x5f,0x77,0x69,0x64, - 0x74,0x68,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f, - 0x66,0x5f,0x74,0x65,0x78,0x5f,0x68,0x65,0x69,0x67,0x68,0x74,0x3b,0x0a,0x7d,0x3b, - 0x0a,0x0a,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x73,0x70,0x76,0x55,0x6e, - 0x73,0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x3c,0x69,0x6e,0x74,0x2c,0x20,0x36, - 0x34,0x3e,0x20,0x5f,0x31,0x34,0x35,0x20,0x3d,0x20,0x73,0x70,0x76,0x55,0x6e,0x73, - 0x61,0x66,0x65,0x41,0x72,0x72,0x61,0x79,0x3c,0x69,0x6e,0x74,0x2c,0x20,0x36,0x34, - 0x3e,0x28,0x7b,0x20,0x30,0x2c,0x20,0x33,0x32,0x2c,0x20,0x38,0x2c,0x20,0x34,0x30, - 0x2c,0x20,0x32,0x2c,0x20,0x33,0x34,0x2c,0x20,0x31,0x30,0x2c,0x20,0x34,0x32,0x2c, - 0x20,0x34,0x38,0x2c,0x20,0x31,0x36,0x2c,0x20,0x35,0x36,0x2c,0x20,0x32,0x34,0x2c, - 0x20,0x35,0x30,0x2c,0x20,0x31,0x38,0x2c,0x20,0x35,0x38,0x2c,0x20,0x32,0x36,0x2c, - 0x20,0x31,0x32,0x2c,0x20,0x34,0x34,0x2c,0x20,0x34,0x2c,0x20,0x33,0x36,0x2c,0x20, - 0x31,0x34,0x2c,0x20,0x34,0x36,0x2c,0x20,0x36,0x2c,0x20,0x33,0x38,0x2c,0x20,0x36, - 0x30,0x2c,0x20,0x32,0x38,0x2c,0x20,0x35,0x32,0x2c,0x20,0x32,0x30,0x2c,0x20,0x36, - 0x32,0x2c,0x20,0x33,0x30,0x2c,0x20,0x35,0x34,0x2c,0x20,0x32,0x32,0x2c,0x20,0x33, - 0x2c,0x20,0x33,0x35,0x2c,0x20,0x31,0x31,0x2c,0x20,0x34,0x33,0x2c,0x20,0x31,0x2c, - 0x20,0x33,0x33,0x2c,0x20,0x39,0x2c,0x20,0x34,0x31,0x2c,0x20,0x35,0x31,0x2c,0x20, - 0x31,0x39,0x2c,0x20,0x35,0x39,0x2c,0x20,0x32,0x37,0x2c,0x20,0x34,0x39,0x2c,0x20, - 0x31,0x37,0x2c,0x20,0x35,0x37,0x2c,0x20,0x32,0x35,0x2c,0x20,0x31,0x35,0x2c,0x20, - 0x34,0x37,0x2c,0x20,0x37,0x2c,0x20,0x33,0x39,0x2c,0x20,0x31,0x33,0x2c,0x20,0x34, - 0x35,0x2c,0x20,0x35,0x2c,0x20,0x33,0x37,0x2c,0x20,0x36,0x33,0x2c,0x20,0x33,0x31, - 0x2c,0x20,0x35,0x35,0x2c,0x20,0x32,0x33,0x2c,0x20,0x36,0x31,0x2c,0x20,0x32,0x39, - 0x2c,0x20,0x35,0x33,0x2c,0x20,0x32,0x31,0x20,0x7d,0x29,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,0x62,0x61,0x79,0x65,0x72,0x38,0x28,0x74, - 0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x32,0x26,0x20,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x6e,0x74,0x32,0x20,0x5f,0x36,0x38,0x20,0x3d,0x20,0x69,0x6e,0x74,0x32,0x28,0x70, - 0x6f,0x73,0x29,0x20,0x25,0x20,0x69,0x6e,0x74,0x32,0x28,0x38,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74, - 0x28,0x5f,0x31,0x34,0x35,0x5b,0x5f,0x36,0x38,0x2e,0x78,0x20,0x2b,0x20,0x28,0x5f, - 0x36,0x38,0x2e,0x79,0x20,0x2a,0x20,0x38,0x29,0x5d,0x29,0x20,0x2a,0x20,0x30,0x2e, - 0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,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,0x31,0x37, - 0x34,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c, - 0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x64,0x6f,0x66,0x5f,0x63,0x6f, - 0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x32,0x37,0x31,0x20,0x5b,0x5b,0x62,0x75,0x66, - 0x66,0x65,0x72,0x28,0x31,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x28,0x31,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,0x32,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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70, - 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,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,0x32,0x29, - 0x5d,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72, - 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69, - 0x6f,0x6e,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,0x31,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,0x31,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65, - 0x6e,0x67,0x74,0x68,0x28,0x5f,0x31,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x31,0x38,0x34,0x20,0x3d,0x20,0x28,0x5f, - 0x31,0x36,0x36,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x31, - 0x36,0x37,0x20,0x2a,0x20,0x5f,0x31,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,0x31,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, - 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,0x31,0x39,0x32, - 0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x39,0x33,0x20,0x3d,0x20,0x5f, - 0x31,0x39,0x32,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x39,0x33,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,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31, - 0x39,0x32,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,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31, - 0x39,0x33,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,0x32,0x30,0x37,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x32, - 0x30,0x30,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,0x32,0x30,0x37,0x20,0x3d, - 0x20,0x5f,0x31,0x38,0x34,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,0x32,0x30,0x37, - 0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,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,0x32,0x31,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x28,0x21,0x5f,0x32,0x30,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, - 0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x31,0x38,0x34,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,0x32,0x31,0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x37,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,0x32,0x31,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, - 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,0x33,0x20, - 0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64, - 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,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,0x20,0x3e, - 0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34, - 0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x32,0x28,0x5f,0x31,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,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, - 0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x31,0x38,0x34,0x20,0x2b,0x20,0x5f, - 0x32,0x34,0x32,0x29,0x29,0x2e,0x78,0x2c,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38, - 0x34,0x29,0x2e,0x79,0x2c,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70, - 0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x31,0x38,0x34,0x20, - 0x2d,0x20,0x5f,0x32,0x34,0x32,0x29,0x29,0x2e,0x7a,0x20,0x2b,0x20,0x28,0x5f,0x32, - 0x37,0x31,0x2e,0x64,0x6f,0x66,0x5f,0x6d,0x69,0x6e,0x20,0x2a,0x20,0x39,0x2e,0x39, - 0x39,0x39,0x39,0x39,0x39,0x38,0x32,0x34,0x35,0x31,0x36,0x37,0x30,0x30,0x34,0x34, - 0x31,0x38,0x31,0x32,0x31,0x33,0x33,0x37,0x30,0x33,0x39,0x33,0x33,0x38,0x65,0x2d, - 0x31,0x35,0x29,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,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29, - 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x39,0x32,0x20,0x3d,0x20,0x62,0x6c, - 0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62, - 0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x30,0x33, - 0x20,0x3d,0x20,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x5f,0x68,0x64,0x72,0x20,0x2b,0x20,0x28,0x5f,0x32,0x39,0x32,0x2e,0x78,0x79, - 0x7a,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61, - 0x6d,0x6f,0x75,0x6e,0x74,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,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,0x31, - 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,0x20,0x3d,0x20,0x5f, - 0x33,0x30,0x33,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,0x33,0x30, - 0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x5f,0x33,0x32,0x33,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,0x31,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,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, - 0x33,0x32,0x33,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,0x33,0x32,0x33,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x64,0x69,0x74,0x68, - 0x65,0x72,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,0x32,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e, - 0x78,0x79,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,0x66, - 0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x63,0x6f,0x6c,0x6f,0x72, - 0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20,0x2b,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x28,0x28,0x62,0x61,0x79,0x65,0x72,0x38,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x64,0x69,0x74, - 0x68,0x65,0x72,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a, - 0x20,0x30,0x2e,0x30,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30,0x31,0x34,0x33,0x36, - 0x30,0x34,0x32,0x37,0x38,0x35,0x36,0x34,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x2c, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66,0x5f,0x6d,0x61, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x6f,0x66, + 0x5f,0x70,0x6f,0x69,0x6e,0x74,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x63,0x6f,0x6e,0x73, + 0x74,0x61,0x6e,0x74,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72, + 0x72,0x61,0x79,0x3c,0x69,0x6e,0x74,0x2c,0x20,0x36,0x34,0x3e,0x20,0x5f,0x31,0x34, + 0x35,0x20,0x3d,0x20,0x73,0x70,0x76,0x55,0x6e,0x73,0x61,0x66,0x65,0x41,0x72,0x72, + 0x61,0x79,0x3c,0x69,0x6e,0x74,0x2c,0x20,0x36,0x34,0x3e,0x28,0x7b,0x20,0x30,0x2c, + 0x20,0x33,0x32,0x2c,0x20,0x38,0x2c,0x20,0x34,0x30,0x2c,0x20,0x32,0x2c,0x20,0x33, + 0x34,0x2c,0x20,0x31,0x30,0x2c,0x20,0x34,0x32,0x2c,0x20,0x34,0x38,0x2c,0x20,0x31, + 0x36,0x2c,0x20,0x35,0x36,0x2c,0x20,0x32,0x34,0x2c,0x20,0x35,0x30,0x2c,0x20,0x31, + 0x38,0x2c,0x20,0x35,0x38,0x2c,0x20,0x32,0x36,0x2c,0x20,0x31,0x32,0x2c,0x20,0x34, + 0x34,0x2c,0x20,0x34,0x2c,0x20,0x33,0x36,0x2c,0x20,0x31,0x34,0x2c,0x20,0x34,0x36, + 0x2c,0x20,0x36,0x2c,0x20,0x33,0x38,0x2c,0x20,0x36,0x30,0x2c,0x20,0x32,0x38,0x2c, + 0x20,0x35,0x32,0x2c,0x20,0x32,0x30,0x2c,0x20,0x36,0x32,0x2c,0x20,0x33,0x30,0x2c, + 0x20,0x35,0x34,0x2c,0x20,0x32,0x32,0x2c,0x20,0x33,0x2c,0x20,0x33,0x35,0x2c,0x20, + 0x31,0x31,0x2c,0x20,0x34,0x33,0x2c,0x20,0x31,0x2c,0x20,0x33,0x33,0x2c,0x20,0x39, + 0x2c,0x20,0x34,0x31,0x2c,0x20,0x35,0x31,0x2c,0x20,0x31,0x39,0x2c,0x20,0x35,0x39, + 0x2c,0x20,0x32,0x37,0x2c,0x20,0x34,0x39,0x2c,0x20,0x31,0x37,0x2c,0x20,0x35,0x37, + 0x2c,0x20,0x32,0x35,0x2c,0x20,0x31,0x35,0x2c,0x20,0x34,0x37,0x2c,0x20,0x37,0x2c, + 0x20,0x33,0x39,0x2c,0x20,0x31,0x33,0x2c,0x20,0x34,0x35,0x2c,0x20,0x35,0x2c,0x20, + 0x33,0x37,0x2c,0x20,0x36,0x33,0x2c,0x20,0x33,0x31,0x2c,0x20,0x35,0x35,0x2c,0x20, + 0x32,0x33,0x2c,0x20,0x36,0x31,0x2c,0x20,0x32,0x39,0x2c,0x20,0x35,0x33,0x2c,0x20, + 0x32,0x31,0x20,0x7d,0x29,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,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,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, + 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,0x62,0x61,0x79,0x65,0x72,0x38,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x26,0x20,0x70,0x6f, + 0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x32,0x20,0x5f,0x36, + 0x38,0x20,0x3d,0x20,0x69,0x6e,0x74,0x32,0x28,0x70,0x6f,0x73,0x29,0x20,0x25,0x20, + 0x69,0x6e,0x74,0x32,0x28,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x31,0x34,0x35,0x5b, + 0x5f,0x36,0x38,0x2e,0x78,0x20,0x2b,0x20,0x28,0x5f,0x36,0x38,0x2e,0x79,0x20,0x2a, + 0x20,0x38,0x29,0x5d,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x35,0x36,0x32,0x35, + 0x29,0x20,0x2d,0x20,0x30,0x2e,0x35,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,0x31,0x37,0x34,0x20,0x5b,0x5b,0x62,0x75, + 0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74, + 0x61,0x6e,0x74,0x20,0x64,0x6f,0x66,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20, + 0x5f,0x32,0x39,0x33,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x31,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,0x70,0x6f,0x73,0x5f, + 0x62,0x75,0x66,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x31,0x29, + 0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c, + 0x6f,0x61,0x74,0x3e,0x20,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x32,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x62,0x6c, + 0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x33,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,0x34,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,0x70,0x6f,0x73,0x5f,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x20,0x64,0x6f,0x66,0x5f,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x72,0x20,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x33,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,0x34,0x29,0x5d,0x5d,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, + 0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x31,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,0x31,0x36,0x37,0x20,0x3d,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68, + 0x28,0x5f,0x31,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x31,0x38,0x34,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x36,0x20, + 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2b,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a, + 0x20,0x5f,0x31,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,0x31,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,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,0x31,0x39,0x32,0x20,0x3d,0x20,0x5f, + 0x31,0x38,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x6f,0x6f,0x6c,0x20,0x5f,0x31,0x39,0x33,0x20,0x3d,0x20,0x5f,0x31,0x39,0x32,0x20, + 0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x31,0x39,0x33,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,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31,0x39,0x32,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,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x31,0x36,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,0x34,0x31, - 0x39,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x31,0x36,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x5f,0x34,0x33,0x30,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,0x34,0x33,0x36,0x20,0x3d, + 0x20,0x20,0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x5f,0x31,0x39,0x33,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,0x32,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x32,0x30,0x30,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,0x32,0x30,0x37,0x20,0x3d,0x20,0x5f,0x31,0x38, + 0x34,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,0x32,0x30,0x37,0x20,0x3d,0x20,0x5f, + 0x32,0x30,0x30,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,0x32,0x31,0x34, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f, + 0x32,0x30,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,0x32,0x31,0x34,0x20, + 0x3d,0x20,0x5f,0x31,0x38,0x34,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,0x32,0x31, + 0x34,0x20,0x3d,0x20,0x5f,0x32,0x30,0x37,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,0x32,0x31,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,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,0x33,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,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,0x20,0x3e,0x20,0x30,0x2e,0x30, + 0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38, + 0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x32,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x5f,0x31,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, + 0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x70, + 0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d, + 0x70,0x2c,0x20,0x28,0x5f,0x31,0x38,0x34,0x20,0x2b,0x20,0x5f,0x32,0x34,0x32,0x29, + 0x29,0x2e,0x78,0x2c,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x2e,0x79, + 0x2c,0x20,0x70,0x70,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70, + 0x70,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x31,0x38,0x34,0x20,0x2d,0x20,0x5f,0x32, + 0x34,0x32,0x29,0x29,0x2e,0x7a,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,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x70,0x70,0x74,0x65,0x78,0x2e, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x70,0x70,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31, + 0x38,0x34,0x29,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x32,0x38,0x34,0x20,0x3d, + 0x20,0x70,0x6f,0x73,0x5f,0x62,0x75,0x66,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, + 0x70,0x6f,0x73,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x31,0x31,0x20, + 0x3d,0x20,0x64,0x6f,0x66,0x5f,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x28,0x64,0x6f,0x66,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x31,0x33, + 0x20,0x3d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x5f,0x68,0x64,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x5f,0x33,0x31,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x33,0x31,0x33, + 0x2c,0x20,0x5f,0x33,0x31,0x31,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x61,0x62,0x73,0x28,0x61,0x62,0x73,0x28, + 0x5f,0x32,0x38,0x34,0x2e,0x7a,0x29,0x20,0x2d,0x20,0x5f,0x32,0x39,0x33,0x2e,0x64, + 0x6f,0x66,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x29,0x20,0x2f,0x20,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x32,0x39,0x33,0x2e,0x64,0x6f,0x66,0x5f,0x6d, + 0x61,0x78,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33, + 0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33, + 0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x64,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x5f,0x68,0x64,0x72,0x20,0x3d,0x20,0x5f,0x33,0x31,0x37,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x32,0x35,0x20,0x3d,0x20,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x31,0x38,0x34,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x33, + 0x36,0x20,0x3d,0x20,0x28,0x5f,0x33,0x31,0x37,0x20,0x2b,0x20,0x28,0x5f,0x33,0x32, + 0x35,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34,0x2e,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75,0x6e,0x74,0x29,0x29,0x20,0x2a,0x20,0x5f,0x31, + 0x37,0x34,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,0x31,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, + 0x20,0x3d,0x20,0x5f,0x33,0x33,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,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,0x34,0x31,0x39,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x5f, - 0x34,0x33,0x36,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e, - 0x30,0x30,0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x34,0x33,0x30,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,0x34,0x31,0x39,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,0x34,0x33, - 0x36,0x29,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30, - 0x33,0x39,0x30,0x36,0x32,0x35,0x2c,0x20,0x5f,0x34,0x33,0x30,0x29,0x29,0x2e,0x78, - 0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x34,0x31,0x36,0x20, - 0x2d,0x20,0x5f,0x34,0x31,0x39,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,0x31,0x37,0x34,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,0x31, - 0x37,0x34,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f,0x72,0x61,0x64,0x69, - 0x75,0x73,0x2c,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x5f,0x31,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,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, - 0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x31,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,0x31,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,0x35,0x32,0x36,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,0x35,0x32,0x38,0x20,0x3d,0x20,0x5f,0x35, - 0x32,0x36,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,0x31,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,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72,0x67,0x62,0x20,0x3d, - 0x20,0x5f,0x35,0x32,0x38,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, - 0x35,0x32,0x38,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, + 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,0x33,0x33,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x35,0x36,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,0x31,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,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,0x33,0x35,0x36,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,0x33,0x35,0x36,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e, + 0x64,0x69,0x74,0x68,0x65,0x72,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,0x32,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, + 0x6f,0x72,0x64,0x2e,0x78,0x79,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,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x63, + 0x6f,0x6c,0x6f,0x72,0x5f,0x6c,0x64,0x72,0x5f,0x6c,0x69,0x6e,0x65,0x61,0x72,0x20, + 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x28,0x62,0x61,0x79,0x65,0x72,0x38, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x5f,0x31,0x37,0x34, + 0x2e,0x64,0x69,0x74,0x68,0x65,0x72,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, + 0x79,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x30, + 0x31,0x34,0x33,0x36,0x30,0x34,0x32,0x37,0x38,0x35,0x36,0x34,0x34,0x35,0x33,0x31, + 0x32,0x35,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,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31, + 0x37,0x34,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,0x31,0x37,0x34,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,0x34,0x34, + 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,0x34,0x35,0x32,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34, + 0x34,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x36,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,0x34, + 0x36,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,0x34,0x35,0x32,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29, + 0x20,0x2b,0x20,0x5f,0x34,0x36,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,0x34, + 0x36,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,0x34,0x35,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,0x34,0x36,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,0x34,0x36,0x33, + 0x29,0x29,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f, + 0x34,0x34,0x39,0x20,0x2d,0x20,0x5f,0x34,0x35,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,0x31,0x37,0x34,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,0x31,0x37,0x34,0x2e,0x76,0x69,0x67,0x6e,0x65,0x74,0x74,0x65,0x5f, + 0x72,0x61,0x64,0x69,0x75,0x73,0x2c,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20, + 0x5f,0x31,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,0x67,0x6c,0x5f,0x46,0x72, + 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x79,0x20,0x2a,0x20,0x5f,0x31,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,0x31,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,0x35,0x35, + 0x39,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,0x35,0x36,0x31,0x20, + 0x3d,0x20,0x5f,0x35,0x35,0x39,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,0x31,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,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x73,0x72, + 0x67,0x62,0x20,0x3d,0x20,0x5f,0x35,0x36,0x31,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,0x35,0x36,0x31,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; @@ -1825,9 +1925,9 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[0].glsl_uniforms[14].glsl_name = "_174.bloom_amount"; desc.uniform_blocks[1].stage = .FRAGMENT; desc.uniform_blocks[1].layout = .STD140; - desc.uniform_blocks[1].size = 32; + desc.uniform_blocks[1].size = 16; desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[1].glsl_uniforms[0].array_count = 2; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 1; desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "dof_config"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; @@ -1841,28 +1941,48 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.images[2].multisampled = false; desc.images[2].image_type = ._2D; desc.images[2].sample_type = .FLOAT; + desc.images[3].stage = .FRAGMENT; + desc.images[3].multisampled = false; + desc.images[3].image_type = ._2D; + desc.images[3].sample_type = .FLOAT; + desc.images[4].stage = .FRAGMENT; + desc.images[4].multisampled = false; + desc.images[4].image_type = ._2D; + desc.images[4].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.samplers[2].stage = .FRAGMENT; desc.samplers[2].sampler_type = .FILTERING; + desc.samplers[3].stage = .FRAGMENT; + desc.samplers[3].sampler_type = .FILTERING; + desc.samplers[4].stage = .FRAGMENT; + desc.samplers[4].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 = 2; - desc.image_sampler_pairs[1].sampler_slot = 2; - desc.image_sampler_pairs[1].glsl_name = "bloom_tex_bloom_smp"; + desc.image_sampler_pairs[1].image_slot = 4; + desc.image_sampler_pairs[1].sampler_slot = 4; + desc.image_sampler_pairs[1].glsl_name = "pos_buf_pos_smp"; desc.image_sampler_pairs[2].stage = .FRAGMENT; - desc.image_sampler_pairs[2].image_slot = 1; - desc.image_sampler_pairs[2].sampler_slot = 0; - desc.image_sampler_pairs[2].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[2].image_slot = 3; + desc.image_sampler_pairs[2].sampler_slot = 3; + desc.image_sampler_pairs[2].glsl_name = "dof_tex_dof_smp"; desc.image_sampler_pairs[3].stage = .FRAGMENT; - desc.image_sampler_pairs[3].image_slot = 1; - desc.image_sampler_pairs[3].sampler_slot = 1; - desc.image_sampler_pairs[3].glsl_name = "lut_lut_linear"; + desc.image_sampler_pairs[3].image_slot = 2; + desc.image_sampler_pairs[3].sampler_slot = 2; + desc.image_sampler_pairs[3].glsl_name = "bloom_tex_bloom_smp"; + desc.image_sampler_pairs[4].stage = .FRAGMENT; + desc.image_sampler_pairs[4].image_slot = 1; + desc.image_sampler_pairs[4].sampler_slot = 0; + desc.image_sampler_pairs[4].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[5].stage = .FRAGMENT; + desc.image_sampler_pairs[5].image_slot = 1; + desc.image_sampler_pairs[5].sampler_slot = 1; + desc.image_sampler_pairs[5].glsl_name = "lut_lut_linear"; case .GLES3; desc.vertex_func.source = xx *vs_pp_source_glsl300es; desc.vertex_func.entry = "main"; @@ -1922,9 +2042,9 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[0].glsl_uniforms[14].glsl_name = "_174.bloom_amount"; desc.uniform_blocks[1].stage = .FRAGMENT; desc.uniform_blocks[1].layout = .STD140; - desc.uniform_blocks[1].size = 32; + desc.uniform_blocks[1].size = 16; desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT4; - desc.uniform_blocks[1].glsl_uniforms[0].array_count = 2; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 1; desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "dof_config"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; @@ -1938,28 +2058,48 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.images[2].multisampled = false; desc.images[2].image_type = ._2D; desc.images[2].sample_type = .FLOAT; + desc.images[3].stage = .FRAGMENT; + desc.images[3].multisampled = false; + desc.images[3].image_type = ._2D; + desc.images[3].sample_type = .FLOAT; + desc.images[4].stage = .FRAGMENT; + desc.images[4].multisampled = false; + desc.images[4].image_type = ._2D; + desc.images[4].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.samplers[2].stage = .FRAGMENT; desc.samplers[2].sampler_type = .FILTERING; + desc.samplers[3].stage = .FRAGMENT; + desc.samplers[3].sampler_type = .FILTERING; + desc.samplers[4].stage = .FRAGMENT; + desc.samplers[4].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 = 2; - desc.image_sampler_pairs[1].sampler_slot = 2; - desc.image_sampler_pairs[1].glsl_name = "bloom_tex_bloom_smp"; + desc.image_sampler_pairs[1].image_slot = 4; + desc.image_sampler_pairs[1].sampler_slot = 4; + desc.image_sampler_pairs[1].glsl_name = "pos_buf_pos_smp"; desc.image_sampler_pairs[2].stage = .FRAGMENT; - desc.image_sampler_pairs[2].image_slot = 1; - desc.image_sampler_pairs[2].sampler_slot = 0; - desc.image_sampler_pairs[2].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[2].image_slot = 3; + desc.image_sampler_pairs[2].sampler_slot = 3; + desc.image_sampler_pairs[2].glsl_name = "dof_tex_dof_smp"; desc.image_sampler_pairs[3].stage = .FRAGMENT; - desc.image_sampler_pairs[3].image_slot = 1; - desc.image_sampler_pairs[3].sampler_slot = 1; - desc.image_sampler_pairs[3].glsl_name = "lut_lut_linear"; + desc.image_sampler_pairs[3].image_slot = 2; + desc.image_sampler_pairs[3].sampler_slot = 2; + desc.image_sampler_pairs[3].glsl_name = "bloom_tex_bloom_smp"; + desc.image_sampler_pairs[4].stage = .FRAGMENT; + desc.image_sampler_pairs[4].image_slot = 1; + desc.image_sampler_pairs[4].sampler_slot = 0; + desc.image_sampler_pairs[4].glsl_name = "lut_ppsmp"; + desc.image_sampler_pairs[5].stage = .FRAGMENT; + desc.image_sampler_pairs[5].image_slot = 1; + desc.image_sampler_pairs[5].sampler_slot = 1; + desc.image_sampler_pairs[5].glsl_name = "lut_lut_linear"; case .METAL_MACOS; desc.vertex_func.source = xx *vs_pp_source_metal_macos; desc.vertex_func.entry = "main0"; @@ -1973,7 +2113,7 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[0].msl_buffer_n = 0; desc.uniform_blocks[1].stage = .FRAGMENT; desc.uniform_blocks[1].layout = .STD140; - desc.uniform_blocks[1].size = 32; + desc.uniform_blocks[1].size = 16; desc.uniform_blocks[1].msl_buffer_n = 1; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; @@ -1984,33 +2124,55 @@ postprocess_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.images[1].multisampled = false; desc.images[1].image_type = ._2D; desc.images[1].sample_type = .FLOAT; - desc.images[1].msl_texture_n = 2; + desc.images[1].msl_texture_n = 4; desc.images[2].stage = .FRAGMENT; desc.images[2].multisampled = false; desc.images[2].image_type = ._2D; desc.images[2].sample_type = .FLOAT; - desc.images[2].msl_texture_n = 1; + desc.images[2].msl_texture_n = 3; + desc.images[3].stage = .FRAGMENT; + desc.images[3].multisampled = false; + desc.images[3].image_type = ._2D; + desc.images[3].sample_type = .FLOAT; + desc.images[3].msl_texture_n = 2; + desc.images[4].stage = .FRAGMENT; + desc.images[4].multisampled = false; + desc.images[4].image_type = ._2D; + desc.images[4].sample_type = .FLOAT; + desc.images[4].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 = 2; + desc.samplers[1].msl_sampler_n = 4; desc.samplers[2].stage = .FRAGMENT; desc.samplers[2].sampler_type = .FILTERING; - desc.samplers[2].msl_sampler_n = 1; + desc.samplers[2].msl_sampler_n = 3; + desc.samplers[3].stage = .FRAGMENT; + desc.samplers[3].sampler_type = .FILTERING; + desc.samplers[3].msl_sampler_n = 2; + desc.samplers[4].stage = .FRAGMENT; + desc.samplers[4].sampler_type = .FILTERING; + desc.samplers[4].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 = 2; - desc.image_sampler_pairs[1].sampler_slot = 2; + desc.image_sampler_pairs[1].image_slot = 4; + desc.image_sampler_pairs[1].sampler_slot = 4; desc.image_sampler_pairs[2].stage = .FRAGMENT; - desc.image_sampler_pairs[2].image_slot = 1; - desc.image_sampler_pairs[2].sampler_slot = 0; + desc.image_sampler_pairs[2].image_slot = 3; + desc.image_sampler_pairs[2].sampler_slot = 3; desc.image_sampler_pairs[3].stage = .FRAGMENT; - desc.image_sampler_pairs[3].image_slot = 1; - desc.image_sampler_pairs[3].sampler_slot = 1; + desc.image_sampler_pairs[3].image_slot = 2; + desc.image_sampler_pairs[3].sampler_slot = 2; + desc.image_sampler_pairs[4].stage = .FRAGMENT; + desc.image_sampler_pairs[4].image_slot = 1; + desc.image_sampler_pairs[4].sampler_slot = 0; + desc.image_sampler_pairs[5].stage = .FRAGMENT; + desc.image_sampler_pairs[5].image_slot = 1; + desc.image_sampler_pairs[5].sampler_slot = 1; } return desc; } diff --git a/src/shaders/jai/shader_sh_deferred.jai b/src/shaders/jai/shader_sh_deferred.jai index 6e2c97f..264fdef 100644 --- a/src/shaders/jai/shader_sh_deferred.jai +++ b/src/shaders/jai/shader_sh_deferred.jai @@ -93,7 +93,7 @@ vs_sh_deferred_source_glsl430 := u8.[ vec3 sh_eval(ivec3 probe, vec3 N) { int _35 = probe.x * 3; - int _45 = (probe.z * 64) + probe.y; + int _45 = (probe.z * 32) + probe.y; vec4 _65 = texelFetch(sh_chunk_sh_smp, ivec2(_35, _45), 0); vec4 _76 = texelFetch(sh_chunk_sh_smp, ivec2(_35 + 1, _45), 0); vec4 _87 = texelFetch(sh_chunk_sh_smp, ivec2(_35 + 2, _45), 0); @@ -103,7 +103,7 @@ vs_sh_deferred_source_glsl430 := u8.[ float sh_probe_energy(ivec3 probe) { int _176 = probe.x * 3; - int _183 = (probe.z * 64) + probe.y; + int _183 = (probe.z * 32) + probe.y; return max(0.88622701168060302734375 * ((texelFetch(sh_chunk_sh_smp, ivec2(_176, _183), 0).x + texelFetch(sh_chunk_sh_smp, ivec2(_176 + 1, _183), 0).x) + texelFetch(sh_chunk_sh_smp, ivec2(_176 + 2, _183), 0).x), 0.0); } @@ -196,10 +196,10 @@ vs_sh_deferred_source_glsl430 := u8.[ discard; } mat4 _442 = mat4(sh_deferred_params[0], sh_deferred_params[1], sh_deferred_params[2], sh_deferred_params[3]); - vec3 _466 = clamp((_404 - (sh_deferred_params[4].xyz - vec3(2.0))) * vec3(1.77777779102325439453125), vec3(0.0), vec3(63.0)); + vec3 _466 = clamp((_404 - (sh_deferred_params[4].xyz - vec3(2.0))) * vec3(0.888888895511627197265625), vec3(0.0), vec3(31.0)); ivec3 _470 = ivec3(floor(_466)); ivec3 param = _470; - ivec3 param_1 = min((_470 + ivec3(1)), ivec3(63)); + ivec3 param_1 = min((_470 + ivec3(1)), ivec3(31)); vec3 param_2 = fract(_466); vec3 param_3 = normalize(mat3(_442[0].xyz, _442[1].xyz, _442[2].xyz) * normalize(texture(gbuf_norm_sh_smp, quad_uv).xyz)); frag_color = vec4(sh_eval_trilinear(param, param_1, param_2, param_3), 1.0); @@ -231,7 +231,7 @@ fs_sh_deferred_source_glsl430 := u8.[ 0x20,0x4e,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, 0x35,0x20,0x3d,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x78,0x20,0x2a,0x20,0x33,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x28, - 0x70,0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x36,0x34,0x29,0x20,0x2b,0x20, + 0x70,0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x33,0x32,0x29,0x20,0x2b,0x20, 0x70,0x72,0x6f,0x62,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, 0x34,0x20,0x5f,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x65,0x6c,0x46,0x65,0x74, 0x63,0x68,0x28,0x73,0x68,0x5f,0x63,0x68,0x75,0x6e,0x6b,0x5f,0x73,0x68,0x5f,0x73, @@ -277,7 +277,7 @@ fs_sh_deferred_source_glsl430 := u8.[ 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x37,0x36,0x20, 0x3d,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x78,0x20,0x2a,0x20,0x33,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x28,0x70, - 0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x36,0x34,0x29,0x20,0x2b,0x20,0x70, + 0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x33,0x32,0x29,0x20,0x2b,0x20,0x70, 0x72,0x6f,0x62,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, 0x72,0x6e,0x20,0x6d,0x61,0x78,0x28,0x30,0x2e,0x38,0x38,0x36,0x32,0x32,0x37,0x30, 0x31,0x31,0x36,0x38,0x30,0x36,0x30,0x33,0x30,0x32,0x37,0x33,0x34,0x33,0x37,0x35, @@ -440,33 +440,33 @@ fs_sh_deferred_source_glsl430 := u8.[ 0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x5f,0x34,0x30,0x34,0x20,0x2d,0x20,0x28, 0x73,0x68,0x5f,0x64,0x65,0x66,0x65,0x72,0x72,0x65,0x64,0x5f,0x70,0x61,0x72,0x61, 0x6d,0x73,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x76,0x65,0x63,0x33, - 0x28,0x32,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x31, - 0x2e,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x39,0x31,0x30,0x32,0x33,0x32,0x35,0x34, - 0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, - 0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x36,0x33,0x2e,0x30,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x37, - 0x30,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28, - 0x5f,0x34,0x36,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x34,0x37,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28,0x28,0x5f,0x34,0x37,0x30,0x20,0x2b,0x20, - 0x69,0x76,0x65,0x63,0x33,0x28,0x31,0x29,0x29,0x2c,0x20,0x69,0x76,0x65,0x63,0x33, - 0x28,0x36,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28, - 0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x69,0x7a,0x65,0x28,0x6d,0x61,0x74,0x33,0x28,0x5f,0x34,0x34,0x32,0x5b,0x30,0x5d, - 0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x31,0x5d,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20, - 0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x74, - 0x75,0x72,0x65,0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x5f,0x73,0x68, - 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x75,0x76,0x29,0x2e,0x78, - 0x79,0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x68,0x5f,0x65, - 0x76,0x61,0x6c,0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70,0x61, - 0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c, - 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x28,0x32,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x39,0x35,0x35,0x31,0x31,0x36,0x32,0x37, + 0x31,0x39,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x33,0x31,0x2e,0x30, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x5f,0x34, + 0x37,0x30,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x66,0x6c,0x6f,0x6f,0x72, + 0x28,0x5f,0x34,0x36,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65, + 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x34,0x37,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28,0x28,0x5f,0x34,0x37,0x30,0x20,0x2b, + 0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x31,0x29,0x29,0x2c,0x20,0x69,0x76,0x65,0x63, + 0x33,0x28,0x33,0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74, + 0x28,0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x69,0x7a,0x65,0x28,0x6d,0x61,0x74,0x33,0x28,0x5f,0x34,0x34,0x32,0x5b,0x30, + 0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x31,0x5d,0x2e,0x78, + 0x79,0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29, + 0x20,0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x5f,0x73, + 0x68,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x75,0x76,0x29,0x2e, + 0x78,0x79,0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x68,0x5f, + 0x65,0x76,0x61,0x6c,0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #version 300 es @@ -512,7 +512,7 @@ vs_sh_deferred_source_glsl300es := u8.[ highp vec3 sh_eval(ivec3 probe, highp vec3 N) { int _35 = probe.x * 3; - int _45 = (probe.z * 64) + probe.y; + int _45 = (probe.z * 32) + probe.y; highp vec4 _65 = texelFetch(sh_chunk_sh_smp, ivec2(_35, _45), 0); highp vec4 _76 = texelFetch(sh_chunk_sh_smp, ivec2(_35 + 1, _45), 0); highp vec4 _87 = texelFetch(sh_chunk_sh_smp, ivec2(_35 + 2, _45), 0); @@ -522,7 +522,7 @@ vs_sh_deferred_source_glsl300es := u8.[ highp float sh_probe_energy(ivec3 probe) { int _176 = probe.x * 3; - int _183 = (probe.z * 64) + probe.y; + int _183 = (probe.z * 32) + probe.y; return max(0.88622701168060302734375 * ((texelFetch(sh_chunk_sh_smp, ivec2(_176, _183), 0).x + texelFetch(sh_chunk_sh_smp, ivec2(_176 + 1, _183), 0).x) + texelFetch(sh_chunk_sh_smp, ivec2(_176 + 2, _183), 0).x), 0.0); } @@ -615,10 +615,10 @@ vs_sh_deferred_source_glsl300es := u8.[ discard; } highp mat4 _442 = mat4(sh_deferred_params[0], sh_deferred_params[1], sh_deferred_params[2], sh_deferred_params[3]); - highp vec3 _466 = clamp((_404 - (sh_deferred_params[4].xyz - vec3(2.0))) * vec3(1.77777779102325439453125), vec3(0.0), vec3(63.0)); + highp vec3 _466 = clamp((_404 - (sh_deferred_params[4].xyz - vec3(2.0))) * vec3(0.888888895511627197265625), vec3(0.0), vec3(31.0)); ivec3 _470 = ivec3(floor(_466)); ivec3 param = _470; - ivec3 param_1 = min((_470 + ivec3(1)), ivec3(63)); + ivec3 param_1 = min((_470 + ivec3(1)), ivec3(31)); highp vec3 param_2 = fract(_466); highp vec3 param_3 = normalize(mat3(_442[0].xyz, _442[1].xyz, _442[2].xyz) * normalize(texture(gbuf_norm_sh_smp, quad_uv).xyz)); frag_color = vec4(sh_eval_trilinear(param, param_1, param_2, param_3), 1.0); @@ -651,7 +651,7 @@ fs_sh_deferred_source_glsl300es := u8.[ 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x35,0x20,0x3d, 0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x78,0x20,0x2a,0x20,0x33,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x28,0x70,0x72,0x6f, - 0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x36,0x34,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f, + 0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x33,0x32,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f, 0x62,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, 0x76,0x65,0x63,0x34,0x20,0x5f,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x65,0x6c, 0x46,0x65,0x74,0x63,0x68,0x28,0x73,0x68,0x5f,0x63,0x68,0x75,0x6e,0x6b,0x5f,0x73, @@ -698,7 +698,7 @@ fs_sh_deferred_source_glsl300es := u8.[ 0x72,0x6f,0x62,0x65,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, 0x5f,0x31,0x37,0x36,0x20,0x3d,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x78,0x20,0x2a, 0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x38,0x33, - 0x20,0x3d,0x20,0x28,0x70,0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x36,0x34, + 0x20,0x3d,0x20,0x28,0x70,0x72,0x6f,0x62,0x65,0x2e,0x7a,0x20,0x2a,0x20,0x33,0x32, 0x29,0x20,0x2b,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x78,0x28,0x30,0x2e,0x38,0x38, 0x36,0x32,0x32,0x37,0x30,0x31,0x31,0x36,0x38,0x30,0x36,0x30,0x33,0x30,0x32,0x37, @@ -869,33 +869,33 @@ fs_sh_deferred_source_glsl300es := u8.[ 0x28,0x73,0x68,0x5f,0x64,0x65,0x66,0x65,0x72,0x72,0x65,0x64,0x5f,0x70,0x61,0x72, 0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x76,0x65,0x63, 0x33,0x28,0x32,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28, - 0x31,0x2e,0x37,0x37,0x37,0x37,0x37,0x37,0x37,0x39,0x31,0x30,0x32,0x33,0x32,0x35, - 0x34,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x36,0x33,0x2e,0x30, - 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x5f,0x34, - 0x37,0x30,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x66,0x6c,0x6f,0x6f,0x72, - 0x28,0x5f,0x34,0x36,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65, - 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x34,0x37,0x30,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28,0x28,0x5f,0x34,0x37,0x30,0x20,0x2b, - 0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x31,0x29,0x29,0x2c,0x20,0x69,0x76,0x65,0x63, - 0x33,0x28,0x36,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, - 0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x6d,0x61,0x74,0x33,0x28,0x5f,0x34,0x34,0x32,0x5b,0x30,0x5d,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20, - 0x5f,0x34,0x34,0x32,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65, - 0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x5f,0x73,0x68,0x5f,0x73,0x6d, - 0x70,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x75,0x76,0x29,0x2e,0x78,0x79,0x7a,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x68,0x5f,0x65,0x76,0x61,0x6c, - 0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70,0x61,0x72,0x61,0x6d, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c,0x20,0x31,0x2e, - 0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x30,0x2e,0x38,0x38,0x38,0x38,0x38,0x38,0x38,0x39,0x35,0x35,0x31,0x31,0x36,0x32, + 0x37,0x31,0x39,0x37,0x32,0x36,0x35,0x36,0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x33,0x31,0x2e, + 0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x5f, + 0x34,0x37,0x30,0x20,0x3d,0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x66,0x6c,0x6f,0x6f, + 0x72,0x28,0x5f,0x34,0x36,0x36,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76, + 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x34,0x37,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28,0x28,0x5f,0x34,0x37,0x30,0x20, + 0x2b,0x20,0x69,0x76,0x65,0x63,0x33,0x28,0x31,0x29,0x29,0x2c,0x20,0x69,0x76,0x65, + 0x63,0x33,0x28,0x33,0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20, + 0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, + 0x65,0x28,0x6d,0x61,0x74,0x33,0x28,0x5f,0x34,0x34,0x32,0x5b,0x30,0x5d,0x2e,0x78, + 0x79,0x7a,0x2c,0x20,0x5f,0x34,0x34,0x32,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c, + 0x20,0x5f,0x34,0x34,0x32,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20, + 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x5f,0x73,0x68,0x5f,0x73, + 0x6d,0x70,0x2c,0x20,0x71,0x75,0x61,0x64,0x5f,0x75,0x76,0x29,0x2e,0x78,0x79,0x7a, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x73,0x68,0x5f,0x65,0x76,0x61, + 0x6c,0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c,0x20,0x31, + 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #include @@ -1022,7 +1022,7 @@ vs_sh_deferred_source_metal_macos := u8.[ float3 sh_eval(thread const int3& probe, thread const float3& N, texture2d sh_chunk, sampler sh_smp) { int _35 = probe.x * 3; - int _45 = (probe.z * 64) + probe.y; + int _45 = (probe.z * 32) + probe.y; float4 _65 = sh_chunk.read(uint2(int2(_35, _45)), 0); float4 _76 = sh_chunk.read(uint2(int2(_35 + 1, _45)), 0); float4 _87 = sh_chunk.read(uint2(int2(_35 + 2, _45)), 0); @@ -1033,7 +1033,7 @@ vs_sh_deferred_source_metal_macos := u8.[ float sh_probe_energy(thread const int3& probe, texture2d sh_chunk, sampler sh_smp) { int _176 = probe.x * 3; - int _183 = (probe.z * 64) + probe.y; + int _183 = (probe.z * 32) + probe.y; return fast::max(0.88622701168060302734375 * ((sh_chunk.read(uint2(int2(_176, _183)), 0).x + sh_chunk.read(uint2(int2(_176 + 1, _183)), 0).x) + sh_chunk.read(uint2(int2(_176 + 2, _183)), 0).x), 0.0); } @@ -1130,10 +1130,10 @@ vs_sh_deferred_source_metal_macos := u8.[ { discard_fragment(); } - float3 _466 = fast::clamp((_404 - (_359.chunk_origin.xyz - float3(2.0))) * float3(1.77777779102325439453125), float3(0.0), float3(63.0)); + float3 _466 = fast::clamp((_404 - (_359.chunk_origin.xyz - float3(2.0))) * float3(0.888888895511627197265625), float3(0.0), float3(31.0)); int3 _470 = int3(floor(_466)); int3 param = _470; - int3 param_1 = min((_470 + int3(1)), int3(63)); + int3 param_1 = min((_470 + int3(1)), int3(31)); float3 param_2 = fract(_466); float3 param_3 = fast::normalize(float3x3(_359.inv_view[0].xyz, _359.inv_view[1].xyz, _359.inv_view[2].xyz) * fast::normalize(gbuf_norm.sample(sh_smp, in.quad_uv).xyz)); out.frag_color = float4(sh_eval_trilinear(param, param_1, param_2, param_3, sh_chunk, sh_smp, _359), 1.0); @@ -1232,7 +1232,7 @@ fs_sh_deferred_source_metal_macos := u8.[ 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x35,0x20,0x3d,0x20,0x70, 0x72,0x6f,0x62,0x65,0x2e,0x78,0x20,0x2a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x69,0x6e,0x74,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x28,0x70,0x72,0x6f,0x62,0x65, - 0x2e,0x7a,0x20,0x2a,0x20,0x36,0x34,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f,0x62,0x65, + 0x2e,0x7a,0x20,0x2a,0x20,0x33,0x32,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f,0x62,0x65, 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f, 0x36,0x35,0x20,0x3d,0x20,0x73,0x68,0x5f,0x63,0x68,0x75,0x6e,0x6b,0x2e,0x72,0x65, 0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x5f,0x33, @@ -1284,7 +1284,7 @@ fs_sh_deferred_source_metal_macos := u8.[ 0x20,0x69,0x6e,0x74,0x20,0x5f,0x31,0x37,0x36,0x20,0x3d,0x20,0x70,0x72,0x6f,0x62, 0x65,0x2e,0x78,0x20,0x2a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74, 0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x28,0x70,0x72,0x6f,0x62,0x65,0x2e,0x7a, - 0x20,0x2a,0x20,0x36,0x34,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x79, + 0x20,0x2a,0x20,0x33,0x32,0x29,0x20,0x2b,0x20,0x70,0x72,0x6f,0x62,0x65,0x2e,0x79, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x61,0x73, 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x30,0x2e,0x38,0x38,0x36,0x32,0x32,0x37,0x30, 0x31,0x31,0x36,0x38,0x30,0x36,0x30,0x33,0x30,0x32,0x37,0x33,0x34,0x33,0x37,0x35, @@ -1485,39 +1485,39 @@ fs_sh_deferred_source_metal_macos := u8.[ 0x5f,0x34,0x30,0x34,0x20,0x2d,0x20,0x28,0x5f,0x33,0x35,0x39,0x2e,0x63,0x68,0x75, 0x6e,0x6b,0x5f,0x6f,0x72,0x69,0x67,0x69,0x6e,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x32,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x37,0x37,0x37,0x37,0x37,0x37,0x37, - 0x39,0x31,0x30,0x32,0x33,0x32,0x35,0x34,0x33,0x39,0x34,0x35,0x33,0x31,0x32,0x35, - 0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x36,0x33,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x69,0x6e,0x74,0x33,0x20,0x5f,0x34,0x37,0x30,0x20,0x3d,0x20,0x69, - 0x6e,0x74,0x33,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x36,0x36,0x29,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x20,0x3d,0x20,0x5f,0x34,0x37,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28, - 0x28,0x5f,0x34,0x37,0x30,0x20,0x2b,0x20,0x69,0x6e,0x74,0x33,0x28,0x31,0x29,0x29, - 0x2c,0x20,0x69,0x6e,0x74,0x33,0x28,0x36,0x33,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20, - 0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x33,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x69,0x7a,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x5f,0x33,0x35, - 0x39,0x2e,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5b,0x30,0x5d,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x5f,0x33,0x35,0x39,0x2e,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77, - 0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x35,0x39,0x2e,0x69,0x6e, - 0x76,0x5f,0x76,0x69,0x65,0x77,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a, - 0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x2e,0x73,0x61,0x6d,0x70,0x6c, - 0x65,0x28,0x73,0x68,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x71,0x75,0x61, - 0x64,0x5f,0x75,0x76,0x29,0x2e,0x78,0x79,0x7a,0x29,0x29,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,0x73,0x68,0x5f,0x65,0x76,0x61,0x6c, - 0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70,0x61,0x72,0x61,0x6d, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x73,0x68,0x5f, - 0x63,0x68,0x75,0x6e,0x6b,0x2c,0x20,0x73,0x68,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f, - 0x33,0x35,0x39,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, - + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x38,0x38,0x38,0x38,0x38,0x38,0x38, + 0x39,0x35,0x35,0x31,0x31,0x36,0x32,0x37,0x31,0x39,0x37,0x32,0x36,0x35,0x36,0x32, + 0x35,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x33,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x33,0x20,0x5f,0x34,0x37,0x30,0x20,0x3d,0x20, + 0x69,0x6e,0x74,0x33,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x5f,0x34,0x36,0x36,0x29, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x5f,0x34,0x37,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e, + 0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x6d,0x69,0x6e, + 0x28,0x28,0x5f,0x34,0x37,0x30,0x20,0x2b,0x20,0x69,0x6e,0x74,0x33,0x28,0x31,0x29, + 0x29,0x2c,0x20,0x69,0x6e,0x74,0x33,0x28,0x33,0x31,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, + 0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x5f,0x34,0x36,0x36,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x69,0x7a,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x5f,0x33, + 0x35,0x39,0x2e,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5b,0x30,0x5d,0x2e,0x78, + 0x79,0x7a,0x2c,0x20,0x5f,0x33,0x35,0x39,0x2e,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65, + 0x77,0x5b,0x31,0x5d,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x5f,0x33,0x35,0x39,0x2e,0x69, + 0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5b,0x32,0x5d,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, + 0x65,0x28,0x67,0x62,0x75,0x66,0x5f,0x6e,0x6f,0x72,0x6d,0x2e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x73,0x68,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x6e,0x2e,0x71,0x75, + 0x61,0x64,0x5f,0x75,0x76,0x29,0x2e,0x78,0x79,0x7a,0x29,0x29,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,0x73,0x68,0x5f,0x65,0x76,0x61, + 0x6c,0x5f,0x74,0x72,0x69,0x6c,0x69,0x6e,0x65,0x61,0x72,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x73,0x68, + 0x5f,0x63,0x68,0x75,0x6e,0x6b,0x2c,0x20,0x73,0x68,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x33,0x35,0x39,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, ]; sh_deferred_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc: sg_shader_desc; diff --git a/src/shaders/jai/shader_trile.jai b/src/shaders/jai/shader_trile.jai index 88887fc..a107333 100644 --- a/src/shaders/jai/shader_trile.jai +++ b/src/shaders/jai/shader_trile.jai @@ -123,6 +123,9 @@ Trile_Fs_Params :: struct { is_preview: s32; indirect_tint: [3]float; sh_enabled: s32; + fog_start: float; + fog_end: float; + _: [8]u8; }; /* #version 430 @@ -440,6 +443,8 @@ vs_trile_source_glsl430 := u8.[ int is_preview; vec3 indirect_tint; int sh_enabled; + float fog_start; + float fog_end; }; uniform trile_fs_params _254; @@ -621,9 +626,9 @@ vs_trile_source_glsl430 := u8.[ vec4 _552 = _254.mvp_shadow * vec4(floor(vpos * 16.0) * vec3(0.0625), 1.0); vec3 _563 = ((_552.xyz / vec3(_552.w)) * 0.5) + vec3(0.5); float _567 = _563.z - 0.001000000047497451305389404296875; - vec3 _832 = _563; - _832.z = _567; - vec3 light = ((((((((vec3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * vec3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_832.xy, _567))) * _490) * _55.sunLightColor) * _55.sunIntensity; + vec3 _852 = _563; + _852.z = _567; + vec3 light = ((((((((vec3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * vec3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_852.xy, _567))) * _490) * _55.sunLightColor) * _55.sunIntensity; vec2 _629 = gl_FragCoord.xy / vec2(float(_254.screen_w), float(_254.screen_h)); vec4 _630 = texture(ssaotex_linsmp, _629); float param_9 = _495; @@ -650,24 +655,24 @@ vs_trile_source_glsl430 := u8.[ vec3 _748 = light; vec3 _749 = _748 + (((((((vec3(1.0) - _646) * (1.0 - metallic)) * indirectDiff) * vec3(0.3183098733425140380859375)) * trixel_material.xyz) * _630.x) * _254.indirect_diff_scale); light = _749; - frag_color = vec4(mix(_55.deepColor, _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), vec3(smoothstep(0.0, _55.planeHeight, vpos.y))), 1.0); + frag_color = vec4(mix(mix(_55.deepColor, _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), vec3(smoothstep(0.0, _55.planeHeight, vpos.y))), _55.skyBase, vec3(smoothstep(_254.fog_start, _254.fog_end, length(vpos - cam)))), 1.0); if (_254.is_preview == 1) { - vec4 _775 = frag_color; - vec3 _779 = mix(_775.xyz, vec3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), vec3(0.5)); - frag_color.x = _779.x; - frag_color.y = _779.y; - frag_color.z = _779.z; + vec4 _795 = frag_color; + vec3 _799 = mix(_795.xyz, vec3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), vec3(0.5)); + frag_color.x = _799.x; + frag_color.y = _799.y; + frag_color.z = _799.z; } else { if (_254.is_preview == 2) { - vec4 _793 = frag_color; - vec3 _797 = mix(_793.xyz, vec3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), vec3(0.5)); - frag_color.x = _797.x; - frag_color.y = _797.y; - frag_color.z = _797.z; + vec4 _813 = frag_color; + vec3 _817 = mix(_813.xyz, vec3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), vec3(0.5)); + frag_color.x = _817.x; + frag_color.y = _817.y; + frag_color.z = _817.z; } } } @@ -719,508 +724,516 @@ fs_trile_source_glsl430 := u8.[ 0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, 0x33,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62, - 0x6c,0x65,0x64,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, - 0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, - 0x20,0x5f,0x32,0x35,0x34,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,0x74, - 0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x5f,0x74,0x72,0x69,0x6c,0x65,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,0x53,0x68,0x61,0x64,0x6f,0x77,0x20,0x73, - 0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,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,0x73,0x73,0x61,0x6f,0x74, - 0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, - 0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x31,0x39,0x29,0x20, - 0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32, - 0x44,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x73,0x6d, + 0x6c,0x65,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66, + 0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,0x3b,0x0a,0x7d,0x3b,0x0a, + 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x66, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x32,0x35,0x34,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,0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x5f, + 0x74,0x72,0x69,0x6c,0x65,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, + 0x53,0x68,0x61,0x64,0x6f,0x77,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78, + 0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,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,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73,0x6d, 0x70,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e, - 0x67,0x20,0x3d,0x20,0x32,0x30,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, - 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x73,0x68,0x5f,0x69,0x72,0x72, - 0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a, - 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, - 0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x70, - 0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74, - 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33, - 0x20,0x69,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f, - 0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x35,0x29,0x20,0x69,0x6e,0x20,0x76, - 0x65,0x63,0x33,0x20,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,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,0x33,0x20,0x74,0x6f, - 0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, - 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e, - 0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x6c, + 0x67,0x20,0x3d,0x20,0x31,0x39,0x29,0x20,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c, + 0x75,0x74,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x62,0x69,0x6e,0x64,0x69,0x6e,0x67,0x20,0x3d,0x20,0x32,0x30,0x29,0x20, + 0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x32, + 0x44,0x20,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f, + 0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28, + 0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e, + 0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f, + 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29, + 0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x69,0x70,0x6f,0x73,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,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,0x33,0x20,0x63,0x61,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, - 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x36,0x29,0x20, - 0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x63,0x76,0x3b,0x0a,0x0a,0x76,0x65,0x63, - 0x33,0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b, - 0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c, - 0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x76,0x65, - 0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20, - 0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20, - 0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f, - 0x6e,0x47,0x47,0x58,0x28,0x76,0x65,0x63,0x33,0x20,0x4e,0x2c,0x20,0x76,0x65,0x63, - 0x33,0x20,0x48,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68, - 0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x31,0x33,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d, - 0x20,0x5f,0x31,0x33,0x38,0x20,0x2a,0x20,0x5f,0x31,0x33,0x38,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x6d, - 0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x48,0x29,0x2c,0x20,0x30,0x2e, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, - 0x35,0x35,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x34,0x37,0x20,0x2a,0x20,0x5f,0x31, - 0x34,0x37,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2d,0x20,0x31,0x2e, - 0x30,0x29,0x29,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x34,0x32,0x20,0x2f,0x20,0x28,0x28,0x33, - 0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32,0x35,0x37,0x33, - 0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20, - 0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28, - 0x76,0x65,0x63,0x33,0x20,0x4e,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x56,0x2c,0x20, - 0x76,0x65,0x63,0x33,0x20,0x4c,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f, - 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36,0x37,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67, - 0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x33,0x20,0x3d,0x20,0x28,0x5f, - 0x31,0x36,0x37,0x20,0x2a,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e, - 0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, - 0x31,0x37,0x38,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c, - 0x20,0x56,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28, - 0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x4c,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x38,0x20, - 0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x33,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x5f,0x31,0x38,0x33,0x20,0x2f, - 0x20,0x28,0x28,0x5f,0x31,0x38,0x33,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20, - 0x2b,0x20,0x5f,0x31,0x37,0x33,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x37,0x38, - 0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x37,0x38,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38, - 0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76, - 0x65,0x63,0x33,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69, - 0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x20,0x46,0x30,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68, - 0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x6d,0x61,0x78,0x28,0x76,0x65, - 0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x29,0x2c,0x20,0x46,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a, - 0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d, - 0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, - 0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x28,0x76,0x65,0x63,0x33,0x20,0x73,0x6b, - 0x79,0x70,0x6f,0x73,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x6e,0x70,0x6f, - 0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34, - 0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b, - 0x79,0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x34,0x35,0x2c,0x20, - 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x75,0x6e,0x70,0x6f,0x73, - 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36, - 0x36,0x20,0x3d,0x20,0x5f,0x34,0x35,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78, - 0x28,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x5f,0x35, - 0x35,0x2e,0x73,0x6b,0x79,0x54,0x6f,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63, - 0x6c,0x61,0x6d,0x70,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20, - 0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38, - 0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29, - 0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x48,0x61, - 0x6c,0x6f,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x5f,0x35,0x30,0x20, - 0x2d,0x20,0x30,0x2e,0x39,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39, - 0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20, - 0x31,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x38,0x30,0x30, - 0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30, - 0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x30,0x30,0x30, - 0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36, - 0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x5f,0x35,0x30,0x20,0x3e,0x20,0x30,0x2e,0x39,0x39,0x39,0x38,0x39,0x39,0x39, - 0x38,0x33,0x34,0x30,0x36,0x30,0x36,0x36,0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e, - 0x44,0x69,0x73,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x35,0x20,0x3d,0x20,0x72,0x65,0x73,0x75, - 0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31, - 0x36,0x20,0x3d,0x20,0x5f,0x31,0x31,0x35,0x20,0x2b,0x20,0x28,0x6d,0x69,0x78,0x28, - 0x5f,0x35,0x35,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c, - 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x36,0x36,0x29,0x20, - 0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30, - 0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35, - 0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74, - 0x20,0x3d,0x20,0x5f,0x31,0x31,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x5f,0x31,0x31,0x36,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63, - 0x33,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x69,0x6e, - 0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x52,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69, - 0x66,0x20,0x28,0x52,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20, - 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, - 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x73,0x75, - 0x6e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61, - 0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, - 0x5f,0x32,0x34,0x37,0x20,0x3d,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20, - 0x28,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74, - 0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37, - 0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36, - 0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32, - 0x35,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x37, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72, - 0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x32,0x35, - 0x39,0x20,0x3d,0x20,0x5f,0x32,0x34,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x39,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63, - 0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x3d, - 0x20,0x69,0x70,0x6f,0x73,0x20,0x2d,0x20,0x28,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f, - 0x72,0x6d,0x61,0x6c,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39, - 0x39,0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37, - 0x30,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, - 0x20,0x5f,0x32,0x37,0x35,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f, - 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20, - 0x5f,0x32,0x37,0x35,0x20,0x3f,0x20,0x31,0x20,0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61, - 0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20, - 0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20, - 0x5f,0x32,0x37,0x36,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33, - 0x32,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x65,0x6c,0x46,0x65,0x74,0x63,0x68,0x28, - 0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x5f,0x74,0x72,0x69,0x6c,0x65,0x73,0x6d, - 0x70,0x2c,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61, - 0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x7a,0x2c, + 0x20,0x35,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x6f,0x72,0x69,0x67, + 0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,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,0x33,0x20,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b, + 0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x34,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x6e, + 0x6f,0x72,0x6d,0x61,0x6c,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,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,0x33,0x20,0x63,0x61, + 0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x20,0x36,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20, + 0x63,0x76,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x66,0x72,0x65,0x73,0x6e,0x65, + 0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63, + 0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x30, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46, + 0x30,0x20,0x2b,0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20, + 0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d, + 0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61, + 0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30, + 0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x44,0x69,0x73, + 0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x76,0x65,0x63, + 0x33,0x20,0x4e,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x48,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x38,0x20,0x3d, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75, + 0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x5f,0x31,0x33,0x38,0x20,0x2a,0x20, + 0x5f,0x31,0x33,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e, + 0x2c,0x20,0x48,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x28,0x28,0x5f, + 0x31,0x34,0x37,0x20,0x2a,0x20,0x5f,0x31,0x34,0x37,0x29,0x20,0x2a,0x20,0x28,0x5f, + 0x31,0x34,0x32,0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29,0x20,0x2b,0x20,0x31,0x2e, + 0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31, + 0x34,0x32,0x20,0x2f,0x20,0x28,0x28,0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37, + 0x34,0x31,0x30,0x31,0x32,0x35,0x37,0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x20, + 0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b, + 0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74, + 0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x76,0x65,0x63,0x33,0x20,0x4e,0x2c,0x20, + 0x76,0x65,0x63,0x33,0x20,0x56,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x4c,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36, + 0x37,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20, + 0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x31,0x37,0x33,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a,0x20,0x5f,0x31, + 0x36,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x38,0x20,0x3d,0x20,0x6d,0x61, + 0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x56,0x29,0x2c,0x20,0x30,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38, + 0x33,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x4c, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20, + 0x5f,0x31,0x37,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x28,0x5f,0x31,0x38,0x33,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x38,0x33,0x20, + 0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33,0x29,0x29, + 0x20,0x2a,0x20,0x28,0x5f,0x31,0x37,0x38,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x37, + 0x38,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33, + 0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x46,0x72,0x65,0x73, + 0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e, + 0x65,0x73,0x73,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x54,0x68,0x65, + 0x74,0x61,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x30,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20, + 0x28,0x28,0x6d,0x61,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2d, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x2c,0x20,0x46,0x30,0x29, + 0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61, + 0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74, + 0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e, + 0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79, + 0x28,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x70,0x6f,0x73,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b,0x79,0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x64, + 0x6f,0x74,0x28,0x5f,0x34,0x35,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, + 0x65,0x28,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x5f,0x34,0x35,0x2e, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x72,0x65,0x73,0x75, + 0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79, + 0x42,0x61,0x73,0x65,0x2c,0x20,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x54,0x6f,0x70, + 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x36,0x36, + 0x20,0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x36, + 0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34, + 0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f, + 0x35,0x35,0x2e,0x73,0x75,0x6e,0x48,0x61,0x6c,0x6f,0x20,0x2a,0x20,0x63,0x6c,0x61, + 0x6d,0x70,0x28,0x28,0x5f,0x35,0x30,0x20,0x2d,0x20,0x30,0x2e,0x39,0x34,0x39,0x39, + 0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32, + 0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32, + 0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30, + 0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x35,0x30,0x20,0x3e,0x20,0x30, + 0x2e,0x39,0x39,0x39,0x38,0x39,0x39,0x39,0x38,0x33,0x34,0x30,0x36,0x30,0x36,0x36, + 0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d, + 0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31, + 0x35,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x5f,0x31,0x31,0x35, + 0x20,0x2b,0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x68,0x6f,0x72,0x69, + 0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61, + 0x62,0x73,0x28,0x5f,0x36,0x36,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20, + 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e, + 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31, + 0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x31,0x31,0x36,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x31,0x36, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65, + 0x66,0x6c,0x65,0x63,0x74,0x28,0x69,0x6e,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33, + 0x20,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x52,0x2e,0x79,0x20,0x3c, + 0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28, + 0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20, + 0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x6b,0x79,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x34,0x37,0x20,0x3d,0x20,0x76, + 0x70,0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61, + 0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39, + 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30, + 0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x35,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f, + 0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x34,0x37, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x32,0x35,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x69,0x70,0x6f,0x73,0x20,0x2d,0x20, + 0x28,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39,0x36,0x35, + 0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x37,0x35,0x20,0x3d,0x20, + 0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74, + 0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x5f,0x32,0x37,0x35,0x20,0x3f,0x20,0x31, + 0x20,0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x74, + 0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d, + 0x20,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20,0x5f,0x32,0x37,0x36,0x3b,0x20,0x69,0x2b, + 0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x74,0x65,0x78, + 0x65,0x6c,0x46,0x65,0x74,0x63,0x68,0x28,0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78, + 0x5f,0x74,0x72,0x69,0x6c,0x65,0x73,0x6d,0x70,0x2c,0x20,0x69,0x76,0x65,0x63,0x32, + 0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x5f,0x70,0x6f,0x73,0x2e,0x7a,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39, + 0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31, + 0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20, + 0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37, + 0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29, + 0x2c,0x20,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x79,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35, + 0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c, + 0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36, + 0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30, + 0x29,0x20,0x2b,0x20,0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x2c,0x20,0x39,0x2e,0x39, + 0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33, + 0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d, + 0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34, + 0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31, + 0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x31,0x36,0x29,0x29,0x2c,0x20,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f, + 0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x33,0x32,0x37,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74, + 0x28,0x5f,0x33,0x32,0x37,0x2c,0x20,0x5f,0x33,0x32,0x37,0x29,0x20,0x3e,0x20,0x39, + 0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31, + 0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38, + 0x65,0x2d,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61, + 0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20, + 0x2b,0x3d,0x20,0x28,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x20,0x2a,0x20, + 0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31, + 0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33, + 0x35,0x32,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x74, + 0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x77, + 0x20,0x2a,0x20,0x32,0x35,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20, + 0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x2e,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x65,0x74,0x61, + 0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x26,0x20,0x31,0x29,0x20,0x21, + 0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x31,0x29, + 0x20,0x26,0x20,0x31,0x32,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x37,0x38, + 0x37,0x34,0x30,0x31,0x35,0x37,0x31,0x38,0x36,0x39,0x38,0x35,0x30,0x31,0x35,0x38, + 0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,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,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73, + 0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33, + 0x35,0x32,0x20,0x3e,0x3e,0x20,0x35,0x29,0x20,0x26,0x20,0x37,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x31,0x34,0x32,0x38,0x35,0x37,0x31,0x34,0x39,0x32,0x34,0x33,0x33,0x35, + 0x34,0x37,0x39,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30, + 0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20, + 0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e, + 0x20,0x33,0x29,0x20,0x26,0x20,0x33,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x33,0x33, + 0x33,0x33,0x33,0x33,0x34,0x33,0x32,0x36,0x37,0x34,0x34,0x30,0x37,0x39,0x35,0x38, + 0x39,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x39,0x32,0x20,0x3d,0x20,0x61,0x62, + 0x73,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d, + 0x20,0x5f,0x33,0x39,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x79, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x39,0x37,0x20, + 0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x36,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x30,0x35,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x39,0x37,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x34,0x30,0x35,0x20, + 0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x7a, + 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,0x5f, + 0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x4e,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x33,0x28,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e, + 0x78,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c, + 0x20,0x5f,0x34,0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20, + 0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f, + 0x6f,0x6c,0x20,0x5f,0x34,0x32,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20, + 0x5f,0x33,0x39,0x32,0x2e,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,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38, + 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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x79, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,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,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e, + 0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x32,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f, + 0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28, + 0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f, + 0x6c,0x6f,0x72,0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c, + 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73, + 0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36, + 0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x63,0x61,0x6d,0x20,0x2d,0x20,0x76,0x70,0x6f,0x73, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x30, + 0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x35, + 0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x35,0x20,0x3d,0x20,0x6e, + 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20, + 0x5f,0x34,0x38,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28, + 0x4e,0x2c,0x20,0x5f,0x34,0x38,0x30,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x35,0x20,0x3d, + 0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x37,0x36, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x35,0x30,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x30,0x33,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x31,0x30,0x35, + 0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,0x29, + 0x2c,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x6d,0x65,0x74,0x61, + 0x6c,0x6c,0x69,0x63,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f, + 0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x31,0x33,0x20,0x3d,0x20,0x66,0x72, + 0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, + 0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x4e, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x36,0x20,0x3d,0x20,0x5f,0x34,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, + 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x34, + 0x38,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73, + 0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x35,0x35,0x32, + 0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x6d,0x76,0x70,0x5f,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x76,0x70,0x6f,0x73,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x36,0x33, + 0x20,0x3d,0x20,0x28,0x28,0x5f,0x35,0x35,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20, + 0x76,0x65,0x63,0x33,0x28,0x5f,0x35,0x35,0x32,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x36,0x37, + 0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30, + 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31, + 0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x38,0x35,0x32,0x20,0x3d, + 0x20,0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x38,0x35,0x32,0x2e, + 0x7a,0x20,0x3d,0x20,0x5f,0x35,0x36,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28, + 0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f, + 0x35,0x31,0x33,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65, + 0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65, + 0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38, + 0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33, + 0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35,0x31,0x33,0x20,0x2a,0x20, + 0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65, + 0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29, + 0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a, + 0x20,0x5f,0x34,0x39,0x35,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2b, 0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37, 0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31, - 0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39, - 0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29, - 0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x74,0x28,0x63,0x6c, - 0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x79, - 0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38, - 0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37, - 0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38, - 0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35, - 0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x28,0x69,0x6e,0x74, - 0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f, - 0x73,0x2e,0x78,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37, - 0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36, - 0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39, - 0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34, - 0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x31, - 0x36,0x29,0x29,0x2c,0x20,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c, - 0x20,0x3d,0x20,0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74,0x28,0x5f,0x33,0x32,0x37,0x2c,0x20,0x5f, - 0x33,0x32,0x37,0x29,0x20,0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37, - 0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35, - 0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x2b,0x3d,0x20,0x28,0x74,0x6f,0x5f,0x63, - 0x65,0x6e,0x74,0x65,0x72,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30, - 0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37, - 0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x35,0x32,0x20,0x3d,0x20,0x69,0x6e,0x74, - 0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61, - 0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x77,0x20,0x2a,0x20,0x32,0x35,0x35,0x2e,0x30, - 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x65,0x6d, - 0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x30, - 0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x5f,0x33,0x35, - 0x32,0x20,0x26,0x20,0x31,0x29,0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6d,0x69,0x74,0x74, - 0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33, - 0x35,0x32,0x20,0x3e,0x3e,0x20,0x31,0x29,0x20,0x26,0x20,0x31,0x32,0x37,0x29,0x20, - 0x2a,0x20,0x30,0x2e,0x30,0x30,0x37,0x38,0x37,0x34,0x30,0x31,0x35,0x37,0x31,0x38, - 0x36,0x39,0x38,0x35,0x30,0x31,0x35,0x38,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35, - 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,0x72, - 0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x66, - 0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x35,0x29, - 0x20,0x26,0x20,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x34,0x32,0x38,0x35,0x37, - 0x31,0x34,0x39,0x32,0x34,0x33,0x33,0x35,0x34,0x37,0x39,0x37,0x33,0x36,0x33,0x32, - 0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30, - 0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32, - 0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d, - 0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28, - 0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x33,0x29,0x20,0x26,0x20,0x33,0x29, - 0x20,0x2a,0x20,0x30,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x34,0x33,0x32,0x36, - 0x37,0x34,0x34,0x30,0x37,0x39,0x35,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, - 0x33,0x39,0x32,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x78,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x36,0x20, - 0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f, - 0x6f,0x6c,0x20,0x5f,0x33,0x39,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e, - 0x3d,0x20,0x5f,0x33,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c, - 0x20,0x5f,0x34,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, - 0x33,0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e, - 0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68, + 0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x38, + 0x35,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x35,0x36,0x37,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e, + 0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35, + 0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x32,0x39,0x20,0x3d,0x20, + 0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20, + 0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35, + 0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x77,0x29,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x68, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x36,0x33, + 0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x73,0x61,0x6f, + 0x74,0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x34,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d, + 0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67, + 0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x5f,0x36,0x34,0x36,0x20,0x3d,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63, + 0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3c, + 0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30, + 0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20, + 0x5f,0x36,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62, + 0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20, + 0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x39,0x35,0x2c,0x20,0x72,0x6f,0x75,0x67,0x68, + 0x6e,0x65,0x73,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20, + 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f,0x34,0x37,0x36,0x2c,0x20,0x4e, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73, + 0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x36,0x37,0x39,0x20,0x3d,0x20, + 0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b, + 0x3d,0x20,0x28,0x28,0x28,0x5f,0x36,0x37,0x39,0x20,0x2a,0x20,0x28,0x28,0x5f,0x36, + 0x34,0x36,0x20,0x2a,0x20,0x5f,0x36,0x36,0x35,0x2e,0x78,0x29,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x33,0x28,0x5f,0x36,0x36,0x35,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20, + 0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x73,0x70, + 0x65,0x63,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30, + 0x20,0x2d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e, + 0x65,0x73,0x73,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x33,0x2e,0x33, + 0x33,0x33,0x33,0x33,0x33,0x32,0x35,0x33,0x38,0x36,0x30,0x34,0x37,0x33,0x36,0x33, + 0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x33,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x68, + 0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64, + 0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63, + 0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e, + 0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72, + 0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,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,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33, - 0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34, - 0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x69,0x67,0x6e,0x28, - 0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c, - 0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x31,0x38,0x20,0x3d,0x20, - 0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x32,0x36,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x31, - 0x38,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,0x34,0x32,0x36,0x20,0x3d,0x20, - 0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,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,0x5f,0x34,0x32, - 0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20, - 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x66, - 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,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,0x4e,0x20, - 0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c, - 0x20,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x7a,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x35,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c, - 0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75, - 0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x6d,0x61, - 0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, - 0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69, - 0x6f,0x6e,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35, - 0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20, - 0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30, - 0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36, - 0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x37, - 0x36,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x63,0x61, - 0x6d,0x20,0x2d,0x20,0x76,0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69, - 0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, - 0x5f,0x34,0x38,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20,0x5f,0x34,0x38,0x30,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20, - 0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x38,0x30,0x29, - 0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x34,0x39,0x35,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x4e,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x30,0x37,0x20,0x3d, - 0x20,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x33,0x39,0x39, - 0x39,0x39,0x39,0x39,0x39,0x31,0x30,0x35,0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36, - 0x39,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x74,0x72,0x69,0x78,0x65,0x6c, - 0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76, - 0x65,0x63,0x33,0x28,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20, - 0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, - 0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, - 0x35,0x31,0x33,0x20,0x3d,0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68, - 0x6c,0x69,0x63,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f, - 0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x34,0x37, - 0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x34,0x38,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20, - 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x34,0x20,0x5f,0x35,0x35,0x32,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e, - 0x6d,0x76,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x20,0x2a,0x20,0x76,0x65,0x63, - 0x34,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76,0x70,0x6f,0x73,0x20,0x2a,0x20,0x31, - 0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36, - 0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x5f,0x35,0x36,0x33,0x20,0x3d,0x20,0x28,0x28,0x5f,0x35,0x35, - 0x32,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x35,0x35, - 0x32,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76, - 0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x35,0x36,0x37,0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x2e, - 0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30, - 0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, - 0x33,0x20,0x5f,0x38,0x33,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x5f,0x38,0x33,0x32,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x35,0x36,0x37, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74, - 0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28, - 0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x35,0x31,0x33,0x29,0x20,0x2a,0x20,0x28, - 0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29, - 0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30, - 0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34, - 0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28, - 0x28,0x5f,0x35,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62, - 0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d, - 0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33, - 0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x5f,0x34,0x39,0x35,0x29,0x20,0x2a, - 0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39, - 0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31, - 0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29, - 0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64, - 0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c, - 0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x38,0x33,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f, - 0x35,0x36,0x37,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2a, - 0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c, - 0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74, - 0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32, - 0x20,0x5f,0x36,0x32,0x39,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43, - 0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x66, - 0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e, - 0x5f,0x77,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e, - 0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x68,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x76,0x65,0x63,0x34,0x20,0x5f,0x36,0x33,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, - 0x75,0x72,0x65,0x28,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73, - 0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f, - 0x34,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x31,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x36,0x34,0x36,0x20,0x3d,0x20,0x46, - 0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x72,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39, - 0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31, - 0x38,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x36,0x36,0x35,0x20,0x3d,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f, - 0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x39, - 0x35,0x2c,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28, - 0x2d,0x5f,0x34,0x37,0x36,0x2c,0x20,0x4e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33, - 0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69, - 0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, - 0x20,0x5f,0x36,0x37,0x39,0x20,0x3d,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c, - 0x65,0x63,0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x31,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x5f,0x36,0x37, - 0x39,0x20,0x2a,0x20,0x28,0x28,0x5f,0x36,0x34,0x36,0x20,0x2a,0x20,0x5f,0x36,0x36, - 0x35,0x2e,0x78,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x36,0x36,0x35, - 0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64, - 0x69,0x72,0x65,0x63,0x74,0x5f,0x73,0x70,0x65,0x63,0x5f,0x73,0x63,0x61,0x6c,0x65, - 0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2d,0x20,0x30,0x2e, - 0x35,0x29,0x20,0x2a,0x20,0x33,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x32,0x35,0x33, - 0x38,0x36,0x30,0x34,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30, - 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x69,0x6e,0x64,0x69,0x72, - 0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64, - 0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66, - 0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x5f,0x69, - 0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70, - 0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x32, - 0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74, - 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,0x69, - 0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x5f,0x32, - 0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f, - 0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x34,0x38,0x20,0x3d, - 0x20,0x6c,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, - 0x20,0x5f,0x37,0x34,0x39,0x20,0x3d,0x20,0x5f,0x37,0x34,0x38,0x20,0x2b,0x20,0x28, - 0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20, - 0x2d,0x20,0x5f,0x36,0x34,0x36,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d, - 0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x69,0x6e, - 0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x29,0x20,0x2a,0x20,0x76,0x65, - 0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34, - 0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29, - 0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e,0x78, - 0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63, - 0x74,0x5f,0x64,0x69,0x66,0x66,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x5f,0x37,0x34,0x39,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x64, - 0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x37,0x34,0x39,0x20,0x2b, - 0x20,0x28,0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e, - 0x63,0x65,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x65,0x6d,0x69,0x73,0x73, - 0x69,0x76,0x65,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c, - 0x20,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74, - 0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e, - 0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x20,0x3d,0x3d,0x20,0x31,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x34,0x20,0x5f,0x37,0x37,0x35,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, - 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76, - 0x65,0x63,0x33,0x20,0x5f,0x37,0x37,0x39,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f, - 0x37,0x37,0x35,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, - 0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39, - 0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39, - 0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32, - 0x31,0x38,0x37,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, - 0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f, - 0x37,0x37,0x39,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37, - 0x37,0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x37, - 0x39,0x2e,0x7a,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,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72, - 0x65,0x76,0x69,0x65,0x77,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,0x76,0x65,0x63,0x34,0x20,0x5f,0x37,0x39,0x33,0x20,0x3d,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x39,0x37,0x20, - 0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x39,0x33,0x2e,0x78,0x79,0x7a,0x2c,0x20, - 0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x33,0x30,0x30,0x30, - 0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37, - 0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31, - 0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x37,0x39,0x37, - 0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f, - 0x37,0x39,0x37,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20, - 0x3d,0x20,0x5f,0x37,0x39,0x37,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44, + 0x69,0x66,0x66,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65, + 0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e, + 0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x37,0x34,0x38,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x34,0x39,0x20,0x3d,0x20, + 0x5f,0x37,0x34,0x38,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65, + 0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x34,0x36,0x29,0x20, + 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69, + 0x63,0x29,0x29,0x20,0x2a,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69, + 0x66,0x66,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38, + 0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30, + 0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65, + 0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e,0x78,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34, + 0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x64,0x69,0x66,0x66,0x5f,0x73, + 0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74, + 0x20,0x3d,0x20,0x5f,0x37,0x34,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d, + 0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x64,0x65,0x65,0x70,0x43, + 0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x37,0x34,0x39,0x20,0x2b,0x20,0x28,0x28,0x74, + 0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78, + 0x79,0x7a,0x20,0x2a,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x29,0x20, + 0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x65,0x6d,0x69,0x73,0x73,0x69,0x76,0x65,0x5f, + 0x73,0x63,0x61,0x6c,0x65,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f, + 0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35,0x35, + 0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70, + 0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79, + 0x42,0x61,0x73,0x65,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74, + 0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x32,0x35,0x34,0x2e,0x66,0x6f,0x67,0x5f,0x73, + 0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x32,0x35,0x34,0x2e,0x66,0x6f,0x67,0x5f,0x65, + 0x6e,0x64,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x70,0x6f,0x73,0x20, + 0x2d,0x20,0x63,0x61,0x6d,0x29,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73, + 0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x34,0x20,0x5f,0x37,0x39,0x35,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x37,0x39,0x39,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x39, + 0x35,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x30, + 0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35, + 0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39, + 0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38, + 0x37,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x37,0x39, + 0x39,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37,0x39,0x39, + 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x39,0x39,0x2e, + 0x7a,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, + 0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76, + 0x69,0x65,0x77,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, + 0x76,0x65,0x63,0x34,0x20,0x5f,0x38,0x31,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x38,0x31,0x37,0x20,0x3d,0x20, + 0x6d,0x69,0x78,0x28,0x5f,0x38,0x31,0x33,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30, + 0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31, + 0x32,0x35,0x2c,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x39, + 0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32,0x35, + 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x38,0x31,0x37,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x38,0x31, + 0x37,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x38,0x31,0x37,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #version 300 es @@ -1531,6 +1544,8 @@ vs_trile_source_glsl300es := u8.[ int is_preview; highp vec3 indirect_tint; int sh_enabled; + highp float fog_start; + highp float fog_end; }; uniform trile_fs_params _254; @@ -1712,9 +1727,9 @@ vs_trile_source_glsl300es := u8.[ highp vec4 _552 = _254.mvp_shadow * vec4(floor(vpos * 16.0) * vec3(0.0625), 1.0); highp vec3 _563 = ((_552.xyz / vec3(_552.w)) * 0.5) + vec3(0.5); highp float _567 = _563.z - 0.001000000047497451305389404296875; - highp vec3 _832 = _563; - _832.z = _567; - highp vec3 light = ((((((((vec3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * vec3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_832.xy, _567))) * _490) * _55.sunLightColor) * _55.sunIntensity; + highp vec3 _852 = _563; + _852.z = _567; + highp vec3 light = ((((((((vec3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * vec3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / vec3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * texture(shadowtex_shadowsmp, vec3(_852.xy, _567))) * _490) * _55.sunLightColor) * _55.sunIntensity; highp vec2 _629 = gl_FragCoord.xy / vec2(float(_254.screen_w), float(_254.screen_h)); highp vec4 _630 = texture(ssaotex_linsmp, _629); highp float param_9 = _495; @@ -1741,24 +1756,24 @@ vs_trile_source_glsl300es := u8.[ highp vec3 _748 = light; highp vec3 _749 = _748 + (((((((vec3(1.0) - _646) * (1.0 - metallic)) * indirectDiff) * vec3(0.3183098733425140380859375)) * trixel_material.xyz) * _630.x) * _254.indirect_diff_scale); light = _749; - frag_color = vec4(mix(_55.deepColor, _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), vec3(smoothstep(0.0, _55.planeHeight, vpos.y))), 1.0); + frag_color = vec4(mix(mix(_55.deepColor, _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), vec3(smoothstep(0.0, _55.planeHeight, vpos.y))), _55.skyBase, vec3(smoothstep(_254.fog_start, _254.fog_end, length(vpos - cam)))), 1.0); if (_254.is_preview == 1) { - highp vec4 _775 = frag_color; - highp vec3 _779 = mix(_775.xyz, vec3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), vec3(0.5)); - frag_color.x = _779.x; - frag_color.y = _779.y; - frag_color.z = _779.z; + highp vec4 _795 = frag_color; + highp vec3 _799 = mix(_795.xyz, vec3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), vec3(0.5)); + frag_color.x = _799.x; + frag_color.y = _799.y; + frag_color.z = _799.z; } else { if (_254.is_preview == 2) { - highp vec4 _793 = frag_color; - highp vec3 _797 = mix(_793.xyz, vec3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), vec3(0.5)); - frag_color.x = _797.x; - frag_color.y = _797.y; - frag_color.z = _797.z; + highp vec4 _813 = frag_color; + highp vec3 _817 = mix(_813.xyz, vec3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), vec3(0.5)); + frag_color.x = _817.x; + frag_color.y = _817.y; + frag_color.z = _817.z; } } } @@ -1820,531 +1835,539 @@ fs_trile_source_glsl300es := u8.[ 0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x69,0x6e,0x64,0x69,0x72, 0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e, - 0x74,0x20,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64,0x3b,0x0a,0x7d,0x3b, - 0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f, - 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x32,0x35,0x34,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,0x74,0x72,0x69,0x6c,0x65,0x74,0x65, - 0x78,0x5f,0x74,0x72,0x69,0x6c,0x65,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,0x53,0x68,0x61,0x64,0x6f,0x77,0x20,0x73,0x68,0x61,0x64,0x6f,0x77, - 0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,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,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x5f,0x6c, - 0x69,0x6e,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,0x62, - 0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a, + 0x74,0x20,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f, + 0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64, + 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x74,0x72, + 0x69,0x6c,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x32, + 0x35,0x34,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,0x74,0x72,0x69, + 0x6c,0x65,0x74,0x65,0x78,0x5f,0x74,0x72,0x69,0x6c,0x65,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,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64, - 0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x69, - 0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x70,0x6f, - 0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, - 0x20,0x69,0x70,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x76,0x65,0x63,0x33,0x20,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, - 0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69, - 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 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,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, - 0x63,0x61,0x6d,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x63,0x76,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63, - 0x6b,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f, - 0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x46,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x28, - 0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77, - 0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73, - 0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29, - 0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75, - 0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x4e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, - 0x20,0x48,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33, - 0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20, - 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x32,0x20, - 0x3d,0x20,0x5f,0x31,0x33,0x38,0x20,0x2a,0x20,0x5f,0x31,0x33,0x38,0x3b,0x0a,0x20, + 0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x53,0x68,0x61,0x64,0x6f,0x77,0x20,0x73,0x68, + 0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,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,0x73,0x73,0x61,0x6f,0x74, + 0x65,0x78,0x5f,0x6c,0x69,0x6e,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,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,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,0x73,0x68,0x5f,0x69, + 0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70, + 0x3b,0x0a,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, + 0x20,0x76,0x70,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x69,0x70,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x3b,0x0a,0x69, + 0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x66,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,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,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x63,0x61,0x6d,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x63,0x76,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63, + 0x68,0x6c,0x69,0x63,0x6b,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a, + 0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d, + 0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x44,0x69,0x73,0x74, + 0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x4e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x48,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x31,0x33,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73, + 0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20, 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, - 0x31,0x34,0x37,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c, - 0x20,0x48,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20, - 0x3d,0x20,0x28,0x28,0x5f,0x31,0x34,0x37,0x20,0x2a,0x20,0x5f,0x31,0x34,0x37,0x29, - 0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29, - 0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x5f,0x31,0x34,0x32,0x20,0x2f,0x20,0x28,0x28,0x33,0x2e,0x31,0x34, - 0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32,0x35,0x37,0x33,0x32,0x34,0x32, - 0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f, - 0x31,0x35,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69, - 0x74,0x68,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x4e,0x2c, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x56,0x2c,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x4c,0x2c,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36,0x37,0x20,0x3d,0x20,0x72,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, - 0x37,0x33,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a,0x20,0x5f,0x31,0x36, - 0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x38, - 0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x56,0x29, - 0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x6d, - 0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x4c,0x29,0x2c,0x20,0x30,0x2e, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d, - 0x20,0x5f,0x31,0x37,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x28,0x5f,0x31,0x38,0x33,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x38,0x33, - 0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33,0x29, - 0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x37,0x38,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31, - 0x37,0x38,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37, - 0x33,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63, - 0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x68,0x69,0x67,0x68,0x70, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x30,0x2c,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67, - 0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, - 0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x6d,0x61,0x78,0x28,0x76, - 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e, - 0x65,0x73,0x73,0x29,0x2c,0x20,0x46,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20, - 0x2a,0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20, - 0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c, - 0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a, - 0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x28, - 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x70,0x6f, - 0x73,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75, - 0x6e,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72, - 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b,0x79,0x70,0x6f,0x73,0x29,0x3b,0x0a, + 0x31,0x34,0x32,0x20,0x3d,0x20,0x5f,0x31,0x33,0x38,0x20,0x2a,0x20,0x5f,0x31,0x33, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f, + 0x74,0x28,0x4e,0x2c,0x20,0x48,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x31,0x35,0x35,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x34,0x37,0x20,0x2a,0x20,0x5f, + 0x31,0x34,0x37,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2d,0x20,0x31, + 0x2e,0x30,0x29,0x29,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x34,0x32,0x20,0x2f,0x20,0x28,0x28, + 0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32,0x35,0x37, + 0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29, + 0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72, + 0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x4e,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x56,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x4c,0x2c, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75, + 0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36,0x37,0x20,0x3d, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20,0x31,0x2e,0x30, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x31,0x37,0x33,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a, + 0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x32,0x35,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x5f,0x35,0x30,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x34,0x35,0x2c,0x20,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x5f,0x34,0x35,0x2e,0x79,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x72, - 0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e, - 0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79, - 0x54,0x6f,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28, - 0x5f,0x36,0x36,0x20,0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, - 0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37, - 0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2b,0x20, - 0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x48,0x61,0x6c,0x6f,0x20,0x2a,0x20, - 0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x5f,0x35,0x30,0x20,0x2d,0x20,0x30,0x2e,0x39, - 0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34, - 0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x2c, - 0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31, - 0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35, - 0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32, - 0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32, - 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x35,0x30,0x20, - 0x3e,0x20,0x30,0x2e,0x39,0x39,0x39,0x38,0x39,0x39,0x39,0x38,0x33,0x34,0x30,0x36, - 0x30,0x36,0x36,0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c, - 0x74,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x35,0x20,0x3d,0x20,0x72,0x65,0x73, - 0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x5f,0x31,0x31,0x35,0x20, - 0x2b,0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x68,0x6f,0x72,0x69,0x7a, - 0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, - 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62, - 0x73,0x28,0x5f,0x36,0x36,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,0x30, - 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31, - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31, - 0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x31,0x31,0x36,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x31,0x36,0x3b, - 0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73, - 0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x69,0x6e,0x6f,0x75,0x74, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x52,0x2c,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73, - 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x52,0x2e,0x79,0x20, - 0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74, - 0x28,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, - 0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x52,0x3b,0x0a,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,0x73,0x75,0x6e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, - 0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f, - 0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x34,0x37,0x20,0x3d,0x20,0x76,0x70,0x6f,0x73, - 0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48, - 0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39, - 0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32, - 0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f, - 0x6f,0x6c,0x20,0x5f,0x32,0x35,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x5f,0x32,0x34,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34, - 0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d, - 0x3d,0x20,0x31,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,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x34,0x37,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35, - 0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x69,0x70,0x6f,0x73, - 0x20,0x2d,0x20,0x28,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20, - 0x2a,0x20,0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32, - 0x39,0x36,0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x37,0x35, - 0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x6e,0x74,0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x5f,0x32,0x37,0x35,0x20, - 0x3f,0x20,0x31,0x20,0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72, - 0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c, - 0x20,0x5f,0x32,0x37,0x36,0x3b,0x20,0x69,0x2b,0x2b,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,0x34,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x74,0x65,0x78,0x65, - 0x6c,0x46,0x65,0x74,0x63,0x68,0x28,0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x5f, - 0x74,0x72,0x69,0x6c,0x65,0x73,0x6d,0x70,0x2c,0x20,0x69,0x76,0x65,0x63,0x32,0x28, - 0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65, - 0x5f,0x70,0x6f,0x73,0x2e,0x7a,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, - 0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34, - 0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30, - 0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37, - 0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x2c, - 0x20,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c, - 0x65,0x5f,0x70,0x6f,0x73,0x2e,0x79,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39, - 0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31, - 0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20, - 0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37, - 0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29, - 0x20,0x2b,0x20,0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x2c,0x20,0x39,0x2e,0x39,0x39, + 0x5f,0x31,0x37,0x38,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e, + 0x2c,0x20,0x56,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x33, + 0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x4c,0x29, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x38,0x20,0x3d,0x20,0x31, + 0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x5f,0x31,0x38,0x33,0x20,0x2f,0x20,0x28,0x28, + 0x5f,0x31,0x38,0x33,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f, + 0x31,0x37,0x33,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x37,0x38,0x20,0x2f,0x20, + 0x28,0x28,0x5f,0x31,0x37,0x38,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b, + 0x20,0x5f,0x31,0x37,0x33,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63, + 0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x63,0x6f,0x73,0x54,0x68, + 0x65,0x74,0x61,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x46,0x30,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x6d, + 0x61,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x72,0x6f, + 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x2c,0x20,0x46,0x30,0x29,0x20,0x2d,0x20, + 0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28, + 0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20, + 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x73,0x6b,0x79,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73, + 0x6b,0x79,0x70,0x6f,0x73,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x35,0x20,0x3d, + 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b,0x79,0x70,0x6f, + 0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x34, + 0x35,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x75,0x6e, + 0x70,0x6f,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x5f,0x34,0x35, + 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28, + 0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x5f,0x35,0x35, + 0x2e,0x73,0x6b,0x79,0x54,0x6f,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c, + 0x61,0x6d,0x70,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30, + 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30, + 0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29, + 0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x48,0x61,0x6c, + 0x6f,0x20,0x2a,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x5f,0x35,0x30,0x20,0x2d, + 0x20,0x30,0x2e,0x39,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30, + 0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x31, + 0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x38,0x30,0x30,0x30, + 0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37, + 0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30, + 0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39, + 0x35,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x35,0x30,0x20,0x3e,0x20,0x30,0x2e,0x39,0x39,0x39,0x38,0x39,0x39,0x39,0x38, + 0x33,0x34,0x30,0x36,0x30,0x36,0x36,0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72, + 0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x44, + 0x69,0x73,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x35,0x20,0x3d, + 0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x5f, + 0x31,0x31,0x35,0x20,0x2b,0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x68, + 0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x63,0x6c,0x61,0x6d, + 0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x36,0x36,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31, + 0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x31, + 0x31,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f, + 0x31,0x31,0x36,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x69, + 0x6e,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x52,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75, + 0x6e,0x70,0x6f,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x52,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66, + 0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x52,0x3b,0x0a,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,0x73,0x75,0x6e,0x70,0x6f,0x73,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x6b,0x79,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x34,0x37,0x20,0x3d,0x20, + 0x76,0x70,0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x35,0x35,0x2e,0x70,0x6c, + 0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30, + 0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32, + 0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x35,0x39,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20, + 0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x34, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x32,0x35,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20, + 0x69,0x70,0x6f,0x73,0x20,0x2d,0x20,0x28,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39, + 0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30, + 0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, + 0x5f,0x32,0x37,0x35,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72, + 0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x5f, + 0x32,0x37,0x35,0x20,0x3f,0x20,0x31,0x20,0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x74,0x72,0x69,0x78, + 0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b, + 0x20,0x69,0x20,0x3c,0x20,0x5f,0x32,0x37,0x36,0x3b,0x20,0x69,0x2b,0x2b,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,0x34,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20, + 0x74,0x65,0x78,0x65,0x6c,0x46,0x65,0x74,0x63,0x68,0x28,0x74,0x72,0x69,0x6c,0x65, + 0x74,0x65,0x78,0x5f,0x74,0x72,0x69,0x6c,0x65,0x73,0x6d,0x70,0x2c,0x20,0x69,0x76, + 0x65,0x63,0x32,0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x7a,0x2c,0x20,0x39,0x2e,0x39,0x39, 0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35, 0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30, 0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31, 0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36, - 0x2e,0x30,0x29,0x20,0x2a,0x20,0x31,0x36,0x29,0x29,0x2c,0x20,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x33,0x32,0x37,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74,0x28, - 0x5f,0x33,0x32,0x37,0x2c,0x20,0x5f,0x33,0x32,0x37,0x29,0x20,0x3e,0x20,0x39,0x2e, - 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36, - 0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65, - 0x2d,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x2b, - 0x3d,0x20,0x28,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x20,0x2a,0x20,0x30, - 0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36, - 0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x35, - 0x32,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x74,0x72, - 0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x77,0x20, - 0x2a,0x20,0x32,0x35,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x65,0x6d,0x69,0x74,0x74, - 0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67, - 0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x65,0x74, - 0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x26,0x20,0x31,0x29,0x20, - 0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x31, - 0x29,0x20,0x26,0x20,0x31,0x32,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x37, - 0x38,0x37,0x34,0x30,0x31,0x35,0x37,0x31,0x38,0x36,0x39,0x38,0x35,0x30,0x31,0x35, - 0x38,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,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,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73, - 0x73,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f, - 0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x35,0x29,0x20,0x26,0x20,0x37,0x29,0x20,0x2a, - 0x20,0x30,0x2e,0x31,0x34,0x32,0x38,0x35,0x37,0x31,0x34,0x39,0x32,0x34,0x33,0x33, - 0x35,0x34,0x37,0x39,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30, - 0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38, - 0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63, - 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e, - 0x3e,0x20,0x33,0x29,0x20,0x26,0x20,0x33,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x33, - 0x33,0x33,0x33,0x33,0x33,0x34,0x33,0x32,0x36,0x37,0x34,0x34,0x30,0x37,0x39,0x35, - 0x38,0x39,0x38,0x34,0x33,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,0x33, - 0x39,0x32,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20,0x5f,0x33, - 0x39,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39, - 0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33, - 0x39,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39, - 0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x30,0x35, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x39,0x37,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x34, - 0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39, - 0x32,0x2e,0x7a,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,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x37,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, - 0x34,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x69,0x67,0x6e, - 0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x29,0x2c,0x20,0x30,0x2e,0x30, - 0x2c,0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x31,0x38,0x20,0x3d, - 0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x32,0x36, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34, - 0x31,0x38,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,0x34,0x32,0x36,0x20,0x3d, - 0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,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,0x5f,0x34, - 0x32,0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d, - 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28, - 0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29, - 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,0x4e, - 0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, - 0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x7a, - 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x35, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, - 0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73, - 0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x6d, - 0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x69,0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f, - 0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, - 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30, - 0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37, - 0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x69,0x7a,0x65,0x28,0x63,0x61,0x6d,0x20,0x2d,0x20,0x76,0x70,0x6f,0x73,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, - 0x20,0x5f,0x34,0x38,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, - 0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, - 0x63,0x33,0x20,0x5f,0x34,0x38,0x35,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x69,0x7a,0x65,0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20,0x5f,0x34,0x38,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x4e,0x2c,0x20,0x5f,0x34,0x38,0x30,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, + 0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x79,0x2c,0x20,0x39,0x2e,0x39, + 0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33, + 0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d, + 0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34, + 0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31, + 0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x28,0x69,0x6e,0x74,0x28,0x63,0x6c,0x61,0x6d, + 0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x2c,0x20, + 0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35, + 0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38, + 0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39, + 0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20, + 0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x31,0x36,0x29,0x29,0x2c,0x20, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x69,0x78, + 0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x33, + 0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x64,0x6f,0x74,0x28,0x5f,0x33,0x32,0x37,0x2c,0x20,0x5f,0x33,0x32,0x37,0x29,0x20, + 0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38, + 0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37, + 0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, + 0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70, + 0x6f,0x73,0x20,0x2b,0x3d,0x20,0x28,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72, + 0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39, + 0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74, + 0x20,0x5f,0x33,0x35,0x32,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e, + 0x64,0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x2e,0x77,0x20,0x2a,0x20,0x32,0x35,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x65, + 0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x5f,0x34,0x39,0x35,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28, - 0x4e,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x26, + 0x20,0x31,0x29,0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63, + 0x65,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20, + 0x3e,0x3e,0x20,0x31,0x29,0x20,0x26,0x20,0x31,0x32,0x37,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x30,0x30,0x37,0x38,0x37,0x34,0x30,0x31,0x35,0x37,0x31,0x38,0x36,0x39,0x38, + 0x35,0x30,0x31,0x35,0x38,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,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,0x72,0x6f,0x75,0x67, + 0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x66,0x6c,0x6f,0x61, + 0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x35,0x29,0x20,0x26,0x20, + 0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x34,0x32,0x38,0x35,0x37,0x31,0x34,0x39, + 0x32,0x34,0x33,0x33,0x35,0x34,0x37,0x39,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34, + 0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32, + 0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61, + 0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33, + 0x35,0x32,0x20,0x3e,0x3e,0x20,0x33,0x29,0x20,0x26,0x20,0x33,0x29,0x20,0x2a,0x20, + 0x30,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x34,0x33,0x32,0x36,0x37,0x34,0x34, + 0x30,0x37,0x39,0x35,0x38,0x39,0x38,0x34,0x33,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,0x33,0x39,0x32,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x66,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x34,0x20, + 0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d, + 0x20,0x5f,0x33,0x39,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f, + 0x6c,0x20,0x5f,0x33,0x39,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d, + 0x20,0x5f,0x33,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, + 0x5f,0x34,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33, + 0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d, + 0x20,0x5f,0x33,0x39,0x32,0x2e,0x7a,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,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x34,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28, + 0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x29,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34, + 0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39, + 0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, + 0x5f,0x34,0x32,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x34,0x31,0x38,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,0x34, + 0x32,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39, + 0x32,0x2e,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,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x73, + 0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x79,0x29,0x2c,0x20, + 0x30,0x2e,0x30,0x29,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,0x4e,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x66,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x32,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74, + 0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f, + 0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72, + 0x20,0x2a,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29, + 0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73, + 0x69,0x74,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x30, + 0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39, + 0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,0x6e, + 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x63,0x61,0x6d,0x20,0x2d,0x20,0x76, + 0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x30,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x35,0x20,0x3d,0x20,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20,0x5f, + 0x34,0x38,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x38,0x30,0x29,0x2c,0x20,0x30, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x35,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28, + 0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x5f,0x35,0x30,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x30,0x33,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x31,0x30, + 0x35,0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35, + 0x29,0x2c,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69, + 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x6d,0x65,0x74, + 0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, + 0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20,0x5f, + 0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,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,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x31,0x33,0x20,0x3d, + 0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x34,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x34,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x37,0x20,0x3d,0x20,0x5f,0x34,0x38,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f, + 0x35,0x35,0x32,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x6d,0x76,0x70,0x5f,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x66,0x6c,0x6f, + 0x6f,0x72,0x28,0x76,0x70,0x6f,0x73,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20, + 0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x36,0x33,0x20,0x3d,0x20,0x28,0x28,0x5f,0x35, + 0x35,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x35, + 0x35,0x32,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20, + 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x36,0x37,0x20, + 0x3d,0x20,0x5f,0x35,0x36,0x33,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x31, + 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33, + 0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, - 0x35,0x30,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x30, - 0x2e,0x30,0x33,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x31,0x30,0x35,0x39,0x33,0x30, - 0x33,0x32,0x38,0x33,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x74, - 0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78, - 0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69, - 0x63,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x6d,0x61,0x78, - 0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29, - 0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,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,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x35,0x31,0x33,0x20,0x3d,0x20,0x66,0x72,0x65, - 0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28,0x70,0x61,0x72,0x61, - 0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x32,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20, - 0x3d,0x20,0x5f,0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20, - 0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x35,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, - 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20, - 0x3d,0x20,0x5f,0x34,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d, - 0x20,0x5f,0x34,0x38,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d, - 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x35,0x35,0x32,0x20, - 0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x6d,0x76,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f, - 0x77,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x76, - 0x70,0x6f,0x73,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x76,0x65, - 0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, - 0x20,0x5f,0x35,0x36,0x33,0x20,0x3d,0x20,0x28,0x28,0x5f,0x35,0x35,0x32,0x2e,0x78, - 0x79,0x7a,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x35,0x35,0x32,0x2e,0x77, - 0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33, - 0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x36,0x37,0x20,0x3d,0x20,0x5f,0x35, - 0x36,0x33,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30, - 0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38, - 0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x38,0x33,0x32,0x20, - 0x3d,0x20,0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x38,0x33,0x32, - 0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x35,0x36,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x20, - 0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31, - 0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x35,0x31,0x33,0x29,0x20,0x2a,0x20,0x28,0x31, - 0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20, - 0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, - 0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, - 0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30, - 0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28, - 0x5f,0x35,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75, - 0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69, - 0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x76,0x65,0x63,0x33,0x28, - 0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x5f,0x34,0x39,0x35,0x29,0x20,0x2a,0x20, - 0x5f,0x34,0x39,0x30,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, - 0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34, - 0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29, - 0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f, - 0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20, - 0x76,0x65,0x63,0x33,0x28,0x5f,0x38,0x33,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x35, - 0x36,0x37,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2a,0x20, - 0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f, - 0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65, - 0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x32,0x39,0x20,0x3d,0x20,0x67,0x6c,0x5f, - 0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2f,0x20,0x76, - 0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73, - 0x63,0x72,0x65,0x65,0x6e,0x5f,0x77,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28, - 0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x68,0x29,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20, - 0x5f,0x36,0x33,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73, - 0x73,0x61,0x6f,0x74,0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f, - 0x36,0x32,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20, - 0x5f,0x34,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20, - 0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d, - 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x36,0x34,0x36,0x20, - 0x3d,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b, - 0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3c,0x20,0x30,0x2e,0x36,0x39, - 0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34, - 0x39,0x32,0x31,0x38,0x37,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,0x34, - 0x20,0x5f,0x36,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, - 0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c, - 0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x39,0x35,0x2c,0x20,0x72,0x6f,0x75,0x67, - 0x68,0x6e,0x65,0x73,0x73,0x29,0x29,0x3b,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,0x32,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d, - 0x5f,0x34,0x37,0x36,0x2c,0x20,0x4e,0x29,0x3b,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,0x33,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x36,0x37,0x39, - 0x20,0x3d,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68, - 0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x5f,0x36,0x37,0x39,0x20,0x2a,0x20,0x28, - 0x28,0x5f,0x36,0x34,0x36,0x20,0x2a,0x20,0x5f,0x36,0x36,0x35,0x2e,0x78,0x29,0x20, - 0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x36,0x36,0x35,0x2e,0x79,0x29,0x29,0x29, - 0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74, - 0x5f,0x73,0x70,0x65,0x63,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x20,0x2a,0x20,0x28, - 0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x72,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20, - 0x33,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x32,0x35,0x33,0x38,0x36,0x30,0x34,0x37, - 0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x69,0x6e,0x64,0x69, - 0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, - 0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65, - 0x64,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69, - 0x66,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x5f, - 0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c,0x69,0x6e,0x73,0x6d, - 0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f, - 0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x74,0x69,0x6e, - 0x74,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, - 0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x5f, - 0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, - 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33, - 0x20,0x5f,0x37,0x34,0x38,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37, - 0x34,0x39,0x20,0x3d,0x20,0x5f,0x37,0x34,0x38,0x20,0x2b,0x20,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f, - 0x36,0x34,0x36,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65, - 0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x69,0x6e,0x64,0x69,0x72, - 0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28, - 0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31, - 0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2a,0x20, - 0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e, - 0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e,0x78,0x29,0x20,0x2a, - 0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x64, - 0x69,0x66,0x66,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x5f,0x37,0x34,0x39,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76, - 0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x64,0x65,0x65,0x70, - 0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f,0x37,0x34,0x39,0x20,0x2b,0x20,0x28,0x28, - 0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e, - 0x78,0x79,0x7a,0x20,0x2a,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x29, - 0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x65,0x6d,0x69,0x73,0x73,0x69,0x76,0x65, - 0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d, - 0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35, - 0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76, - 0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f, - 0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x20,0x3d,0x3d,0x20,0x31,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,0x34,0x20,0x5f,0x37,0x37,0x35,0x20,0x3d,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x37, - 0x39,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x37,0x35,0x2e,0x78,0x79,0x7a, - 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30, - 0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32, - 0x35,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37, - 0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x78,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x79,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x7a,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,0x69,0x66,0x20,0x28,0x5f, - 0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,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,0x68,0x69,0x67,0x68,0x70, - 0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x37,0x39,0x33,0x20,0x3d,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x38,0x35,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x5f,0x38,0x35,0x32,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x35,0x36,0x37,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69, + 0x67,0x68,0x74,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65, + 0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x35,0x31,0x33,0x29,0x20, + 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69, + 0x63,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74, + 0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32, + 0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20, + 0x2b,0x20,0x28,0x28,0x5f,0x35,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74, + 0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72, + 0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x76, + 0x65,0x63,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x5f,0x34,0x39,0x35, + 0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39, + 0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35, + 0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30, + 0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x73, + 0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x38,0x35,0x32,0x2e,0x78,0x79, + 0x2c,0x20,0x5f,0x35,0x36,0x37,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30, + 0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74, + 0x43,0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e, + 0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x32,0x39,0x20,0x3d, + 0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79, + 0x20,0x2f,0x20,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32, + 0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x77,0x29,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f, + 0x68,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x34,0x20,0x5f,0x36,0x33,0x30,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x5f,0x6c,0x69,0x6e,0x73,0x6d, + 0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x39,0x20,0x3d,0x20,0x5f,0x34,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x30,0x20,0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x31,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, + 0x36,0x34,0x36,0x20,0x3d,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68, + 0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3c,0x20, + 0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37, + 0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,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,0x34,0x20,0x5f,0x36,0x36,0x35,0x20,0x3d,0x20,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x5f,0x6c,0x69,0x6e, + 0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x5f,0x34,0x39,0x35,0x2c,0x20, + 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, - 0x5f,0x37,0x39,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x39,0x33,0x2e, - 0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30, - 0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38, - 0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x32,0x30,0x30, - 0x30,0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37, - 0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30, - 0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d, - 0x20,0x5f,0x37,0x39,0x37,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x79,0x20,0x3d,0x20,0x5f,0x37,0x39,0x37,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x39,0x37,0x2e,0x7a,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65, + 0x63,0x74,0x28,0x2d,0x5f,0x34,0x37,0x36,0x2c,0x20,0x4e,0x29,0x3b,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,0x33,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e, + 0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x5f,0x36,0x37,0x39,0x20,0x3d,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65, + 0x63,0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x5f,0x36,0x37,0x39, + 0x20,0x2a,0x20,0x28,0x28,0x5f,0x36,0x34,0x36,0x20,0x2a,0x20,0x5f,0x36,0x36,0x35, + 0x2e,0x78,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x36,0x36,0x35,0x2e, + 0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69, + 0x72,0x65,0x63,0x74,0x5f,0x73,0x70,0x65,0x63,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29, + 0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6c,0x61,0x6d,0x70,0x28, + 0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2d,0x20,0x30,0x2e,0x35, + 0x29,0x20,0x2a,0x20,0x33,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x32,0x35,0x33,0x38, + 0x36,0x30,0x34,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x68,0x5f,0x65,0x6e, + 0x61,0x62,0x6c,0x65,0x64,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64,0x69,0x72,0x65, + 0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x5f,0x6c, + 0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a, + 0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74, + 0x5f,0x74,0x69,0x6e,0x74,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,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66, + 0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62, + 0x69,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x34,0x38,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68, + 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x37,0x34,0x39,0x20,0x3d,0x20,0x5f,0x37,0x34,0x38,0x20,0x2b,0x20, + 0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29, + 0x20,0x2d,0x20,0x5f,0x36,0x34,0x36,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20, + 0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x69, + 0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x29,0x20,0x2a,0x20,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33, + 0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29, + 0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72, + 0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e, + 0x78,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65, + 0x63,0x74,0x5f,0x64,0x69,0x66,0x66,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x5f,0x37,0x34,0x39, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28, + 0x5f,0x35,0x35,0x2e,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x5f, + 0x37,0x34,0x39,0x20,0x2b,0x20,0x28,0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d, + 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x65,0x6d, + 0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e, + 0x65,0x6d,0x69,0x73,0x73,0x69,0x76,0x65,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x2c, + 0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48, + 0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29, + 0x2c,0x20,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f, + 0x32,0x35,0x34,0x2e,0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f, + 0x32,0x35,0x34,0x2e,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,0x2c,0x20,0x6c,0x65,0x6e, + 0x67,0x74,0x68,0x28,0x76,0x70,0x6f,0x73,0x20,0x2d,0x20,0x63,0x61,0x6d,0x29,0x29, + 0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65, + 0x77,0x20,0x3d,0x3d,0x20,0x31,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,0x34, + 0x20,0x5f,0x37,0x39,0x35,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x39,0x39,0x20,0x3d,0x20,0x6d,0x69, + 0x78,0x28,0x5f,0x37,0x39,0x35,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39, + 0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x36, + 0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34, + 0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20, + 0x3d,0x20,0x5f,0x37,0x39,0x39,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d, + 0x20,0x5f,0x37,0x39,0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x37,0x39,0x39,0x2e,0x7a,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,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73, + 0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,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,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20, + 0x5f,0x38,0x31,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x38,0x31,0x37,0x20,0x3d, + 0x20,0x6d,0x69,0x78,0x28,0x5f,0x38,0x31,0x33,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30, + 0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38, + 0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32, + 0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32, + 0x35,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x38,0x31,0x37,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x38, + 0x31,0x37,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d, + 0x20,0x5f,0x38,0x31,0x37,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #pragma clang diagnostic ignored "-Wmissing-prototypes" @@ -2730,6 +2753,8 @@ vs_trile_source_metal_macos := u8.[ int is_preview; packed_float3 indirect_tint; int sh_enabled; + float fog_start; + float fog_end; }; struct main0_out @@ -2916,9 +2941,9 @@ vs_trile_source_metal_macos := u8.[ float4 _552 = _254.mvp_shadow * float4(floor(in.vpos * 16.0) * float3(0.0625), 1.0); float3 _563 = ((_552.xyz / float3(_552.w)) * 0.5) + float3(0.5); float _567 = _563.z - 0.001000000047497451305389404296875; - float3 _832 = _563; - _832.z = _567; - float3 light = ((((((((float3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * float3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / float3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * shadowtex.sample_compare(shadowsmp, _832.xy, _567)) * _490) * _55.sunLightColor) * _55.sunIntensity; + float3 _852 = _563; + _852.z = _567; + float3 light = ((((((((float3(1.0) - _513) * (1.0 - metallic)) * trixel_material.xyz) * float3(0.3183098733425140380859375)) + ((_513 * (DistributionGGX(param_2, param_3, param_4) * GeometrySmith(param_5, param_6, param_7, param_8))) / float3(((4.0 * _495) * _490) + 9.9999997473787516355514526367188e-05))) * shadowtex.sample_compare(shadowsmp, _852.xy, _567)) * _490) * _55.sunLightColor) * _55.sunIntensity; float2 _629 = gl_FragCoord.xy / float2(float(_254.screen_w), float(_254.screen_h)); float4 _630 = ssaotex.sample(linsmp, _629); float param_9 = _495; @@ -2945,24 +2970,24 @@ vs_trile_source_metal_macos := u8.[ float3 _748 = light; float3 _749 = _748 + (((((((float3(1.0) - _646) * (1.0 - metallic)) * indirectDiff) * float3(0.3183098733425140380859375)) * trixel_material.xyz) * _630.x) * _254.indirect_diff_scale); light = _749; - out.frag_color = float4(mix(float3(_55.deepColor), _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), float3(smoothstep(0.0, _55.planeHeight, in.vpos.y))), 1.0); + out.frag_color = float4(mix(mix(float3(_55.deepColor), _749 + ((trixel_material.xyz * emittance) * _254.emissive_scale), float3(smoothstep(0.0, _55.planeHeight, in.vpos.y))), _55.skyBase, float3(smoothstep(_254.fog_start, _254.fog_end, length(in.vpos - in.cam)))), 1.0); if (_254.is_preview == 1) { - float4 _775 = out.frag_color; - float3 _779 = mix(_775.xyz, float3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), float3(0.5)); - out.frag_color.x = _779.x; - out.frag_color.y = _779.y; - out.frag_color.z = _779.z; + float4 _795 = out.frag_color; + float3 _799 = mix(_795.xyz, float3(0.300000011920928955078125, 0.699999988079071044921875, 1.0), float3(0.5)); + out.frag_color.x = _799.x; + out.frag_color.y = _799.y; + out.frag_color.z = _799.z; } else { if (_254.is_preview == 2) { - float4 _793 = out.frag_color; - float3 _797 = mix(_793.xyz, float3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), float3(0.5)); - out.frag_color.x = _797.x; - out.frag_color.y = _797.y; - out.frag_color.z = _797.z; + float4 _813 = out.frag_color; + float3 _817 = mix(_813.xyz, float3(1.0, 0.300000011920928955078125, 0.20000000298023223876953125), float3(0.5)); + out.frag_color.x = _817.x; + out.frag_color.y = _817.y; + out.frag_color.z = _817.z; } } return out; @@ -3025,583 +3050,591 @@ fs_trile_source_metal_macos := u8.[ 0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x69, 0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x69,0x6e,0x74,0x20,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64, - 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,0x33,0x20,0x63,0x61, - 0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d, - 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f, - 0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c, - 0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x76,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28, - 0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x69,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, - 0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b, - 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x34,0x29,0x5d,0x5d,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6f,0x72,0x69,0x67,0x5f,0x6e, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f, + 0x73,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,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,0x33,0x20,0x63,0x61,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, + 0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x20, + 0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x70,0x6f,0x73, + 0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x69,0x70,0x6f, + 0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x66,0x6e, 0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63, - 0x6e,0x35,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x61,0x74,0x69, + 0x6e,0x34,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x5b,0x5b, + 0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x35,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,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63, + 0x68,0x6c,0x69,0x63,0x6b,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x63,0x6f,0x73,0x54,0x68,0x65, + 0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x46,0x30,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x46, + 0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x72,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a, + 0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54, + 0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c, + 0x20,0x35,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,0x33,0x20,0x66, - 0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28,0x74,0x68, + 0x6e,0x6c,0x69,0x6e,0x65,0x29,0x29,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20,0x44,0x69, + 0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x74,0x68, 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x26,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65, - 0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26, - 0x20,0x46,0x30,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, - 0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77, - 0x72,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e, - 0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e, - 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a, + 0x33,0x26,0x20,0x4e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x48,0x2c,0x20,0x74,0x68, + 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x38,0x20,0x3d,0x20, + 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67, + 0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x5f,0x31,0x33,0x38,0x20,0x2a,0x20,0x5f, + 0x31,0x33,0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x31,0x34,0x37,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28, + 0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x48,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20, + 0x3d,0x20,0x28,0x28,0x5f,0x31,0x34,0x37,0x20,0x2a,0x20,0x5f,0x31,0x34,0x37,0x29, + 0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32,0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29, + 0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x5f,0x31,0x34,0x32,0x20,0x2f,0x20,0x28,0x28,0x33,0x2e,0x31,0x34, + 0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32,0x35,0x37,0x33,0x32,0x34,0x32, + 0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f, + 0x31,0x35,0x35,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,0x47,0x65,0x6f,0x6d, + 0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x74,0x68,0x72,0x65,0x61,0x64, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x4e, + 0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x56,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x4c, + 0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36, + 0x37,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20, + 0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x31,0x37,0x33,0x20,0x3d,0x20,0x28,0x5f,0x31,0x36,0x37,0x20,0x2a,0x20,0x5f,0x31, + 0x36,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x38,0x20,0x3d,0x20,0x66,0x61, + 0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x56, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x38,0x33,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a, + 0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x4c,0x29,0x2c,0x20,0x30, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x31,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e,0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x33, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x5f,0x31, + 0x38,0x33,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x38,0x33,0x20,0x2a,0x20,0x5f,0x31, + 0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33,0x29,0x29,0x20,0x2a,0x20,0x28, + 0x5f,0x31,0x37,0x38,0x20,0x2f,0x20,0x28,0x28,0x5f,0x31,0x37,0x38,0x20,0x2a,0x20, + 0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31,0x37,0x33,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,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69, - 0x6f,0x6e,0x47,0x47,0x58,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, - 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x4e,0x2c,0x20,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x26,0x20,0x48,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63, + 0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x74, + 0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x26,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72, + 0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x26,0x20,0x46,0x30,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e, - 0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x5f,0x31,0x33,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73, - 0x73,0x20,0x2a,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20, - 0x5f,0x31,0x33,0x38,0x20,0x2a,0x20,0x5f,0x31,0x33,0x38,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x34,0x37,0x20,0x3d,0x20,0x66,0x61, - 0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x48, - 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x5f,0x31,0x35,0x35,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x34,0x37, - 0x20,0x2a,0x20,0x5f,0x31,0x34,0x37,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x34,0x32, - 0x20,0x2d,0x20,0x31,0x2e,0x30,0x29,0x29,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x34,0x32,0x20, - 0x2f,0x20,0x28,0x28,0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30, - 0x31,0x32,0x35,0x37,0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x20,0x2a,0x20,0x5f, - 0x31,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x35,0x35,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,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74, - 0x68,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x4e,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, - 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x56, - 0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x4c,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, - 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x72,0x6f, - 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x36,0x37,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67, - 0x68,0x6e,0x65,0x73,0x73,0x20,0x2b,0x20,0x31,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x37,0x33,0x20,0x3d,0x20,0x28,0x5f, - 0x31,0x36,0x37,0x20,0x2a,0x20,0x5f,0x31,0x36,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e, - 0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, - 0x31,0x37,0x38,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28, - 0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x56,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x33,0x20, - 0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28, - 0x4e,0x2c,0x20,0x4c,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x38,0x38,0x20,0x3d,0x20,0x31,0x2e, - 0x30,0x20,0x2d,0x20,0x5f,0x31,0x37,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x28,0x5f,0x31,0x38,0x33,0x20,0x2f,0x20,0x28,0x28,0x5f, - 0x31,0x38,0x33,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20,0x5f,0x31, - 0x37,0x33,0x29,0x29,0x20,0x2a,0x20,0x28,0x5f,0x31,0x37,0x38,0x20,0x2f,0x20,0x28, - 0x28,0x5f,0x31,0x37,0x38,0x20,0x2a,0x20,0x5f,0x31,0x38,0x38,0x29,0x20,0x2b,0x20, - 0x5f,0x31,0x37,0x33,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,0x33,0x20,0x46, - 0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f, - 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x63,0x6f,0x73,0x54,0x68, - 0x65,0x74,0x61,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73, - 0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x46,0x30,0x2c,0x20,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x26,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28, - 0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73, - 0x73,0x29,0x2c,0x20,0x46,0x30,0x29,0x20,0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20, - 0x70,0x6f,0x77,0x72,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63,0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c, - 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x35,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,0x33,0x20,0x73,0x6b,0x79,0x28,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x26,0x20,0x73,0x6b,0x79,0x70,0x6f,0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61, - 0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20, - 0x73,0x75,0x6e,0x70,0x6f,0x73,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74, - 0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e, - 0x66,0x69,0x67,0x26,0x20,0x5f,0x35,0x35,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x35,0x20,0x3d,0x20,0x66,0x61,0x73, - 0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b,0x79, - 0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x5f,0x35,0x30,0x20,0x3d,0x20,0x64,0x6f,0x74,0x28,0x5f,0x34,0x35,0x2c,0x20,0x66, - 0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73, - 0x75,0x6e,0x70,0x6f,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x5f,0x36,0x36,0x20,0x3d,0x20,0x5f,0x34,0x35,0x2e,0x79,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x72,0x65,0x73,0x75,0x6c, - 0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x42, - 0x61,0x73,0x65,0x2c,0x20,0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x54,0x6f,0x70,0x2c, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c, - 0x61,0x6d,0x70,0x28,0x5f,0x36,0x36,0x20,0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30, - 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30, - 0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29, - 0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x48,0x61,0x6c, - 0x6f,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, - 0x28,0x5f,0x35,0x30,0x20,0x2d,0x20,0x30,0x2e,0x39,0x34,0x39,0x39,0x39,0x39,0x39, - 0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37, - 0x35,0x29,0x20,0x2a,0x20,0x31,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, - 0x30,0x2e,0x38,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32, - 0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x30, - 0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32, - 0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x35,0x30,0x20,0x3e,0x20,0x30,0x2e,0x39,0x39, - 0x39,0x38,0x39,0x39,0x39,0x38,0x33,0x34,0x30,0x36,0x30,0x36,0x36,0x38,0x39,0x34, - 0x35,0x33,0x31,0x32,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x35, - 0x35,0x2e,0x73,0x75,0x6e,0x44,0x69,0x73,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x31,0x35, - 0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x5f,0x31,0x31, - 0x35,0x20,0x2b,0x20,0x28,0x6d,0x69,0x78,0x28,0x5f,0x35,0x35,0x2e,0x68,0x6f,0x72, - 0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61, - 0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x36, - 0x36,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, - 0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30, - 0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34, - 0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73, - 0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x31,0x31,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f,0x31,0x31,0x36,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,0x33,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28, - 0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x52, - 0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x2c,0x20,0x63, - 0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x77,0x6f, - 0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x35,0x35,0x29, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x52,0x2e,0x79,0x20,0x3c, - 0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28, - 0x52,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31, - 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x73,0x75,0x6e,0x70, - 0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73, - 0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x31,0x2c,0x20,0x5f,0x35,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,0x74,0x72,0x69,0x6c,0x65,0x5f,0x77,0x6f, - 0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x35,0x35,0x20, - 0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63, - 0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x66,0x73, - 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,0x35,0x34,0x20,0x5b,0x5b, - 0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78, - 0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x72, - 0x69,0x6c,0x65,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65, - 0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x64,0x65,0x70,0x74,0x68,0x32,0x64,0x3c,0x66, - 0x6c,0x6f,0x61,0x74,0x3e,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x20, - 0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20, - 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e, - 0x20,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75, - 0x72,0x65,0x28,0x32,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, - 0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c, - 0x75,0x74,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x33,0x29,0x5d, - 0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f, - 0x61,0x74,0x3e,0x20,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63, - 0x65,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x34,0x29,0x5d,0x5d, - 0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x74,0x72,0x69,0x6c,0x65,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,0x73,0x68,0x61,0x64,0x6f, - 0x77,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31, - 0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x20,0x6c,0x69,0x6e, - 0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x32,0x29, - 0x5d,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72, - 0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69, - 0x6f,0x6e,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,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x34,0x37,0x20,0x3d,0x20, - 0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x35,0x35, - 0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30, - 0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32, - 0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x35,0x39,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x34,0x37,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x39, - 0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65, - 0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20, - 0x5f,0x32,0x34,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x39,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, - 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x69,0x70,0x6f, - 0x73,0x20,0x2d,0x20,0x28,0x69,0x6e,0x2e,0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72, - 0x6d,0x61,0x6c,0x20,0x2a,0x20,0x30,0x2e,0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39, - 0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31,0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30, - 0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20, - 0x5f,0x32,0x37,0x35,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72, - 0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x5f, - 0x32,0x37,0x35,0x20,0x3f,0x20,0x31,0x20,0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72, - 0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c, - 0x20,0x5f,0x32,0x37,0x36,0x3b,0x20,0x69,0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, - 0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20,0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78, - 0x2e,0x72,0x65,0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x32, - 0x28,0x69,0x6e,0x74,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x7a,0x2c,0x20,0x39, - 0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31, - 0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38, - 0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38, - 0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a, - 0x20,0x31,0x36,0x2e,0x30,0x29,0x2c,0x20,0x69,0x6e,0x74,0x28,0x66,0x61,0x73,0x74, - 0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70, - 0x6f,0x73,0x2e,0x79,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34, - 0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32, - 0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39, - 0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33, - 0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20, - 0x28,0x69,0x6e,0x74,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x78,0x2c,0x20,0x39, - 0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31, - 0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38, - 0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38, - 0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a, - 0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x31,0x36,0x29,0x29,0x29,0x2c,0x20, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x74,0x72,0x69,0x78, - 0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x33, - 0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, - 0x64,0x6f,0x74,0x28,0x5f,0x33,0x32,0x37,0x2c,0x20,0x5f,0x33,0x32,0x37,0x29,0x20, - 0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38, - 0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37, - 0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62, - 0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70, - 0x6f,0x73,0x20,0x2b,0x3d,0x20,0x28,0x69,0x6e,0x2e,0x74,0x6f,0x5f,0x63,0x65,0x6e, - 0x74,0x65,0x72,0x20,0x2a,0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30, - 0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35, - 0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, - 0x69,0x6e,0x74,0x20,0x5f,0x33,0x35,0x32,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72, - 0x6f,0x75,0x6e,0x64,0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65, - 0x72,0x69,0x61,0x6c,0x2e,0x77,0x20,0x2a,0x20,0x32,0x35,0x35,0x2e,0x30,0x29,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x65,0x6d,0x69,0x74, - 0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73, - 0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x30,0x2e,0x30, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x5f,0x33,0x35,0x32,0x20, - 0x26,0x20,0x31,0x29,0x20,0x21,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e, - 0x63,0x65,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32, - 0x20,0x3e,0x3e,0x20,0x31,0x29,0x20,0x26,0x20,0x31,0x32,0x37,0x29,0x20,0x2a,0x20, - 0x30,0x2e,0x30,0x30,0x37,0x38,0x37,0x34,0x30,0x31,0x35,0x37,0x31,0x38,0x36,0x39, - 0x38,0x35,0x30,0x31,0x35,0x38,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,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,0x72,0x6f,0x75, - 0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d, - 0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e, - 0x3e,0x20,0x35,0x29,0x20,0x26,0x20,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x34, - 0x32,0x38,0x35,0x37,0x31,0x34,0x39,0x32,0x34,0x33,0x33,0x35,0x34,0x37,0x39,0x37, - 0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x35,0x30,0x30, - 0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35,0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39, - 0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x20,0x3d,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x33,0x29,0x20, - 0x26,0x20,0x33,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x33, - 0x34,0x33,0x32,0x36,0x37,0x34,0x34,0x30,0x37,0x39,0x35,0x38,0x39,0x38,0x34,0x33, - 0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39,0x32,0x20,0x3d,0x20,0x61,0x62,0x73,0x28, - 0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x34,0x20, - 0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e, - 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x39,0x37, - 0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x36,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x30,0x35,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x39,0x37,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x34,0x30,0x35, - 0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e, - 0x7a,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, - 0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x4e,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x30,0x35,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x73,0x69,0x67,0x6e,0x28,0x69,0x6e,0x2e, - 0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x78,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c, - 0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x31,0x38,0x20,0x3d,0x20, - 0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x34,0x32,0x36,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x31, - 0x38,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,0x34,0x32,0x36,0x20,0x3d,0x20, - 0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,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,0x5f,0x34,0x32, - 0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e, - 0x28,0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x79,0x29,0x2c,0x20, - 0x30,0x2e,0x30,0x29,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,0x4e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e, - 0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x69,0x6e,0x2e, - 0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c, - 0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75, - 0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x66,0x61, - 0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x66, - 0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73, - 0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20, - 0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69, - 0x74,0x79,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x31, - 0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31, - 0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20, - 0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28, - 0x69,0x6e,0x2e,0x63,0x61,0x6d,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34, - 0x38,0x30,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x69,0x7a,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e, - 0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x38,0x35,0x20,0x3d, - 0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20,0x5f,0x34,0x38,0x30,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20, - 0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c, - 0x20,0x5f,0x34,0x38,0x30,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x39,0x35,0x20,0x3d,0x20,0x66, - 0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20, - 0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x35,0x30,0x37,0x20,0x3d,0x20,0x6d, - 0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x33,0x39,0x39, - 0x39,0x39,0x39,0x39,0x39,0x31,0x30,0x35,0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36, - 0x39,0x31,0x34,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x74,0x72,0x69,0x78,0x65,0x6c, - 0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66, - 0x6c,0x6f,0x61,0x74,0x33,0x28,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f, - 0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30, - 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x35,0x31,0x33,0x20, - 0x3d,0x20,0x66,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b, - 0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f, - 0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d, - 0x20,0x5f,0x34,0x37,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x34,0x38,0x30, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x38,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x35,0x35,0x32, - 0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e,0x6d,0x76,0x70,0x5f,0x73,0x68,0x61,0x64, - 0x6f,0x77,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x6c,0x6f,0x6f, - 0x72,0x28,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30, - 0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x36,0x32, - 0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x5f,0x35,0x36,0x33,0x20,0x3d,0x20,0x28,0x28,0x5f,0x35, - 0x35,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, - 0x5f,0x35,0x35,0x32,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20, - 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x36,0x37,0x20,0x3d,0x20, - 0x5f,0x35,0x36,0x33,0x2e,0x7a,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30, - 0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34,0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35, - 0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x38,0x33,0x32,0x20,0x3d,0x20, - 0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x5f,0x38,0x33,0x32,0x2e,0x7a, - 0x20,0x3d,0x20,0x5f,0x35,0x36,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x28,0x28,0x28,0x28, - 0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20, - 0x2d,0x20,0x5f,0x35,0x31,0x33,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d, - 0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x74,0x72, - 0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79, - 0x7a,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x33,0x31, - 0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38, - 0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35, - 0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69,0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69, - 0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29, - 0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65,0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68, - 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, - 0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20,0x5f,0x34,0x39,0x35,0x29,0x20,0x2a,0x20, - 0x5f,0x34,0x39,0x30,0x29,0x20,0x2b,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39, - 0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34, - 0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29, - 0x20,0x2a,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x5f,0x63,0x6f,0x6d,0x70,0x61,0x72,0x65,0x28,0x73,0x68,0x61,0x64, - 0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x38,0x33,0x32,0x2e,0x78,0x79,0x2c,0x20, - 0x5f,0x35,0x36,0x37,0x29,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2a, - 0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c, - 0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74, - 0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x32,0x20,0x5f,0x36,0x32,0x39,0x20,0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61, - 0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63, - 0x72,0x65,0x65,0x6e,0x5f,0x77,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f, - 0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x68,0x29,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x36,0x33,0x30,0x20, - 0x3d,0x20,0x73,0x73,0x61,0x6f,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, - 0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x39,0x20,0x3d,0x20,0x5f,0x34,0x39,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20, - 0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68, - 0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x36,0x34,0x36,0x20,0x3d,0x20,0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53, - 0x63,0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x69,0x66,0x20,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20, - 0x3c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39, - 0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x34,0x20,0x5f,0x36,0x36,0x35,0x20,0x3d,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c, - 0x75,0x74,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70, - 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x5f,0x34,0x39,0x35,0x2c,0x20,0x72, - 0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x31,0x32,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f, - 0x34,0x37,0x36,0x2c,0x20,0x4e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33, - 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75, - 0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x36,0x37,0x39,0x20, - 0x3d,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33, - 0x2c,0x20,0x5f,0x35,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x5f,0x36,0x37,0x39, - 0x20,0x2a,0x20,0x28,0x28,0x5f,0x36,0x34,0x36,0x20,0x2a,0x20,0x5f,0x36,0x36,0x35, - 0x2e,0x78,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x36,0x36, - 0x35,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e, - 0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x73,0x70,0x65,0x63,0x5f,0x73,0x63,0x61,0x6c, - 0x65,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x66,0x61,0x73,0x74, - 0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65, - 0x73,0x73,0x20,0x2d,0x20,0x30,0x2e,0x35,0x29,0x20,0x2a,0x20,0x33,0x2e,0x33,0x33, - 0x33,0x33,0x33,0x33,0x32,0x35,0x33,0x38,0x36,0x30,0x34,0x37,0x33,0x36,0x33,0x32, - 0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29, + 0x65,0x73,0x73,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x46,0x30,0x20,0x2b,0x20,0x28,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d, + 0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20, + 0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x29,0x2c,0x20,0x46,0x30,0x29,0x20, + 0x2d,0x20,0x46,0x30,0x29,0x20,0x2a,0x20,0x70,0x6f,0x77,0x72,0x28,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x63, + 0x6f,0x73,0x54,0x68,0x65,0x74,0x61,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x2c,0x20,0x35,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, + 0x33,0x20,0x73,0x6b,0x79,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x73,0x6b,0x79,0x70,0x6f, + 0x73,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x2c,0x20, + 0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x77, + 0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66,0x69,0x67,0x26,0x20,0x5f,0x35,0x35, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f, + 0x34,0x35,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x69,0x7a,0x65,0x28,0x73,0x6b,0x79,0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x64,0x6f, + 0x74,0x28,0x5f,0x34,0x35,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x73,0x75,0x6e,0x70,0x6f,0x73,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x36,0x20,0x3d, + 0x20,0x5f,0x34,0x35,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28, + 0x5f,0x35,0x35,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x5f,0x35,0x35, + 0x2e,0x73,0x6b,0x79,0x54,0x6f,0x70,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x5f,0x36,0x36,0x20, + 0x2a,0x20,0x32,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x36,0x39, + 0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34, + 0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35, + 0x35,0x2e,0x73,0x75,0x6e,0x48,0x61,0x6c,0x6f,0x20,0x2a,0x20,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x28,0x5f,0x35,0x30,0x20,0x2d,0x20,0x30, + 0x2e,0x39,0x34,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31, + 0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x38,0x30,0x30,0x30,0x30,0x30, + 0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31, + 0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30, + 0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33, + 0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x35, + 0x30,0x20,0x3e,0x20,0x30,0x2e,0x39,0x39,0x39,0x38,0x39,0x39,0x39,0x38,0x33,0x34, + 0x30,0x36,0x30,0x36,0x36,0x38,0x39,0x34,0x35,0x33,0x31,0x32,0x35,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x72,0x65,0x73, + 0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x44,0x69,0x73, + 0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x5f,0x31,0x31,0x35,0x20,0x3d,0x20,0x72,0x65,0x73,0x75,0x6c, + 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31, + 0x31,0x36,0x20,0x3d,0x20,0x5f,0x31,0x31,0x35,0x20,0x2b,0x20,0x28,0x6d,0x69,0x78, + 0x28,0x5f,0x35,0x35,0x2e,0x68,0x6f,0x72,0x69,0x7a,0x6f,0x6e,0x48,0x61,0x6c,0x6f, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d, + 0x70,0x28,0x61,0x62,0x73,0x28,0x5f,0x36,0x36,0x29,0x20,0x2a,0x20,0x38,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31, + 0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x73,0x75,0x6c,0x74,0x20,0x3d,0x20,0x5f,0x31, + 0x31,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x5f, + 0x31,0x31,0x36,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,0x33,0x20,0x73,0x6b,0x79,0x5f, + 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x52,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64, + 0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x73, + 0x75,0x6e,0x70,0x6f,0x73,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20, + 0x74,0x72,0x69,0x6c,0x65,0x5f,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66, + 0x69,0x67,0x26,0x20,0x5f,0x35,0x35,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x52,0x2e,0x79,0x20,0x3c,0x20,0x30,0x2e,0x30,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x52,0x20,0x3d,0x20, + 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x52,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29, 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73, - 0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65,0x64,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e, - 0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x73,0x68,0x5f, - 0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c, - 0x65,0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e, - 0x78,0x79,0x7a,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x35, - 0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,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,0x69, - 0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x20,0x3d,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e, - 0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e, - 0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, - 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x20,0x5f,0x37,0x34,0x38,0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x34, - 0x39,0x20,0x3d,0x20,0x5f,0x37,0x34,0x38,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x28, - 0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20, - 0x5f,0x36,0x34,0x36,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d, - 0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x20,0x2a,0x20,0x69,0x6e,0x64,0x69, - 0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34, - 0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29, - 0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e,0x78, - 0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63, - 0x74,0x5f,0x64,0x69,0x66,0x66,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x5f,0x37,0x34,0x39,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,0x6d,0x69,0x78, - 0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e,0x64,0x65,0x65,0x70, - 0x43,0x6f,0x6c,0x6f,0x72,0x29,0x2c,0x20,0x5f,0x37,0x34,0x39,0x20,0x2b,0x20,0x28, - 0x28,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c, - 0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65, - 0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x65,0x6d,0x69,0x73,0x73,0x69,0x76, - 0x65,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c, - 0x20,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74, - 0x2c,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20, - 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32, - 0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x20,0x3d,0x3d, - 0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x37,0x37,0x35,0x20,0x3d,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f, - 0x37,0x37,0x39,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x37,0x35,0x2e,0x78, - 0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x33,0x30,0x30, - 0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30, - 0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39,0x39,0x39,0x39, - 0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32,0x31,0x38,0x37, - 0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, - 0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f, - 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20, - 0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x52,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x20,0x3d,0x20,0x73,0x75,0x6e,0x70,0x6f,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x6b,0x79,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x5f,0x35,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, + 0x74,0x72,0x69,0x6c,0x65,0x5f,0x77,0x6f,0x72,0x6c,0x64,0x5f,0x63,0x6f,0x6e,0x66, + 0x69,0x67,0x26,0x20,0x5f,0x35,0x35,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72, + 0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e,0x74,0x20, + 0x74,0x72,0x69,0x6c,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26, + 0x20,0x5f,0x32,0x35,0x34,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x31, + 0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66, + 0x6c,0x6f,0x61,0x74,0x3e,0x20,0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x20,0x5b, + 0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x64, + 0x65,0x70,0x74,0x68,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x73,0x68, + 0x61,0x64,0x6f,0x77,0x74,0x65,0x78,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x73,0x73,0x61,0x6f,0x74,0x65,0x78, + 0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x32,0x29,0x5d,0x5d,0x2c, + 0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74, + 0x3e,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x20,0x5b,0x5b,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x33,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x73,0x68,0x5f,0x69, + 0x72,0x72,0x61,0x64,0x69,0x61,0x6e,0x63,0x65,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x28,0x34,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x72,0x20,0x74,0x72,0x69,0x6c,0x65,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,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d, + 0x70,0x6c,0x65,0x72,0x20,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x72,0x28,0x32,0x29,0x5d,0x5d,0x2c,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x20, + 0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x62,0x6f,0x6f,0x6c, + 0x20,0x5f,0x32,0x34,0x37,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e, + 0x79,0x20,0x3c,0x20,0x28,0x5f,0x35,0x35,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65, + 0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38, + 0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f, + 0x6c,0x20,0x5f,0x32,0x35,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x32,0x34,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e, + 0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d, + 0x20,0x31,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,0x5f,0x32,0x35,0x39,0x20,0x3d,0x20,0x5f,0x32,0x34,0x37,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x39, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74, + 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x69,0x70,0x6f,0x73,0x20,0x2d,0x20,0x28,0x69,0x6e,0x2e, + 0x6f,0x72,0x69,0x67,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x2a,0x20,0x30,0x2e, + 0x30,0x31,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x35,0x32,0x39,0x36,0x35,0x31, + 0x36,0x34,0x31,0x38,0x34,0x35,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x37,0x35,0x20,0x3d,0x20,0x5f, + 0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x3d,0x20,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20, + 0x5f,0x32,0x37,0x36,0x20,0x3d,0x20,0x5f,0x32,0x37,0x35,0x20,0x3f,0x20,0x31,0x20, + 0x3a,0x20,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6f,0x72,0x20,0x28,0x69,0x6e,0x74,0x20,0x69,0x20, + 0x3d,0x20,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20,0x5f,0x32,0x37,0x36,0x3b,0x20,0x69, + 0x2b,0x2b,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x32,0x37,0x20,0x3d,0x20, + 0x74,0x72,0x69,0x6c,0x65,0x74,0x65,0x78,0x2e,0x72,0x65,0x61,0x64,0x28,0x75,0x69, + 0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x28,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x70,0x6f,0x73,0x2e,0x7a,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37, + 0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35, + 0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e, + 0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37, + 0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x2c,0x20, + 0x69,0x6e,0x74,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x2e,0x79,0x2c,0x20,0x39,0x2e, + 0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36, + 0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65, + 0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e,0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36, + 0x34,0x31,0x39,0x36,0x37,0x37,0x37,0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20, + 0x31,0x36,0x2e,0x30,0x29,0x20,0x2b,0x20,0x28,0x69,0x6e,0x74,0x28,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f, + 0x70,0x6f,0x73,0x2e,0x78,0x2c,0x20,0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37, + 0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35, + 0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x2c,0x20,0x30,0x2e, + 0x39,0x39,0x39,0x39,0x38,0x39,0x39,0x38,0x36,0x34,0x31,0x39,0x36,0x37,0x37,0x37, + 0x33,0x34,0x33,0x37,0x35,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a, + 0x20,0x31,0x36,0x29,0x29,0x29,0x2c,0x20,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72, + 0x69,0x61,0x6c,0x20,0x3d,0x20,0x5f,0x33,0x32,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x64,0x6f,0x74,0x28,0x5f,0x33,0x32,0x37, + 0x2c,0x20,0x5f,0x33,0x32,0x37,0x29,0x20,0x3e,0x20,0x39,0x2e,0x39,0x39,0x39,0x39, + 0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35,0x31,0x36,0x33,0x35,0x35,0x35, + 0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38,0x38,0x65,0x2d,0x30,0x35,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x70,0x6f,0x73,0x20,0x2b,0x3d,0x20,0x28,0x69, + 0x6e,0x2e,0x74,0x6f,0x5f,0x63,0x65,0x6e,0x74,0x65,0x72,0x20,0x2a,0x20,0x30,0x2e, + 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31, + 0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x33,0x35,0x32, + 0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x74,0x72,0x69, + 0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x77,0x20,0x2a, + 0x20,0x32,0x35,0x35,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20, + 0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x72, + 0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c, + 0x69,0x63,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x26,0x20,0x31,0x29,0x20,0x21,0x3d,0x20, + 0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x20,0x3d,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x31,0x29,0x20,0x26, + 0x20,0x31,0x32,0x37,0x29,0x20,0x2a,0x20,0x30,0x2e,0x30,0x30,0x37,0x38,0x37,0x34, + 0x30,0x31,0x35,0x37,0x31,0x38,0x36,0x39,0x38,0x35,0x30,0x31,0x35,0x38,0x36,0x39, + 0x31,0x34,0x30,0x36,0x32,0x35,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,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3d, + 0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x28,0x28,0x5f,0x33,0x35,0x32,0x20,0x3e,0x3e,0x20,0x35,0x29,0x20,0x26,0x20,0x37, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x31,0x34,0x32,0x38,0x35,0x37,0x31,0x34,0x39,0x32, + 0x34,0x33,0x33,0x35,0x34,0x37,0x39,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35, + 0x2c,0x20,0x30,0x2e,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x37,0x34,0x35, + 0x30,0x35,0x38,0x30,0x35,0x39,0x36,0x39,0x32,0x33,0x38,0x32,0x38,0x31,0x32,0x35, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6d,0x65,0x74,0x61,0x6c, + 0x6c,0x69,0x63,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x5f,0x33,0x35, + 0x32,0x20,0x3e,0x3e,0x20,0x33,0x29,0x20,0x26,0x20,0x33,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x33,0x34,0x33,0x32,0x36,0x37,0x34,0x34,0x30, + 0x37,0x39,0x35,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x39, + 0x32,0x20,0x3d,0x20,0x61,0x62,0x73,0x28,0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x33,0x39,0x34,0x20,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x39,0x36, + 0x20,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62, + 0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x39,0x37,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20, + 0x3e,0x3d,0x20,0x5f,0x33,0x39,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f, + 0x6c,0x20,0x5f,0x34,0x30,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x33,0x39,0x37,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f,0x33,0x39,0x34,0x20, + 0x3e,0x3d,0x20,0x5f,0x33,0x39,0x32,0x2e,0x7a,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,0x5f,0x34,0x30,0x35,0x20,0x3d,0x20,0x5f, + 0x33,0x39,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x34,0x30,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x73,0x69,0x67,0x6e,0x28,0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e, + 0x78,0x29,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,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,0x62,0x6f,0x6f,0x6c, + 0x20,0x5f,0x34,0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20, + 0x5f,0x33,0x39,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f, + 0x6f,0x6c,0x20,0x5f,0x34,0x32,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x69,0x66,0x20,0x28,0x5f,0x34,0x31,0x38,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,0x34,0x32,0x36,0x20,0x3d,0x20,0x5f,0x33,0x39,0x36,0x20,0x3e,0x3d,0x20, + 0x5f,0x33,0x39,0x32,0x2e,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,0x5f,0x34,0x32,0x36,0x20,0x3d,0x20,0x5f,0x34,0x31,0x38, + 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,0x34,0x32,0x36,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x4e,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x73,0x69,0x67,0x6e,0x28,0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x2e,0x79,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,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,0x4e,0x20,0x3d,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, + 0x73,0x69,0x67,0x6e,0x28,0x69,0x6e,0x2e,0x66,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e, + 0x7a,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37, + 0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,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,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f, + 0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x28, + 0x28,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f, + 0x6c,0x6f,0x72,0x20,0x2a,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28, + 0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35, + 0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x29, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75, + 0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31, + 0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36, + 0x32,0x35,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x5f,0x34,0x37,0x36,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f, + 0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x69,0x6e,0x2e,0x63,0x61,0x6d,0x20,0x2d, + 0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x38,0x30,0x20,0x3d,0x20,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x5f,0x34,0x38,0x35,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e, + 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x34,0x37,0x36,0x20,0x2b,0x20, + 0x5f,0x34,0x38,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x34,0x39,0x30,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61, + 0x78,0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x38,0x30,0x29,0x2c,0x20, + 0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x34,0x39,0x35,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x4e,0x2c,0x20,0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, + 0x5f,0x35,0x30,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x30,0x2e,0x30,0x33,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x31,0x30,0x35, + 0x39,0x33,0x30,0x33,0x32,0x38,0x33,0x36,0x39,0x31,0x34,0x30,0x36,0x32,0x35,0x29, + 0x2c,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x6d,0x65, + 0x74,0x61,0x6c,0x6c,0x69,0x63,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x35,0x2c,0x20, + 0x5f,0x34,0x37,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20, + 0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x5f,0x35,0x31,0x33,0x20,0x3d,0x20,0x66,0x72,0x65,0x73,0x6e,0x65, + 0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x4e, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x34,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d, + 0x20,0x4e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x34,0x37,0x36,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x37,0x20,0x3d,0x20,0x5f,0x34,0x38,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x72,0x6f, + 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x20,0x5f,0x35,0x35,0x32,0x20,0x3d,0x20,0x5f,0x32,0x35,0x34,0x2e, + 0x6d,0x76,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x20,0x2a,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x34,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x69,0x6e,0x2e,0x76,0x70,0x6f, + 0x73,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x35,0x36, + 0x33,0x20,0x3d,0x20,0x28,0x28,0x5f,0x35,0x35,0x32,0x2e,0x78,0x79,0x7a,0x20,0x2f, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x32,0x2e,0x77,0x29,0x29, + 0x20,0x2a,0x20,0x30,0x2e,0x35,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x35,0x36,0x37,0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x2e,0x7a,0x20,0x2d, + 0x20,0x30,0x2e,0x30,0x30,0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x34, + 0x39,0x37,0x34,0x35,0x31,0x33,0x30,0x35,0x33,0x38,0x39,0x34,0x30,0x34,0x32,0x39, + 0x36,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x5f,0x38,0x35,0x32,0x20,0x3d,0x20,0x5f,0x35,0x36,0x33,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x5f,0x38,0x35,0x32,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x35,0x36,0x37,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68, + 0x74,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x35,0x31,0x33,0x29,0x20, + 0x2a,0x20,0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69, + 0x63,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74, + 0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33, + 0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,0x29, + 0x29,0x20,0x2b,0x20,0x28,0x28,0x5f,0x35,0x31,0x33,0x20,0x2a,0x20,0x28,0x44,0x69, + 0x73,0x74,0x72,0x69,0x62,0x75,0x74,0x69,0x6f,0x6e,0x47,0x47,0x58,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x20,0x2a,0x20,0x47,0x65,0x6f,0x6d,0x65, + 0x74,0x72,0x79,0x53,0x6d,0x69,0x74,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x29,0x29,0x20,0x2f, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x28,0x28,0x34,0x2e,0x30,0x20,0x2a,0x20, + 0x5f,0x34,0x39,0x35,0x29,0x20,0x2a,0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2b,0x20, + 0x39,0x2e,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x34,0x37,0x33,0x37,0x38,0x37,0x35, + 0x31,0x36,0x33,0x35,0x35,0x35,0x31,0x34,0x35,0x32,0x36,0x33,0x36,0x37,0x31,0x38, + 0x38,0x65,0x2d,0x30,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x73,0x68,0x61,0x64,0x6f, + 0x77,0x74,0x65,0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x5f,0x63,0x6f,0x6d,0x70, + 0x61,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x73,0x6d,0x70,0x2c,0x20,0x5f, + 0x38,0x35,0x32,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x35,0x36,0x37,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x34,0x39,0x30,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e, + 0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35, + 0x35,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f,0x36,0x32,0x39,0x20, + 0x3d,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78, + 0x79,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x77,0x29,0x2c, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x63,0x72,0x65, + 0x65,0x6e,0x5f,0x68,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x5f,0x36,0x33,0x30,0x20,0x3d,0x20,0x73,0x73,0x61,0x6f,0x74,0x65, + 0x78,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c, + 0x20,0x5f,0x36,0x32,0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x34,0x39,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x35,0x30,0x37,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31, + 0x20,0x3d,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x36,0x34,0x36,0x20,0x3d,0x20, + 0x46,0x72,0x65,0x73,0x6e,0x65,0x6c,0x53,0x63,0x68,0x6c,0x69,0x63,0x6b,0x52,0x6f, + 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x72,0x6f, + 0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x3c,0x20,0x30,0x2e,0x36,0x39,0x39,0x39, + 0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34,0x34,0x39,0x32, + 0x31,0x38,0x37,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x36,0x36,0x35,0x20, + 0x3d,0x20,0x62,0x72,0x64,0x66,0x5f,0x6c,0x75,0x74,0x2e,0x73,0x61,0x6d,0x70,0x6c, + 0x65,0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32, + 0x28,0x5f,0x34,0x39,0x35,0x2c,0x20,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x20,0x3d,0x20,0x72,0x65, + 0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x5f,0x34,0x37,0x36,0x2c,0x20,0x4e,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x5f,0x35,0x35,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x5f,0x36,0x37,0x39,0x20,0x3d,0x20,0x73,0x6b,0x79,0x5f,0x72,0x65, + 0x66,0x6c,0x65,0x63,0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x32,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x33,0x2c,0x20,0x5f,0x35,0x35,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d, + 0x20,0x28,0x28,0x28,0x5f,0x36,0x37,0x39,0x20,0x2a,0x20,0x28,0x28,0x5f,0x36,0x34, + 0x36,0x20,0x2a,0x20,0x5f,0x36,0x36,0x35,0x2e,0x78,0x29,0x20,0x2b,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x36,0x36,0x35,0x2e,0x79,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x73, + 0x70,0x65,0x63,0x5f,0x73,0x63,0x61,0x6c,0x65,0x29,0x20,0x2a,0x20,0x28,0x31,0x2e, + 0x30,0x20,0x2d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28, + 0x28,0x72,0x6f,0x75,0x67,0x68,0x6e,0x65,0x73,0x73,0x20,0x2d,0x20,0x30,0x2e,0x35, + 0x29,0x20,0x2a,0x20,0x33,0x2e,0x33,0x33,0x33,0x33,0x33,0x33,0x32,0x35,0x33,0x38, + 0x36,0x30,0x34,0x37,0x33,0x36,0x33,0x32,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x69,0x6e,0x64,0x69, + 0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x73,0x68,0x5f,0x65,0x6e,0x61,0x62,0x6c,0x65, + 0x64,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69, + 0x66,0x66,0x20,0x3d,0x20,0x73,0x68,0x5f,0x69,0x72,0x72,0x61,0x64,0x69,0x61,0x6e, + 0x63,0x65,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x6c,0x69,0x6e,0x73,0x6d,0x70, + 0x2c,0x20,0x5f,0x36,0x32,0x39,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x6e,0x64,0x69,0x72,0x65, + 0x63,0x74,0x5f,0x74,0x69,0x6e,0x74,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,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44, + 0x69,0x66,0x66,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x32,0x35, + 0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29, + 0x20,0x2a,0x20,0x5f,0x32,0x35,0x34,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f, + 0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x34,0x38, + 0x20,0x3d,0x20,0x6c,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x34,0x39,0x20,0x3d,0x20,0x5f,0x37,0x34,0x38, + 0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x31,0x2e,0x30,0x29,0x20,0x2d,0x20,0x5f,0x36,0x34,0x36,0x29,0x20,0x2a,0x20, + 0x28,0x31,0x2e,0x30,0x20,0x2d,0x20,0x6d,0x65,0x74,0x61,0x6c,0x6c,0x69,0x63,0x29, + 0x29,0x20,0x2a,0x20,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x44,0x69,0x66,0x66, + 0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x33,0x31,0x38, + 0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30, + 0x38,0x35,0x39,0x33,0x37,0x35,0x29,0x29,0x20,0x2a,0x20,0x74,0x72,0x69,0x78,0x65, + 0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x5f,0x36,0x33,0x30,0x2e,0x78,0x29,0x20,0x2a,0x20,0x5f,0x32,0x35,0x34, + 0x2e,0x69,0x6e,0x64,0x69,0x72,0x65,0x63,0x74,0x5f,0x64,0x69,0x66,0x66,0x5f,0x73, + 0x63,0x61,0x6c,0x65,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74, + 0x20,0x3d,0x20,0x5f,0x37,0x34,0x39,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,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x5f,0x35,0x35,0x2e,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f, + 0x72,0x29,0x2c,0x20,0x5f,0x37,0x34,0x39,0x20,0x2b,0x20,0x28,0x28,0x74,0x72,0x69, + 0x78,0x65,0x6c,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x2e,0x78,0x79,0x7a, + 0x20,0x2a,0x20,0x65,0x6d,0x69,0x74,0x74,0x61,0x6e,0x63,0x65,0x29,0x20,0x2a,0x20, + 0x5f,0x32,0x35,0x34,0x2e,0x65,0x6d,0x69,0x73,0x73,0x69,0x76,0x65,0x5f,0x73,0x63, + 0x61,0x6c,0x65,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x73,0x6d,0x6f, + 0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35,0x35, + 0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c,0x20,0x69,0x6e, + 0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x5f,0x35,0x35,0x2e, + 0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x32,0x35,0x34,0x2e, + 0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x32,0x35,0x34,0x2e, + 0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28, + 0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x20,0x2d,0x20,0x69,0x6e,0x2e,0x63,0x61,0x6d, + 0x29,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76, + 0x69,0x65,0x77,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f, + 0x37,0x39,0x35,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x39,0x39,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28, + 0x5f,0x37,0x39,0x35,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39, + 0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x36, + 0x39,0x39,0x39,0x39,0x39,0x39,0x38,0x38,0x30,0x37,0x39,0x30,0x37,0x31,0x30,0x34, + 0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x37,0x39,0x2e,0x7a,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,0x69,0x66,0x20, - 0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77, - 0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, + 0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x37,0x39,0x39,0x2e,0x78,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37,0x39,0x39,0x2e, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37, + 0x39,0x39,0x2e,0x7a,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,0x69,0x66,0x20,0x28,0x5f,0x32,0x35,0x34,0x2e,0x69,0x73,0x5f,0x70, + 0x72,0x65,0x76,0x69,0x65,0x77,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,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x38,0x31,0x33,0x20,0x3d, + 0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x34,0x20,0x5f,0x37,0x39,0x33,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37, - 0x39,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f,0x37,0x39,0x33,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30, - 0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38, - 0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c,0x20,0x30,0x2e,0x32,0x30,0x30, - 0x30,0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32,0x33,0x32,0x32,0x33,0x38,0x37, - 0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,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,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x37,0x39,0x37,0x2e,0x78,0x3b,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,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x37, - 0x39,0x37,0x2e,0x79,0x3b,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, - 0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x37,0x39,0x37,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x00, + 0x61,0x74,0x33,0x20,0x5f,0x38,0x31,0x37,0x20,0x3d,0x20,0x6d,0x69,0x78,0x28,0x5f, + 0x38,0x31,0x33,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31, + 0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x2c, + 0x20,0x30,0x2e,0x32,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x39,0x38,0x30,0x32, + 0x33,0x32,0x32,0x33,0x38,0x37,0x36,0x39,0x35,0x33,0x31,0x32,0x35,0x29,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x3b,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,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x38,0x31, + 0x37,0x2e,0x78,0x3b,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,0x2e, + 0x79,0x20,0x3d,0x20,0x5f,0x38,0x31,0x37,0x2e,0x79,0x3b,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,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x38,0x31,0x37,0x2e, + 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75, + 0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc: sg_shader_desc; @@ -3679,7 +3712,7 @@ trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[1].glsl_uniforms[15].glsl_name = "_55.hsv_lighting"; desc.uniform_blocks[3].stage = .FRAGMENT; desc.uniform_blocks[3].layout = .STD140; - desc.uniform_blocks[3].size = 128; + desc.uniform_blocks[3].size = 144; desc.uniform_blocks[3].glsl_uniforms[0].type = .MAT4; desc.uniform_blocks[3].glsl_uniforms[0].array_count = 0; desc.uniform_blocks[3].glsl_uniforms[0].glsl_name = "_254.mvp_shadow"; @@ -3716,6 +3749,12 @@ trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[3].glsl_uniforms[11].type = .INT; desc.uniform_blocks[3].glsl_uniforms[11].array_count = 0; desc.uniform_blocks[3].glsl_uniforms[11].glsl_name = "_254.sh_enabled"; + desc.uniform_blocks[3].glsl_uniforms[12].type = .FLOAT; + desc.uniform_blocks[3].glsl_uniforms[12].array_count = 0; + desc.uniform_blocks[3].glsl_uniforms[12].glsl_name = "_254.fog_start"; + desc.uniform_blocks[3].glsl_uniforms[13].type = .FLOAT; + desc.uniform_blocks[3].glsl_uniforms[13].array_count = 0; + desc.uniform_blocks[3].glsl_uniforms[13].glsl_name = "_254.fog_end"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; @@ -3834,7 +3873,7 @@ trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[1].glsl_uniforms[15].glsl_name = "_55.hsv_lighting"; desc.uniform_blocks[3].stage = .FRAGMENT; desc.uniform_blocks[3].layout = .STD140; - desc.uniform_blocks[3].size = 128; + desc.uniform_blocks[3].size = 144; desc.uniform_blocks[3].glsl_uniforms[0].type = .MAT4; desc.uniform_blocks[3].glsl_uniforms[0].array_count = 0; desc.uniform_blocks[3].glsl_uniforms[0].glsl_name = "_254.mvp_shadow"; @@ -3871,6 +3910,12 @@ trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[3].glsl_uniforms[11].type = .INT; desc.uniform_blocks[3].glsl_uniforms[11].array_count = 0; desc.uniform_blocks[3].glsl_uniforms[11].glsl_name = "_254.sh_enabled"; + desc.uniform_blocks[3].glsl_uniforms[12].type = .FLOAT; + desc.uniform_blocks[3].glsl_uniforms[12].array_count = 0; + desc.uniform_blocks[3].glsl_uniforms[12].glsl_name = "_254.fog_start"; + desc.uniform_blocks[3].glsl_uniforms[13].type = .FLOAT; + desc.uniform_blocks[3].glsl_uniforms[13].array_count = 0; + desc.uniform_blocks[3].glsl_uniforms[13].glsl_name = "_254.fog_end"; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; desc.images[0].image_type = ._2D; @@ -3936,7 +3981,7 @@ trile_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.uniform_blocks[1].msl_buffer_n = 0; desc.uniform_blocks[3].stage = .FRAGMENT; desc.uniform_blocks[3].layout = .STD140; - desc.uniform_blocks[3].size = 128; + desc.uniform_blocks[3].size = 144; desc.uniform_blocks[3].msl_buffer_n = 1; desc.images[0].stage = .FRAGMENT; desc.images[0].multisampled = false; diff --git a/src/shaders/jai/shader_trile_lod.jai b/src/shaders/jai/shader_trile_lod.jai new file mode 100644 index 0000000..c91a6d2 --- /dev/null +++ b/src/shaders/jai/shader_trile_lod.jai @@ -0,0 +1,1491 @@ +/* + #version:1# (machine generated, don't edit!) + + Generated by sokol-shdc (https://github.com/floooh/sokol-tools) + + Cmdline: + sokol-shdc -i shader_trile_lod.glsl -o ./jai/shader_trile_lod.jai -l glsl430:glsl300es:metal_macos -f sokol_jai + + Overview: + ========= + Shader program: 'trile_lod': + Get shader desc: trile_lod_shader_desc(sg_query_backend()) + Vertex Shader: vs_trile_lod + Fragment Shader: fs_trile_lod + Attributes: + ATTR_trile_lod_position => 0 + ATTR_trile_lod_normal => 1 + ATTR_trile_lod_color => 2 + ATTR_trile_lod_instance => 3 + Bindings: + Uniform block 'trile_lod_vs_params': + Jai struct: Trile_Lod_Vs_Params + Bind slot: UB_trile_lod_vs_params => 0 + Uniform block 'trile_lod_fs_params': + Jai struct: Trile_Lod_Fs_Params + Bind slot: UB_trile_lod_fs_params => 1 +*/ +ATTR_trile_lod_position :: 0; +ATTR_trile_lod_normal :: 1; +ATTR_trile_lod_color :: 2; +ATTR_trile_lod_instance :: 3; +UB_trile_lod_vs_params :: 0; +UB_trile_lod_fs_params :: 1; +Trile_Lod_Vs_Params :: struct { + mvp: [16]float; + camera: [3]float; + _: [4]u8; +}; +Trile_Lod_Fs_Params :: struct { + skyBase: [3]float; + _: [4]u8; + sunPosition: [3]float; + _: [4]u8; + sunLightColor: [3]float; + sunIntensity: float; + ambient_color: [3]float; + ambient_intensity: float; + planeHeight: float; + _: [12]u8; + deepColor: [3]float; + is_reflection: s32; + fog_start: float; + fog_end: float; + _: [8]u8; +}; +/* + #version 430 + + uniform vec4 trile_lod_vs_params[5]; + layout(location = 3) in vec4 instance; + layout(location = 0) in vec4 position; + layout(location = 0) out vec3 vpos; + layout(location = 1) out vec3 cam; + layout(location = 2) out vec3 vcolor; + layout(location = 2) in vec4 color; + layout(location = 3) out vec3 vnorm; + layout(location = 1) in vec4 normal; + + mat3 rot_x(float a) + { + float _28 = cos(a); + float _31 = sin(a); + return mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, _28, -_31), vec3(0.0, _31, _28)); + } + + mat3 rot_z(float a) + { + float _64 = cos(a); + float _67 = sin(a); + return mat3(vec3(_64, -_67, 0.0), vec3(_67, _64, 0.0), vec3(0.0, 0.0, 1.0)); + } + + mat3 rot_y(float a) + { + float _47 = cos(a); + float _50 = sin(a); + return mat3(vec3(_47, 0.0, _50), vec3(0.0, 1.0, 0.0), vec3(-_50, 0.0, _47)); + } + + mat3 get_orientation_matrix(int ori) + { + int _82 = ori / 4; + mat3 base; + if (_82 == 0) + { + base = mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, 0.0, 1.0)); + } + else + { + if (_82 == 1) + { + float param = 3.1415927410125732421875; + base = rot_x(param); + } + else + { + if (_82 == 2) + { + float param_1 = -1.57079637050628662109375; + base = rot_z(param_1); + } + else + { + if (_82 == 3) + { + float param_2 = 1.57079637050628662109375; + base = rot_z(param_2); + } + else + { + if (_82 == 4) + { + float param_3 = 1.57079637050628662109375; + base = rot_x(param_3); + } + else + { + float param_4 = -1.57079637050628662109375; + base = rot_x(param_4); + } + } + } + } + } + float param_5 = float(ori % 4) * 1.57079637050628662109375; + return base * rot_y(param_5); + } + + void main() + { + int param = int(round(instance.w)); + mat3 _171 = get_orientation_matrix(param); + vec3 _200 = ((_171 * (position.xyz - vec3(0.5))) + vec3(0.5)) + instance.xyz; + gl_Position = mat4(trile_lod_vs_params[0], trile_lod_vs_params[1], trile_lod_vs_params[2], trile_lod_vs_params[3]) * vec4(_200, 1.0); + vpos = _200; + cam = trile_lod_vs_params[4].xyz; + vcolor = color.xyz; + vnorm = _171 * normal.xyz; + } + +*/ +vs_trile_lod_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,0x74,0x72,0x69,0x6c,0x65, + 0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35, + 0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20, + 0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x3b,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,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x33,0x20,0x76, + 0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61, + 0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x31,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65, + 0x63,0x33,0x20,0x63,0x61,0x6d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c, + 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x6f,0x75,0x74, + 0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6c,0x61, + 0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, + 0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20, + 0x76,0x6e,0x6f,0x72,0x6d,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,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x6d,0x61,0x74, + 0x33,0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38, + 0x20,0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x31,0x20,0x3d,0x20,0x73,0x69,0x6e,0x28,0x61, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61, + 0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x5f,0x32,0x38,0x2c,0x20,0x2d,0x5f,0x33,0x31,0x29,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x33,0x31,0x2c,0x20,0x5f,0x32,0x38, + 0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x6d,0x61,0x74,0x33,0x20,0x72,0x6f,0x74,0x5f, + 0x7a,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x63,0x6f,0x73, + 0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x36,0x37,0x20,0x3d,0x20,0x73,0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63, + 0x33,0x28,0x5f,0x36,0x34,0x2c,0x20,0x2d,0x5f,0x36,0x37,0x2c,0x20,0x30,0x2e,0x30, + 0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x36,0x37,0x2c,0x20,0x5f,0x36,0x34, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x6d,0x61,0x74,0x33,0x20,0x72,0x6f,0x74,0x5f,0x79,0x28,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x73, + 0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x5f,0x34,0x37,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c, + 0x20,0x76,0x65,0x63,0x33,0x28,0x2d,0x5f,0x35,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x5f,0x34,0x37,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x6d,0x61,0x74,0x33,0x20, + 0x67,0x65,0x74,0x5f,0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x5f, + 0x6d,0x61,0x74,0x72,0x69,0x78,0x28,0x69,0x6e,0x74,0x20,0x6f,0x72,0x69,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x38,0x32,0x20,0x3d,0x20, + 0x6f,0x72,0x69,0x20,0x2f,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x74, + 0x33,0x20,0x62,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x6d, + 0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30, + 0x29,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,0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x31,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,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x20,0x3d,0x20,0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31, + 0x32,0x35,0x37,0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20, + 0x72,0x6f,0x74,0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,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,0x69,0x66,0x20,0x28,0x5f, + 0x38,0x32,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x2d,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36, + 0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37, + 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x7a,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d, + 0x3d,0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30, + 0x37,0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30, + 0x39,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d, + 0x20,0x72,0x6f,0x74,0x5f,0x7a,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x34,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30,0x37, + 0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39, + 0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73, + 0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c, + 0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x2d,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36, + 0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f, + 0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,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,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x35,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x6f,0x72,0x69,0x20, + 0x25,0x20,0x34,0x29,0x20,0x2a,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33, + 0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61,0x73, + 0x65,0x20,0x2a,0x20,0x72,0x6f,0x74,0x5f,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 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,0x69,0x6e,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x69, + 0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x77,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x6d,0x61,0x74,0x33,0x20,0x5f,0x31,0x37,0x31,0x20,0x3d,0x20,0x67,0x65,0x74, + 0x5f,0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x6d,0x61,0x74, + 0x72,0x69,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31, + 0x37,0x31,0x20,0x2a,0x20,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78, + 0x79,0x7a,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x29, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20, + 0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, + 0x6d,0x61,0x74,0x34,0x28,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x74,0x72,0x69, + 0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x5b,0x31,0x5d,0x2c,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x74,0x72,0x69, + 0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32,0x30,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x70,0x6f,0x73, + 0x20,0x3d,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x61,0x6d, + 0x20,0x3d,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f, + 0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6e,0x6f,0x72,0x6d, + 0x20,0x3d,0x20,0x5f,0x31,0x37,0x31,0x20,0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 430 + + struct trile_lod_fs_params + { + vec3 skyBase; + vec3 sunPosition; + vec3 sunLightColor; + float sunIntensity; + vec3 ambient_color; + float ambient_intensity; + float planeHeight; + vec3 deepColor; + int is_reflection; + float fog_start; + float fog_end; + }; + + uniform trile_lod_fs_params _19; + + layout(location = 0) in vec3 vpos; + layout(location = 3) in vec3 vnorm; + layout(location = 2) in vec3 vcolor; + layout(location = 1) in vec3 cam; + layout(location = 0) out vec4 frag_color; + + void main() + { + bool _26 = vpos.y < (_19.planeHeight - 0.00999999977648258209228515625); + bool _35; + if (_26) + { + _35 = _19.is_reflection == 1; + } + else + { + _35 = _26; + } + if (_35) + { + discard; + } + float _55 = max(dot(normalize(vnorm), normalize(_19.sunPosition)), 0.0); + vec3 lit; + if (_19.is_reflection == 1) + { + lit = (vcolor * (((_19.sunLightColor * _55) * _19.sunIntensity) + vec3(0.100000001490116119384765625))) * vec3(0.3183098733425140380859375); + } + else + { + lit = (vcolor * (((_19.sunLightColor * _55) * _19.sunIntensity) + (_19.ambient_color * _19.ambient_intensity))) * vec3(0.3183098733425140380859375); + } + frag_color = vec4(mix(mix(_19.deepColor, lit, vec3(smoothstep(0.0, _19.planeHeight, vpos.y))), _19.skyBase, vec3(smoothstep(_19.fog_start, _19.fog_end, length(vpos - cam)))), 1.0); + } + +*/ +fs_trile_lod_source_glsl430 := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x33,0x30,0x0a,0x0a,0x73,0x74, + 0x72,0x75,0x63,0x74,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x66, + 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76, + 0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x75,0x6e,0x4c, + 0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74, + 0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x6d,0x62,0x69, + 0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x69,0x73,0x5f,0x72,0x65, + 0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64, + 0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x74,0x72, + 0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x20,0x5f,0x31,0x39,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,0x33,0x20,0x76,0x70,0x6f,0x73,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75, + 0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20, + 0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x6e,0x6f,0x72,0x6d,0x3b,0x0a,0x6c, + 0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d, + 0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x63,0x6f,0x6c, + 0x6f,0x72,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,0x33, + 0x20,0x63,0x61,0x6d,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,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x32,0x36,0x20,0x3d,0x20,0x76,0x70, + 0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e, + 0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39,0x39, + 0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39, + 0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x35,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x69, + 0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20, + 0x31,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, + 0x5f,0x33,0x35,0x20,0x3d,0x20,0x5f,0x32,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x35,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63, + 0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x35,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64, + 0x6f,0x74,0x28,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x76,0x6e,0x6f, + 0x72,0x6d,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f, + 0x31,0x39,0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x6c,0x69,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31, + 0x39,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x6c,0x69,0x74,0x20,0x3d,0x20,0x28,0x76,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x4c,0x69, + 0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x35,0x35,0x29,0x20, + 0x2a,0x20,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69, + 0x74,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x30,0x30, + 0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33, + 0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34, + 0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,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,0x6c,0x69, + 0x74,0x20,0x3d,0x20,0x28,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x28,0x28, + 0x28,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c, + 0x6f,0x72,0x20,0x2a,0x20,0x5f,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e, + 0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b,0x20, + 0x28,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, + 0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20,0x2a,0x20, + 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33, + 0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x6d, + 0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x39,0x2e,0x64,0x65,0x65,0x70,0x43, + 0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,0x74,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, + 0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x30,0x2c,0x20, + 0x5f,0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x2c, + 0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x5f,0x31,0x39,0x2e, + 0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x73,0x6d, + 0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x39,0x2e,0x66,0x6f,0x67, + 0x5f,0x73,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x66,0x6f,0x67,0x5f, + 0x65,0x6e,0x64,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76,0x70,0x6f,0x73, + 0x20,0x2d,0x20,0x63,0x61,0x6d,0x29,0x29,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 300 es + + uniform vec4 trile_lod_vs_params[5]; + layout(location = 3) in vec4 instance; + layout(location = 0) in vec4 position; + out vec3 vpos; + out vec3 cam; + out vec3 vcolor; + layout(location = 2) in vec4 color; + out vec3 vnorm; + layout(location = 1) in vec4 normal; + + mat3 rot_x(float a) + { + float _28 = cos(a); + float _31 = sin(a); + return mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, _28, -_31), vec3(0.0, _31, _28)); + } + + mat3 rot_z(float a) + { + float _64 = cos(a); + float _67 = sin(a); + return mat3(vec3(_64, -_67, 0.0), vec3(_67, _64, 0.0), vec3(0.0, 0.0, 1.0)); + } + + mat3 rot_y(float a) + { + float _47 = cos(a); + float _50 = sin(a); + return mat3(vec3(_47, 0.0, _50), vec3(0.0, 1.0, 0.0), vec3(-_50, 0.0, _47)); + } + + mat3 get_orientation_matrix(int ori) + { + int _82 = ori / 4; + mat3 base; + if (_82 == 0) + { + base = mat3(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), vec3(0.0, 0.0, 1.0)); + } + else + { + if (_82 == 1) + { + float param = 3.1415927410125732421875; + base = rot_x(param); + } + else + { + if (_82 == 2) + { + float param_1 = -1.57079637050628662109375; + base = rot_z(param_1); + } + else + { + if (_82 == 3) + { + float param_2 = 1.57079637050628662109375; + base = rot_z(param_2); + } + else + { + if (_82 == 4) + { + float param_3 = 1.57079637050628662109375; + base = rot_x(param_3); + } + else + { + float param_4 = -1.57079637050628662109375; + base = rot_x(param_4); + } + } + } + } + } + float param_5 = float(ori % 4) * 1.57079637050628662109375; + return base * rot_y(param_5); + } + + void main() + { + int param = int(round(instance.w)); + mat3 _171 = get_orientation_matrix(param); + vec3 _200 = ((_171 * (position.xyz - vec3(0.5))) + vec3(0.5)) + instance.xyz; + gl_Position = mat4(trile_lod_vs_params[0], trile_lod_vs_params[1], trile_lod_vs_params[2], trile_lod_vs_params[3]) * vec4(_200, 1.0); + vpos = _200; + cam = trile_lod_vs_params[4].xyz; + vcolor = color.xyz; + vnorm = _171 * normal.xyz; + } + +*/ +vs_trile_lod_source_glsl300es := u8.[ + 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, + 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x74,0x72, + 0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x35,0x5d,0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63, + 0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x33,0x29,0x20,0x69,0x6e,0x20,0x76,0x65, + 0x63,0x34,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x3b,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,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x70,0x6f, + 0x73,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x63,0x61,0x6d,0x3b, + 0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x6c,0x61,0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x20,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63,0x34,0x20,0x63, + 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76, + 0x6e,0x6f,0x72,0x6d,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,0x34,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x0a,0x6d,0x61,0x74,0x33, + 0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x29,0x0a, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x38,0x20, + 0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x33,0x31,0x20,0x3d,0x20,0x73,0x69,0x6e,0x28,0x61,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x74, + 0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c, + 0x20,0x5f,0x32,0x38,0x2c,0x20,0x2d,0x5f,0x33,0x31,0x29,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x33,0x31,0x2c,0x20,0x5f,0x32,0x38,0x29, + 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x6d,0x61,0x74,0x33,0x20,0x72,0x6f,0x74,0x5f,0x7a, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x63,0x6f,0x73,0x28, + 0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36, + 0x37,0x20,0x3d,0x20,0x73,0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33, + 0x28,0x5f,0x36,0x34,0x2c,0x20,0x2d,0x5f,0x36,0x37,0x2c,0x20,0x30,0x2e,0x30,0x29, + 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x5f,0x36,0x37,0x2c,0x20,0x5f,0x36,0x34,0x2c, + 0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x6d,0x61,0x74,0x33,0x20,0x72,0x6f,0x74,0x5f,0x79,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x34,0x37,0x20,0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x30,0x20,0x3d,0x20,0x73,0x69, + 0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6d,0x61,0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x5f,0x34,0x37,0x2c,0x20, + 0x30,0x2e,0x30,0x2c,0x20,0x5f,0x35,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28, + 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20, + 0x76,0x65,0x63,0x33,0x28,0x2d,0x5f,0x35,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, + 0x5f,0x34,0x37,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x6d,0x61,0x74,0x33,0x20,0x67, + 0x65,0x74,0x5f,0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x6d, + 0x61,0x74,0x72,0x69,0x78,0x28,0x69,0x6e,0x74,0x20,0x6f,0x72,0x69,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x38,0x32,0x20,0x3d,0x20,0x6f, + 0x72,0x69,0x20,0x2f,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x74,0x33, + 0x20,0x62,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x38,0x32,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x6d,0x61, + 0x74,0x33,0x28,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29, + 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, + 0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x31,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,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, + 0x3d,0x20,0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32, + 0x35,0x37,0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72, + 0x6f,0x74,0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,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,0x69,0x66,0x20,0x28,0x5f,0x38, + 0x32,0x20,0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x2d,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33, + 0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x7a,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d, + 0x20,0x33,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30,0x37, + 0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39, + 0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20, + 0x72,0x6f,0x74,0x5f,0x7a,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39, + 0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33, + 0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65, + 0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73, + 0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20, + 0x2d,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32, + 0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x78, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 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,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x35,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x6f,0x72,0x69,0x20,0x25, + 0x20,0x34,0x29,0x20,0x2a,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37, + 0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61,0x73,0x65, + 0x20,0x2a,0x20,0x72,0x6f,0x74,0x5f,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,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,0x69,0x6e,0x74,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x69,0x6e, + 0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x77,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x6d,0x61,0x74,0x33,0x20,0x5f,0x31,0x37,0x31,0x20,0x3d,0x20,0x67,0x65,0x74,0x5f, + 0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x5f,0x6d,0x61,0x74,0x72, + 0x69,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76, + 0x65,0x63,0x33,0x20,0x5f,0x32,0x30,0x30,0x20,0x3d,0x20,0x28,0x28,0x5f,0x31,0x37, + 0x31,0x20,0x2a,0x20,0x28,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79, + 0x7a,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x29,0x20, + 0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x69, + 0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x6d, + 0x61,0x74,0x34,0x28,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x74,0x72,0x69,0x6c, + 0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x31,0x5d,0x2c,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x74,0x72,0x69,0x6c, + 0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32,0x30,0x30,0x2c, + 0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x70,0x6f,0x73,0x20, + 0x3d,0x20,0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x63,0x61,0x6d,0x20, + 0x3d,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,0x5d,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x6e,0x6f,0x72,0x6d,0x20, + 0x3d,0x20,0x5f,0x31,0x37,0x31,0x20,0x2a,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x2e, + 0x78,0x79,0x7a,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 300 es + precision mediump float; + precision highp int; + + struct trile_lod_fs_params + { + highp vec3 skyBase; + highp vec3 sunPosition; + highp vec3 sunLightColor; + highp float sunIntensity; + highp vec3 ambient_color; + highp float ambient_intensity; + highp float planeHeight; + highp vec3 deepColor; + int is_reflection; + highp float fog_start; + highp float fog_end; + }; + + uniform trile_lod_fs_params _19; + + in highp vec3 vpos; + in highp vec3 vnorm; + in highp vec3 vcolor; + in highp vec3 cam; + layout(location = 0) out highp vec4 frag_color; + + void main() + { + bool _26 = vpos.y < (_19.planeHeight - 0.00999999977648258209228515625); + bool _35; + if (_26) + { + _35 = _19.is_reflection == 1; + } + else + { + _35 = _26; + } + if (_35) + { + discard; + } + highp float _55 = max(dot(normalize(vnorm), normalize(_19.sunPosition)), 0.0); + highp vec3 lit; + if (_19.is_reflection == 1) + { + lit = (vcolor * (((_19.sunLightColor * _55) * _19.sunIntensity) + vec3(0.100000001490116119384765625))) * vec3(0.3183098733425140380859375); + } + else + { + lit = (vcolor * (((_19.sunLightColor * _55) * _19.sunIntensity) + (_19.ambient_color * _19.ambient_intensity))) * vec3(0.3183098733425140380859375); + } + frag_color = vec4(mix(mix(_19.deepColor, lit, vec3(smoothstep(0.0, _19.planeHeight, vpos.y))), _19.skyBase, vec3(smoothstep(_19.fog_start, _19.fog_end, length(vpos - cam)))), 1.0); + } + +*/ +fs_trile_lod_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,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f, + 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73,0x6b,0x79,0x42,0x61, + 0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x73, + 0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x75, + 0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x61,0x6d,0x62,0x69,0x65, + 0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e, + 0x74,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,0x70,0x6c,0x61, + 0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x69,0x73,0x5f,0x72, + 0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68, + 0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x73, + 0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,0x3b,0x0a,0x7d, + 0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x74,0x72,0x69,0x6c,0x65, + 0x5f,0x6c,0x6f,0x64,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f, + 0x31,0x39,0x3b,0x0a,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x76,0x70,0x6f,0x73,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x6e,0x6f,0x72,0x6d,0x3b,0x0a,0x69,0x6e, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x63,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x63,0x61,0x6d,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,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69, + 0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f, + 0x32,0x36,0x20,0x3d,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f, + 0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x20,0x2d, + 0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39,0x39,0x39,0x39,0x37,0x37,0x36,0x34, + 0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32,0x38,0x35,0x31,0x35,0x36,0x32,0x35, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x35,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x36,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x35,0x20, + 0x3d,0x20,0x5f,0x31,0x39,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74, + 0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x33,0x35,0x20,0x3d,0x20,0x5f,0x32,0x36, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x33,0x35,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x35,0x35,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28, + 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x76,0x6e,0x6f,0x72,0x6d,0x29, + 0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x31,0x39,0x2e, + 0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20,0x30, + 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x6c,0x69,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, + 0x28,0x5f,0x31,0x39,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x74,0x20,0x3d,0x20,0x28,0x76,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x28,0x28,0x28,0x5f,0x31,0x39,0x2e,0x73,0x75, + 0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x35, + 0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65, + 0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, + 0x31,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31, + 0x31,0x39,0x33,0x38,0x34,0x37,0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x29,0x20,0x2a, + 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37, + 0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37, + 0x35,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,0x6c,0x69,0x74,0x20,0x3d,0x20,0x28,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a, + 0x20,0x28,0x28,0x28,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74, + 0x43,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f, + 0x31,0x39,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, + 0x20,0x2b,0x20,0x28,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69, + 0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29, + 0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39, + 0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39, + 0x33,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x34,0x28,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x39,0x2e,0x64,0x65, + 0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72,0x2c,0x20,0x6c,0x69,0x74,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e, + 0x30,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67, + 0x68,0x74,0x2c,0x20,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29,0x29,0x2c,0x20,0x5f, + 0x31,0x39,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x5f,0x31,0x39,0x2e, + 0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x66, + 0x6f,0x67,0x5f,0x65,0x6e,0x64,0x2c,0x20,0x6c,0x65,0x6e,0x67,0x74,0x68,0x28,0x76, + 0x70,0x6f,0x73,0x20,0x2d,0x20,0x63,0x61,0x6d,0x29,0x29,0x29,0x29,0x2c,0x20,0x31, + 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + struct trile_lod_vs_params + { + float4x4 mvp; + float3 camera; + }; + + struct main0_out + { + float3 vpos [[user(locn0)]]; + float3 cam [[user(locn1)]]; + float3 vcolor [[user(locn2)]]; + float3 vnorm [[user(locn3)]]; + float4 gl_Position [[position]]; + }; + + struct main0_in + { + float4 position [[attribute(0)]]; + float4 normal [[attribute(1)]]; + float4 color [[attribute(2)]]; + float4 instance [[attribute(3)]]; + }; + + static inline __attribute__((always_inline)) + float3x3 rot_x(thread const float& a) + { + float _28 = cos(a); + float _31 = sin(a); + return float3x3(float3(1.0, 0.0, 0.0), float3(0.0, _28, -_31), float3(0.0, _31, _28)); + } + + static inline __attribute__((always_inline)) + float3x3 rot_z(thread const float& a) + { + float _64 = cos(a); + float _67 = sin(a); + return float3x3(float3(_64, -_67, 0.0), float3(_67, _64, 0.0), float3(0.0, 0.0, 1.0)); + } + + static inline __attribute__((always_inline)) + float3x3 rot_y(thread const float& a) + { + float _47 = cos(a); + float _50 = sin(a); + return float3x3(float3(_47, 0.0, _50), float3(0.0, 1.0, 0.0), float3(-_50, 0.0, _47)); + } + + static inline __attribute__((always_inline)) + float3x3 get_orientation_matrix(thread const int& ori) + { + int _82 = ori / 4; + float3x3 base; + if (_82 == 0) + { + base = float3x3(float3(1.0, 0.0, 0.0), float3(0.0, 1.0, 0.0), float3(0.0, 0.0, 1.0)); + } + else + { + if (_82 == 1) + { + float param = 3.1415927410125732421875; + base = rot_x(param); + } + else + { + if (_82 == 2) + { + float param_1 = -1.57079637050628662109375; + base = rot_z(param_1); + } + else + { + if (_82 == 3) + { + float param_2 = 1.57079637050628662109375; + base = rot_z(param_2); + } + else + { + if (_82 == 4) + { + float param_3 = 1.57079637050628662109375; + base = rot_x(param_3); + } + else + { + float param_4 = -1.57079637050628662109375; + base = rot_x(param_4); + } + } + } + } + } + float param_5 = float(ori % 4) * 1.57079637050628662109375; + return base * rot_y(param_5); + } + + vertex main0_out main0(main0_in in [[stage_in]], constant trile_lod_vs_params& _193 [[buffer(0)]]) + { + main0_out out = {}; + int param = int(round(in.instance.w)); + float3x3 _171 = get_orientation_matrix(param); + float3 _200 = ((_171 * (in.position.xyz - float3(0.5))) + float3(0.5)) + in.instance.xyz; + out.gl_Position = _193.mvp * float4(_200, 1.0); + out.vpos = _200; + out.cam = _193.camera; + out.vcolor = in.color.xyz; + out.vnorm = _171 * in.normal.xyz; + return out; + } + +*/ +vs_trile_lod_source_metal_macos := u8.[ + 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, + 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, + 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, + 0x6f,0x74,0x79,0x70,0x65,0x73,0x22,0x0a,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64, + 0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f,0x73,0x74,0x64,0x6c,0x69,0x62,0x3e, + 0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f, + 0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a,0x75,0x73,0x69,0x6e,0x67,0x20,0x6e, + 0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20,0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a, + 0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f, + 0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x6d,0x76,0x70,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x63,0x61,0x6d,0x65,0x72, + 0x61,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,0x33,0x20,0x76,0x70,0x6f,0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, + 0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x63,0x61,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72, + 0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75, + 0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x6e,0x6f,0x72,0x6d,0x20,0x5b, + 0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x6c,0x5f,0x50,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b,0x5b,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,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,0x34,0x20,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x5b, + 0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x30,0x29,0x5d,0x5d,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x31, + 0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x63,0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x61,0x74,0x74,0x72,0x69,0x62,0x75,0x74, + 0x65,0x28,0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x69,0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x20,0x5b,0x5b,0x61,0x74, + 0x74,0x72,0x69,0x62,0x75,0x74,0x65,0x28,0x33,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,0x78,0x33,0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x74,0x68, + 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x26,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x32,0x38,0x20,0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x31,0x20,0x3d,0x20,0x73, + 0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x32, + 0x38,0x2c,0x20,0x2d,0x5f,0x33,0x31,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x5f,0x33,0x31,0x2c,0x20,0x5f,0x32,0x38,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,0x33,0x78,0x33,0x20,0x72,0x6f,0x74,0x5f,0x7a, + 0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x26,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x36,0x34,0x20,0x3d,0x20,0x63,0x6f,0x73,0x28,0x61,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x36,0x37,0x20, + 0x3d,0x20,0x73,0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x36,0x34,0x2c,0x20,0x2d,0x5f,0x36,0x37,0x2c,0x20, + 0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x36,0x37, + 0x2c,0x20,0x5f,0x36,0x34,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,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,0x33,0x78,0x33,0x20,0x72,0x6f, + 0x74,0x5f,0x79,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x61,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x63,0x6f,0x73, + 0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f, + 0x35,0x30,0x20,0x3d,0x20,0x73,0x69,0x6e,0x28,0x61,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x34,0x37,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x5f,0x35,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x2d,0x5f,0x35,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c, + 0x20,0x5f,0x34,0x37,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,0x33,0x78,0x33, + 0x20,0x67,0x65,0x74,0x5f,0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e, + 0x5f,0x6d,0x61,0x74,0x72,0x69,0x78,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63, + 0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x26,0x20,0x6f,0x72,0x69,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x38,0x32,0x20,0x3d,0x20,0x6f, + 0x72,0x69,0x20,0x2f,0x20,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x78,0x33,0x20,0x62,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, + 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20, + 0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29, + 0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28, + 0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,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,0x69,0x66, + 0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x31,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,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20, + 0x33,0x2e,0x31,0x34,0x31,0x35,0x39,0x32,0x37,0x34,0x31,0x30,0x31,0x32,0x35,0x37, + 0x33,0x32,0x34,0x32,0x31,0x38,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74, + 0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,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,0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20, + 0x3d,0x3d,0x20,0x32,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x20,0x3d,0x20,0x2d,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37,0x30, + 0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x7a,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x38,0x32,0x20,0x3d,0x3d,0x20,0x33, + 0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36, + 0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37, + 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f, + 0x74,0x5f,0x7a,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, + 0x38,0x32,0x20,0x3d,0x3d,0x20,0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33, + 0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d, + 0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x2d,0x31, + 0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37,0x30,0x35,0x30,0x36,0x32,0x38,0x36, + 0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x62,0x61,0x73,0x65,0x20,0x3d,0x20,0x72,0x6f,0x74,0x5f,0x78,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,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,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35, + 0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x6f,0x72,0x69,0x20,0x25,0x20,0x34, + 0x29,0x20,0x2a,0x20,0x31,0x2e,0x35,0x37,0x30,0x37,0x39,0x36,0x33,0x37,0x30,0x35, + 0x30,0x36,0x32,0x38,0x36,0x36,0x32,0x31,0x30,0x39,0x33,0x37,0x35,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x62,0x61,0x73,0x65,0x20,0x2a, + 0x20,0x72,0x6f,0x74,0x5f,0x79,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b, + 0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x72,0x74,0x65,0x78,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,0x74,0x72, + 0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x76,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x26,0x20,0x5f,0x31,0x39,0x33,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,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,0x69,0x6e,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d, + 0x20,0x69,0x6e,0x74,0x28,0x72,0x6f,0x75,0x6e,0x64,0x28,0x69,0x6e,0x2e,0x69,0x6e, + 0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x77,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x78,0x33,0x20,0x5f,0x31,0x37,0x31,0x20,0x3d,0x20, + 0x67,0x65,0x74,0x5f,0x6f,0x72,0x69,0x65,0x6e,0x74,0x61,0x74,0x69,0x6f,0x6e,0x5f, + 0x6d,0x61,0x74,0x72,0x69,0x78,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x30,0x30,0x20,0x3d, + 0x20,0x28,0x28,0x5f,0x31,0x37,0x31,0x20,0x2a,0x20,0x28,0x69,0x6e,0x2e,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x2e,0x78,0x79,0x7a,0x20,0x2d,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2b,0x20,0x69,0x6e,0x2e,0x69, + 0x6e,0x73,0x74,0x61,0x6e,0x63,0x65,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x6f,0x75,0x74,0x2e,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x20,0x3d,0x20,0x5f,0x31,0x39,0x33,0x2e,0x6d,0x76,0x70,0x20,0x2a,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x28,0x5f,0x32,0x30,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x70,0x6f,0x73,0x20,0x3d,0x20, + 0x5f,0x32,0x30,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x63,0x61, + 0x6d,0x20,0x3d,0x20,0x5f,0x31,0x39,0x33,0x2e,0x63,0x61,0x6d,0x65,0x72,0x61,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20, + 0x3d,0x20,0x69,0x6e,0x2e,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x6e,0x6f,0x72,0x6d,0x20,0x3d,0x20, + 0x5f,0x31,0x37,0x31,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #include + #include + + using namespace metal; + + struct trile_lod_fs_params + { + float3 skyBase; + float3 sunPosition; + packed_float3 sunLightColor; + float sunIntensity; + packed_float3 ambient_color; + float ambient_intensity; + float planeHeight; + char _m7_pad[12]; + packed_float3 deepColor; + int is_reflection; + float fog_start; + float fog_end; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float3 vpos [[user(locn0)]]; + float3 cam [[user(locn1)]]; + float3 vcolor [[user(locn2)]]; + float3 vnorm [[user(locn3)]]; + }; + + fragment main0_out main0(main0_in in [[stage_in]], constant trile_lod_fs_params& _19 [[buffer(0)]]) + { + main0_out out = {}; + bool _26 = in.vpos.y < (_19.planeHeight - 0.00999999977648258209228515625); + bool _35; + if (_26) + { + _35 = _19.is_reflection == 1; + } + else + { + _35 = _26; + } + if (_35) + { + discard_fragment(); + } + float _55 = fast::max(dot(fast::normalize(in.vnorm), fast::normalize(_19.sunPosition)), 0.0); + float3 lit; + if (_19.is_reflection == 1) + { + lit = (in.vcolor * (((float3(_19.sunLightColor) * _55) * _19.sunIntensity) + float3(0.100000001490116119384765625))) * float3(0.3183098733425140380859375); + } + else + { + lit = (in.vcolor * (((float3(_19.sunLightColor) * _55) * _19.sunIntensity) + (float3(_19.ambient_color) * _19.ambient_intensity))) * float3(0.3183098733425140380859375); + } + out.frag_color = float4(mix(mix(float3(_19.deepColor), lit, float3(smoothstep(0.0, _19.planeHeight, in.vpos.y))), _19.skyBase, float3(smoothstep(_19.fog_start, _19.fog_end, length(in.vpos - in.cam)))), 1.0); + return out; + } + +*/ +fs_trile_lod_source_metal_macos := u8.[ + 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, + 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, + 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, + 0x75,0x73,0x69,0x6e,0x67,0x20,0x6e,0x61,0x6d,0x65,0x73,0x70,0x61,0x63,0x65,0x20, + 0x6d,0x65,0x74,0x61,0x6c,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x74, + 0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f,0x64,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, + 0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x20,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x75,0x6e,0x49, + 0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61, + 0x63,0x6b,0x65,0x64,0x5f,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x61,0x6d,0x62,0x69, + 0x65,0x6e,0x74,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x69,0x6e,0x74, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69,0x67,0x68,0x74,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x63,0x68,0x61,0x72,0x20,0x5f,0x6d,0x37,0x5f,0x70,0x61,0x64,0x5b, + 0x31,0x32,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x63,0x6b,0x65,0x64,0x5f, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x64,0x65,0x65,0x70,0x43,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x69,0x73,0x5f,0x72,0x65,0x66, + 0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,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,0x33,0x20,0x76,0x70,0x6f, + 0x73,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x30,0x29,0x5d, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x63,0x61, + 0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e,0x31,0x29,0x5d, + 0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x76,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, + 0x32,0x29,0x5d,0x5d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x76,0x6e,0x6f,0x72,0x6d,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f, + 0x63,0x6e,0x33,0x29,0x5d,0x5d,0x3b,0x0a,0x7d,0x3b,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,0x74,0x72,0x69,0x6c,0x65,0x5f,0x6c,0x6f, + 0x64,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x39, + 0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,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,0x62,0x6f, + 0x6f,0x6c,0x20,0x5f,0x32,0x36,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73, + 0x2e,0x79,0x20,0x3c,0x20,0x28,0x5f,0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48, + 0x65,0x69,0x67,0x68,0x74,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x39,0x39,0x39,0x39, + 0x39,0x39,0x39,0x37,0x37,0x36,0x34,0x38,0x32,0x35,0x38,0x32,0x30,0x39,0x32,0x32, + 0x38,0x35,0x31,0x35,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x62,0x6f, + 0x6f,0x6c,0x20,0x5f,0x33,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, + 0x5f,0x32,0x36,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x5f,0x33,0x35,0x20,0x3d,0x20,0x5f,0x31,0x39,0x2e,0x69,0x73,0x5f, + 0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x3d,0x20,0x31,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,0x5f,0x33, + 0x35,0x20,0x3d,0x20,0x5f,0x32,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x35,0x29,0x0a,0x20,0x20,0x20,0x20, + 0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72, + 0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35, + 0x35,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f, + 0x74,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, + 0x65,0x28,0x69,0x6e,0x2e,0x76,0x6e,0x6f,0x72,0x6d,0x29,0x2c,0x20,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x5f,0x31,0x39, + 0x2e,0x73,0x75,0x6e,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x29,0x29,0x2c,0x20, + 0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x6c,0x69,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31, + 0x39,0x2e,0x69,0x73,0x5f,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x3d,0x20,0x31,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x6c,0x69,0x74,0x20,0x3d,0x20,0x28,0x69,0x6e,0x2e,0x76,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20,0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c, + 0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39, + 0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x31,0x30,0x30,0x30,0x30,0x30, + 0x30,0x30,0x31,0x34,0x39,0x30,0x31,0x31,0x36,0x31,0x31,0x39,0x33,0x38,0x34,0x37, + 0x36,0x35,0x36,0x32,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x38,0x37,0x33,0x33,0x34,0x32, + 0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35,0x39,0x33,0x37,0x35,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,0x6c,0x69,0x74, + 0x20,0x3d,0x20,0x28,0x69,0x6e,0x2e,0x76,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x20, + 0x28,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x39,0x2e,0x73,0x75, + 0x6e,0x4c,0x69,0x67,0x68,0x74,0x43,0x6f,0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f, + 0x35,0x35,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e,0x73,0x75,0x6e,0x49,0x6e,0x74, + 0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x29,0x20,0x2a,0x20,0x5f,0x31,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65, + 0x6e,0x74,0x5f,0x69,0x6e,0x74,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x29,0x29,0x20, + 0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x33,0x31,0x38,0x33,0x30, + 0x39,0x38,0x37,0x33,0x33,0x34,0x32,0x35,0x31,0x34,0x30,0x33,0x38,0x30,0x38,0x35, + 0x39,0x33,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,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,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78, + 0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x39,0x2e,0x64,0x65,0x65,0x70, + 0x43,0x6f,0x6c,0x6f,0x72,0x29,0x2c,0x20,0x6c,0x69,0x74,0x2c,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30, + 0x2e,0x30,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x70,0x6c,0x61,0x6e,0x65,0x48,0x65,0x69, + 0x67,0x68,0x74,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x2e,0x79,0x29,0x29, + 0x29,0x2c,0x20,0x5f,0x31,0x39,0x2e,0x73,0x6b,0x79,0x42,0x61,0x73,0x65,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65, + 0x70,0x28,0x5f,0x31,0x39,0x2e,0x66,0x6f,0x67,0x5f,0x73,0x74,0x61,0x72,0x74,0x2c, + 0x20,0x5f,0x31,0x39,0x2e,0x66,0x6f,0x67,0x5f,0x65,0x6e,0x64,0x2c,0x20,0x6c,0x65, + 0x6e,0x67,0x74,0x68,0x28,0x69,0x6e,0x2e,0x76,0x70,0x6f,0x73,0x20,0x2d,0x20,0x69, + 0x6e,0x2e,0x63,0x61,0x6d,0x29,0x29,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, +]; +trile_lod_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "trile_lod_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_trile_lod_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_trile_lod_source_glsl430; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "normal"; + desc.attrs[2].base_type = .FLOAT; + desc.attrs[2].glsl_name = "color"; + desc.attrs[3].base_type = .FLOAT; + desc.attrs[3].glsl_name = "instance"; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 80; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 5; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "trile_lod_vs_params"; + desc.uniform_blocks[1].stage = .FRAGMENT; + desc.uniform_blocks[1].layout = .STD140; + desc.uniform_blocks[1].size = 112; + desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "_19.skyBase"; + desc.uniform_blocks[1].glsl_uniforms[1].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[1].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[1].glsl_name = "_19.sunPosition"; + desc.uniform_blocks[1].glsl_uniforms[2].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[2].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[2].glsl_name = "_19.sunLightColor"; + desc.uniform_blocks[1].glsl_uniforms[3].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[3].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[3].glsl_name = "_19.sunIntensity"; + desc.uniform_blocks[1].glsl_uniforms[4].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[4].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[4].glsl_name = "_19.ambient_color"; + desc.uniform_blocks[1].glsl_uniforms[5].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[5].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[5].glsl_name = "_19.ambient_intensity"; + desc.uniform_blocks[1].glsl_uniforms[6].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[6].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[6].glsl_name = "_19.planeHeight"; + desc.uniform_blocks[1].glsl_uniforms[7].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[7].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[7].glsl_name = "_19.deepColor"; + desc.uniform_blocks[1].glsl_uniforms[8].type = .INT; + desc.uniform_blocks[1].glsl_uniforms[8].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[8].glsl_name = "_19.is_reflection"; + desc.uniform_blocks[1].glsl_uniforms[9].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[9].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[9].glsl_name = "_19.fog_start"; + desc.uniform_blocks[1].glsl_uniforms[10].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[10].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[10].glsl_name = "_19.fog_end"; + case .GLES3; + desc.vertex_func.source = xx *vs_trile_lod_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_trile_lod_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[0].glsl_name = "position"; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[1].glsl_name = "normal"; + desc.attrs[2].base_type = .FLOAT; + desc.attrs[2].glsl_name = "color"; + desc.attrs[3].base_type = .FLOAT; + desc.attrs[3].glsl_name = "instance"; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 80; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 5; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "trile_lod_vs_params"; + desc.uniform_blocks[1].stage = .FRAGMENT; + desc.uniform_blocks[1].layout = .STD140; + desc.uniform_blocks[1].size = 112; + desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "_19.skyBase"; + desc.uniform_blocks[1].glsl_uniforms[1].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[1].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[1].glsl_name = "_19.sunPosition"; + desc.uniform_blocks[1].glsl_uniforms[2].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[2].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[2].glsl_name = "_19.sunLightColor"; + desc.uniform_blocks[1].glsl_uniforms[3].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[3].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[3].glsl_name = "_19.sunIntensity"; + desc.uniform_blocks[1].glsl_uniforms[4].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[4].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[4].glsl_name = "_19.ambient_color"; + desc.uniform_blocks[1].glsl_uniforms[5].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[5].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[5].glsl_name = "_19.ambient_intensity"; + desc.uniform_blocks[1].glsl_uniforms[6].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[6].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[6].glsl_name = "_19.planeHeight"; + desc.uniform_blocks[1].glsl_uniforms[7].type = .FLOAT3; + desc.uniform_blocks[1].glsl_uniforms[7].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[7].glsl_name = "_19.deepColor"; + desc.uniform_blocks[1].glsl_uniforms[8].type = .INT; + desc.uniform_blocks[1].glsl_uniforms[8].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[8].glsl_name = "_19.is_reflection"; + desc.uniform_blocks[1].glsl_uniforms[9].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[9].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[9].glsl_name = "_19.fog_start"; + desc.uniform_blocks[1].glsl_uniforms[10].type = .FLOAT; + desc.uniform_blocks[1].glsl_uniforms[10].array_count = 0; + desc.uniform_blocks[1].glsl_uniforms[10].glsl_name = "_19.fog_end"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_trile_lod_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_trile_lod_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.attrs[0].base_type = .FLOAT; + desc.attrs[1].base_type = .FLOAT; + desc.attrs[2].base_type = .FLOAT; + desc.attrs[3].base_type = .FLOAT; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 80; + desc.uniform_blocks[0].msl_buffer_n = 0; + desc.uniform_blocks[1].stage = .FRAGMENT; + desc.uniform_blocks[1].layout = .STD140; + desc.uniform_blocks[1].size = 112; + desc.uniform_blocks[1].msl_buffer_n = 0; + } + return desc; +} diff --git a/src/shaders/shader_bloom.glsl b/src/shaders/shader_bloom.glsl deleted file mode 100644 index 6570f24..0000000 --- a/src/shaders/shader_bloom.glsl +++ /dev/null @@ -1,32 +0,0 @@ -@vs vs_bloom -in vec2 position; -in vec2 uv; - -out vec2 texcoord; - -void main() { - gl_Position = vec4(position, 0.5, 1.0); - texcoord = uv; -} -@end - -@fs fs_bloom -in vec2 texcoord; -out vec4 frag_color; - -layout(binding=0) uniform bloom_params { - float bloom_treshold; -}; - -layout(binding = 0) uniform texture2D bloom_src; -layout(binding = 0) uniform sampler bloom_src_smp; - -void main() { - vec4 color = texture(sampler2D(bloom_src, bloom_src_smp), texcoord); - float value = max(color.r, max(color.g, color.b)); - if(value < bloom_treshold) { color = vec4(0.0, 0.0, 0.0, 1.0); } - frag_color = vec4(color.rgb, 1.0); -} -@end - -@program bloom vs_bloom fs_bloom diff --git a/src/shaders/shader_bloom_downsample.glsl b/src/shaders/shader_bloom_downsample.glsl new file mode 100644 index 0000000..4890d83 --- /dev/null +++ b/src/shaders/shader_bloom_downsample.glsl @@ -0,0 +1,35 @@ +@vs vs_bloom_downsample +in vec2 position; +in vec2 uv; + +out vec2 texcoord; + +void main() { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; +} +@end + +@fs fs_bloom_downsample +in vec2 texcoord; +out vec4 frag_color; + +layout(binding=0) uniform bloom_downsample_params { + float src_texel_x; + float src_texel_y; +}; + +layout(binding = 0) uniform texture2D bloom_downsample_src; +layout(binding = 0) uniform sampler bloom_downsample_src_smp; + +void main() { + vec2 ts = vec2(src_texel_x, src_texel_y) * 0.5; + vec3 a = texture(sampler2D(bloom_downsample_src, bloom_downsample_src_smp), texcoord + vec2(-ts.x, -ts.y)).rgb; + vec3 b = texture(sampler2D(bloom_downsample_src, bloom_downsample_src_smp), texcoord + vec2( ts.x, -ts.y)).rgb; + vec3 c = texture(sampler2D(bloom_downsample_src, bloom_downsample_src_smp), texcoord + vec2(-ts.x, ts.y)).rgb; + vec3 d = texture(sampler2D(bloom_downsample_src, bloom_downsample_src_smp), texcoord + vec2( ts.x, ts.y)).rgb; + frag_color = vec4((a + b + c + d) * 0.25, 1.0); +} +@end + +@program bloom_downsample vs_bloom_downsample fs_bloom_downsample diff --git a/src/shaders/shader_bloom_prefilter.glsl b/src/shaders/shader_bloom_prefilter.glsl new file mode 100644 index 0000000..acb92fe --- /dev/null +++ b/src/shaders/shader_bloom_prefilter.glsl @@ -0,0 +1,39 @@ +@vs vs_bloom_prefilter +in vec2 position; +in vec2 uv; + +out vec2 texcoord; + +void main() { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; +} +@end + +@fs fs_bloom_prefilter +in vec2 texcoord; +out vec4 frag_color; + +layout(binding=0) uniform bloom_prefilter_params { + float src_texel_x; + float src_texel_y; + float threshold; +}; + +layout(binding = 0) uniform texture2D bloom_prefilter_src; +layout(binding = 0) uniform sampler bloom_prefilter_src_smp; + +void main() { + vec2 ts = vec2(src_texel_x, src_texel_y) * 0.5; + vec3 a = texture(sampler2D(bloom_prefilter_src, bloom_prefilter_src_smp), texcoord + vec2(-ts.x, -ts.y)).rgb; + vec3 b = texture(sampler2D(bloom_prefilter_src, bloom_prefilter_src_smp), texcoord + vec2( ts.x, -ts.y)).rgb; + vec3 c = texture(sampler2D(bloom_prefilter_src, bloom_prefilter_src_smp), texcoord + vec2(-ts.x, ts.y)).rgb; + vec3 d = texture(sampler2D(bloom_prefilter_src, bloom_prefilter_src_smp), texcoord + vec2( ts.x, ts.y)).rgb; + vec3 color = (a + b + c + d) * 0.25; + float lum = dot(color, vec3(0.2126, 0.7152, 0.0722)); + if (lum < threshold) color = vec3(0.0); + frag_color = vec4(color, 1.0); +} +@end + +@program bloom_prefilter vs_bloom_prefilter fs_bloom_prefilter diff --git a/src/shaders/shader_bloom_upsample.glsl b/src/shaders/shader_bloom_upsample.glsl new file mode 100644 index 0000000..1299b46 --- /dev/null +++ b/src/shaders/shader_bloom_upsample.glsl @@ -0,0 +1,39 @@ +@vs vs_bloom_upsample +in vec2 position; +in vec2 uv; + +out vec2 texcoord; + +void main() { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; +} +@end + +@fs fs_bloom_upsample +in vec2 texcoord; +out vec4 frag_color; + +layout(binding=0) uniform bloom_upsample_params { + float src_texel_x; + float src_texel_y; +}; + +layout(binding = 0) uniform texture2D bloom_upsample_small; +layout(binding = 0) uniform sampler bloom_upsample_small_smp; +layout(binding = 1) uniform texture2D bloom_upsample_large; +layout(binding = 1) uniform sampler bloom_upsample_large_smp; + +void main() { + vec2 ts = vec2(src_texel_x, src_texel_y) * 0.5; + vec3 tent = + texture(sampler2D(bloom_upsample_small, bloom_upsample_small_smp), texcoord + vec2(-ts.x, -ts.y)).rgb + + texture(sampler2D(bloom_upsample_small, bloom_upsample_small_smp), texcoord + vec2( ts.x, -ts.y)).rgb + + texture(sampler2D(bloom_upsample_small, bloom_upsample_small_smp), texcoord + vec2(-ts.x, ts.y)).rgb + + texture(sampler2D(bloom_upsample_small, bloom_upsample_small_smp), texcoord + vec2( ts.x, ts.y)).rgb; + vec3 large = texture(sampler2D(bloom_upsample_large, bloom_upsample_large_smp), texcoord).rgb; + frag_color = vec4(tent * 0.25 + large, 1.0); +} +@end + +@program bloom_upsample vs_bloom_upsample fs_bloom_upsample diff --git a/src/shaders/shader_dof.glsl b/src/shaders/shader_dof.glsl deleted file mode 100644 index ab6c6da..0000000 --- a/src/shaders/shader_dof.glsl +++ /dev/null @@ -1,32 +0,0 @@ -@vs vs_dof -in vec2 position; -in vec2 uv; - -out vec2 texcoord; - -void main() { - gl_Position = vec4(position, 0.5, 1.0); - texcoord = uv; -} -@end - -@fs fs_dof -in vec2 texcoord; -out vec4 frag_color; - -layout(binding=0) uniform dof_params { - float dof_treshold; -}; - -layout(binding = 0) uniform texture2D dof_src; -layout(binding = 0) uniform sampler dof_src_smp; - -void main() { - vec4 color = texture(sampler2D(dof_src, dof_src_smp), texcoord); - float value = max(color.r, max(color.g, color.b)); - if(value < dof_treshold) { color = vec4(0.0, 0.0, 0.0, 1.0); } - frag_color = vec4(color.rgb, 1.0); -} -@end - -@program dof vs_dof fs_dof diff --git a/src/shaders/shader_dof_blur.glsl b/src/shaders/shader_dof_blur.glsl new file mode 100644 index 0000000..05519c3 --- /dev/null +++ b/src/shaders/shader_dof_blur.glsl @@ -0,0 +1,48 @@ +@vs vs_dof_blur +in vec2 position; +in vec2 uv; + +out vec2 texcoord; + +void main() { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; +} +@end + +@fs fs_dof_blur +in vec2 texcoord; +out vec4 frag_color; + +layout(binding=0) uniform dof_blur_params { + float bokeh_radius_x; + float bokeh_radius_y; +}; + +layout(binding = 0) uniform texture2D dof_blur_src; +layout(binding = 0) uniform sampler dof_blur_src_smp; + +void main() { + const int NUM_SAMPLES = 32; + const float GOLDEN_ANGLE = 2.39996323; + + vec4 best = texture(sampler2D(dof_blur_src, dof_blur_src_smp), texcoord); + float best_lum = dot(best.rgb, vec3(0.2126, 0.7152, 0.0722)); + + for (int i = 0; i < NUM_SAMPLES; i++) { + float theta = float(i) * GOLDEN_ANGLE; + float r = sqrt(float(i) / float(NUM_SAMPLES - 1) + 0.001); + vec2 offset = vec2(cos(theta), sin(theta)) * r * vec2(bokeh_radius_x, bokeh_radius_y); + vec4 s = texture(sampler2D(dof_blur_src, dof_blur_src_smp), texcoord + offset); + float lum = dot(s.rgb, vec3(0.2126, 0.7152, 0.0722)); + if (lum > best_lum) { + best = s; + best_lum = lum; + } + } + + frag_color = best; +} +@end + +@program dof_blur vs_dof_blur fs_dof_blur diff --git a/src/shaders/shader_dof_downsample.glsl b/src/shaders/shader_dof_downsample.glsl new file mode 100644 index 0000000..81b77e7 --- /dev/null +++ b/src/shaders/shader_dof_downsample.glsl @@ -0,0 +1,25 @@ +@vs vs_dof_downsample +in vec2 position; +in vec2 uv; + +out vec2 texcoord; + +void main() { + gl_Position = vec4(position, 0.5, 1.0); + texcoord = uv; +} +@end + +@fs fs_dof_downsample +in vec2 texcoord; +out vec4 frag_color; + +layout(binding = 0) uniform texture2D dof_downsample_src; +layout(binding = 0) uniform sampler dof_downsample_src_smp; + +void main() { + frag_color = vec4(texture(sampler2D(dof_downsample_src, dof_downsample_src_smp), texcoord).rgb, 1.0); +} +@end + +@program dof_downsample vs_dof_downsample fs_dof_downsample diff --git a/src/shaders/shader_gbuffer_billboard.glsl b/src/shaders/shader_gbuffer_billboard.glsl index b46014f..9cd1893 100644 --- a/src/shaders/shader_gbuffer_billboard.glsl +++ b/src/shaders/shader_gbuffer_billboard.glsl @@ -22,7 +22,7 @@ void main() { vec3 look_dir = offset - cam; look_dir.y = 0.0; look_dir = normalize(look_dir); - if(faceDir.x < -10) look_dir = faceDir; + if(faceDir.x > -10) look_dir = faceDir; vec3 world_right = normalize(cross(world_up, look_dir)); vec3 world_pos = offset + (world_right * local_pos.x) + (world_up * local_pos.y); gl_Position = mvp * vec4(world_pos, 1.0); diff --git a/src/shaders/shader_post_process_main.glsl b/src/shaders/shader_post_process_main.glsl index a1e7d7f..60288bb 100644 --- a/src/shaders/shader_post_process_main.glsl +++ b/src/shaders/shader_post_process_main.glsl @@ -25,6 +25,11 @@ layout(binding = 3) uniform sampler dof_smp; layout(binding = 4) uniform texture2D pos_buf; layout(binding = 4) uniform sampler pos_smp; +layout(binding=1) uniform dof_config { + float dof_max; + float dof_point; +}; + layout(binding=0) uniform post_process_config { float exposure; float contrast; @@ -43,14 +48,6 @@ layout(binding=0) uniform post_process_config { float bloom_amount; }; -layout(binding=1) uniform dof_config { - float dof_min; - float dof_max; - float dof_point; - float dof_tex_width; - float dof_tex_height; -}; - vec3 aces(vec3 x) { const float a = 2.51; const float b = 0.03; @@ -129,11 +126,16 @@ void main() { 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_color_hdr = vec3(r,g,b + dof_min * 0.00000000000001); + sampled_color_hdr = vec3(r,g,b); } else { sampled_color_hdr = texture(sampler2D(pptex, ppsmp), distorted_texcoord).rgb; } + float view_z = texture(sampler2D(pos_buf, pos_smp), distorted_texcoord).z; + float depth = abs(view_z); + float coc = smoothstep(0.0, 1.0, abs(depth - dof_point) / max(dof_max, 0.0001)); + vec3 dof_blurred = texture(sampler2D(dof_tex, dof_smp), distorted_texcoord).rgb; + sampled_color_hdr = mix(sampled_color_hdr, dof_blurred, coc); vec3 bloom_color = texture(sampler2D(bloom_tex, bloom_smp), distorted_texcoord).rgb; vec3 color_hdr = (sampled_color_hdr + bloom_color * bloom_amount) * exposure; diff --git a/src/shaders/shader_sh_deferred.glsl b/src/shaders/shader_sh_deferred.glsl index fa33728..2bbd938 100644 --- a/src/shaders/shader_sh_deferred.glsl +++ b/src/shaders/shader_sh_deferred.glsl @@ -28,7 +28,7 @@ const float PI = 3.14159265359; vec3 sh_eval(ivec3 probe, vec3 N) { int base = probe.x * 3; - int row = probe.z * 64 + probe.y; + int row = probe.z * 32 + probe.y; vec4 t0 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base, row), 0); vec4 t1 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base+1, row), 0); vec4 t2 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base+2, row), 0); @@ -41,7 +41,7 @@ vec3 sh_eval(ivec3 probe, vec3 N) { float sh_probe_energy(ivec3 probe) { int base = probe.x * 3; - int row = probe.z * 64 + probe.y; + int row = probe.z * 32 + probe.y; vec4 t0 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base, row), 0); vec4 t1 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base+1, row), 0); vec4 t2 = texelFetch(sampler2D(sh_chunk, sh_smp), ivec2(base+2, row), 0); @@ -90,10 +90,10 @@ void main() { vec3 world_norm = normalize(mat3(inv_view) * view_norm); const float SH_PAD = 2.0; - const float SH_SPACING = (32.0 + 2.0 * SH_PAD) / 64.0; - vec3 probe_f = clamp((world_pos - (cmin - vec3(SH_PAD))) / SH_SPACING, vec3(0.0), vec3(63.0)); + const float SH_SPACING = (32.0 + 2.0 * SH_PAD) / 32.0; + vec3 probe_f = clamp((world_pos - (cmin - vec3(SH_PAD))) / SH_SPACING, vec3(0.0), vec3(31.0)); ivec3 p0 = ivec3(floor(probe_f)); - ivec3 p1 = min(p0 + ivec3(1), ivec3(63)); + ivec3 p1 = min(p0 + ivec3(1), ivec3(31)); frag_color = vec4(sh_eval_trilinear(p0, p1, fract(probe_f), world_norm), 1.0); } diff --git a/src/shaders/shader_trile.glsl b/src/shaders/shader_trile.glsl index 960104e..5434873 100644 --- a/src/shaders/shader_trile.glsl +++ b/src/shaders/shader_trile.glsl @@ -100,6 +100,8 @@ layout(binding=3) uniform trile_fs_params { int is_preview; vec3 indirect_tint; int sh_enabled; + float fog_start; + float fog_end; }; layout(binding = 0) uniform texture2D triletex; @@ -270,7 +272,13 @@ void main() { light += (1.0 - Frough) * (1.0 - metallic) * indirectDiff / PI * albedo * ssao * indirect_diff_scale; vec3 final_color = light + emissive; - frag_color = vec4(mix(deepColor, final_color, smoothstep(0.0, planeHeight, vpos.y)), 1.0); + final_color = mix(deepColor, final_color, smoothstep(0.0, planeHeight, vpos.y)); + + float fog_dist = length(vpos - cam); + float fog_factor = smoothstep(fog_start, fog_end, fog_dist); + final_color = mix(final_color, skyBase, fog_factor); + + frag_color = vec4(final_color, 1.0); if (is_preview == 1) frag_color.rgb = mix(frag_color.rgb, vec3(0.3, 0.7, 1.0), 0.5); else if (is_preview == 2) frag_color.rgb = mix(frag_color.rgb, vec3(1.0, 0.3, 0.2), 0.5); diff --git a/src/shaders/shader_trile_lod.glsl b/src/shaders/shader_trile_lod.glsl new file mode 100644 index 0000000..b4ea10a --- /dev/null +++ b/src/shaders/shader_trile_lod.glsl @@ -0,0 +1,97 @@ +@vs vs_trile_lod + +in vec4 position; +in vec4 normal; +in vec4 color; +in vec4 instance; + +layout(binding=0) uniform trile_lod_vs_params { + mat4 mvp; + vec3 camera; +}; + +out vec3 vpos; +out vec3 cam; +out vec3 vcolor; +out vec3 vnorm; + +mat3 rot_x(float a) { float c=cos(a),s=sin(a); return mat3(1,0,0, 0,c,-s, 0,s,c); } +mat3 rot_y(float a) { float c=cos(a),s=sin(a); return mat3(c,0,s, 0,1,0, -s,0,c); } +mat3 rot_z(float a) { float c=cos(a),s=sin(a); return mat3(c,-s,0, s,c,0, 0,0,1); } + +mat3 get_orientation_matrix(int ori) { + int face = ori / 4; + int twist = ori % 4; + float PI = 3.1415927; + mat3 base; + if (face == 0) base = mat3(1.0); + else if (face == 1) base = rot_x(PI); + else if (face == 2) base = rot_z(-PI*0.5); + else if (face == 3) base = rot_z( PI*0.5); + else if (face == 4) base = rot_x( PI*0.5); + else base = rot_x(-PI*0.5); + return base * rot_y(float(twist) * PI * 0.5); +} + +void main() { + int ori = int(round(instance.w)); + mat3 rot = get_orientation_matrix(ori); + vec3 local = position.xyz - 0.5; + vec3 rotated = rot * local + 0.5; + + gl_Position = mvp * vec4(rotated + instance.xyz, 1.0); + vpos = rotated + instance.xyz; + cam = camera; + vcolor = color.xyz; + vnorm = rot * normal.xyz; +} +@end + +@fs fs_trile_lod + +layout(binding=1) uniform trile_lod_fs_params { + vec3 skyBase; + vec3 sunPosition; + vec3 sunLightColor; + float sunIntensity; + vec3 ambient_color; + float ambient_intensity; + float planeHeight; + vec3 deepColor; + int is_reflection; + float fog_start; + float fog_end; +}; + +in vec3 vpos; +in vec3 cam; +in vec3 vcolor; +in vec3 vnorm; +out vec4 frag_color; + +void main() { + if (vpos.y < planeHeight - 0.01 && is_reflection == 1) discard; + + const float PI = 3.1415927; + vec3 N = normalize(vnorm); + vec3 L = normalize(sunPosition); + float NdotL = max(dot(N, L), 0.0); + + vec3 lit; + if (is_reflection == 1) { + lit = vcolor * (NdotL * sunLightColor * sunIntensity + 0.1) / PI; + } else { + lit = vcolor * (NdotL * sunLightColor * sunIntensity + ambient_color * ambient_intensity) / PI; + } + + vec3 final_color = mix(deepColor, lit, smoothstep(0.0, planeHeight, vpos.y)); + + float fog_dist = length(vpos - cam); + float fog_factor = smoothstep(fog_start, fog_end, fog_dist); + final_color = mix(final_color, skyBase, fog_factor); + + frag_color = vec4(final_color, 1.0); +} +@end + +@program trile_lod vs_trile_lod fs_trile_lod diff --git a/src/trile.jai b/src/trile.jai index a8573c4..ef2e900 100644 --- a/src/trile.jai +++ b/src/trile.jai @@ -7,6 +7,13 @@ trile_table : Table(string, Trile); editor_current_trile : *Trile = null; +Trile_GFX_LOD :: struct { + vertex_buffer : sg_buffer; + normal_buffer : sg_buffer; + color_buffer : sg_buffer; + vertex_count : s64; +} + Trile_GFX :: struct { trixel_colors : sg_image; vertex_buffer : sg_buffer; @@ -14,6 +21,9 @@ Trile_GFX :: struct { centre_buffer : sg_buffer; vertices : []float; vertex_count : s64; + + lod_4 : Trile_GFX_LOD; // 4^3 cube grid + lod_2 : Trile_GFX_LOD; // 2^3 cube grid }; get_trile_table_ptr :: () -> *Table(string, Trile) { @@ -49,6 +59,8 @@ set_trile_gfx :: (name: string, gfx: Trile_GFX, skip_preexist_check: bool = fals sg_destroy_buffer(old_gfx.normal_buffer); sg_destroy_buffer(old_gfx.centre_buffer); sg_destroy_image(old_gfx.trixel_colors); + destroy_trile_gfx_lod(*old_gfx.lod_4); + destroy_trile_gfx_lod(*old_gfx.lod_2); array_reset(*old_gfx.vertices); log_debug("Destroyed old GFX buffers for trile: %", name); } @@ -65,6 +77,8 @@ set_trile :: (name: string, trile: Trile) { sg_destroy_buffer(old_gfx.normal_buffer); sg_destroy_buffer(old_gfx.centre_buffer); sg_destroy_image(old_gfx.trixel_colors); + destroy_trile_gfx_lod(*old_gfx.lod_4); + destroy_trile_gfx_lod(*old_gfx.lod_2); array_reset(*old_gfx.vertices); table_remove(*trile_gfx_table, name); } @@ -95,6 +109,8 @@ rename_trile :: (old_name: string, new_name: string) { sg_destroy_buffer(old_gfx.normal_buffer); sg_destroy_buffer(old_gfx.centre_buffer); sg_destroy_image(old_gfx.trixel_colors); + destroy_trile_gfx_lod(*old_gfx.lod_4); + destroy_trile_gfx_lod(*old_gfx.lod_2); array_reset(*old_gfx.vertices); table_remove(*trile_gfx_table, old_name); } @@ -112,6 +128,8 @@ delete_trile :: (name: string) { sg_destroy_buffer(old_gfx.normal_buffer); sg_destroy_buffer(old_gfx.centre_buffer); sg_destroy_image(old_gfx.trixel_colors); + destroy_trile_gfx_lod(*old_gfx.lod_4); + destroy_trile_gfx_lod(*old_gfx.lod_2); array_reset(*old_gfx.vertices); table_remove(*trile_gfx_table, name); } @@ -185,22 +203,25 @@ Trixel :: struct { }; Trile :: struct { - name : string = "test"; - trixels : [16][16][16] Trixel; + name : string = "test"; + is_opaque : bool = true; + trixels : [16][16][16] Trixel; }; TrixelSerialize :: [5]u8; TrileSerialize :: struct { - name : string = "test"; - version : int = 0; - trixels : [16][16][16] TrixelSerialize; + name : string = "test"; + version : int = 0; + is_opaque : u8 = 1; + trixels : [16][16][16] TrixelSerialize; }; trile_to_serialize_form :: (t: Trile) -> TrileSerialize { ts := TrileSerialize.{ - name = t.name, - version = 1, + name = t.name, + version = 2, + is_opaque = ifx t.is_opaque then cast(u8)1 else cast(u8)0, }; for i: 0..15 { for j: 0..15 { @@ -215,6 +236,8 @@ trile_to_serialize_form :: (t: Trile) -> TrileSerialize { trile_from_serialize_form :: (ts: TrileSerialize) -> Trile { t := Trile.{ name = sprint("%", ts.name) }; + if ts.version >= 2 t.is_opaque = ts.is_opaque != 0; + else t.is_opaque = true; for i: 0..15 { for j: 0..15 { for k: 0..15 { diff --git a/src/world.jai b/src/world.jai index 4385cf0..9f5ab11 100644 --- a/src/world.jai +++ b/src/world.jai @@ -46,6 +46,7 @@ Trile_Instance :: struct { Chunk_Trile_Group :: struct { trile_name: string; instances: [..]Trile_Instance; + is_buried: [..]bool; // Runtime-only, parallel to instances. Not serialized. } Chunk :: struct { @@ -210,6 +211,7 @@ unload_current_world :: () { for *chunk: current_world.world.chunks { for *group: chunk.groups { array_free(group.instances); + array_free(group.is_buried); } array_free(chunk.groups); } @@ -224,6 +226,108 @@ set_loaded_world :: (world: World) { current_world.world = world; current_world.valid = true; resolve_emitter_definitions(*current_world.world); + for *chunk: current_world.world.chunks { + recompute_buried_for_chunk(*current_world.world, chunk); + } +} + +is_cell_opaque :: (name: string) -> bool { + if name.count == 0 return false; + t, ok := get_trile(name); + if !ok return false; + return t.is_opaque; +} + +trile_at_world :: (world: *World, wx: s32, wy: s32, wz: s32) -> string { + key := world_to_chunk_coord(wx, wy, wz); + chunk := table_find_pointer(*world.chunks, key); + if !chunk return ""; + lx, ly, lz := world_to_local(wx, wy, wz); + for *group: chunk.groups { + for inst: group.instances { + if inst.x == lx && inst.y == ly && inst.z == lz { + return group.trile_name; + } + } + } + return ""; +} + +BURIED_DIRS :: s32.[ 1,0,0, -1,0,0, 0,1,0, 0,-1,0, 0,0,1, 0,0,-1 ]; + +compute_buried_at_world :: (world: *World, wx: s32, wy: s32, wz: s32) -> bool { + for axis: 0..5 { + nwx := wx + BURIED_DIRS[axis*3+0]; + nwy := wy + BURIED_DIRS[axis*3+1]; + nwz := wz + BURIED_DIRS[axis*3+2]; + if !is_cell_opaque(trile_at_world(world, nwx, nwy, nwz)) return false; + } + return true; +} + +recompute_buried_for_chunk :: (world: *World, chunk: *Chunk) { + // Build an O(1) local lookup grid (32^3 trile names) for this chunk so the + // common in-chunk neighbor case is a single index lookup. Cross-chunk + // neighbors fall back to trile_at_world. + GRID :: CHUNK_SIZE * CHUNK_SIZE * CHUNK_SIZE; + grid: [GRID] string; + grid_data := grid; + for *group: chunk.groups { + for inst: group.instances { + idx := cast(int)inst.x + CHUNK_SIZE * (cast(int)inst.y + CHUNK_SIZE * cast(int)inst.z); + grid_data[idx] = group.trile_name; + } + } + + for *group: chunk.groups { + array_resize(*group.is_buried, group.instances.count); + for inst, i: group.instances { + wx, wy, wz := chunk_local_to_world(chunk.coord, inst.x, inst.y, inst.z); + buried := true; + for axis: 0..5 { + nwx := wx + BURIED_DIRS[axis*3+0]; + nwy := wy + BURIED_DIRS[axis*3+1]; + nwz := wz + BURIED_DIRS[axis*3+2]; + neighbor_name: string; + nkey := world_to_chunk_coord(nwx, nwy, nwz); + if nkey == chunk.coord { + nlx, nly, nlz := world_to_local(nwx, nwy, nwz); + nidx := cast(int)nlx + CHUNK_SIZE * (cast(int)nly + CHUNK_SIZE * cast(int)nlz); + neighbor_name = grid_data[nidx]; + } else { + neighbor_name = trile_at_world(world, nwx, nwy, nwz); + } + if !is_cell_opaque(neighbor_name) { + buried = false; + break; + } + } + group.is_buried[i] = buried; + } + } +} + +recompute_buried_at_cell :: (world: *World, wx: s32, wy: s32, wz: s32) { + key := world_to_chunk_coord(wx, wy, wz); + chunk := table_find_pointer(*world.chunks, key); + if !chunk return; + lx, ly, lz := world_to_local(wx, wy, wz); + for *group: chunk.groups { + for inst, i: group.instances { + if inst.x == lx && inst.y == ly && inst.z == lz { + if group.is_buried.count != group.instances.count array_resize(*group.is_buried, group.instances.count); + group.is_buried[i] = compute_buried_at_world(world, wx, wy, wz); + return; + } + } + } +} + +invalidate_buried_around :: (world: *World, wx: s32, wy: s32, wz: s32) { + recompute_buried_at_cell(world, wx, wy, wz); + for axis: 0..5 { + recompute_buried_at_cell(world, wx + BURIED_DIRS[axis*3+0], wy + BURIED_DIRS[axis*3+1], wz + BURIED_DIRS[axis*3+2]); + } } resolve_emitter_definitions :: (world: *World) { @@ -237,6 +341,7 @@ clear_world :: () { for *chunk: current_world.world.chunks { for *group: chunk.groups { array_free(group.instances); + array_free(group.is_buried); } array_free(chunk.groups); }