diff --git a/src/assets/asset_manager.jai b/src/assets/asset_manager.jai index 649d831..58e177d 100644 --- a/src/assets/asset_manager.jai +++ b/src/assets/asset_manager.jai @@ -267,6 +267,8 @@ add_resources_from_pack :: (pack: *Loaded_Pack) { } log_info("Loaded % particle definitions from pack", g_emitter_defs.count); } + } else if name == "foliage" { + load_foliage_defs_from_json(create_string_from_memory(v.data)); } case "hex"; pal : Loaded_Palette; diff --git a/src/editor/editor.jai b/src/editor/editor.jai index 62b269a..36762a1 100644 --- a/src/editor/editor.jai +++ b/src/editor/editor.jai @@ -7,6 +7,7 @@ #load "level_editor.jai"; #load "particle_editor.jai"; #load "material_studio.jai"; + #load "foliage_studio.jai"; } #if FLAG_TACOMA_ENABLED { #load "tacoma.jai"; } #load "console.jai"; @@ -19,6 +20,7 @@ Editor_View :: enum { Level_Editor; Particle_Editor; Material_Editor; + Foliage_Editor; }; current_editor_view : Editor_View = .Trile_Editor; @@ -65,6 +67,8 @@ draw_editor_ui :: (theme: *GR.Overall_Theme) { if keybind_button(r, "Particle studio", .STUDIO_MATERIAL, *t_button_selectable(theme, current_editor_view == .Particle_Editor)) { clear_particles(); current_editor_view = .Particle_Editor; } r.x -= r.w; if keybind_button(r, "Material studio", .STUDIO_SWATCHES, *t_button_selectable(theme, current_editor_view == .Material_Editor)) { clear_particles(); current_editor_view = .Material_Editor; } + r.x -= r.w; + if keybind_button(r, "Foliage studio", .STUDIO_FOLIAGE, *t_button_selectable(theme, current_editor_view == .Foliage_Editor)) { clear_particles(); current_editor_view = .Foliage_Editor; } if current_editor_view == { case .Trile_Editor; @@ -75,6 +79,8 @@ draw_editor_ui :: (theme: *GR.Overall_Theme) { draw_particle_editor_ui(theme); case .Material_Editor; draw_material_studio_ui(theme); + case .Foliage_Editor; + draw_foliage_studio_ui(theme); } } draw_profiler(); diff --git a/src/editor/foliage_studio.jai b/src/editor/foliage_studio.jai new file mode 100644 index 0000000..2129571 --- /dev/null +++ b/src/editor/foliage_studio.jai @@ -0,0 +1,155 @@ +#scope_file + +fs_selected_index : s32 = -1; +fs_scroll : float = 0; + +fs_name_input_start : string = ""; +fs_anim_input_start : string = ""; + +fs_label :: (r: *GR.Rect, text: string, theme: *GR.Overall_Theme) { + GR.label(r.*, text, *t_label_left(theme)); + r.y += r.h; +} + +fs_float :: (r: *GR.Rect, label: string, value: *float, lo: float, hi: float, step: float, theme: *GR.Overall_Theme, loc := #caller_location) { + GR.label(r.*, label, *t_label_left(theme)); + r.y += r.h; + GR.slider(r.*, value, lo, hi, step, *theme.slider_theme, loc = loc); + r.y += r.h; +} + +fs_select_def :: (idx: s32) { + fs_selected_index = idx; + if idx >= 0 && idx < cast(s32) g_foliage_defs.count { + fs_name_input_start = g_foliage_defs[idx].name; + fs_anim_input_start = g_foliage_defs[idx].animation_name; + } +} + +#scope_export + +draw_foliage_studio_ui :: (theme: *GR.Overall_Theme) { + panel_w := ui_w(20, 20); + row_h := ui_h(3, 0); + + list_r := GR.get_rect(ui_w(80, 20), ui_h(5,0), panel_w, ui_h(95, 0)); + ui_add_mouse_occluder(list_r); + draw_bg_rectangle(list_r, theme); + + r := list_r; + r.h = row_h; + + half_w := r.w / 2; + orig_w := r.w; + r.w = half_w; + if GR.button(r, "New", *theme.button_theme) { + def : Foliage_Def; + def.name = sprint("foliage_%", g_foliage_defs.count); + array_add(*g_foliage_defs, def); + fs_select_def(cast(s32)(g_foliage_defs.count - 1)); + } + r.x += half_w; + if GR.button(r, "Duplicate", *theme.button_theme) { + if fs_selected_index >= 0 && fs_selected_index < cast(s32) g_foliage_defs.count { + def := g_foliage_defs[fs_selected_index]; + def.name = sprint("%_copy", def.name); + def.animation_name = copy_string(def.animation_name); + array_add(*g_foliage_defs, def); + fs_select_def(cast(s32)(g_foliage_defs.count - 1)); + } + } + r.x -= half_w; + r.w = orig_w; + r.y += r.h; + + for def, idx : g_foliage_defs { + if r.y > list_r.y + list_r.h - row_h * 3 then break; + selected := (cast(s32)idx == fs_selected_index); + if GR.button(r, def.name, *t_button_selectable(theme, selected), cast(s32)idx) { + fs_select_def(cast(s32)idx); + } + r.y += r.h; + } + + r.y = list_r.y + list_r.h - row_h * 2; + r.w = half_w; + if keybind_button(r, "Save", .SAVE, *theme.button_theme) { + save_foliage_defs(); + } + r.x += half_w; + if GR.button(r, "Delete", *theme.button_theme) { + if fs_selected_index >= 0 && fs_selected_index < cast(s32) g_foliage_defs.count { + array_ordered_remove_by_index(*g_foliage_defs, fs_selected_index); + if fs_selected_index >= cast(s32) g_foliage_defs.count then fs_selected_index -= 1; + fs_select_def(fs_selected_index); + } + } + r.w = orig_w; + + if fs_selected_index < 0 || fs_selected_index >= cast(s32) g_foliage_defs.count then return; + + def := *g_foliage_defs[fs_selected_index]; + + edit_r := GR.get_rect(0, ui_h(5,0), panel_w, ui_h(95, 0)); + ui_add_mouse_occluder(edit_r); + draw_bg_rectangle(edit_r, theme); + + region, inside := GR.begin_scrollable_region(edit_r, *theme.scrollable_region_theme); + er := inside; + er.y -= fs_scroll; + er.h = row_h; + + fs_label(*er, "Name", theme); + a, new_name, _ := GR.text_input(er, fs_name_input_start, *theme.text_input_theme, 0); + if a & .ENTERED { + def.name = copy_string(new_name); + fs_name_input_start = def.name; + } + er.y += er.h; + + fs_label(*er, "Animation (pack.anim)", theme); + a2, new_anim, _ := GR.text_input(er, fs_anim_input_start, *theme.text_input_theme, 1); + if a2 & .ENTERED { + def.animation_name = copy_string(new_anim); + fs_anim_input_start = def.animation_name; + } + er.y += er.h; + + anim := get_animation_from_string(def.animation_name); + if anim != null { + fs_label(*er, tprint("Animation: % frames", anim.frames.count), theme); + } else { + fs_label(*er, tprint("Animation: not found ('%')", def.animation_name), theme); + } + + orig_w2 := er.w; + er.w = orig_w2 / 2; + + fs_label(*er, "Type", theme); + if GR.button(er, "Grass", *t_button_selectable(theme, def.type == .GRASS), 100) then def.type = .GRASS; + er.x += er.w; + if GR.button(er, "Tree", *t_button_selectable(theme, def.type == .TREE), 101) then def.type = .TREE; + er.x -= er.w; + er.y += er.h; + + fs_label(*er, "Frames", theme); + if GR.button(er, "Variant", *t_button_selectable(theme, def.frame_mode == .VARIANT), 102) then def.frame_mode = .VARIANT; + er.x += er.w; + if GR.button(er, "Loop", *t_button_selectable(theme, def.frame_mode == .LOOP), 103) then def.frame_mode = .LOOP; + er.x -= er.w; + er.y += er.h; + + er.w = orig_w2; + + if def.type == .GRASS { + fs_float(*er, tprint("Density: %", def.density), *def.density, 0, 1, 0.05, theme); + fs_float(*er, tprint("Jitter: %", def.jitter), *def.jitter, 0, 0.5, 0.05, theme); + } + fs_float(*er, tprint("Scale Min: %", def.scale_min), *def.scale_min, 0.1, 4, 0.05, theme); + fs_float(*er, tprint("Scale Max: %", def.scale_max), *def.scale_max, 0.1, 4, 0.05, theme); + if def.scale_max < def.scale_min then def.scale_max = def.scale_min; + fs_float(*er, tprint("Sway Intensity: %", def.sway_intensity), *def.sway_intensity, 0, 1, 0.05, theme); + fs_float(*er, tprint("Sway Speed: %", def.sway_speed), *def.sway_speed, 0, 5, 0.1, theme); + + GR.end_scrollable_region(region, er.x + er.w, er.y, *fs_scroll); +} diff --git a/src/foliage.jai b/src/foliage.jai new file mode 100644 index 0000000..34bba25 --- /dev/null +++ b/src/foliage.jai @@ -0,0 +1,88 @@ +// Our foliage system. Cells on a 2D grid. + +Foliage_Type :: enum u8 { + GRASS; // For stuff that you want to just paint and gets rendered a lot. Grass or hay. + TREE; // For when you want single placements of something. Trees or bushes. +} + +Foliage_Frame_Mode :: enum u8 { + VARIANT; // The seed picks one frame and it stays there. + LOOP; // Plays the animation, with the seed offsetting the start. +} + +Foliage_Def :: struct { + name : string; + type : Foliage_Type; + + // What we render + animation_name : string; + frame_mode : Foliage_Frame_Mode; + + density : float = 0.5; // Only does anything when foliage type is grass. + scale_min : float = 1; + scale_max : float = 1; + jitter : float = 0.4; + sway_intensity : float; + sway_speed : float = 1; +} + +FOLIAGE_NONE :: 0; + +// Chunks in the world contain a 2D grid of these. +Foliage_Cell :: struct { + id : u8; // FOLIAGE_NONE when empty. + y : u8; // Local y inside the chunk, so we don't draw grass on top of a bridge. +} + +g_foliage_defs : [..]Foliage_Def; + +get_foliage_def :: (name: string) -> *Foliage_Def { + for *def: g_foliage_defs { + if def.name == name then return def; + } + return null; +} + +register_foliage_def :: (def: Foliage_Def) { + for *existing: g_foliage_defs { + if existing.name == def.name { + existing.* = def; + return; + } + } + array_add(*g_foliage_defs, def); +} + +get_foliage_def_names :: () -> []string { + names : [..]string; + names.allocator = temp; + for def: g_foliage_defs { + array_add(*names, def.name); + } + return names; +} + +load_foliage_defs_from_json :: (s: string) { + success, defs := Jaison.json_parse_string(s, [..]Foliage_Def,, temp); + if !success { + log_error("Failed to parse foliage definitions"); + return; + } + array_reset(*g_foliage_defs); + for defs { + def := it; + def.name = sprint("%", it.name); + def.animation_name = sprint("%", it.animation_name); + array_add(*g_foliage_defs, def); + } + log_info("Loaded % foliage definitions from pack", g_foliage_defs.count); +} + +save_foliage_defs :: () { + #if OS != .WASM { + file :: #import "File"; + json := Jaison.json_write_string(g_foliage_defs, " "); + file.write_entire_file(tprint("%/game_core/foliage.json", GAME_RESOURCES_DIR), json); + log_info("Saved % foliage definitions", g_foliage_defs.count); + } +} diff --git a/src/input/keybinds.jai b/src/input/keybinds.jai index 2fa17e0..6485bac 100644 --- a/src/input/keybinds.jai +++ b/src/input/keybinds.jai @@ -40,6 +40,7 @@ Editor_Action :: enum { STUDIO_LEVEL; STUDIO_MATERIAL; STUDIO_SWATCHES; + STUDIO_FOLIAGE; // Trile editor — view modes TRIXEL_VIEW_TILE; // Trile editor — tiling controls @@ -213,6 +214,7 @@ set_default_bindings :: () { set(.STUDIO_LEVEL, cast(Key_Code) #char "2", ctrl = true); set(.STUDIO_MATERIAL, cast(Key_Code) #char "3", ctrl = true); set(.STUDIO_SWATCHES, cast(Key_Code) #char "4", ctrl = true); + set(.STUDIO_FOLIAGE, cast(Key_Code) #char "5", ctrl = true); set(.TRIXEL_VIEW_TILE, cast(Key_Code) #char "9"); set(.TRIXEL_TILING_AXIS, cast(Key_Code) #char "Q"); set(.TRIXEL_TILING_ROTATE, cast(Key_Code) #char "R"); diff --git a/src/main.jai b/src/main.jai index 7b8168a..1eee5d1 100644 --- a/src/main.jai +++ b/src/main.jai @@ -42,6 +42,7 @@ FLAG_USE_TEST_GAME :: FLAG_TEST_ENGINE || FLAG_TEST_EXE_ENGINE; #load "ray.jai"; #load "profiling.jai"; #load "particles/particles.jai"; +#load "foliage.jai"; #load "orientation.jai"; #load "entities.jai"; #load "world.jai"; diff --git a/src/renderer_sokol/gpu.jai b/src/renderer_sokol/gpu.jai index 645f2ca..7428431 100644 --- a/src/renderer_sokol/gpu.jai +++ b/src/renderer_sokol/gpu.jai @@ -3,7 +3,7 @@ VIEW_COLOR_FORMAT :: sg_pixel_format.RGBA16F; VIEW_DEPTH_FORMAT :: sg_pixel_format.DEPTH; VIEW_SCENE_FORMAT :: sg_pixel_format.R32F; VIEW_GLOW_FORMAT :: sg_pixel_format.R16F; -SHADOW_TINT_FORMAT :: sg_pixel_format.RGBA8; // how strongly each pixel blooms, can exceed 1 +SHADOW_TINT_FORMAT :: sg_pixel_format.RGBA16F; // glass colour, and the nearest glass depth in alpha ALPHA_BLEND :: sg_blend_state.{ enabled = true, diff --git a/src/renderer_sokol/renderer.jai b/src/renderer_sokol/renderer.jai index 8aa1c8e..d02b35d 100644 --- a/src/renderer_sokol/renderer.jai +++ b/src/renderer_sokol/renderer.jai @@ -92,6 +92,8 @@ renderer_render :: (scene: *Scene, width: s32, height: s32) { sprites_draw(*pass, transparent = true); lines_draw(*pass, width, height); sg_end_pass(); + + if kind == .MAIN view_shafts(*pass); } view_bloom(view_index); } diff --git a/src/renderer_sokol/shaders/jai/shaders.jai b/src/renderer_sokol/shaders/jai/shaders.jai index 0bc811f..3299d33 100644 --- a/src/renderer_sokol/shaders/jai/shaders.jai +++ b/src/renderer_sokol/shaders/jai/shaders.jai @@ -48,6 +48,11 @@ Vertex Shader: vs_fullscreen Fragment Shader: fs_post Attributes: + Shader program: 'shafts': + Get shader desc: shafts_shader_desc(sg_query_backend()) + Vertex Shader: vs_shafts + Fragment Shader: fs_shafts + Attributes: Shader program: 'sky': Get shader desc: sky_shader_desc(sg_query_backend()) Vertex Shader: vs_sky @@ -136,12 +141,15 @@ Uniform block 'post_params': Jai struct: Post_Params Bind slot: UB_post_params => 0 - Uniform block 'sky_params': - Jai struct: Sky_Params - Bind slot: UB_sky_params => 1 + Uniform block 'shaft_params': + Jai struct: Shaft_Params + Bind slot: UB_shaft_params => 1 Uniform block 'shadow_params': Jai struct: Shadow_Params Bind slot: UB_shadow_params => 3 + Uniform block 'sky_params': + Jai struct: Sky_Params + Bind slot: UB_sky_params => 1 Uniform block 'trile_params': Jai struct: Trile_Params Bind slot: UB_trile_params => 1 @@ -185,16 +193,26 @@ Sample type: .FLOAT Multisampled: false Bind slot: IMG_bloom => 1 - Image 'shadow_map': + Image 'shafts': Image type: ._2D - Sample type: .DEPTH + Sample type: .FLOAT Multisampled: false - Bind slot: IMG_shadow_map => 7 + Bind slot: IMG_shafts => 2 + Image 'shaft_scene': + Image type: ._2D + Sample type: .UNFILTERABLE_FLOAT + Multisampled: false + Bind slot: IMG_shaft_scene => 0 Image 'shadow_tint': Image type: ._2D Sample type: .FLOAT Multisampled: false Bind slot: IMG_shadow_tint => 8 + Image 'shadow_map': + Image type: ._2D + Sample type: .DEPTH + Multisampled: false + Bind slot: IMG_shadow_map => 7 Image 'probe_index': Image type: ._3D Sample type: .FLOAT @@ -252,12 +270,15 @@ Sampler 'bloom_view_smp': Type: .FILTERING Bind slot: SMP_bloom_view_smp => 1 - Sampler 'shadow_smp': - Type: .COMPARISON - Bind slot: SMP_shadow_smp => 7 + Sampler 'shaft_scene_smp': + Type: .NONFILTERING + Bind slot: SMP_shaft_scene_smp => 0 Sampler 'shadow_tint_smp': Type: .FILTERING Bind slot: SMP_shadow_tint_smp => 8 + Sampler 'shadow_smp': + Type: .COMPARISON + Bind slot: SMP_shadow_smp => 7 Sampler 'probe_smp': Type: .FILTERING Bind slot: SMP_probe_smp => 2 @@ -321,8 +342,9 @@ UB_view_params :: 0; UB_line_params :: 1; UB_sprite_params :: 1; UB_post_params :: 0; -UB_sky_params :: 1; +UB_shaft_params :: 1; UB_shadow_params :: 3; +UB_sky_params :: 1; UB_trile_params :: 1; UB_trile_fs_params :: 2; UB_ui_vs_params :: 0; @@ -334,8 +356,10 @@ IMG_bloom_glow :: 1; IMG_sprite :: 0; IMG_view_color :: 0; IMG_bloom :: 1; -IMG_shadow_map :: 7; +IMG_shafts :: 2; +IMG_shaft_scene :: 0; IMG_shadow_tint :: 8; +IMG_shadow_map :: 7; IMG_probe_index :: 3; IMG_probe_atlas :: 4; IMG_palette :: 0; @@ -349,8 +373,9 @@ SMP_bloom_smp :: 0; SMP_sprite_smp :: 0; SMP_view_smp :: 0; SMP_bloom_view_smp :: 1; -SMP_shadow_smp :: 7; +SMP_shaft_scene_smp :: 0; SMP_shadow_tint_smp :: 8; +SMP_shadow_smp :: 7; SMP_probe_smp :: 2; SMP_palette_smp :: 0; SMP_trile_reflection_smp :: 1; @@ -380,6 +405,15 @@ Post_Params :: struct { saturation: float; bloom_amount: float; }; +Shaft_Params :: struct { + density: float; + amount: float; + max_distance: float; + steps: float; +}; +Shadow_Params :: struct { + shadow_uv: [16]float; +}; Sky_Params :: struct { sky_base: [4]float; sky_top: [4]float; @@ -388,9 +422,6 @@ Sky_Params :: struct { horizon_halo: [4]float; sun: [4]float; }; -Shadow_Params :: struct { - shadow_uv: [16]float; -}; Trile_Params :: struct { orientations: [72][4]float; show_hidden: float; @@ -770,17 +801,497 @@ fs_bloom_up_source_glsl430 := u8.[ /* #version 430 + uniform vec4 view_params[13]; + layout(location = 0) out vec4 v_point; + layout(location = 1) out vec3 v_camera; + layout(location = 2) out vec3 v_sun; + layout(location = 3) out float v_time; + + vec2 fullscreen_position(int vertex_index) + { + return (vec2(float((vertex_index << 1) & 2), float(vertex_index & 2)) * 2.0) - vec2(1.0); + } + + void main() + { + int param = gl_VertexID; + vec2 _37 = fullscreen_position(param); + float _48 = _37.x; + gl_Position = vec4(_48, _37.y, 0.0, 1.0); + v_point = mat4(view_params[4], view_params[5], view_params[6], view_params[7]) * vec4(_48, _37.y, 0.5, 1.0); + v_camera = view_params[8].xyz; + v_sun = view_params[11].xyz; + v_time = view_params[8].w; + } + +*/ +vs_shafts_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,0x76,0x69,0x65,0x77,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x33,0x5d,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,0x76,0x5f,0x70,0x6f,0x69,0x6e, + 0x74,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,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,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,0x5f,0x73,0x75,0x6e,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,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76, + 0x5f,0x74,0x69,0x6d,0x65,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x32,0x20,0x66,0x75,0x6c, + 0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, + 0x28,0x69,0x6e,0x74,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x6e,0x64,0x65, + 0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x28,0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x76,0x65,0x72, + 0x74,0x65,0x78,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3c,0x3c,0x20,0x31,0x29,0x20, + 0x26,0x20,0x32,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x76,0x65,0x72,0x74, + 0x65,0x78,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a, + 0x20,0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30, + 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,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x33,0x37,0x20,0x3d,0x20, + 0x66,0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x70,0x6f,0x73,0x69,0x74, + 0x69,0x6f,0x6e,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x33,0x37,0x2e, + 0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,0x38,0x2c,0x20,0x5f, + 0x33,0x37,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x20,0x3d,0x20,0x6d, + 0x61,0x74,0x34,0x28,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x34,0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x35,0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x36,0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, + 0x37,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,0x38,0x2c,0x20, + 0x5f,0x33,0x37,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x20,0x3d, + 0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x2e, + 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x73,0x75,0x6e,0x20,0x3d, + 0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x31,0x5d, + 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65, + 0x20,0x3d,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38, + 0x5d,0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 430 + + uniform vec4 shaft_params[1]; + uniform vec4 shadow_params[4]; + layout(binding = 16) uniform sampler2D shaft_scene_shaft_scene_smp; + layout(binding = 17) uniform sampler2D shadow_tint_shadow_tint_smp; + layout(binding = 18) uniform sampler2DShadow shadow_map_shadow_smp; + + layout(location = 3) in float v_time; + layout(location = 0) in vec4 v_point; + layout(location = 1) in vec3 v_camera; + layout(location = 0) out vec4 frag_color; + layout(location = 2) in vec3 v_sun; + + float brightest(vec3 c) + { + return max(c.x, max(c.y, c.z)); + } + + float hash(inout vec3 p) + { + p = fract((p * 0.31830990314483642578125) + vec3(0.100000001490116119384765625)); + p *= 17.0; + return fract(((p.x * p.y) * p.z) * ((p.x + p.y) + p.z)); + } + + float value_noise(vec3 p) + { + vec3 _69 = floor(p); + vec3 _72 = fract(p); + vec3 _82 = (_72 * _72) * (vec3(3.0) - (_72 * 2.0)); + vec3 param = _69; + float _85 = hash(param); + vec3 param_1 = _69 + vec3(1.0, 0.0, 0.0); + float _92 = hash(param_1); + float _94 = _82.x; + vec3 param_2 = _69 + vec3(0.0, 1.0, 0.0); + float _100 = hash(param_2); + vec3 param_3 = _69 + vec3(1.0, 1.0, 0.0); + float _105 = hash(param_3); + float _110 = _82.y; + vec3 param_4 = _69 + vec3(0.0, 0.0, 1.0); + float _116 = hash(param_4); + vec3 param_5 = _69 + vec3(1.0, 0.0, 1.0); + float _121 = hash(param_5); + vec3 param_6 = _69 + vec3(0.0, 1.0, 1.0); + float _129 = hash(param_6); + vec3 param_7 = _69 + vec3(1.0); + float _134 = hash(param_7); + return mix(mix(mix(_85, _92, _94), mix(_100, _105, _94), _110), mix(mix(_116, _121, _94), mix(_129, _134, _94), _110), _82.z); + } + + float dust(vec3 p) + { + vec3 _149 = p * 0.800000011920928955078125; + vec3 param = _149 + ((vec3(0.4000000059604644775390625, 0.1500000059604644775390625, 0.300000011920928955078125) * v_time) * 0.800000011920928955078125); + vec3 param_1 = (_149 * 2.2999999523162841796875) - (((vec3(0.300000011920928955078125, 0.4000000059604644775390625, 0.1500000059604644775390625) * v_time) * 0.800000011920928955078125) * 1.7000000476837158203125); + return mix(0.0, 2.0, smoothstep(0.25, 0.75, (value_noise(param) * 0.64999997615814208984375) + (value_noise(param_1) * 0.3499999940395355224609375))); + } + + void main() + { + vec3 _204 = normalize((v_point.xyz / vec3(v_point.w)) - v_camera); + float _242 = min(texelFetch(shaft_scene_shaft_scene_smp, ivec2(gl_FragCoord.xy) * ivec2(2), 0).x, shaft_params[0].z) / shaft_params[0].w; + float _253 = fract(52.98291778564453125 * fract(dot(gl_FragCoord.xy, vec2(0.067110560834407806396484375, 0.005837149918079376220703125)))); + vec3 light = vec3(0.0); + for (float i = 0.0; i < shaft_params[0].w; i += 1.0) + { + float _272 = (i + _253) * _242; + vec3 _286 = (floor((v_camera + (_204 * _272)) * 16.0) + vec3(0.5)) * vec3(0.0625); + vec4 _301 = mat4(shadow_params[0], shadow_params[1], shadow_params[2], shadow_params[3]) * vec4(_286, 1.0); + float _303 = _301.x; + bool _304 = _303 < 0.0; + bool _311; + if (!_304) + { + _311 = _303 > 1.0; + } + else + { + _311 = _304; + } + bool _318; + if (!_311) + { + _318 = _301.y < 0.0; + } + else + { + _318 = _311; + } + bool _325; + if (!_318) + { + _325 = _301.y > 1.0; + } + else + { + _325 = _318; + } + bool _332; + if (!_325) + { + _332 = _301.z > 1.0; + } + else + { + _332 = _325; + } + if (_332) + { + continue; + } + vec4 _344 = texture(shadow_tint_shadow_tint_smp, _301.xy); + float _346 = _301.z; + if (_346 < (_344.w + 0.001000000047497451305389404296875)) + { + continue; + } + float _368 = _346 - 0.0005000000237487256526947021484375; + vec3 _377 = _344.xyz; + vec3 param = _377; + vec3 param_1 = _286; + light += (((mix(vec3(brightest(param)), _377, vec3(0.60000002384185791015625)) * texture(shadow_map_shadow_smp, vec3(vec3(_303, _301.y, _368).xy, _368))) * exp((-shaft_params[0].x) * _272)) * dust(param_1)); + } + frag_color = vec4((((light * v_sun) * shaft_params[0].x) * _242) * shaft_params[0].y, 1.0); + } + +*/ +fs_shafts_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,0x73,0x68,0x61,0x66,0x74, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x3b,0x0a,0x75,0x6e,0x69,0x66, + 0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34,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,0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x68, + 0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,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,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e, + 0x74,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,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,0x53,0x68,0x61,0x64,0x6f,0x77,0x20, + 0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f, + 0x77,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,0x33,0x29,0x20,0x69,0x6e,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x74,0x69,0x6d,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,0x76,0x5f,0x70,0x6f,0x69, + 0x6e,0x74,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,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,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,0x32,0x29,0x20,0x69,0x6e,0x20,0x76,0x65,0x63, + 0x33,0x20,0x76,0x5f,0x73,0x75,0x6e,0x3b,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x62,0x72,0x69,0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x76,0x65,0x63,0x33,0x20,0x63, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d, + 0x61,0x78,0x28,0x63,0x2e,0x78,0x2c,0x20,0x6d,0x61,0x78,0x28,0x63,0x2e,0x79,0x2c, + 0x20,0x63,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x68,0x61,0x73,0x68,0x28,0x69,0x6e,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x20,0x3d,0x20,0x66,0x72, + 0x61,0x63,0x74,0x28,0x28,0x70,0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,0x38,0x33,0x30, + 0x39,0x39,0x30,0x33,0x31,0x34,0x34,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31, + 0x32,0x35,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,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x70,0x20,0x2a,0x3d,0x20,0x31,0x37,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x28,0x70,0x2e, + 0x78,0x20,0x2a,0x20,0x70,0x2e,0x79,0x29,0x20,0x2a,0x20,0x70,0x2e,0x7a,0x29,0x20, + 0x2a,0x20,0x28,0x28,0x70,0x2e,0x78,0x20,0x2b,0x20,0x70,0x2e,0x79,0x29,0x20,0x2b, + 0x20,0x70,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6e,0x6f,0x69,0x73,0x65,0x28,0x76,0x65,0x63, + 0x33,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x5f,0x36,0x39,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x66, + 0x72,0x61,0x63,0x74,0x28,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x38,0x32,0x20,0x3d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x5f, + 0x37,0x32,0x29,0x20,0x2a,0x20,0x28,0x76,0x65,0x63,0x33,0x28,0x33,0x2e,0x30,0x29, + 0x20,0x2d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, + 0x3d,0x20,0x5f,0x36,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x5f,0x38,0x35,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63, + 0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x32,0x20, + 0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x34,0x20,0x3d, + 0x20,0x5f,0x38,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20, + 0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x31,0x30,0x30,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e, + 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, + 0x30,0x35,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31, + 0x31,0x30,0x20,0x3d,0x20,0x5f,0x38,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f, + 0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x30, + 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x36,0x39, + 0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, + 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x31,0x32,0x31,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x31,0x32,0x39,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x31,0x33,0x34,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78, + 0x28,0x5f,0x38,0x35,0x2c,0x20,0x5f,0x39,0x32,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c, + 0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x30,0x30,0x2c,0x20,0x5f,0x31,0x30,0x35,0x2c, + 0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x5f,0x31,0x31,0x30,0x29,0x2c,0x20,0x6d,0x69, + 0x78,0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x31,0x36,0x2c,0x20,0x5f,0x31,0x32,0x31, + 0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x32,0x39, + 0x2c,0x20,0x5f,0x31,0x33,0x34,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x5f,0x31, + 0x31,0x30,0x29,0x2c,0x20,0x5f,0x38,0x32,0x2e,0x7a,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x75,0x73,0x74,0x28,0x76,0x65,0x63,0x33,0x20, + 0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31, + 0x34,0x39,0x20,0x3d,0x20,0x70,0x20,0x2a,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x34,0x39,0x20,0x2b,0x20,0x28,0x28,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,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,0x2c, + 0x20,0x30,0x2e,0x31,0x35,0x30,0x30,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, + 0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39, + 0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x20,0x2a,0x20,0x76,0x5f,0x74,0x69, + 0x6d,0x65,0x29,0x20,0x2a,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x28,0x5f,0x31,0x34,0x39,0x20,0x2a,0x20,0x32,0x2e, + 0x32,0x39,0x39,0x39,0x39,0x39,0x39,0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31, + 0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x20,0x2d,0x20,0x28,0x28,0x28,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, + 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,0x2c,0x20,0x30,0x2e,0x31,0x35,0x30, + 0x30,0x30,0x30,0x30,0x30,0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35, + 0x33,0x39,0x30,0x36,0x32,0x35,0x29,0x20,0x2a,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65, + 0x29,0x20,0x2a,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,0x20, + 0x2a,0x20,0x31,0x2e,0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x36,0x38,0x33, + 0x37,0x31,0x35,0x38,0x32,0x30,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x69,0x78,0x28,0x30,0x2e,0x30,0x2c, + 0x20,0x32,0x2e,0x30,0x2c,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70, + 0x28,0x30,0x2e,0x32,0x35,0x2c,0x20,0x30,0x2e,0x37,0x35,0x2c,0x20,0x28,0x76,0x61, + 0x6c,0x75,0x65,0x5f,0x6e,0x6f,0x69,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29, + 0x20,0x2a,0x20,0x30,0x2e,0x36,0x34,0x39,0x39,0x39,0x39,0x39,0x37,0x36,0x31,0x35, + 0x38,0x31,0x34,0x32,0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20, + 0x28,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6e,0x6f,0x69,0x73,0x65,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x34,0x39,0x39,0x39,0x39, + 0x39,0x39,0x34,0x30,0x33,0x39,0x35,0x33,0x35,0x35,0x32,0x32,0x34,0x36,0x30,0x39, + 0x33,0x37,0x35,0x29,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20, + 0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x32,0x30,0x34,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, + 0x7a,0x65,0x28,0x28,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x20, + 0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x2e,0x77, + 0x29,0x29,0x20,0x2d,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d, + 0x20,0x6d,0x69,0x6e,0x28,0x74,0x65,0x78,0x65,0x6c,0x46,0x65,0x74,0x63,0x68,0x28, + 0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x68,0x61,0x66, + 0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x69,0x76,0x65, + 0x63,0x32,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e, + 0x78,0x79,0x29,0x20,0x2a,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x32,0x29,0x2c,0x20, + 0x30,0x29,0x2e,0x78,0x2c,0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x7a,0x29,0x20,0x2f,0x20,0x73,0x68,0x61,0x66,0x74, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x66, + 0x72,0x61,0x63,0x74,0x28,0x35,0x32,0x2e,0x39,0x38,0x32,0x39,0x31,0x37,0x37,0x38, + 0x35,0x36,0x34,0x34,0x35,0x33,0x31,0x32,0x35,0x20,0x2a,0x20,0x66,0x72,0x61,0x63, + 0x74,0x28,0x64,0x6f,0x74,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f, + 0x72,0x64,0x2e,0x78,0x79,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x36, + 0x37,0x31,0x31,0x30,0x35,0x36,0x30,0x38,0x33,0x34,0x34,0x30,0x37,0x38,0x30,0x36, + 0x33,0x39,0x36,0x34,0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x35, + 0x38,0x33,0x37,0x31,0x34,0x39,0x39,0x31,0x38,0x30,0x37,0x39,0x33,0x37,0x36,0x32, + 0x32,0x30,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20,0x76, + 0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6f, + 0x72,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x69,0x20,0x3d,0x20,0x30,0x2e,0x30, + 0x3b,0x20,0x69,0x20,0x3c,0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x3b,0x20,0x69,0x20,0x2b,0x3d,0x20,0x31,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,0x32,0x37,0x32,0x20,0x3d,0x20,0x28,0x69, + 0x20,0x2b,0x20,0x5f,0x32,0x35,0x33,0x29,0x20,0x2a,0x20,0x5f,0x32,0x34,0x32,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32, + 0x38,0x36,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x28,0x76,0x5f,0x63, + 0x61,0x6d,0x65,0x72,0x61,0x20,0x2b,0x20,0x28,0x5f,0x32,0x30,0x34,0x20,0x2a,0x20, + 0x5f,0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x76,0x65, + 0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x30,0x31,0x20,0x3d,0x20, + 0x6d,0x61,0x74,0x34,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x30,0x5d,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x5b,0x31,0x5d,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x32,0x5d,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f, + 0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76, + 0x65,0x63,0x34,0x28,0x5f,0x32,0x38,0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33, + 0x30,0x33,0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d, + 0x20,0x5f,0x33,0x30,0x33,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x31,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x30, + 0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20, + 0x5f,0x33,0x30,0x33,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,0x33,0x31,0x31,0x20,0x3d,0x20, + 0x5f,0x33,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21, + 0x5f,0x33,0x31,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,0x5f,0x33,0x31,0x38, + 0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,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,0x33, + 0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,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,0x33,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x21,0x5f,0x33,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,0x33,0x32,0x35,0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,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,0x33,0x32,0x35,0x20,0x3d,0x20,0x5f,0x33,0x31,0x38,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,0x33,0x33,0x32,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x32,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,0x5f,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f,0x33,0x30, + 0x31,0x2e,0x7a,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,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f, + 0x33,0x32,0x35,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,0x33,0x33,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33,0x34,0x34,0x20,0x3d,0x20,0x74, + 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69, + 0x6e,0x74,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,0x5f,0x73, + 0x6d,0x70,0x2c,0x20,0x5f,0x33,0x30,0x31,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x34,0x36, + 0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x34,0x36,0x20,0x3c,0x20,0x28,0x5f, + 0x33,0x34,0x34,0x2e,0x77,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,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x36,0x38,0x20,0x3d,0x20,0x5f,0x33,0x34, + 0x36,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30, + 0x32,0x33,0x37,0x34,0x38,0x37,0x32,0x35,0x36,0x35,0x32,0x36,0x39,0x34,0x37,0x30, + 0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x33,0x37,0x37,0x20,0x3d,0x20,0x5f,0x33, + 0x34,0x34,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x33,0x37, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x32,0x38,0x36,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x2b,0x3d, + 0x20,0x28,0x28,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x62,0x72,0x69, + 0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x29,0x2c,0x20, + 0x5f,0x33,0x37,0x37,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x36,0x30,0x30, + 0x30,0x30,0x30,0x30,0x32,0x33,0x38,0x34,0x31,0x38,0x35,0x37,0x39,0x31,0x30,0x31, + 0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x76,0x65,0x63, + 0x33,0x28,0x5f,0x33,0x30,0x33,0x2c,0x20,0x5f,0x33,0x30,0x31,0x2e,0x79,0x2c,0x20, + 0x5f,0x33,0x36,0x38,0x29,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x33,0x36,0x38,0x29,0x29, + 0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x28,0x28,0x2d,0x73,0x68,0x61,0x66,0x74,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x5f, + 0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x64,0x75,0x73,0x74,0x28,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x31,0x29,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,0x28,0x28,0x28,0x6c,0x69,0x67,0x68,0x74,0x20,0x2a,0x20,0x76, + 0x5f,0x73,0x75,0x6e,0x29,0x20,0x2a,0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a,0x20,0x5f,0x32,0x34, + 0x32,0x29,0x20,0x2a,0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x00, +]; +/* + #version 430 + uniform vec4 post_params[1]; layout(binding = 16) uniform sampler2D view_color_view_smp; layout(binding = 17) uniform sampler2D bloom_bloom_view_smp; + layout(binding = 18) uniform sampler2D shafts_bloom_view_smp; layout(location = 0) out vec4 frag_color; void main() { vec2 _31 = gl_FragCoord.xy / vec2(textureSize(view_color_view_smp, 0)); - vec3 _73 = ((((texture(view_color_view_smp, _31).xyz + (texture(bloom_bloom_view_smp, _31).xyz * post_params[0].w)) * exp2(post_params[0].x)) - vec3(0.5)) * post_params[0].y) + vec3(0.5); - frag_color = vec4(clamp(mix(vec3(dot(_73, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _73, vec3(post_params[0].z)), vec3(0.0), vec3(1.0)), 1.0); + vec2 _67 = vec2(textureSize(shafts_bloom_view_smp, 0)); + vec3 _142 = (((((texture(view_color_view_smp, _31).xyz + (texture(bloom_bloom_view_smp, _31).xyz * post_params[0].w)) + ((((((texture(shafts_bloom_view_smp, _31).xyz * 2.0) + texture(shafts_bloom_view_smp, _31 + (vec2(1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(-1.0, 1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(1.0, -1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(-1.0) / _67)).xyz) * vec3(0.16666667163372039794921875))) * exp2(post_params[0].x)) - vec3(0.5)) * post_params[0].y) + vec3(0.5); + frag_color = vec4(clamp(mix(vec3(dot(_142, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _142, vec3(post_params[0].z)), vec3(0.0), vec3(1.0)), 1.0); } */ @@ -795,40 +1306,70 @@ fs_post_source_glsl430 := u8.[ 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,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,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,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,0x33,0x31,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28, - 0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69,0x65,0x77,0x5f, - 0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x5f,0x37,0x33,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x74,0x65,0x78, - 0x74,0x75,0x72,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f, - 0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78, - 0x79,0x7a,0x20,0x2b,0x20,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c, - 0x6f,0x6f,0x6d,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73, - 0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70, - 0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29, - 0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x32,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61, - 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x29,0x20,0x2d,0x20,0x76,0x65, - 0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f, - 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2b,0x20,0x76, - 0x65,0x63,0x33,0x28,0x30,0x2e,0x35,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, - 0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x64, - 0x6f,0x74,0x28,0x5f,0x37,0x33,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,0x29, - 0x2c,0x20,0x5f,0x37,0x33,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x70,0x6f,0x73,0x74, - 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x7a,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,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x00, + 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,0x68,0x61,0x66,0x74, + 0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,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,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,0x33,0x31,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x76,0x69, + 0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d, + 0x70,0x2c,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32, + 0x20,0x5f,0x36,0x37,0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74, + 0x75,0x72,0x65,0x53,0x69,0x7a,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30, + 0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x34, + 0x32,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69,0x65,0x77, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b, + 0x20,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f, + 0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x29,0x20,0x2b,0x20, + 0x28,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68, + 0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f, + 0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20, + 0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73, + 0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77, + 0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x76,0x65,0x63, + 0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x2e,0x78, + 0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68, + 0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f, + 0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32, + 0x28,0x2d,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x5f,0x36, + 0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f, + 0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20,0x2b,0x20, + 0x28,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29, + 0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20, + 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f, + 0x33,0x31,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,0x31,0x2e,0x30,0x29, + 0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2a,0x20, + 0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x36,0x36,0x36,0x36,0x36,0x36,0x37,0x31, + 0x36,0x33,0x33,0x37,0x32,0x30,0x33,0x39,0x37,0x39,0x34,0x39,0x32,0x31,0x38,0x37, + 0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x32,0x28,0x70,0x6f,0x73,0x74, + 0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x29,0x20,0x2d, + 0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x70,0x6f, + 0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20, + 0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,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,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63, + 0x33,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x34,0x32,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,0x29,0x2c,0x20,0x5f,0x31,0x34,0x32,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e, + 0x7a,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,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #version 430 @@ -1871,7 +2412,7 @@ fs_trile_shadow_source_glsl430 := u8.[ discard; } vec4 _51 = texelFetch(palette_palette_smp, ivec2(_15, 0), 0); - frag_color = vec4(_51.xyz / vec3(max(max(_51.x, max(_51.y, _51.z)), 0.001000000047497451305389404296875)), 1.0); + frag_color = vec4(_51.xyz / vec3(max(max(_51.x, max(_51.y, _51.z)), 0.001000000047497451305389404296875)), gl_FragCoord.z); } */ @@ -1929,8 +2470,9 @@ fs_trile_glass_shadow_source_glsl430 := u8.[ 0x2e,0x78,0x2c,0x20,0x6d,0x61,0x78,0x28,0x5f,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f, 0x35,0x31,0x2e,0x7a,0x29,0x29,0x2c,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,0x2c,0x20,0x31, - 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x38,0x39,0x34,0x30,0x34,0x32,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x67, + 0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x7a,0x29,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, ]; /* #version 430 @@ -3752,6 +4294,496 @@ fs_bloom_up_source_glsl300es := u8.[ 0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x2c,0x20,0x31,0x2e,0x30, 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; +/* + #version 300 es + + uniform vec4 view_params[13]; + out vec4 v_point; + out vec3 v_camera; + out vec3 v_sun; + out float v_time; + + vec2 fullscreen_position(int vertex_index) + { + return (vec2(float((vertex_index << 1) & 2), float(vertex_index & 2)) * 2.0) - vec2(1.0); + } + + void main() + { + int param = gl_VertexID; + vec2 _37 = fullscreen_position(param); + float _48 = _37.x; + gl_Position = vec4(_48, _37.y, 0.0, 1.0); + v_point = mat4(view_params[4], view_params[5], view_params[6], view_params[7]) * vec4(_48, _37.y, 0.5, 1.0); + v_camera = view_params[8].xyz; + v_sun = view_params[11].xyz; + v_time = view_params[8].w; + } + +*/ +vs_shafts_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,0x76,0x69, + 0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x33,0x5d,0x3b,0x0a,0x6f, + 0x75,0x74,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x3b, + 0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65, + 0x72,0x61,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x76,0x65,0x63,0x33,0x20,0x76,0x5f,0x73, + 0x75,0x6e,0x3b,0x0a,0x6f,0x75,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f, + 0x74,0x69,0x6d,0x65,0x3b,0x0a,0x0a,0x76,0x65,0x63,0x32,0x20,0x66,0x75,0x6c,0x6c, + 0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x28, + 0x69,0x6e,0x74,0x20,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x6e,0x64,0x65,0x78, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28, + 0x76,0x65,0x63,0x32,0x28,0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x76,0x65,0x72,0x74, + 0x65,0x78,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x3c,0x3c,0x20,0x31,0x29,0x20,0x26, + 0x20,0x32,0x29,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x28,0x76,0x65,0x72,0x74,0x65, + 0x78,0x5f,0x69,0x6e,0x64,0x65,0x78,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a,0x20, + 0x32,0x2e,0x30,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,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,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x44,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x33,0x37,0x20,0x3d,0x20,0x66, + 0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x5f,0x33,0x37,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x67,0x6c,0x5f,0x50,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x20,0x3d,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,0x38,0x2c,0x20,0x5f,0x33, + 0x37,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x20,0x3d,0x20,0x6d,0x61, + 0x74,0x34,0x28,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x34, + 0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x35, + 0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x36, + 0x5d,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x37, + 0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x34,0x38,0x2c,0x20,0x5f, + 0x33,0x37,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x20,0x3d,0x20, + 0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d,0x2e,0x78, + 0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x73,0x75,0x6e,0x20,0x3d,0x20, + 0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31,0x31,0x5d,0x2e, + 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,0x20, + 0x3d,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x38,0x5d, + 0x2e,0x77,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #version 300 es + precision mediump float; + precision highp int; + + uniform highp vec4 shaft_params[1]; + uniform highp vec4 shadow_params[4]; + uniform highp sampler2D shaft_scene_shaft_scene_smp; + uniform highp sampler2D shadow_tint_shadow_tint_smp; + uniform highp sampler2DShadow shadow_map_shadow_smp; + + in highp float v_time; + in highp vec4 v_point; + in highp vec3 v_camera; + layout(location = 0) out highp vec4 frag_color; + in highp vec3 v_sun; + + highp float brightest(highp vec3 c) + { + return max(c.x, max(c.y, c.z)); + } + + highp float hash(inout highp vec3 p) + { + p = fract((p * 0.31830990314483642578125) + vec3(0.100000001490116119384765625)); + p *= 17.0; + return fract(((p.x * p.y) * p.z) * ((p.x + p.y) + p.z)); + } + + highp float value_noise(highp vec3 p) + { + highp vec3 _69 = floor(p); + highp vec3 _72 = fract(p); + highp vec3 _82 = (_72 * _72) * (vec3(3.0) - (_72 * 2.0)); + highp vec3 param = _69; + highp float _85 = hash(param); + highp vec3 param_1 = _69 + vec3(1.0, 0.0, 0.0); + highp float _92 = hash(param_1); + highp float _94 = _82.x; + highp vec3 param_2 = _69 + vec3(0.0, 1.0, 0.0); + highp float _100 = hash(param_2); + highp vec3 param_3 = _69 + vec3(1.0, 1.0, 0.0); + highp float _105 = hash(param_3); + highp float _110 = _82.y; + highp vec3 param_4 = _69 + vec3(0.0, 0.0, 1.0); + highp float _116 = hash(param_4); + highp vec3 param_5 = _69 + vec3(1.0, 0.0, 1.0); + highp float _121 = hash(param_5); + highp vec3 param_6 = _69 + vec3(0.0, 1.0, 1.0); + highp float _129 = hash(param_6); + highp vec3 param_7 = _69 + vec3(1.0); + highp float _134 = hash(param_7); + return mix(mix(mix(_85, _92, _94), mix(_100, _105, _94), _110), mix(mix(_116, _121, _94), mix(_129, _134, _94), _110), _82.z); + } + + highp float dust(highp vec3 p) + { + highp vec3 _149 = p * 0.800000011920928955078125; + highp vec3 param = _149 + ((vec3(0.4000000059604644775390625, 0.1500000059604644775390625, 0.300000011920928955078125) * v_time) * 0.800000011920928955078125); + highp vec3 param_1 = (_149 * 2.2999999523162841796875) - (((vec3(0.300000011920928955078125, 0.4000000059604644775390625, 0.1500000059604644775390625) * v_time) * 0.800000011920928955078125) * 1.7000000476837158203125); + return mix(0.0, 2.0, smoothstep(0.25, 0.75, (value_noise(param) * 0.64999997615814208984375) + (value_noise(param_1) * 0.3499999940395355224609375))); + } + + void main() + { + highp vec3 _204 = normalize((v_point.xyz / vec3(v_point.w)) - v_camera); + highp float _242 = min(texelFetch(shaft_scene_shaft_scene_smp, ivec2(gl_FragCoord.xy) * ivec2(2), 0).x, shaft_params[0].z) / shaft_params[0].w; + highp float _253 = fract(52.98291778564453125 * fract(dot(gl_FragCoord.xy, vec2(0.067110560834407806396484375, 0.005837149918079376220703125)))); + highp vec3 light = vec3(0.0); + for (highp float i = 0.0; i < shaft_params[0].w; i += 1.0) + { + highp float _272 = (i + _253) * _242; + highp vec3 _286 = (floor((v_camera + (_204 * _272)) * 16.0) + vec3(0.5)) * vec3(0.0625); + highp vec4 _301 = mat4(shadow_params[0], shadow_params[1], shadow_params[2], shadow_params[3]) * vec4(_286, 1.0); + highp float _303 = _301.x; + bool _304 = _303 < 0.0; + bool _311; + if (!_304) + { + _311 = _303 > 1.0; + } + else + { + _311 = _304; + } + bool _318; + if (!_311) + { + _318 = _301.y < 0.0; + } + else + { + _318 = _311; + } + bool _325; + if (!_318) + { + _325 = _301.y > 1.0; + } + else + { + _325 = _318; + } + bool _332; + if (!_325) + { + _332 = _301.z > 1.0; + } + else + { + _332 = _325; + } + if (_332) + { + continue; + } + highp vec4 _344 = texture(shadow_tint_shadow_tint_smp, _301.xy); + highp float _346 = _301.z; + if (_346 < (_344.w + 0.001000000047497451305389404296875)) + { + continue; + } + highp float _368 = _346 - 0.0005000000237487256526947021484375; + highp vec3 _377 = _344.xyz; + highp vec3 param = _377; + highp vec3 param_1 = _286; + light += (((mix(vec3(brightest(param)), _377, vec3(0.60000002384185791015625)) * texture(shadow_map_shadow_smp, vec3(vec3(_303, _301.y, _368).xy, _368))) * exp((-shaft_params[0].x) * _272)) * dust(param_1)); + } + frag_color = vec4((((light * v_sun) * shaft_params[0].x) * _242) * shaft_params[0].y, 1.0); + } + +*/ +fs_shafts_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,0x73,0x68,0x61,0x66,0x74,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,0x76,0x65,0x63,0x34,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x5b,0x34,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, + 0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x68,0x61,0x66, + 0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,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,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74, + 0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,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,0x53,0x68,0x61,0x64,0x6f,0x77,0x20, + 0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f,0x73,0x68,0x61,0x64,0x6f, + 0x77,0x5f,0x73,0x6d,0x70,0x3b,0x0a,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,0x3b,0x0a,0x69, + 0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x5f,0x70, + 0x6f,0x69,0x6e,0x74,0x3b,0x0a,0x69,0x6e,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,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,0x76,0x5f,0x73,0x75, + 0x6e,0x3b,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x62,0x72,0x69,0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x68,0x69,0x67,0x68,0x70,0x20, + 0x76,0x65,0x63,0x33,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, + 0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x78,0x28,0x63,0x2e,0x78,0x2c,0x20,0x6d,0x61, + 0x78,0x28,0x63,0x2e,0x79,0x2c,0x20,0x63,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x68,0x61,0x73, + 0x68,0x28,0x69,0x6e,0x6f,0x75,0x74,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x70,0x20,0x3d,0x20, + 0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x70,0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,0x38, + 0x33,0x30,0x39,0x39,0x30,0x33,0x31,0x34,0x34,0x38,0x33,0x36,0x34,0x32,0x35,0x37, + 0x38,0x31,0x32,0x35,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,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x70,0x20,0x2a,0x3d,0x20,0x31,0x37,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x28, + 0x70,0x2e,0x78,0x20,0x2a,0x20,0x70,0x2e,0x79,0x29,0x20,0x2a,0x20,0x70,0x2e,0x7a, + 0x29,0x20,0x2a,0x20,0x28,0x28,0x70,0x2e,0x78,0x20,0x2b,0x20,0x70,0x2e,0x79,0x29, + 0x20,0x2b,0x20,0x70,0x2e,0x7a,0x29,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6e, + 0x6f,0x69,0x73,0x65,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x5f,0x36,0x39,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x33,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x70, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x38,0x32,0x20,0x3d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x5f, + 0x37,0x32,0x29,0x20,0x2a,0x20,0x28,0x76,0x65,0x63,0x33,0x28,0x33,0x2e,0x30,0x29, + 0x20,0x2d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x36,0x39,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x38,0x35, + 0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,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,0x36,0x39,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,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,0x39,0x32,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67, + 0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x39,0x34,0x20,0x3d,0x20,0x5f, + 0x38,0x32,0x2e,0x78,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,0x5f, + 0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c,0x20,0x31, + 0x2e,0x30,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,0x30,0x30,0x20,0x3d, + 0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,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,0x5f,0x36,0x39,0x20,0x2b,0x20,0x76, + 0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,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,0x30,0x35,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69, + 0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,0x30,0x20,0x3d, + 0x20,0x5f,0x38,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, + 0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,0x36, + 0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29, + 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,0x5f,0x36,0x39,0x20,0x2b, + 0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20, + 0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x31,0x20,0x3d,0x20,0x68,0x61,0x73, + 0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,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,0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28, + 0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x31,0x32,0x39,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,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,0x37,0x20,0x3d,0x20,0x5f, + 0x36,0x39,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x31,0x33,0x34,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x5f,0x38,0x35, + 0x2c,0x20,0x5f,0x39,0x32,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x6d,0x69,0x78, + 0x28,0x5f,0x31,0x30,0x30,0x2c,0x20,0x5f,0x31,0x30,0x35,0x2c,0x20,0x5f,0x39,0x34, + 0x29,0x2c,0x20,0x5f,0x31,0x31,0x30,0x29,0x2c,0x20,0x6d,0x69,0x78,0x28,0x6d,0x69, + 0x78,0x28,0x5f,0x31,0x31,0x36,0x2c,0x20,0x5f,0x31,0x32,0x31,0x2c,0x20,0x5f,0x39, + 0x34,0x29,0x2c,0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x32,0x39,0x2c,0x20,0x5f,0x31, + 0x33,0x34,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x5f,0x31,0x31,0x30,0x29,0x2c, + 0x20,0x5f,0x38,0x32,0x2e,0x7a,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x64,0x75,0x73,0x74,0x28,0x68,0x69,0x67, + 0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x31,0x34,0x39, + 0x20,0x3d,0x20,0x70,0x20,0x2a,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x34,0x39,0x20,0x2b, + 0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,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,0x2c,0x20,0x30,0x2e,0x31,0x35,0x30,0x30,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,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x31,0x39,0x32,0x30, + 0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35,0x29,0x20,0x2a,0x20, + 0x76,0x5f,0x74,0x69,0x6d,0x65,0x29,0x20,0x2a,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,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, + 0x28,0x5f,0x31,0x34,0x39,0x20,0x2a,0x20,0x32,0x2e,0x32,0x39,0x39,0x39,0x39,0x39, + 0x39,0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35, + 0x29,0x20,0x2d,0x20,0x28,0x28,0x28,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,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,0x2c,0x20,0x30,0x2e,0x31,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x35, + 0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36,0x32,0x35, + 0x29,0x20,0x2a,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,0x29,0x20,0x2a,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,0x20,0x2a,0x20,0x31,0x2e,0x37,0x30, + 0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x36,0x38,0x33,0x37,0x31,0x35,0x38,0x32,0x30, + 0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x6d,0x69,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x32,0x2e,0x30,0x2c,0x20, + 0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x32,0x35,0x2c, + 0x20,0x30,0x2e,0x37,0x35,0x2c,0x20,0x28,0x76,0x61,0x6c,0x75,0x65,0x5f,0x6e,0x6f, + 0x69,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x20,0x2a,0x20,0x30,0x2e,0x36, + 0x34,0x39,0x39,0x39,0x39,0x39,0x37,0x36,0x31,0x35,0x38,0x31,0x34,0x32,0x30,0x38, + 0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x28,0x76,0x61,0x6c,0x75,0x65, + 0x5f,0x6e,0x6f,0x69,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x20, + 0x2a,0x20,0x30,0x2e,0x33,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x34,0x30,0x33,0x39, + 0x35,0x33,0x35,0x35,0x32,0x32,0x34,0x36,0x30,0x39,0x33,0x37,0x35,0x29,0x29,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, + 0x33,0x20,0x5f,0x32,0x30,0x34,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, + 0x7a,0x65,0x28,0x28,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x20, + 0x2f,0x20,0x76,0x65,0x63,0x33,0x28,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x2e,0x77, + 0x29,0x29,0x20,0x2d,0x20,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, + 0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x6d,0x69,0x6e,0x28,0x74,0x65,0x78,0x65,0x6c, + 0x46,0x65,0x74,0x63,0x68,0x28,0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e, + 0x65,0x5f,0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,0x5f,0x73,0x6d, + 0x70,0x2c,0x20,0x69,0x76,0x65,0x63,0x32,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67, + 0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78,0x79,0x29,0x20,0x2a,0x20,0x69,0x76,0x65,0x63, + 0x32,0x28,0x32,0x29,0x2c,0x20,0x30,0x29,0x2e,0x78,0x2c,0x20,0x73,0x68,0x61,0x66, + 0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x7a,0x29,0x20,0x2f, + 0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d, + 0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74, + 0x28,0x35,0x32,0x2e,0x39,0x38,0x32,0x39,0x31,0x37,0x37,0x38,0x35,0x36,0x34,0x34, + 0x35,0x33,0x31,0x32,0x35,0x20,0x2a,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x64,0x6f, + 0x74,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x78, + 0x79,0x2c,0x20,0x76,0x65,0x63,0x32,0x28,0x30,0x2e,0x30,0x36,0x37,0x31,0x31,0x30, + 0x35,0x36,0x30,0x38,0x33,0x34,0x34,0x30,0x37,0x38,0x30,0x36,0x33,0x39,0x36,0x34, + 0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x35,0x38,0x33,0x37,0x31, + 0x34,0x39,0x39,0x31,0x38,0x30,0x37,0x39,0x33,0x37,0x36,0x32,0x32,0x30,0x37,0x30, + 0x33,0x31,0x32,0x35,0x29,0x29,0x29,0x29,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,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6f,0x72,0x20,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x69,0x20,0x3d,0x20,0x30,0x2e,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20,0x73,0x68, + 0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x3b, + 0x20,0x69,0x20,0x2b,0x3d,0x20,0x31,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,0x32,0x37,0x32,0x20,0x3d,0x20,0x28,0x69,0x20,0x2b, + 0x20,0x5f,0x32,0x35,0x33,0x29,0x20,0x2a,0x20,0x5f,0x32,0x34,0x32,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x33,0x20,0x5f,0x32,0x38,0x36,0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28, + 0x28,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x20,0x2b,0x20,0x28,0x5f,0x32,0x30, + 0x34,0x20,0x2a,0x20,0x5f,0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e, + 0x30,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20, + 0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x34,0x20,0x5f,0x33,0x30,0x31,0x20,0x3d,0x20,0x6d,0x61,0x74,0x34,0x28,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2c, + 0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x31, + 0x5d,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, + 0x5b,0x32,0x5d,0x2c,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x5b,0x33,0x5d,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x34,0x28,0x5f,0x32, + 0x38,0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33, + 0x30,0x33,0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d, + 0x20,0x5f,0x33,0x30,0x33,0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x31,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x30, + 0x34,0x29,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20, + 0x5f,0x33,0x30,0x33,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,0x33,0x31,0x31,0x20,0x3d,0x20, + 0x5f,0x33,0x30,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21, + 0x5f,0x33,0x31,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,0x5f,0x33,0x31,0x38, + 0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,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,0x33, + 0x31,0x38,0x20,0x3d,0x20,0x5f,0x33,0x31,0x31,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,0x33,0x32,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x21,0x5f,0x33,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,0x33,0x32,0x35,0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,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,0x33,0x32,0x35,0x20,0x3d,0x20,0x5f,0x33,0x31,0x38,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,0x33,0x33,0x32,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x32,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,0x5f,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f,0x33,0x30, + 0x31,0x2e,0x7a,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,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f, + 0x33,0x32,0x35,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,0x33,0x33,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x33, + 0x34,0x34,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61, + 0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,0x5f,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f, + 0x74,0x69,0x6e,0x74,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x30,0x31,0x2e,0x78, + 0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x34,0x36,0x20,0x3d,0x20,0x5f, + 0x33,0x30,0x31,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x33,0x34,0x36,0x20,0x3c,0x20,0x28,0x5f,0x33,0x34,0x34,0x2e, + 0x77,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,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x36,0x38,0x20,0x3d,0x20,0x5f, + 0x33,0x34,0x36,0x20,0x2d,0x20,0x30,0x2e,0x30,0x30,0x30,0x35,0x30,0x30,0x30,0x30, + 0x30,0x30,0x32,0x33,0x37,0x34,0x38,0x37,0x32,0x35,0x36,0x35,0x32,0x36,0x39,0x34, + 0x37,0x30,0x32,0x31,0x34,0x38,0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, + 0x33,0x37,0x37,0x20,0x3d,0x20,0x5f,0x33,0x34,0x34,0x2e,0x78,0x79,0x7a,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,0x20,0x3d,0x20,0x5f,0x33,0x37,0x37,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,0x20,0x3d,0x20,0x5f,0x32, + 0x38,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68, + 0x74,0x20,0x2b,0x3d,0x20,0x28,0x28,0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33, + 0x28,0x62,0x72,0x69,0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x29,0x29,0x2c,0x20,0x5f,0x33,0x37,0x37,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30, + 0x2e,0x36,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x33,0x38,0x34,0x31,0x38,0x35,0x37, + 0x39,0x31,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x5f, + 0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x76,0x65,0x63,0x33, + 0x28,0x76,0x65,0x63,0x33,0x28,0x5f,0x33,0x30,0x33,0x2c,0x20,0x5f,0x33,0x30,0x31, + 0x2e,0x79,0x2c,0x20,0x5f,0x33,0x36,0x38,0x29,0x2e,0x78,0x79,0x2c,0x20,0x5f,0x33, + 0x36,0x38,0x29,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x28,0x28,0x2d,0x73,0x68, + 0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29, + 0x20,0x2a,0x20,0x5f,0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x64,0x75,0x73,0x74, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,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,0x28,0x28,0x28,0x6c,0x69,0x67,0x68,0x74, + 0x20,0x2a,0x20,0x76,0x5f,0x73,0x75,0x6e,0x29,0x20,0x2a,0x20,0x73,0x68,0x61,0x66, + 0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x20,0x2a, + 0x20,0x5f,0x32,0x34,0x32,0x29,0x20,0x2a,0x20,0x73,0x68,0x61,0x66,0x74,0x5f,0x70, + 0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79,0x2c,0x20,0x31,0x2e,0x30,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; /* #version 300 es precision mediump float; @@ -3760,14 +4792,16 @@ fs_bloom_up_source_glsl300es := u8.[ uniform highp vec4 post_params[1]; uniform highp sampler2D view_color_view_smp; uniform highp sampler2D bloom_bloom_view_smp; + uniform highp sampler2D shafts_bloom_view_smp; layout(location = 0) out highp vec4 frag_color; void main() { highp vec2 _31 = gl_FragCoord.xy / vec2(textureSize(view_color_view_smp, 0)); - highp vec3 _73 = ((((texture(view_color_view_smp, _31).xyz + (texture(bloom_bloom_view_smp, _31).xyz * post_params[0].w)) * exp2(post_params[0].x)) - vec3(0.5)) * post_params[0].y) + vec3(0.5); - frag_color = vec4(clamp(mix(vec3(dot(_73, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _73, vec3(post_params[0].z)), vec3(0.0), vec3(1.0)), 1.0); + highp vec2 _67 = vec2(textureSize(shafts_bloom_view_smp, 0)); + highp vec3 _142 = (((((texture(view_color_view_smp, _31).xyz + (texture(bloom_bloom_view_smp, _31).xyz * post_params[0].w)) + ((((((texture(shafts_bloom_view_smp, _31).xyz * 2.0) + texture(shafts_bloom_view_smp, _31 + (vec2(1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(-1.0, 1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(1.0, -1.0) / _67)).xyz) + texture(shafts_bloom_view_smp, _31 + (vec2(-1.0) / _67)).xyz) * vec3(0.16666667163372039794921875))) * exp2(post_params[0].x)) - vec3(0.5)) * post_params[0].y) + vec3(0.5); + frag_color = vec4(clamp(mix(vec3(dot(_142, vec3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _142, vec3(post_params[0].z)), vec3(0.0), vec3(1.0)), 1.0); } */ @@ -3783,41 +4817,71 @@ fs_post_source_glsl300es := u8.[ 0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69,0x65,0x77,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,0x62,0x6c,0x6f, - 0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,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,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,0x33,0x31,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65, - 0x53,0x69,0x7a,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f, - 0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x37, - 0x33,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, - 0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69,0x65,0x77,0x5f, - 0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20, - 0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x62, - 0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f, - 0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70, - 0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x29,0x20,0x2a,0x20,0x65, - 0x78,0x70,0x32,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b, - 0x30,0x5d,0x2e,0x78,0x29,0x29,0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, - 0x35,0x29,0x29,0x20,0x2a,0x20,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d, - 0x73,0x5b,0x30,0x5d,0x2e,0x79,0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30, - 0x2e,0x35,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,0x63,0x6c,0x61,0x6d,0x70, - 0x28,0x6d,0x69,0x78,0x28,0x76,0x65,0x63,0x33,0x28,0x64,0x6f,0x74,0x28,0x5f,0x37, - 0x33,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,0x29,0x2c,0x20,0x5f,0x37,0x33, - 0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x7a,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, - 0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,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,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x76,0x69,0x65,0x77,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,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,0x33,0x31,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,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53, + 0x69,0x7a,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76, + 0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x32,0x20,0x5f,0x36,0x37, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x32,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x53, + 0x69,0x7a,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d, + 0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x30,0x29,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f, + 0x31,0x34,0x32,0x20,0x3d,0x20,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x76,0x69, + 0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a, + 0x20,0x2b,0x20,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70, + 0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x70,0x6f,0x73, + 0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x77,0x29,0x29,0x20, + 0x2b,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65, + 0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20, + 0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69, + 0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x76, + 0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29, + 0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28, + 0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65, + 0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x76,0x65, + 0x63,0x32,0x28,0x2d,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20, + 0x5f,0x36,0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x5f,0x62,0x6c,0x6f,0x6f, + 0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x20, + 0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x31,0x2e,0x30,0x2c,0x20,0x2d,0x31,0x2e, + 0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2b,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x73,0x68,0x61,0x66,0x74,0x73, + 0x5f,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c, + 0x20,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x76,0x65,0x63,0x32,0x28,0x2d,0x31,0x2e, + 0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20, + 0x2a,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x31,0x36,0x36,0x36,0x36,0x36,0x36, + 0x37,0x31,0x36,0x33,0x33,0x37,0x32,0x30,0x33,0x39,0x37,0x39,0x34,0x39,0x32,0x31, + 0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x32,0x28,0x70,0x6f, + 0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x29,0x29, + 0x20,0x2d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20, + 0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x79, + 0x29,0x20,0x2b,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x35,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,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x76, + 0x65,0x63,0x33,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x34,0x32,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,0x29,0x2c,0x20,0x5f,0x31,0x34,0x32,0x2c,0x20,0x76,0x65, + 0x63,0x33,0x28,0x70,0x6f,0x73,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x5b,0x30, + 0x5d,0x2e,0x7a,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,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #version 300 es @@ -4853,7 +5917,7 @@ fs_trile_shadow_source_glsl300es := u8.[ discard; } highp vec4 _51 = texelFetch(palette_palette_smp, ivec2(_15, 0), 0); - frag_color = vec4(_51.xyz / vec3(max(max(_51.x, max(_51.y, _51.z)), 0.001000000047497451305389404296875)), 1.0); + frag_color = vec4(_51.xyz / vec3(max(max(_51.x, max(_51.y, _51.z)), 0.001000000047497451305389404296875)), gl_FragCoord.z); } */ @@ -4904,8 +5968,8 @@ fs_trile_glass_shadow_source_glsl300es := u8.[ 0x5f,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x35,0x31,0x2e,0x7a,0x29,0x29,0x2c,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,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x00, + 0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f, + 0x6f,0x72,0x64,0x2e,0x7a,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, ]; /* #version 300 es @@ -6934,6 +7998,608 @@ fs_bloom_up_source_metal_macos := u8.[ 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, ]; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + struct view_params + { + float4x4 view_proj; + float4x4 inv_view_proj; + float4 camera; + float4 clip; + float4 sun_direction; + float4 sun_color; + float4 shade_color; + }; + + struct main0_out + { + float4 v_point [[user(locn0)]]; + float3 v_camera [[user(locn1)]]; + float3 v_sun [[user(locn2)]]; + float v_time [[user(locn3)]]; + float4 gl_Position [[position]]; + }; + + static inline __attribute__((always_inline)) + float2 fullscreen_position(thread const int& vertex_index) + { + return (float2(float((vertex_index << 1) & 2), float(vertex_index & 2)) * 2.0) - float2(1.0); + } + + vertex main0_out main0(constant view_params& _57 [[buffer(0)]], uint gl_VertexIndex [[vertex_id]]) + { + main0_out out = {}; + int param = int(gl_VertexIndex); + float2 _37 = fullscreen_position(param); + float _48 = _37.x; + out.gl_Position = float4(_48, _37.y, 0.0, 1.0); + out.v_point = _57.inv_view_proj * float4(_48, _37.y, 0.5, 1.0); + out.v_camera = _57.camera.xyz; + out.v_sun = _57.sun_color.xyz; + out.v_time = _57.camera.w; + return out; + } + +*/ +vs_shafts_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,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x78,0x34,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x69,0x6e,0x76,0x5f,0x76, + 0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x63,0x61,0x6d,0x65,0x72,0x61,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x6c,0x69,0x70,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x75,0x6e,0x5f,0x64,0x69,0x72, + 0x65,0x63,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x73,0x75,0x6e,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x73,0x68,0x61,0x64,0x65,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,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,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,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,0x76,0x5f,0x63,0x61, + 0x6d,0x65,0x72,0x61,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,0x5f,0x73,0x75,0x6e,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,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,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,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,0x32,0x20,0x66,0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,0x65, + 0x6e,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x28,0x74,0x68,0x72,0x65,0x61, + 0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x69,0x6e,0x74,0x26,0x20,0x76,0x65,0x72, + 0x74,0x65,0x78,0x5f,0x69,0x6e,0x64,0x65,0x78,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28, + 0x66,0x6c,0x6f,0x61,0x74,0x28,0x28,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x6e, + 0x64,0x65,0x78,0x20,0x3c,0x3c,0x20,0x31,0x29,0x20,0x26,0x20,0x32,0x29,0x2c,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x28,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69,0x6e,0x64, + 0x65,0x78,0x20,0x26,0x20,0x32,0x29,0x29,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20, + 0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,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,0x63,0x6f,0x6e,0x73,0x74,0x61,0x6e, + 0x74,0x20,0x76,0x69,0x65,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f, + 0x35,0x37,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d, + 0x2c,0x20,0x75,0x69,0x6e,0x74,0x20,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78, + 0x49,0x6e,0x64,0x65,0x78,0x20,0x5b,0x5b,0x76,0x65,0x72,0x74,0x65,0x78,0x5f,0x69, + 0x64,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,0x67,0x6c,0x5f,0x56,0x65,0x72,0x74,0x65,0x78,0x49,0x6e,0x64,0x65, + 0x78,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20,0x5f, + 0x33,0x37,0x20,0x3d,0x20,0x66,0x75,0x6c,0x6c,0x73,0x63,0x72,0x65,0x65,0x6e,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x34,0x38,0x20,0x3d, + 0x20,0x5f,0x33,0x37,0x2e,0x78,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,0x5f,0x34,0x38,0x2c,0x20,0x5f,0x33,0x37,0x2e,0x79,0x2c, + 0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x6f,0x75,0x74,0x2e,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x20,0x3d,0x20,0x5f,0x35, + 0x37,0x2e,0x69,0x6e,0x76,0x5f,0x76,0x69,0x65,0x77,0x5f,0x70,0x72,0x6f,0x6a,0x20, + 0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f,0x34,0x38,0x2c,0x20,0x5f,0x33, + 0x37,0x2e,0x79,0x2c,0x20,0x30,0x2e,0x35,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61, + 0x20,0x3d,0x20,0x5f,0x35,0x37,0x2e,0x63,0x61,0x6d,0x65,0x72,0x61,0x2e,0x78,0x79, + 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f,0x73,0x75,0x6e, + 0x20,0x3d,0x20,0x5f,0x35,0x37,0x2e,0x73,0x75,0x6e,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x76,0x5f, + 0x74,0x69,0x6d,0x65,0x20,0x3d,0x20,0x5f,0x35,0x37,0x2e,0x63,0x61,0x6d,0x65,0x72, + 0x61,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, + 0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, +]; +/* + #pragma clang diagnostic ignored "-Wmissing-prototypes" + + #include + #include + + using namespace metal; + + struct shaft_params + { + float density; + float amount; + float max_distance; + float steps; + }; + + struct shadow_params + { + float4x4 shadow_uv; + }; + + struct main0_out + { + float4 frag_color [[color(0)]]; + }; + + struct main0_in + { + float4 v_point [[user(locn0)]]; + float3 v_camera [[user(locn1)]]; + float3 v_sun [[user(locn2)]]; + float v_time [[user(locn3)]]; + }; + + static inline __attribute__((always_inline)) + float brightest(thread const float3& c) + { + return fast::max(c.x, fast::max(c.y, c.z)); + } + + static inline __attribute__((always_inline)) + float hash(thread float3& p) + { + p = fract((p * 0.31830990314483642578125) + float3(0.100000001490116119384765625)); + p *= 17.0; + return fract(((p.x * p.y) * p.z) * ((p.x + p.y) + p.z)); + } + + static inline __attribute__((always_inline)) + float value_noise(thread const float3& p) + { + float3 _69 = floor(p); + float3 _72 = fract(p); + float3 _82 = (_72 * _72) * (float3(3.0) - (_72 * 2.0)); + float3 param = _69; + float _85 = hash(param); + float3 param_1 = _69 + float3(1.0, 0.0, 0.0); + float _92 = hash(param_1); + float _94 = _82.x; + float3 param_2 = _69 + float3(0.0, 1.0, 0.0); + float _100 = hash(param_2); + float3 param_3 = _69 + float3(1.0, 1.0, 0.0); + float _105 = hash(param_3); + float _110 = _82.y; + float3 param_4 = _69 + float3(0.0, 0.0, 1.0); + float _116 = hash(param_4); + float3 param_5 = _69 + float3(1.0, 0.0, 1.0); + float _121 = hash(param_5); + float3 param_6 = _69 + float3(0.0, 1.0, 1.0); + float _129 = hash(param_6); + float3 param_7 = _69 + float3(1.0); + float _134 = hash(param_7); + return mix(mix(mix(_85, _92, _94), mix(_100, _105, _94), _110), mix(mix(_116, _121, _94), mix(_129, _134, _94), _110), _82.z); + } + + static inline __attribute__((always_inline)) + float dust(thread const float3& p, thread float& v_time) + { + float3 _149 = p * 0.800000011920928955078125; + float3 param = _149 + ((float3(0.4000000059604644775390625, 0.1500000059604644775390625, 0.300000011920928955078125) * v_time) * 0.800000011920928955078125); + float3 param_1 = (_149 * 2.2999999523162841796875) - (((float3(0.300000011920928955078125, 0.4000000059604644775390625, 0.1500000059604644775390625) * v_time) * 0.800000011920928955078125) * 1.7000000476837158203125); + return mix(0.0, 2.0, smoothstep(0.25, 0.75, (value_noise(param) * 0.64999997615814208984375) + (value_noise(param_1) * 0.3499999940395355224609375))); + } + + fragment main0_out main0(main0_in in [[stage_in]], constant shaft_params& _232 [[buffer(0)]], constant shadow_params& _292 [[buffer(1)]], texture2d shaft_scene [[texture(0)]], texture2d shadow_tint [[texture(1)]], depth2d shadow_map [[texture(2)]], sampler shaft_scene_smp [[sampler(0)]], sampler shadow_tint_smp [[sampler(1)]], sampler shadow_smp [[sampler(2)]], float4 gl_FragCoord [[position]]) + { + main0_out out = {}; + float3 _204 = fast::normalize((in.v_point.xyz / float3(in.v_point.w)) - in.v_camera); + float _242 = fast::min(shaft_scene.read(uint2((int2(gl_FragCoord.xy) * int2(2))), 0).x, _232.max_distance) / _232.steps; + float _253 = fract(52.98291778564453125 * fract(dot(gl_FragCoord.xy, float2(0.067110560834407806396484375, 0.005837149918079376220703125)))); + float3 light = float3(0.0); + for (float i = 0.0; i < _232.steps; i += 1.0) + { + float _272 = (i + _253) * _242; + float3 _286 = (floor((in.v_camera + (_204 * _272)) * 16.0) + float3(0.5)) * float3(0.0625); + float4 _301 = _292.shadow_uv * float4(_286, 1.0); + float _303 = _301.x; + bool _304 = _303 < 0.0; + bool _311; + if (!_304) + { + _311 = _303 > 1.0; + } + else + { + _311 = _304; + } + bool _318; + if (!_311) + { + _318 = _301.y < 0.0; + } + else + { + _318 = _311; + } + bool _325; + if (!_318) + { + _325 = _301.y > 1.0; + } + else + { + _325 = _318; + } + bool _332; + if (!_325) + { + _332 = _301.z > 1.0; + } + else + { + _332 = _325; + } + if (_332) + { + continue; + } + float4 _344 = shadow_tint.sample(shadow_tint_smp, _301.xy); + float _346 = _301.z; + if (_346 < (_344.w + 0.001000000047497451305389404296875)) + { + continue; + } + float _368 = _346 - 0.0005000000237487256526947021484375; + float3 _377 = _344.xyz; + float3 param = _377; + float3 param_1 = _286; + light += (((mix(float3(brightest(param)), _377, float3(0.60000002384185791015625)) * shadow_map.sample_compare(shadow_smp, float3(_303, _301.y, _368).xy, _368)) * exp((-_232.density) * _272)) * dust(param_1, in.v_time)); + } + out.frag_color = float4((((light * in.v_sun) * _232.density) * _242) * _232.amount, 1.0); + return out; + } + +*/ +fs_shafts_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,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x20,0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x61,0x6d,0x6f,0x75,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x20,0x6d,0x61,0x78,0x5f,0x64,0x69,0x73,0x74,0x61,0x6e, + 0x63,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x74, + 0x65,0x70,0x73,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, + 0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x78,0x34,0x20,0x73,0x68,0x61, + 0x64,0x6f,0x77,0x5f,0x75,0x76,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,0x34,0x20,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,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,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61, + 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,0x5f,0x73, + 0x75,0x6e,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,0x20,0x76,0x5f, + 0x74,0x69,0x6d,0x65,0x20,0x5b,0x5b,0x75,0x73,0x65,0x72,0x28,0x6c,0x6f,0x63,0x6e, + 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,0x20,0x62,0x72,0x69, + 0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x63,0x29,0x0a,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x63,0x2e,0x78,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a, + 0x3a,0x6d,0x61,0x78,0x28,0x63,0x2e,0x79,0x2c,0x20,0x63,0x2e,0x7a,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,0x68,0x61,0x73,0x68,0x28,0x74,0x68,0x72,0x65, + 0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x70,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x70,0x20,0x3d,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x70, + 0x20,0x2a,0x20,0x30,0x2e,0x33,0x31,0x38,0x33,0x30,0x39,0x39,0x30,0x33,0x31,0x34, + 0x34,0x38,0x33,0x36,0x34,0x32,0x35,0x37,0x38,0x31,0x32,0x35,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x20,0x2a,0x3d, + 0x20,0x31,0x37,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x28,0x28,0x70,0x2e,0x78,0x20,0x2a,0x20, + 0x70,0x2e,0x79,0x29,0x20,0x2a,0x20,0x70,0x2e,0x7a,0x29,0x20,0x2a,0x20,0x28,0x28, + 0x70,0x2e,0x78,0x20,0x2b,0x20,0x70,0x2e,0x79,0x29,0x20,0x2b,0x20,0x70,0x2e,0x7a, + 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,0x76,0x61,0x6c,0x75,0x65,0x5f, + 0x6e,0x6f,0x69,0x73,0x65,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e, + 0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x70,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x36,0x39,0x20,0x3d, + 0x20,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x63, + 0x74,0x28,0x70,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x20,0x5f,0x38,0x32,0x20,0x3d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x5f,0x37, + 0x32,0x29,0x20,0x2a,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x33,0x2e,0x30, + 0x29,0x20,0x2d,0x20,0x28,0x5f,0x37,0x32,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x20,0x3d,0x20,0x5f,0x36,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x20,0x5f,0x38,0x35,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70, + 0x61,0x72,0x61,0x6d,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,0x36,0x39,0x20, + 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e, + 0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x39,0x32,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x39,0x34,0x20,0x3d,0x20,0x5f,0x38,0x32,0x2e,0x78,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x32,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x30,0x30,0x20, + 0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x28,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x30, + 0x35,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31, + 0x30,0x20,0x3d,0x20,0x5f,0x38,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20, + 0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30, + 0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x31,0x36,0x20,0x3d,0x20,0x68,0x61, + 0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20, + 0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x31, + 0x2e,0x30,0x2c,0x20,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x31,0x20,0x3d,0x20, + 0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x36,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x31,0x32,0x39,0x20, + 0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x36,0x39,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x33,0x28,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x20,0x5f,0x31,0x33,0x34,0x20,0x3d,0x20,0x68,0x61,0x73,0x68,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28,0x6d,0x69,0x78,0x28, + 0x5f,0x38,0x35,0x2c,0x20,0x5f,0x39,0x32,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20, + 0x6d,0x69,0x78,0x28,0x5f,0x31,0x30,0x30,0x2c,0x20,0x5f,0x31,0x30,0x35,0x2c,0x20, + 0x5f,0x39,0x34,0x29,0x2c,0x20,0x5f,0x31,0x31,0x30,0x29,0x2c,0x20,0x6d,0x69,0x78, + 0x28,0x6d,0x69,0x78,0x28,0x5f,0x31,0x31,0x36,0x2c,0x20,0x5f,0x31,0x32,0x31,0x2c, + 0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x6d,0x69,0x78,0x28,0x5f,0x31,0x32,0x39,0x2c, + 0x20,0x5f,0x31,0x33,0x34,0x2c,0x20,0x5f,0x39,0x34,0x29,0x2c,0x20,0x5f,0x31,0x31, + 0x30,0x29,0x2c,0x20,0x5f,0x38,0x32,0x2e,0x7a,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,0x64,0x75,0x73,0x74,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f, + 0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x26,0x20,0x70,0x2c,0x20,0x74, + 0x68,0x72,0x65,0x61,0x64,0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x76,0x5f,0x74, + 0x69,0x6d,0x65,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x5f,0x31,0x34,0x39,0x20,0x3d,0x20,0x70,0x20,0x2a,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x5f,0x31,0x34,0x39, + 0x20,0x2b,0x20,0x28,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,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,0x2c,0x20,0x30,0x2e,0x31,0x35,0x30,0x30,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,0x33,0x30,0x30,0x30,0x30,0x30,0x30,0x31, + 0x31,0x39,0x32,0x30,0x39,0x32,0x38,0x39,0x35,0x35,0x30,0x37,0x38,0x31,0x32,0x35, + 0x29,0x20,0x2a,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,0x29,0x20,0x2a,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,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, + 0x28,0x5f,0x31,0x34,0x39,0x20,0x2a,0x20,0x32,0x2e,0x32,0x39,0x39,0x39,0x39,0x39, + 0x39,0x35,0x32,0x33,0x31,0x36,0x32,0x38,0x34,0x31,0x37,0x39,0x36,0x38,0x37,0x35, + 0x29,0x20,0x2d,0x20,0x28,0x28,0x28,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,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,0x2c,0x20,0x30,0x2e,0x31,0x35,0x30,0x30,0x30,0x30,0x30, + 0x30,0x35,0x39,0x36,0x30,0x34,0x36,0x34,0x34,0x37,0x37,0x35,0x33,0x39,0x30,0x36, + 0x32,0x35,0x29,0x20,0x2a,0x20,0x76,0x5f,0x74,0x69,0x6d,0x65,0x29,0x20,0x2a,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,0x20,0x2a,0x20,0x31,0x2e, + 0x37,0x30,0x30,0x30,0x30,0x30,0x30,0x34,0x37,0x36,0x38,0x33,0x37,0x31,0x35,0x38, + 0x32,0x30,0x33,0x31,0x32,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6d,0x69,0x78,0x28,0x30,0x2e,0x30,0x2c,0x20,0x32,0x2e,0x30, + 0x2c,0x20,0x73,0x6d,0x6f,0x6f,0x74,0x68,0x73,0x74,0x65,0x70,0x28,0x30,0x2e,0x32, + 0x35,0x2c,0x20,0x30,0x2e,0x37,0x35,0x2c,0x20,0x28,0x76,0x61,0x6c,0x75,0x65,0x5f, + 0x6e,0x6f,0x69,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x20,0x2a,0x20,0x30, + 0x2e,0x36,0x34,0x39,0x39,0x39,0x39,0x39,0x37,0x36,0x31,0x35,0x38,0x31,0x34,0x32, + 0x30,0x38,0x39,0x38,0x34,0x33,0x37,0x35,0x29,0x20,0x2b,0x20,0x28,0x76,0x61,0x6c, + 0x75,0x65,0x5f,0x6e,0x6f,0x69,0x73,0x65,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, + 0x29,0x20,0x2a,0x20,0x30,0x2e,0x33,0x34,0x39,0x39,0x39,0x39,0x39,0x39,0x34,0x30, + 0x33,0x39,0x35,0x33,0x35,0x35,0x32,0x32,0x34,0x36,0x30,0x39,0x33,0x37,0x35,0x29, + 0x29,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,0x73,0x68,0x61,0x66,0x74,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26, + 0x20,0x5f,0x32,0x33,0x32,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,0x73,0x68, + 0x61,0x64,0x6f,0x77,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x32,0x39, + 0x32,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,0x73,0x68,0x61,0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,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,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,0x20,0x5b,0x5b,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x31,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, + 0x5f,0x6d,0x61,0x70,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,0x73,0x68,0x61, + 0x66,0x74,0x5f,0x73,0x63,0x65,0x6e,0x65,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,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74, + 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,0x73,0x68,0x61, + 0x64,0x6f,0x77,0x5f,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,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f, + 0x32,0x30,0x34,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x28,0x69,0x6e,0x2e,0x76,0x5f,0x70,0x6f,0x69,0x6e, + 0x74,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x69, + 0x6e,0x2e,0x76,0x5f,0x70,0x6f,0x69,0x6e,0x74,0x2e,0x77,0x29,0x29,0x20,0x2d,0x20, + 0x69,0x6e,0x2e,0x76,0x5f,0x63,0x61,0x6d,0x65,0x72,0x61,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x34,0x32,0x20,0x3d,0x20,0x66, + 0x61,0x73,0x74,0x3a,0x3a,0x6d,0x69,0x6e,0x28,0x73,0x68,0x61,0x66,0x74,0x5f,0x73, + 0x63,0x65,0x6e,0x65,0x2e,0x72,0x65,0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28, + 0x28,0x69,0x6e,0x74,0x32,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f, + 0x72,0x64,0x2e,0x78,0x79,0x29,0x20,0x2a,0x20,0x69,0x6e,0x74,0x32,0x28,0x32,0x29, + 0x29,0x29,0x2c,0x20,0x30,0x29,0x2e,0x78,0x2c,0x20,0x5f,0x32,0x33,0x32,0x2e,0x6d, + 0x61,0x78,0x5f,0x64,0x69,0x73,0x74,0x61,0x6e,0x63,0x65,0x29,0x20,0x2f,0x20,0x5f, + 0x32,0x33,0x32,0x2e,0x73,0x74,0x65,0x70,0x73,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x20,0x5f,0x32,0x35,0x33,0x20,0x3d,0x20,0x66,0x72,0x61,0x63, + 0x74,0x28,0x35,0x32,0x2e,0x39,0x38,0x32,0x39,0x31,0x37,0x37,0x38,0x35,0x36,0x34, + 0x34,0x35,0x33,0x31,0x32,0x35,0x20,0x2a,0x20,0x66,0x72,0x61,0x63,0x74,0x28,0x64, + 0x6f,0x74,0x28,0x67,0x6c,0x5f,0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e, + 0x78,0x79,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x30,0x2e,0x30,0x36,0x37, + 0x31,0x31,0x30,0x35,0x36,0x30,0x38,0x33,0x34,0x34,0x30,0x37,0x38,0x30,0x36,0x33, + 0x39,0x36,0x34,0x38,0x34,0x33,0x37,0x35,0x2c,0x20,0x30,0x2e,0x30,0x30,0x35,0x38, + 0x33,0x37,0x31,0x34,0x39,0x39,0x31,0x38,0x30,0x37,0x39,0x33,0x37,0x36,0x32,0x32, + 0x30,0x37,0x30,0x33,0x31,0x32,0x35,0x29,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x6c,0x69,0x67,0x68,0x74,0x20,0x3d,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x6f,0x72,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x20,0x69,0x20,0x3d,0x20, + 0x30,0x2e,0x30,0x3b,0x20,0x69,0x20,0x3c,0x20,0x5f,0x32,0x33,0x32,0x2e,0x73,0x74, + 0x65,0x70,0x73,0x3b,0x20,0x69,0x20,0x2b,0x3d,0x20,0x31,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,0x32,0x37,0x32,0x20,0x3d,0x20,0x28,0x69,0x20,0x2b,0x20,0x5f, + 0x32,0x35,0x33,0x29,0x20,0x2a,0x20,0x5f,0x32,0x34,0x32,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x38,0x36, + 0x20,0x3d,0x20,0x28,0x66,0x6c,0x6f,0x6f,0x72,0x28,0x28,0x69,0x6e,0x2e,0x76,0x5f, + 0x63,0x61,0x6d,0x65,0x72,0x61,0x20,0x2b,0x20,0x28,0x5f,0x32,0x30,0x34,0x20,0x2a, + 0x20,0x5f,0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x31,0x36,0x2e,0x30,0x29,0x20, + 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x36,0x32,0x35,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, + 0x5f,0x33,0x30,0x31,0x20,0x3d,0x20,0x5f,0x32,0x39,0x32,0x2e,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x5f,0x75,0x76,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x5f, + 0x32,0x38,0x36,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x30,0x33,0x20,0x3d,0x20, + 0x5f,0x33,0x30,0x31,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x30,0x34,0x20,0x3d,0x20,0x5f,0x33,0x30,0x33, + 0x20,0x3c,0x20,0x30,0x2e,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x30,0x34,0x29,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x5f,0x33,0x31,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x33,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,0x33,0x31,0x31,0x20,0x3d,0x20,0x5f,0x33,0x30,0x34,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x62,0x6f,0x6f,0x6c,0x20,0x5f,0x33,0x31,0x38,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x31,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,0x5f,0x33,0x31,0x38,0x20,0x3d,0x20,0x5f,0x33, + 0x30,0x31,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,0x33,0x31,0x38,0x20,0x3d,0x20, + 0x5f,0x33,0x31,0x31,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,0x33,0x32, + 0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x21, + 0x5f,0x33,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,0x33,0x32,0x35, + 0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,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,0x33, + 0x32,0x35,0x20,0x3d,0x20,0x5f,0x33,0x31,0x38,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,0x33,0x33,0x32,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x21,0x5f,0x33,0x32,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,0x5f,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f,0x33,0x30,0x31,0x2e,0x7a,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,0x33,0x33,0x32,0x20,0x3d,0x20,0x5f,0x33,0x32,0x35,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,0x33,0x33,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x5f,0x33,0x34,0x34,0x20,0x3d,0x20,0x73,0x68,0x61,0x64, + 0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x5f,0x74,0x69,0x6e,0x74,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x33,0x30,0x31,0x2e,0x78,0x79,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x33,0x34,0x36,0x20,0x3d,0x20,0x5f, + 0x33,0x30,0x31,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x69, + 0x66,0x20,0x28,0x5f,0x33,0x34,0x36,0x20,0x3c,0x20,0x28,0x5f,0x33,0x34,0x34,0x2e, + 0x77,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,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,0x6e,0x74,0x69,0x6e,0x75,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x20,0x5f,0x33,0x36,0x38,0x20,0x3d,0x20,0x5f,0x33,0x34,0x36,0x20,0x2d,0x20, + 0x30,0x2e,0x30,0x30,0x30,0x35,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x33,0x37,0x34, + 0x38,0x37,0x32,0x35,0x36,0x35,0x32,0x36,0x39,0x34,0x37,0x30,0x32,0x31,0x34,0x38, + 0x34,0x33,0x37,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x20,0x5f,0x33,0x37,0x37,0x20,0x3d,0x20,0x5f,0x33,0x34,0x34, + 0x2e,0x78,0x79,0x7a,0x3b,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,0x37, + 0x37,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x5f,0x32,0x38,0x36, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6c,0x69,0x67,0x68,0x74,0x20, + 0x2b,0x3d,0x20,0x28,0x28,0x28,0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x62,0x72,0x69,0x67,0x68,0x74,0x65,0x73,0x74,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x29,0x29,0x2c,0x20,0x5f,0x33,0x37,0x37,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x30,0x2e,0x36,0x30,0x30,0x30,0x30,0x30,0x30,0x32,0x33,0x38,0x34,0x31,0x38, + 0x35,0x37,0x39,0x31,0x30,0x31,0x35,0x36,0x32,0x35,0x29,0x29,0x20,0x2a,0x20,0x73, + 0x68,0x61,0x64,0x6f,0x77,0x5f,0x6d,0x61,0x70,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65, + 0x5f,0x63,0x6f,0x6d,0x70,0x61,0x72,0x65,0x28,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f, + 0x73,0x6d,0x70,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x33,0x30,0x33, + 0x2c,0x20,0x5f,0x33,0x30,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x33,0x36,0x38,0x29,0x2e, + 0x78,0x79,0x2c,0x20,0x5f,0x33,0x36,0x38,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70, + 0x28,0x28,0x2d,0x5f,0x32,0x33,0x32,0x2e,0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x29, + 0x20,0x2a,0x20,0x5f,0x32,0x37,0x32,0x29,0x29,0x20,0x2a,0x20,0x64,0x75,0x73,0x74, + 0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x74, + 0x69,0x6d,0x65,0x29,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,0x28,0x28,0x28,0x6c,0x69,0x67,0x68, + 0x74,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x76,0x5f,0x73,0x75,0x6e,0x29,0x20,0x2a,0x20, + 0x5f,0x32,0x33,0x32,0x2e,0x64,0x65,0x6e,0x73,0x69,0x74,0x79,0x29,0x20,0x2a,0x20, + 0x5f,0x32,0x34,0x32,0x29,0x20,0x2a,0x20,0x5f,0x32,0x33,0x32,0x2e,0x61,0x6d,0x6f, + 0x75,0x6e,0x74,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, +]; /* #include #include @@ -6953,12 +8619,13 @@ fs_bloom_up_source_metal_macos := u8.[ float4 frag_color [[color(0)]]; }; - fragment main0_out main0(constant post_params& _51 [[buffer(0)]], texture2d view_color [[texture(0)]], texture2d bloom [[texture(1)]], sampler view_smp [[sampler(0)]], sampler bloom_view_smp [[sampler(1)]], float4 gl_FragCoord [[position]]) + fragment main0_out main0(constant post_params& _51 [[buffer(0)]], texture2d view_color [[texture(0)]], texture2d bloom [[texture(1)]], texture2d shafts [[texture(2)]], sampler view_smp [[sampler(0)]], sampler bloom_view_smp [[sampler(1)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; float2 _31 = gl_FragCoord.xy / float2(int2(view_color.get_width(), view_color.get_height())); - float3 _73 = ((((view_color.sample(view_smp, _31).xyz + (bloom.sample(bloom_view_smp, _31).xyz * _51.bloom_amount)) * exp2(_51.exposure)) - float3(0.5)) * _51.contrast) + float3(0.5); - out.frag_color = float4(fast::clamp(mix(float3(dot(_73, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _73, float3(_51.saturation)), float3(0.0), float3(1.0)), 1.0); + float2 _67 = float2(int2(shafts.get_width(), shafts.get_height())); + float3 _142 = (((((view_color.sample(view_smp, _31).xyz + (bloom.sample(bloom_view_smp, _31).xyz * _51.bloom_amount)) + ((((((shafts.sample(bloom_view_smp, _31).xyz * 2.0) + shafts.sample(bloom_view_smp, (_31 + (float2(1.0) / _67))).xyz) + shafts.sample(bloom_view_smp, (_31 + (float2(-1.0, 1.0) / _67))).xyz) + shafts.sample(bloom_view_smp, (_31 + (float2(1.0, -1.0) / _67))).xyz) + shafts.sample(bloom_view_smp, (_31 + (float2(-1.0) / _67))).xyz) * float3(0.16666667163372039794921875))) * exp2(_51.exposure)) - float3(0.5)) * _51.contrast) + float3(0.5); + out.frag_color = float4(fast::clamp(mix(float3(dot(_142, float3(0.2125999927520751953125, 0.715200006961822509765625, 0.072200000286102294921875))), _142, float3(_51.saturation)), float3(0.0), float3(1.0)), 1.0); return out; } @@ -6988,48 +8655,78 @@ fs_post_source_metal_macos := u8.[ 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,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,0x76, - 0x69,0x65,0x77,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,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x20,0x5b, - 0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x31,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,0x33,0x31,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,0x69,0x6e,0x74,0x32,0x28,0x76,0x69,0x65,0x77,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x2e,0x67,0x65,0x74,0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29, - 0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x67,0x65,0x74, + 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,0x68,0x61,0x66,0x74,0x73,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,0x76,0x69,0x65,0x77,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,0x76,0x69, + 0x65,0x77,0x5f,0x73,0x6d,0x70,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72, + 0x28,0x31,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,0x33, + 0x31,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,0x69,0x6e,0x74, + 0x32,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x67,0x65,0x74, + 0x5f,0x77,0x69,0x64,0x74,0x68,0x28,0x29,0x2c,0x20,0x76,0x69,0x65,0x77,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x67,0x65,0x74,0x5f,0x68,0x65,0x69,0x67,0x68,0x74,0x28, + 0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x20, + 0x5f,0x36,0x37,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x69,0x6e,0x74, + 0x32,0x28,0x73,0x68,0x61,0x66,0x74,0x73,0x2e,0x67,0x65,0x74,0x5f,0x77,0x69,0x64, + 0x74,0x68,0x28,0x29,0x2c,0x20,0x73,0x68,0x61,0x66,0x74,0x73,0x2e,0x67,0x65,0x74, 0x5f,0x68,0x65,0x69,0x67,0x68,0x74,0x28,0x29,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x37,0x33,0x20,0x3d,0x20,0x28,0x28, - 0x28,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33, - 0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x2e, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x34,0x32,0x20,0x3d,0x20,0x28, + 0x28,0x28,0x28,0x28,0x76,0x69,0x65,0x77,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x28,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20, + 0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20,0x2b,0x20,0x28,0x62,0x6c,0x6f,0x6f, + 0x6d,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76, + 0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79, + 0x7a,0x20,0x2a,0x20,0x5f,0x35,0x31,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d, + 0x6f,0x75,0x6e,0x74,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x28,0x28,0x28,0x28,0x73, + 0x68,0x61,0x66,0x74,0x73,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31, + 0x29,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x32,0x2e,0x30,0x29,0x20,0x2b,0x20,0x73, + 0x68,0x61,0x66,0x74,0x73,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f, + 0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x33, + 0x31,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x29, + 0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x73,0x68,0x61,0x66,0x74,0x73,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28, + 0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x31, + 0x2e,0x30,0x2c,0x20,0x31,0x2e,0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29, + 0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b,0x20,0x73,0x68,0x61,0x66,0x74,0x73,0x2e, 0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65, - 0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x5f,0x33,0x31,0x29,0x2e,0x78,0x79,0x7a,0x20, - 0x2a,0x20,0x5f,0x35,0x31,0x2e,0x62,0x6c,0x6f,0x6f,0x6d,0x5f,0x61,0x6d,0x6f,0x75, - 0x6e,0x74,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70,0x32,0x28,0x5f,0x35,0x31,0x2e, - 0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x29,0x29,0x20,0x2d,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20,0x2a,0x20,0x5f,0x35,0x31,0x2e, - 0x63,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x29,0x20,0x2b,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x28,0x30,0x2e,0x35,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,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,0x37,0x33,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,0x29,0x2c, - 0x20,0x5f,0x37,0x33,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x31, - 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,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, + 0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28,0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x66, + 0x6c,0x6f,0x61,0x74,0x32,0x28,0x31,0x2e,0x30,0x2c,0x20,0x2d,0x31,0x2e,0x30,0x29, + 0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a,0x29,0x20,0x2b, + 0x20,0x73,0x68,0x61,0x66,0x74,0x73,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x62, + 0x6c,0x6f,0x6f,0x6d,0x5f,0x76,0x69,0x65,0x77,0x5f,0x73,0x6d,0x70,0x2c,0x20,0x28, + 0x5f,0x33,0x31,0x20,0x2b,0x20,0x28,0x66,0x6c,0x6f,0x61,0x74,0x32,0x28,0x2d,0x31, + 0x2e,0x30,0x29,0x20,0x2f,0x20,0x5f,0x36,0x37,0x29,0x29,0x29,0x2e,0x78,0x79,0x7a, + 0x29,0x20,0x2a,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x31,0x36,0x36, + 0x36,0x36,0x36,0x36,0x37,0x31,0x36,0x33,0x33,0x37,0x32,0x30,0x33,0x39,0x37,0x39, + 0x34,0x39,0x32,0x31,0x38,0x37,0x35,0x29,0x29,0x29,0x20,0x2a,0x20,0x65,0x78,0x70, + 0x32,0x28,0x5f,0x35,0x31,0x2e,0x65,0x78,0x70,0x6f,0x73,0x75,0x72,0x65,0x29,0x29, + 0x20,0x2d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,0x29,0x29,0x20, + 0x2a,0x20,0x5f,0x35,0x31,0x2e,0x63,0x6f,0x6e,0x74,0x72,0x61,0x73,0x74,0x29,0x20, + 0x2b,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x35,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,0x66,0x61,0x73,0x74,0x3a, + 0x3a,0x63,0x6c,0x61,0x6d,0x70,0x28,0x6d,0x69,0x78,0x28,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x28,0x64,0x6f,0x74,0x28,0x5f,0x31,0x34,0x32,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,0x29,0x2c,0x20,0x5f,0x31,0x34,0x32,0x2c,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x35,0x31,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, + 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, ]; /* #include @@ -8319,7 +10016,7 @@ fs_trile_shadow_source_metal_macos := u8.[ float v_swatch [[user(locn4)]]; }; - fragment main0_out main0(main0_in in [[stage_in]], texture2d palette [[texture(0)]], sampler palette_smp [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], texture2d palette [[texture(0)]], sampler palette_smp [[sampler(0)]], float4 gl_FragCoord [[position]]) { main0_out out = {}; int _15 = int(in.v_swatch + 0.5); @@ -8328,7 +10025,7 @@ fs_trile_shadow_source_metal_macos := u8.[ discard_fragment(); } float4 _51 = palette.read(uint2(int2(_15, 0)), 0); - out.frag_color = float4(_51.xyz / float3(fast::max(fast::max(_51.x, fast::max(_51.y, _51.z)), 0.001000000047497451305389404296875)), 1.0); + out.frag_color = float4(_51.xyz / float3(fast::max(fast::max(_51.x, fast::max(_51.y, _51.z)), 0.001000000047497451305389404296875)), gl_FragCoord.z); return out; } @@ -8353,31 +10050,34 @@ fs_trile_glass_shadow_source_metal_macos := u8.[ 0x20,0x70,0x61,0x6c,0x65,0x74,0x74,0x65,0x20,0x5b,0x5b,0x74,0x65,0x78,0x74,0x75, 0x72,0x65,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72, 0x20,0x70,0x61,0x6c,0x65,0x74,0x74,0x65,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,0x69,0x6e,0x74,0x20,0x5f, - 0x31,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x69,0x6e,0x2e,0x76,0x5f,0x73,0x77, - 0x61,0x74,0x63,0x68,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x69,0x66,0x20,0x28,0x70,0x61,0x6c,0x65,0x74,0x74,0x65,0x2e,0x72,0x65,0x61, - 0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x5f,0x31,0x35, - 0x2c,0x20,0x31,0x29,0x29,0x2c,0x20,0x30,0x29,0x2e,0x78,0x20,0x3c,0x20,0x30,0x2e, - 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,0x34,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x70,0x61,0x6c,0x65, - 0x74,0x74,0x65,0x2e,0x72,0x65,0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28,0x69, - 0x6e,0x74,0x32,0x28,0x5f,0x31,0x35,0x2c,0x20,0x30,0x29,0x29,0x2c,0x20,0x30,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,0x5f,0x35, - 0x31,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x66, - 0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d, - 0x61,0x78,0x28,0x5f,0x35,0x31,0x2e,0x78,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a, - 0x6d,0x61,0x78,0x28,0x5f,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x35,0x31,0x2e,0x7a, - 0x29,0x29,0x2c,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,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, + 0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,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,0x69,0x6e,0x74, + 0x20,0x5f,0x31,0x35,0x20,0x3d,0x20,0x69,0x6e,0x74,0x28,0x69,0x6e,0x2e,0x76,0x5f, + 0x73,0x77,0x61,0x74,0x63,0x68,0x20,0x2b,0x20,0x30,0x2e,0x35,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x70,0x61,0x6c,0x65,0x74,0x74,0x65,0x2e,0x72, + 0x65,0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32,0x28,0x69,0x6e,0x74,0x32,0x28,0x5f, + 0x31,0x35,0x2c,0x20,0x31,0x29,0x29,0x2c,0x20,0x30,0x29,0x2e,0x78,0x20,0x3c,0x20, + 0x30,0x2e,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,0x34,0x20,0x5f,0x35,0x31,0x20,0x3d,0x20,0x70,0x61, + 0x6c,0x65,0x74,0x74,0x65,0x2e,0x72,0x65,0x61,0x64,0x28,0x75,0x69,0x6e,0x74,0x32, + 0x28,0x69,0x6e,0x74,0x32,0x28,0x5f,0x31,0x35,0x2c,0x20,0x30,0x29,0x29,0x2c,0x20, + 0x30,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, + 0x5f,0x35,0x31,0x2e,0x78,0x79,0x7a,0x20,0x2f,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, + 0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x66,0x61,0x73,0x74,0x3a, + 0x3a,0x6d,0x61,0x78,0x28,0x5f,0x35,0x31,0x2e,0x78,0x2c,0x20,0x66,0x61,0x73,0x74, + 0x3a,0x3a,0x6d,0x61,0x78,0x28,0x5f,0x35,0x31,0x2e,0x79,0x2c,0x20,0x5f,0x35,0x31, + 0x2e,0x7a,0x29,0x29,0x2c,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,0x2c,0x20,0x67,0x6c,0x5f, + 0x46,0x72,0x61,0x67,0x43,0x6f,0x6f,0x72,0x64,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x00, ]; /* #pragma clang diagnostic ignored "-Wmissing-prototypes" @@ -11125,6 +12825,10 @@ post_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[2].stage = .FRAGMENT; + desc.images[2].multisampled = false; + desc.images[2].image_type = ._2D; + desc.images[2].sample_type = .FLOAT; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; desc.samplers[1].stage = .FRAGMENT; @@ -11137,6 +12841,10 @@ post_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.image_sampler_pairs[1].image_slot = 1; desc.image_sampler_pairs[1].sampler_slot = 1; desc.image_sampler_pairs[1].glsl_name = "bloom_bloom_view_smp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 2; + desc.image_sampler_pairs[2].sampler_slot = 1; + desc.image_sampler_pairs[2].glsl_name = "shafts_bloom_view_smp"; case .GLES3; desc.vertex_func.source = xx *vs_fullscreen_source_glsl300es; desc.vertex_func.entry = "main"; @@ -11156,6 +12864,10 @@ post_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[2].stage = .FRAGMENT; + desc.images[2].multisampled = false; + desc.images[2].image_type = ._2D; + desc.images[2].sample_type = .FLOAT; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; desc.samplers[1].stage = .FRAGMENT; @@ -11168,6 +12880,10 @@ post_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.image_sampler_pairs[1].image_slot = 1; desc.image_sampler_pairs[1].sampler_slot = 1; desc.image_sampler_pairs[1].glsl_name = "bloom_bloom_view_smp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 2; + desc.image_sampler_pairs[2].sampler_slot = 1; + desc.image_sampler_pairs[2].glsl_name = "shafts_bloom_view_smp"; case .METAL_MACOS; desc.vertex_func.source = xx *vs_fullscreen_source_metal_macos; desc.vertex_func.entry = "main0"; @@ -11187,6 +12903,11 @@ post_shader_desc :: (backend: sg_backend) -> sg_shader_desc { desc.images[1].image_type = ._2D; desc.images[1].sample_type = .FLOAT; desc.images[1].msl_texture_n = 1; + 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 = 2; desc.samplers[0].stage = .FRAGMENT; desc.samplers[0].sampler_type = .FILTERING; desc.samplers[0].msl_sampler_n = 0; @@ -11199,6 +12920,172 @@ post_shader_desc :: (backend: sg_backend) -> sg_shader_desc { 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[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 2; + desc.image_sampler_pairs[2].sampler_slot = 1; + } + return desc; +} +shafts_shader_desc :: (backend: sg_backend) -> sg_shader_desc { + desc: sg_shader_desc; + desc.label = "shafts_shader"; + if backend == { + case .GLCORE; + desc.vertex_func.source = xx *vs_shafts_source_glsl430; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_shafts_source_glsl430; + desc.fragment_func.entry = "main"; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 208; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 13; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "view_params"; + desc.uniform_blocks[1].stage = .FRAGMENT; + desc.uniform_blocks[1].layout = .STD140; + desc.uniform_blocks[1].size = 16; + desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "shaft_params"; + desc.uniform_blocks[3].stage = .FRAGMENT; + desc.uniform_blocks[3].layout = .STD140; + desc.uniform_blocks[3].size = 64; + desc.uniform_blocks[3].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[3].glsl_uniforms[0].array_count = 4; + desc.uniform_blocks[3].glsl_uniforms[0].glsl_name = "shadow_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .UNFILTERABLE_FLOAT; + desc.images[7].stage = .FRAGMENT; + desc.images[7].multisampled = false; + desc.images[7].image_type = ._2D; + desc.images[7].sample_type = .DEPTH; + desc.images[8].stage = .FRAGMENT; + desc.images[8].multisampled = false; + desc.images[8].image_type = ._2D; + desc.images[8].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .NONFILTERING; + desc.samplers[7].stage = .FRAGMENT; + desc.samplers[7].sampler_type = .COMPARISON; + desc.samplers[8].stage = .FRAGMENT; + desc.samplers[8].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 = "shaft_scene_shaft_scene_smp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 8; + desc.image_sampler_pairs[1].sampler_slot = 8; + desc.image_sampler_pairs[1].glsl_name = "shadow_tint_shadow_tint_smp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 7; + desc.image_sampler_pairs[2].sampler_slot = 7; + desc.image_sampler_pairs[2].glsl_name = "shadow_map_shadow_smp"; + case .GLES3; + desc.vertex_func.source = xx *vs_shafts_source_glsl300es; + desc.vertex_func.entry = "main"; + desc.fragment_func.source = xx *fs_shafts_source_glsl300es; + desc.fragment_func.entry = "main"; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 208; + desc.uniform_blocks[0].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[0].glsl_uniforms[0].array_count = 13; + desc.uniform_blocks[0].glsl_uniforms[0].glsl_name = "view_params"; + desc.uniform_blocks[1].stage = .FRAGMENT; + desc.uniform_blocks[1].layout = .STD140; + desc.uniform_blocks[1].size = 16; + desc.uniform_blocks[1].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[1].glsl_uniforms[0].array_count = 1; + desc.uniform_blocks[1].glsl_uniforms[0].glsl_name = "shaft_params"; + desc.uniform_blocks[3].stage = .FRAGMENT; + desc.uniform_blocks[3].layout = .STD140; + desc.uniform_blocks[3].size = 64; + desc.uniform_blocks[3].glsl_uniforms[0].type = .FLOAT4; + desc.uniform_blocks[3].glsl_uniforms[0].array_count = 4; + desc.uniform_blocks[3].glsl_uniforms[0].glsl_name = "shadow_params"; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .UNFILTERABLE_FLOAT; + desc.images[7].stage = .FRAGMENT; + desc.images[7].multisampled = false; + desc.images[7].image_type = ._2D; + desc.images[7].sample_type = .DEPTH; + desc.images[8].stage = .FRAGMENT; + desc.images[8].multisampled = false; + desc.images[8].image_type = ._2D; + desc.images[8].sample_type = .FLOAT; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .NONFILTERING; + desc.samplers[7].stage = .FRAGMENT; + desc.samplers[7].sampler_type = .COMPARISON; + desc.samplers[8].stage = .FRAGMENT; + desc.samplers[8].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 = "shaft_scene_shaft_scene_smp"; + desc.image_sampler_pairs[1].stage = .FRAGMENT; + desc.image_sampler_pairs[1].image_slot = 8; + desc.image_sampler_pairs[1].sampler_slot = 8; + desc.image_sampler_pairs[1].glsl_name = "shadow_tint_shadow_tint_smp"; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 7; + desc.image_sampler_pairs[2].sampler_slot = 7; + desc.image_sampler_pairs[2].glsl_name = "shadow_map_shadow_smp"; + case .METAL_MACOS; + desc.vertex_func.source = xx *vs_shafts_source_metal_macos; + desc.vertex_func.entry = "main0"; + desc.fragment_func.source = xx *fs_shafts_source_metal_macos; + desc.fragment_func.entry = "main0"; + desc.uniform_blocks[0].stage = .VERTEX; + desc.uniform_blocks[0].layout = .STD140; + desc.uniform_blocks[0].size = 208; + 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 = 16; + 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 = 64; + desc.uniform_blocks[3].msl_buffer_n = 1; + desc.images[0].stage = .FRAGMENT; + desc.images[0].multisampled = false; + desc.images[0].image_type = ._2D; + desc.images[0].sample_type = .UNFILTERABLE_FLOAT; + desc.images[0].msl_texture_n = 0; + desc.images[7].stage = .FRAGMENT; + desc.images[7].multisampled = false; + desc.images[7].image_type = ._2D; + desc.images[7].sample_type = .DEPTH; + desc.images[7].msl_texture_n = 2; + desc.images[8].stage = .FRAGMENT; + desc.images[8].multisampled = false; + desc.images[8].image_type = ._2D; + desc.images[8].sample_type = .FLOAT; + desc.images[8].msl_texture_n = 1; + desc.samplers[0].stage = .FRAGMENT; + desc.samplers[0].sampler_type = .NONFILTERING; + desc.samplers[0].msl_sampler_n = 0; + desc.samplers[7].stage = .FRAGMENT; + desc.samplers[7].sampler_type = .COMPARISON; + desc.samplers[7].msl_sampler_n = 2; + desc.samplers[8].stage = .FRAGMENT; + desc.samplers[8].sampler_type = .FILTERING; + desc.samplers[8].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 = 8; + desc.image_sampler_pairs[1].sampler_slot = 8; + desc.image_sampler_pairs[2].stage = .FRAGMENT; + desc.image_sampler_pairs[2].image_slot = 7; + desc.image_sampler_pairs[2].sampler_slot = 7; } return desc; } diff --git a/src/renderer_sokol/shaders/post.glsl b/src/renderer_sokol/shaders/post.glsl index e3ba8c9..107597b 100644 --- a/src/renderer_sokol/shaders/post.glsl +++ b/src/renderer_sokol/shaders/post.glsl @@ -60,6 +60,101 @@ void main() { } @end +// Sunlight that came through glass, scattered toward the camera by the air between +// it and the first opaque surface. Half resolution. +@vs vs_shafts +@include_block view +@include_block fullscreen + +out vec4 v_point; +out vec3 v_camera; +out vec3 v_sun; +out float v_time; + +void main() { + vec2 p = fullscreen_position(gl_VertexIndex); + gl_Position = vec4(p, 0.0, 1.0); + v_point = inv_view_proj * vec4(p, 0.5, 1.0); + v_camera = camera.xyz; + v_sun = sun_color.rgb; + v_time = camera.w; +} +@end + +@fs fs_shafts +@include_block shadow +layout(binding=1) uniform shaft_params { + float density; // how much light scatters per unit, and how fast it fades + float amount; + float max_distance; + float steps; +}; +layout(binding=0) uniform texture2D shaft_scene; +layout(binding=0) uniform sampler shaft_scene_smp; +@image_sample_type shaft_scene unfilterable_float +@sampler_type shaft_scene_smp nonfiltering + +in vec4 v_point; +in vec3 v_camera; +in vec3 v_sun; +in float v_time; +out vec4 frag_color; + +const vec3 SHAFT_DRIFT = vec3(0.4, 0.15, 0.3); // how the air moves, units per second +const float SHAFT_SCALE = 0.8; // size of the dusty patches, inverse units +const float SHAFT_SHIMMER = 1.0; // how much the dust thins and thickens the light +const float SHAFT_TINT = 0.6; // how much of the glass colour the shafts keep + +float hash(vec3 p) { + p = fract(p * 0.3183099 + 0.1); + p *= 17.0; + return fract(p.x * p.y * p.z * (p.x + p.y + p.z)); +} + +float value_noise(vec3 p) { + vec3 i = floor(p); + vec3 f = fract(p); + f = f * f * (3.0 - 2.0 * f); + return mix(mix(mix(hash(i), hash(i + vec3(1, 0, 0)), f.x), + mix(hash(i + vec3(0, 1, 0)), hash(i + vec3(1, 1, 0)), f.x), f.y), + mix(mix(hash(i + vec3(0, 0, 1)), hash(i + vec3(1, 0, 1)), f.x), + mix(hash(i + vec3(0, 1, 1)), hash(i + vec3(1, 1, 1)), f.x), f.y), f.z); +} + +// Two layers drifting at different speeds, so the dust churns instead of sliding. +float dust(vec3 p) { + vec3 q = p * SHAFT_SCALE; + float n = value_noise(q + SHAFT_DRIFT * v_time * SHAFT_SCALE) * 0.65 + + value_noise(q * 2.3 - SHAFT_DRIFT.zxy * v_time * SHAFT_SCALE * 1.7) * 0.35; + // Sharpened, so the patches read as clear gaps and thick wisps rather than a soft wobble. + n = smoothstep(0.25, 0.75, n); + return mix(1.0 - SHAFT_SHIMMER, 1.0 + SHAFT_SHIMMER, n); +} + +void main() { + vec3 dir = normalize(v_point.xyz / v_point.w - v_camera); + float len = min(texelFetch(sampler2D(shaft_scene, shaft_scene_smp), ivec2(gl_FragCoord.xy) * 2, 0).r, max_distance); + float step = len / steps; + // Interleaved gradient noise spreads the step banding into a fine dither. + float jitter = fract(52.9829189 * fract(dot(gl_FragCoord.xy, vec2(0.06711056, 0.00583715)))); + + vec3 light = vec3(0.0); + for (float i = 0.0; i < steps; i += 1.0) { + float t = (i + jitter) * step; + // Snapped to the trixel grid, so the shafts are blocky like the patches they make. + vec3 p = (floor((v_camera + dir * t) * 16.0) + 0.5) / 16.0; + vec4 s = shadow_uv * vec4(p, 1.0); + if (s.x < 0.0 || s.x > 1.0 || s.y < 0.0 || s.y > 1.0 || s.z > 1.0) continue; + vec4 tint = texture(sampler2D(shadow_tint, shadow_tint_smp), s.xy); + if (s.z < tint.a + 0.001) continue; + float visible = texture(sampler2DShadow(shadow_map, shadow_smp), vec3(s.xy, s.z - 0.0005)); + vec3 color = mix(vec3(brightest(tint.rgb)), tint.rgb, SHAFT_TINT); + light += visible * color * exp(-density * t) * dust(p); + } + frag_color = vec4(light * v_sun * density * step * amount, 1.0); +} +@end + @fs fs_post layout(binding=0) uniform post_params { float exposure; // in stops @@ -69,6 +164,7 @@ layout(binding=0) uniform post_params { }; layout(binding=0) uniform texture2D view_color; layout(binding=1) uniform texture2D bloom; +layout(binding=2) uniform texture2D shafts; layout(binding=0) uniform sampler view_smp; layout(binding=1) uniform sampler bloom_view_smp; out vec4 frag_color; @@ -77,6 +173,13 @@ void main() { vec2 uv = gl_FragCoord.xy / vec2(textureSize(sampler2D(view_color, view_smp), 0)); vec3 c = texture(sampler2D(view_color, view_smp), uv).rgb; c += texture(sampler2D(bloom, bloom_view_smp), uv).rgb * bloom_amount; + // A small tent blur over the half resolution shafts hides their dither. + vec2 st = 1.0 / vec2(textureSize(sampler2D(shafts, bloom_view_smp), 0)); + c += (texture(sampler2D(shafts, bloom_view_smp), uv).rgb * 2.0 + + texture(sampler2D(shafts, bloom_view_smp), uv + st * vec2( 1, 1)).rgb + + texture(sampler2D(shafts, bloom_view_smp), uv + st * vec2(-1, 1)).rgb + + texture(sampler2D(shafts, bloom_view_smp), uv + st * vec2( 1, -1)).rgb + + texture(sampler2D(shafts, bloom_view_smp), uv + st * vec2(-1, -1)).rgb) / 6.0; c *= exp2(exposure); c = (c - 0.5) * contrast + 0.5; c = mix(vec3(dot(c, vec3(0.2126, 0.7152, 0.0722))), c, saturation); @@ -87,4 +190,5 @@ void main() { @program bloom_glow vs_fullscreen fs_bloom_glow @program bloom_down vs_fullscreen fs_bloom_down @program bloom_up vs_fullscreen fs_bloom_up +@program shafts vs_shafts fs_shafts @program post vs_fullscreen fs_post diff --git a/src/renderer_sokol/shaders/trile.glsl b/src/renderer_sokol/shaders/trile.glsl index b8d262a..ddbded5 100644 --- a/src/renderer_sokol/shaders/trile.glsl +++ b/src/renderer_sokol/shaders/trile.glsl @@ -216,7 +216,7 @@ void main() { if (texelFetch(sampler2D(palette, palette_smp), ivec2(id, 1), 0).r < 0.5) discard; vec3 c = texelFetch(sampler2D(palette, palette_smp), ivec2(id, 0), 0).rgb; // Tinted rather than darkened: the glass's brightest channel passes fully. - frag_color = vec4(c / max(max(c.r, max(c.g, c.b)), 0.001), 1.0); + frag_color = vec4(c / max(max(c.r, max(c.g, c.b)), 0.001), gl_FragCoord.z); } @end diff --git a/src/renderer_sokol/triles.jai b/src/renderer_sokol/triles.jai index 5d799b9..f9190fa 100644 --- a/src/renderer_sokol/triles.jai +++ b/src/renderer_sokol/triles.jai @@ -19,8 +19,13 @@ triles_init :: (orientations: [ORIENTATION_COUNT]Matrix3) { shadow_desc.face_winding = .CCW; triles.shadow_pipeline = sg_make_pipeline(*shadow_desc); - glass_desc := pipeline_desc(trile_glass_shadow_shader_desc(sg_query_backend()), .SHADOW, MULTIPLY_BLEND); - glass_desc.colors[0].write_mask = .RGB; + // Alpha keeps the nearest glass depth, so light shafts start at the window. + glass_blend := MULTIPLY_BLEND; + glass_blend.src_factor_alpha = .ONE; + glass_blend.dst_factor_alpha = .ONE; + glass_blend.op_alpha = .MIN; + glass_desc := pipeline_desc(trile_glass_shadow_shader_desc(sg_query_backend()), .SHADOW, glass_blend); + glass_desc.colors[0].write_mask = .RGBA; glass_desc.layout = desc.layout; glass_desc.index_type = .UINT16; glass_desc.cull_mode = .FRONT; diff --git a/src/renderer_sokol/views.jai b/src/renderer_sokol/views.jai index 4c1dcdb..9fcd29c 100644 --- a/src/renderer_sokol/views.jai +++ b/src/renderer_sokol/views.jai @@ -1,10 +1,14 @@ BLOOM_LEVELS :: 5; BLOOM_SCATTER :: 0.7; +SHAFT_STEPS :: 48; +SHAFT_MAX_DISTANCE :: 100.0; views_init :: () { backend := sg_query_backend(); post_desc := pipeline_desc(post_shader_desc(backend), .SCREEN); views.post = sg_make_pipeline(*post_desc); + shafts_desc := pipeline_desc(shafts_shader_desc(backend), .POST); + views.shafts = sg_make_pipeline(*shafts_desc); glow_desc := pipeline_desc(bloom_glow_shader_desc(backend), .POST); views.bloom_glow = sg_make_pipeline(*glow_desc); down_desc := pipeline_desc(bloom_down_shader_desc(backend), .POST); @@ -25,6 +29,8 @@ view_begin_pass :: (index: int, width: s32, height: s32, kind: Pass_Kind, opaque sg_destroy_attachments(level.attachments); sg_destroy_image(level.image); } + sg_destroy_attachments(it.shafts.attachments); + sg_destroy_image(it.shafts.image); } array_reset_keeping_memory(*views.targets); views.width = width; @@ -42,6 +48,10 @@ view_begin_pass :: (index: int, width: s32, height: s32, kind: Pass_Kind, opaque desc.colors[0].image = level.image; level.attachments = sg_make_attachments(*desc); } + targets.shafts.image = sg_make_image(*(sg_image_desc.{ render_target = true, width = max(width / 2, 1), height = max(height / 2, 1), pixel_format = VIEW_COLOR_FORMAT, sample_count = 1 })); + desc : sg_attachments_desc; + desc.colors[0].image = targets.shafts.image; + targets.shafts.attachments = sg_make_attachments(*desc); } targets := views.targets[index]; @@ -120,6 +130,34 @@ view_bloom :: (index: int) { for < 1..BLOOM_LEVELS-1 run(views.bloom_up, targets.bloom[it].image, targets.bloom[it - 1].attachments, true); } +// Marches each view ray through the coloured shadow map, after the main pass has +// written how far it reaches. +view_shafts :: (pass: *Pass) { + env := view_environment(pass.view); + action : sg_pass_action; + action.colors[0] = .{ load_action = .CLEAR, clear_value = .{0, 0, 0, 1} }; + sg_begin_pass(*(sg_pass.{ action = action, attachments = views.targets[pass.view_index].shafts.attachments })); + if env.shaft_amount > 0 { + sg_apply_pipeline(views.shafts); + params := Shaft_Params.{ + density = env.shaft_density, + amount = env.shaft_amount, + max_distance = SHAFT_MAX_DISTANCE, + steps = SHAFT_STEPS, + }; + apply_uniforms(UB_view_params, *pass.params); + apply_uniforms(UB_shadow_params, *pass.shadow); + apply_uniforms(UB_shaft_params, *params); + bind : sg_bindings; + bind.images[IMG_shaft_scene] = views.targets[pass.view_index].main.scene; + bind.samplers[SMP_shaft_scene_smp] = samplers.nearest_clamp; + bind_shadow(pass, *bind); + sg_apply_bindings(*bind); + sg_draw(0, 3, 1); + } + sg_end_pass(); +} + view_composite :: (index: int, env: Environment) { sg_apply_pipeline(views.post); params := Post_Params.{ @@ -133,6 +171,7 @@ view_composite :: (index: int, env: Environment) { bind : sg_bindings; bind.images[IMG_view_color] = views.targets[index].main.color; bind.images[IMG_bloom] = views.targets[index].bloom[0].image; + bind.images[IMG_shafts] = views.targets[index].shafts.image; bind.samplers[SMP_view_smp] = samplers.nearest_clamp; bind.samplers[SMP_bloom_view_smp] = samplers.linear_clamp; sg_apply_bindings(*bind); @@ -152,10 +191,11 @@ View_Target :: struct { views : struct { post : sg_pipeline; + shafts : sg_pipeline; bloom_glow : sg_pipeline; bloom_down : sg_pipeline; bloom_up : sg_pipeline; - targets : [..]struct { main, reflection: View_Target; bloom: [BLOOM_LEVELS]struct { image: sg_image; attachments: sg_attachments; }; }; + targets : [..]struct { main, reflection: View_Target; bloom: [BLOOM_LEVELS]struct { image: sg_image; attachments: sg_attachments; }; shafts: struct { image: sg_image; attachments: sg_attachments; }; }; shadows : [..]struct { depth, tint: sg_image; attachments: sg_attachments; }; width : s32; height : s32; diff --git a/src/rendering/scene.jai b/src/rendering/scene.jai index 25ff404..a94ef16 100644 --- a/src/rendering/scene.jai +++ b/src/rendering/scene.jai @@ -31,6 +31,8 @@ Environment :: struct { contrast : float = 1; saturation : float = 1; bloom_amount : float = 0.4; + shaft_density : float = 0.1; // light shafts through glass + shaft_amount : float = 1; } // With cut on, triles marked ROOF or WALL are hidden from the camera around the diff --git a/src/world.jai b/src/world.jai index 814e5ae..11d75bb 100644 --- a/src/world.jai +++ b/src/world.jai @@ -59,6 +59,9 @@ Chunk :: struct { occupancy_mask : [32][32]u32; // We want to be easily able to identify stairs from the chunk. stairs_mask : [32][32]u32; + + // Foliage grid + foliage : [32][32]Foliage_Cell; } Occupancy_State :: enum { @@ -351,6 +354,8 @@ World_Json_Config :: struct { contrast : float = 1; saturation : float = 1; bloomAmount : float = 0.4; + shaftDensity : float = 0.1; + shaftAmount : float = 1; } World_Json_Chunk :: struct { @@ -512,6 +517,8 @@ world_config_to_json :: (conf: *World_Config) -> World_Json_Config { jc.contrast = conf.contrast; jc.saturation = conf.saturation; jc.bloomAmount = conf.bloomAmount; + jc.shaftDensity = conf.shaftDensity; + jc.shaftAmount = conf.shaftAmount; return jc; } @@ -540,6 +547,8 @@ world_config_from_json :: (jc: *World_Json_Config) -> World_Config { conf.contrast = jc.contrast; conf.saturation = jc.saturation; conf.bloomAmount = jc.bloomAmount; + conf.shaftDensity = jc.shaftDensity; + conf.shaftAmount = jc.shaftAmount; return conf; } @@ -759,6 +768,8 @@ World_Config :: struct { contrast : float = 1; @Slider,0,3,0.05 saturation : float = 1; @Slider,0,3,0.05 bloomAmount : float = 0.4; @Slider,0,3,0.05 + shaftDensity : float = 0.1; @Slider,0,1,0.01 + shaftAmount : float = 1; @Slider,0,5,0.1 sunPosition : Vector3 = #run normalize(Vector3.{0.2, 0.3, 0.4}); sunIntensity : float = 1.0; @Slider,0,4,0.1 skyIntensity : float = 0.3; @Slider,0,5,0.1 @@ -810,6 +821,8 @@ world_environment :: (world: *World) -> *Environment { env.contrast = conf.contrast; env.saturation = conf.saturation; env.bloom_amount = conf.bloomAmount; + env.shaft_density = conf.shaftDensity; + env.shaft_amount = conf.shaftAmount; return env; }