diff --git a/Source/Render/sokol/CMakeLists.txt b/Source/Render/sokol/CMakeLists.txt index c302f944..5f3f0db4 100644 --- a/Source/Render/sokol/CMakeLists.txt +++ b/Source/Render/sokol/CMakeLists.txt @@ -4,7 +4,7 @@ OPTION(OPTION_PROCESS_SHADERS "Re-Process game shaders" OFF) #Include Sokol FetchContent_Declare(sokol GIT_REPOSITORY https://github.com/floooh/sokol - GIT_TAG "004223737d9f6d07a0aa5c63659662480285de29" + GIT_TAG "7f7cd64c6d9d1d4ed08d88a3879b1d69841bf0a4" GIT_SHALLOW OFF ) FetchContent_MakeAvailable(sokol) @@ -34,7 +34,7 @@ IF (OPTION_PROCESS_SHADERS) set(SOKOL_SHDC_BIN ${sokol-tools-bin_SOURCE_DIR}/bin/osx/sokol-shdc) ENDIF() ELSEIF(PERIMETER_WINDOWS) - set(SOKOL_SHDC_BIN ${sokol-tools-bin_SOURCE_DIR}/bin/win32/sokol-shdc) + set(SOKOL_SHDC_BIN ${sokol-tools-bin_SOURCE_DIR}/bin/win32/sokol-shdc.exe) ELSE() set(SOKOL_SHDC_BIN ${sokol-tools-bin_SOURCE_DIR}/bin/linux/sokol-shdc) ENDIF() diff --git a/Source/Render/sokol/SokolD3D.h b/Source/Render/sokol/SokolD3D.h index a6dbed41..7137a096 100644 --- a/Source/Render/sokol/SokolD3D.h +++ b/Source/Render/sokol/SokolD3D.h @@ -10,9 +10,11 @@ struct sokol_d3d_context { ID3D11Device* device = nullptr; ID3D11DeviceContext* device_context = nullptr; IDXGISwapChain* swap_chain = nullptr; - ID3D11Texture2D* render_target = nullptr; + ID3D11Texture2D* render_target_texture = nullptr; ID3D11RenderTargetView* render_target_view = nullptr; - ID3D11Texture2D* depth_stencil_buffer = nullptr; + ID3D11Texture2D* msaa_texture = nullptr; + ID3D11RenderTargetView* msaa_view = nullptr; + ID3D11Texture2D* depth_stencil_texture = nullptr; ID3D11DepthStencilView* depth_stencil_view = nullptr; }; diff --git a/Source/Render/sokol/SokolImpl.mm b/Source/Render/sokol/SokolImpl.mm index 6fe989fd..321531a6 100644 --- a/Source/Render/sokol/SokolImpl.mm +++ b/Source/Render/sokol/SokolImpl.mm @@ -5,34 +5,83 @@ //ObjC Sokol - SDL2 glue code for Metal #ifdef SOKOL_METAL -#import -#import +#import +#import +#import -static CAMetalLayer* sokol_metal_layer; -static id sokol_metal_drawable; -static MTLRenderPassDescriptor* sokol_metal_render_pass_descriptor; +//TODO This should be stored in a metal_context struct like in d3d11 impl +static id mtl_device; +static MTKView* mtk_view; +#if TARGET_OS_IPHONE +static id mtk_view_controller; +#endif -const void* sokol_metal_drawable_cb() { - return (__bridge const void*) sokol_metal_drawable; +void sokol_metal_setup(SDL_Window* sdl_window, sg_desc* desc, sg_swapchain* swapchain, uint32_t ScreenHZ) { + //Get window from SDL which we will use to associate Metal stuff + SDL_SysWMinfo wm_info; + SDL_VERSION(&wm_info.version); + SDL_GetWindowWMInfo(sdl_window, &wm_info); +#if TARGET_OS_IPHONE + UIWindow* window = wm_info.info.uikit.window +#else + NSWindow* window = wm_info.info.cocoa.window; +#endif + + // MTKView and Metal device + mtl_device = MTLCreateSystemDefaultDevice(); + mtk_view = [[MTKView alloc] init]; + mtk_view.paused = true; + mtk_view.enableSetNeedsDisplay = false; + [mtk_view setPreferredFramesPerSecond:ScreenHZ]; + [mtk_view setDevice: mtl_device]; + [mtk_view setColorPixelFormat:MTLPixelFormatBGRA8Unorm]; + [mtk_view setDepthStencilPixelFormat:MTLPixelFormatDepth32Float_Stencil8]; + [mtk_view setSampleCount:(NSUInteger) swapchain->sample_count]; +#if TARGET_OS_IPHONE + [mtk_view setContentScaleFactor:1.0f]; + [mtk_view setUserInteractionEnabled:YES]; + [mtk_view setMultipleTouchEnabled:YES]; + [window addSubview:mtk_view]; + mtk_view_controller = [[UIViewController alloc] init]; + [mtk_view_controller setView:mtk_view]; + [window setRootViewController:mtk_view_controller]; + [window makeKeyAndVisible]; +#else + [window setContentView:mtk_view]; + CGSize drawable_size = { (CGFloat) swapchain->width, (CGFloat) swapchain->height }; + [mtk_view setDrawableSize:drawable_size]; + [[mtk_view layer] setMagnificationFilter:kCAFilterNearest]; + NSApp.activationPolicy = NSApplicationActivationPolicyRegular; + [NSApp activateIgnoringOtherApps:YES]; + [window makeKeyAndOrderFront:nil]; +#endif + + //Setup Metal specific context + desc->environment.metal.device = (__bridge const void*) mtl_device; } -const void* sokol_metal_renderpass_descriptor_cb() { - sokol_metal_drawable = [sokol_metal_layer nextDrawable]; +void sokol_metal_render(sg_swapchain* swapchain, void (*callback)()) { + @autoreleasepool { + swapchain->metal.current_drawable = (__bridge const void*) [mtk_view currentDrawable]; + swapchain->metal.depth_stencil_texture = (__bridge const void*) [mtk_view depthStencilTexture]; + swapchain->metal.msaa_color_texture = (__bridge const void*) [mtk_view multisampleColorTexture]; + callback(); + } +} - sokol_metal_render_pass_descriptor = [[MTLRenderPassDescriptor alloc] init]; - sokol_metal_render_pass_descriptor.colorAttachments[0].texture = sokol_metal_drawable.texture; - return (__bridge const void*) sokol_metal_render_pass_descriptor; +void sokol_metal_draw() { + [mtk_view draw]; } -void sokol_metal_setup_desc(SDL_MetalView view, sg_desc* desc) { - //Get Metal layer from SDL and add Metal device - sokol_metal_layer = (__bridge CAMetalLayer*) SDL_Metal_GetLayer(view); - sokol_metal_layer.device = MTLCreateSystemDefaultDevice(); - - //Setup Metal specific context - sg_metal_context_desc& metalctx = desc->context.metal; - metalctx.device = sokol_metal_layer.device; - metalctx.renderpass_descriptor_cb = sokol_metal_renderpass_descriptor_cb; - metalctx.drawable_cb = sokol_metal_drawable_cb; +void sokol_metal_destroy(sg_swapchain* swapchain) { + swapchain->metal.msaa_color_texture = nullptr; + swapchain->metal.depth_stencil_texture = nullptr; + swapchain->metal.current_drawable = nullptr; +#if TARGET_OS_IPHONE + mtk_view_controller = nullptr; +#endif + mtk_view = nullptr; + mtl_device = nullptr; } + #endif \ No newline at end of file diff --git a/Source/Render/sokol/SokolRender.cpp b/Source/Render/sokol/SokolRender.cpp index a58d5441..0e0e7dd7 100644 --- a/Source/Render/sokol/SokolRender.cpp +++ b/Source/Render/sokol/SokolRender.cpp @@ -21,18 +21,11 @@ #define RENDERUTILS_HWND_FROM_SDL_WINDOW #include "RenderUtils.h" #include "SokolD3D.h" +#endif -//Callbacks for Sokol with D3D - -const void* sokol_d3d_render_target_view_cb() { - cSokolRender* renderer = reinterpret_cast(gb_RenderDevice); - return (const void*) renderer->d3d_context->render_target_view; -} - -const void* sokol_d3d_depth_stencil_view_cb() { - cSokolRender* renderer = reinterpret_cast(gb_RenderDevice); - return (const void*) renderer->d3d_context->depth_stencil_view; -} +#ifdef SOKOL_METAL +void sokol_metal_setup(SDL_Window* sdl_window, sg_desc* desc, sg_swapchain* swapchain, uint32_t ScreenHZ); +void sokol_metal_destroy(sg_swapchain* swapchain); #endif cSokolRender::cSokolRender() = default; @@ -83,10 +76,22 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres desc.shader_pool_size = 8, desc.buffer_pool_size = 1024 * 8; desc.image_pool_size = 1024 * 4; //1024 is enough for PGW+PET game - desc.context.color_format = SG_PIXELFORMAT_RGBA8; - desc.context.depth_format = SG_PIXELFORMAT_DEPTH_STENCIL; - desc.context.sample_count = sample_count; desc.logger.func = slog_func; + + //Setup swapchain pass + swapchain_pass = {}; + swapchain_pass.action.colors[0].load_action = SG_LOADACTION_CLEAR; + swapchain_pass.action.colors[0].store_action = SG_STOREACTION_STORE; + swapchain_pass.action.colors[0].clear_value = sg_color { 0.0f, 0.0f, 0.0f, 1.0f }; + swapchain_pass.action.depth.load_action = SG_LOADACTION_CLEAR; + swapchain_pass.action.depth.store_action = SG_STOREACTION_DONTCARE; + swapchain_pass.action.depth.clear_value = 1.0f; + swapchain_pass.action.stencil.load_action = SG_LOADACTION_CLEAR; + swapchain_pass.action.stencil.store_action = SG_STOREACTION_DONTCARE; + swapchain_pass.action.stencil.clear_value = 0; + swapchain_pass.swapchain.width = ScreenSize.x; + swapchain_pass.swapchain.height = ScreenSize.y; + swapchain_pass.swapchain.sample_count = 1; //OpenGL / OpenGLES #ifdef SOKOL_GL @@ -129,6 +134,8 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres ErrH.Abort("Error creating SDL GL Context", XERR_CRITICAL, 0, SDL_GetError()); } printf("GPU vendor: %s, renderer: %s\n", glGetString(GL_VENDOR), glGetString(GL_RENDER)); + + swapchain_pass.swapchain.gl.framebuffer = 0; #endif //SOKOL_GL //Direct3D @@ -211,6 +218,7 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres dxgiAdapter->Release(); //Create swap chain + uint32_t sample_count = swapchain_pass.swapchain.sample_count; DXGI_SWAP_CHAIN_DESC* swap_chain_desc = &d3d_context->swap_chain_desc; memset(&d3d_context->swap_chain_desc, 0, sizeof(DXGI_SWAP_CHAIN_DESC)); swap_chain_desc->BufferDesc.Width = static_cast(xScr); @@ -238,25 +246,16 @@ int cSokolRender::Init(int xScr, int yScr, int mode, SDL_Window* wnd, int Refres d3d_CreateDefaultRenderTarget(); //Setup d3d context - desc.context.d3d11.device = d3d_context->device; - desc.context.d3d11.device_context = d3d_context->device_context; - desc.context.d3d11.render_target_view_cb = sokol_d3d_render_target_view_cb; - desc.context.d3d11.depth_stencil_view_cb = sokol_d3d_depth_stencil_view_cb; - + desc.environment.d3d11.device = d3d_context->device; + desc.environment.d3d11.device_context = d3d_context->device_context; #endif #ifdef SOKOL_METAL sokol_backend = "Metal"; SDL_SetHintWithPriority(SDL_HINT_RENDER_DRIVER, "metal", SDL_HINT_OVERRIDE); - // Obtain Metal device by creating a SDL Metal View, also useful to retain the Metal device - sdl_metal_view = SDL_Metal_CreateView(sdl_window); - if (sdl_metal_view == nullptr) { - ErrH.Abort("Error creating SDL Metal View", XERR_CRITICAL, 0, SDL_GetError()); - } - //Setup metal sokol context - sokol_metal_setup_desc(sdl_metal_view, &desc); + sokol_metal_setup(sdl_window, &desc, &swapchain_pass.swapchain, ScreenHZ); #endif const char* render_driver = SDL_GetHint(SDL_HINT_RENDER_DRIVER); @@ -321,6 +320,10 @@ bool cSokolRender::ChangeSize(int xScr, int yScr, int mode) { ScreenSize.y = yScr; RenderMode &= ~mode_mask; RenderMode |= mode; + + //Update swapchain + swapchain_pass.swapchain.width = ScreenSize.x; + swapchain_pass.swapchain.height = ScreenSize.y; #ifdef SOKOL_D3D11 if (d3d_context->swap_chain && need_resize) { @@ -374,10 +377,9 @@ int cSokolRender::Done() { } #endif #ifdef SOKOL_METAL - if (sdl_metal_view != nullptr) { + if (swapchain_pass.swapchain.metal.current_drawable != nullptr) { RenderSubmitEvent(RenderEvent::DONE, "Sokol Metal shutdown"); - SDL_Metal_DestroyView(sdl_metal_view); - sdl_metal_view = nullptr; + sokol_metal_destroy(&swapchain_pass.swapchain); } #endif #ifdef SOKOL_GL @@ -483,11 +485,11 @@ void cSokolRender::d3d_CreateDefaultRenderTarget() { hr = d3d_context->swap_chain->GetBuffer( 0, __uuidof(ID3D11Texture2D), - reinterpret_cast(&d3d_context->render_target) + reinterpret_cast(&d3d_context->render_target_texture) ); - assert(SUCCEEDED(hr) && d3d_context->render_target); + assert(SUCCEEDED(hr) && d3d_context->render_target_texture); hr = d3d_context->device->CreateRenderTargetView( - d3d_context->render_target, + d3d_context->render_target_texture, nullptr, &d3d_context->render_target_view ); @@ -498,25 +500,44 @@ void cSokolRender::d3d_CreateDefaultRenderTarget() { ds_desc.Height = static_cast(ScreenSize.y); ds_desc.MipLevels = 1; ds_desc.ArraySize = 1; - ds_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + ds_desc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; ds_desc.SampleDesc = d3d_context->swap_chain_desc.SampleDesc; ds_desc.Usage = D3D11_USAGE_DEFAULT; - ds_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; - hr = d3d_context->device->CreateTexture2D(&ds_desc, nullptr, &d3d_context->depth_stencil_buffer); - assert(SUCCEEDED(hr) && d3d_context->depth_stencil_buffer); + ds_desc.BindFlags = D3D11_BIND_RENDER_TARGET; + + // MSAA render target and view + uint32_t sample_count = ds_desc.SampleDesc.Count; + if (1 < sample_count) { + hr = d3d_context->device->CreateTexture2D(&ds_desc, nullptr, &d3d_context->msaa_texture); + assert(SUCCEEDED(hr) && d3d_context->msaa_texture); + hr = d3d_context->device->CreateRenderTargetView(d3d_context->msaa_texture, nullptr, &d3d_context->msaa_view); + assert(SUCCEEDED(hr) && d3d_context->msaa_view); + } - D3D11_DEPTH_STENCIL_VIEW_DESC dsv_desc = {}; - dsv_desc.Format = ds_desc.Format; - dsv_desc.ViewDimension = sample_count > 1 ? D3D11_DSV_DIMENSION_TEXTURE2DMS : D3D11_DSV_DIMENSION_TEXTURE2D; - hr = d3d_context->device->CreateDepthStencilView(d3d_context->depth_stencil_buffer, &dsv_desc, &d3d_context->depth_stencil_view); + // Depth-stencil render target and view + ds_desc.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + ds_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL; + hr = d3d_context->device->CreateTexture2D(&ds_desc, nullptr, &d3d_context->depth_stencil_texture); + assert(SUCCEEDED(hr) && d3d_context->depth_stencil_texture); + hr = d3d_context->device->CreateDepthStencilView(d3d_context->depth_stencil_texture, nullptr, &d3d_context->depth_stencil_view); assert(SUCCEEDED(hr) && d3d_context->depth_stencil_view); + + //Apply into swapchain pass + swapchain_pass.swapchain.d3d11.render_view = 1 < sample_count ? d3d_context->msaa_view : d3d_context->render_target_view; + swapchain_pass.swapchain.d3d11.resolve_view = 1 < sample_count ? d3d_context->render_target_view : nullptr; + swapchain_pass.swapchain.d3d11.depth_stencil_view = d3d_context->depth_stencil_view; } void cSokolRender::d3d_DestroyDefaultRenderTarget() { - RELEASE(d3d_context->render_target); + swapchain_pass.swapchain.d3d11.render_view = nullptr; + swapchain_pass.swapchain.d3d11.resolve_view = nullptr; + swapchain_pass.swapchain.d3d11.depth_stencil_view = nullptr; + RELEASE(d3d_context->render_target_texture); RELEASE(d3d_context->render_target_view); - RELEASE(d3d_context->depth_stencil_buffer); + RELEASE(d3d_context->depth_stencil_texture); RELEASE(d3d_context->depth_stencil_view); + RELEASE(d3d_context->msaa_texture); + RELEASE(d3d_context->msaa_view); } #endif diff --git a/Source/Render/sokol/SokolRender.h b/Source/Render/sokol/SokolRender.h index e48c4492..f2975dcc 100644 --- a/Source/Render/sokol/SokolRender.h +++ b/Source/Render/sokol/SokolRender.h @@ -8,18 +8,10 @@ #include #include -#ifdef SOKOL_METAL -#include -#endif - #include "SokolTypes.h" const int PERIMETER_SOKOL_TEXTURES = 8; -#ifdef SOKOL_METAL -void sokol_metal_setup_desc(SDL_MetalView view, sg_desc* desc); -#endif - struct SokolCommand { SokolCommand(); ~SokolCommand(); @@ -54,7 +46,7 @@ class cSokolRender: public cInterfaceRenderDevice { SDL_GLContext sdl_gl_context = nullptr; #endif #ifdef SOKOL_METAL - SDL_MetalView sdl_metal_view = nullptr; + friend void sokol_metal_render_callback(); #endif //D3D backend stuff #ifdef SOKOL_D3D11 @@ -67,13 +59,12 @@ class cSokolRender: public cInterfaceRenderDevice { friend const void* sokol_d3d_depth_stencil_view_cb(); #endif - //Samples to use - uint32_t sample_count = 1; + //For swapchain pass that renders into final device + sg_pass swapchain_pass; //Renderer state bool ActiveScene = false; bool isOrthographicProjSet = false; - sg_color fill_color; std::vector commands; sg_sampler sampler; @@ -124,6 +115,9 @@ class cSokolRender: public cInterfaceRenderDevice { //Updates internal state after init/resolution change int UpdateRenderMode(); + + //Does actual drawing using sokol API + void DoSokolRendering(); //Set common VS/FS parameters template diff --git a/Source/Render/sokol/SokolRenderState.cpp b/Source/Render/sokol/SokolRenderState.cpp index a18de36d..cac17073 100644 --- a/Source/Render/sokol/SokolRenderState.cpp +++ b/Source/Render/sokol/SokolRenderState.cpp @@ -24,6 +24,17 @@ #include "SokolD3D.h" #endif +#ifdef SOKOL_METAL +void sokol_metal_render(sg_swapchain* swapchain, void (*callback)()); +void sokol_metal_draw(); + +//According to sokol metal example the sokol render calls must be wrapped by @autoreleasepool +void sokol_metal_render_callback() { + cSokolRender* sokolRender = reinterpret_cast(gb_RenderDevice); + sokolRender->DoSokolRendering(); +} +#endif + int cSokolRender::BeginScene() { RenderSubmitEvent(RenderEvent::BEGIN_SCENE, ActiveScene ? "ActiveScene" : ""); MTG(); @@ -48,21 +59,23 @@ int cSokolRender::EndScene() { //Make sure there is nothing left to send as command FinishActiveDrawBuffer(); - + ActiveScene = false; - //Begin pass - sg_pass_action pass_action = {}; - pass_action.colors[0].load_action = SG_LOADACTION_CLEAR; - pass_action.colors[0].store_action = SG_STOREACTION_STORE; - pass_action.colors[0].clear_value = fill_color; - pass_action.depth.load_action = SG_LOADACTION_CLEAR; - pass_action.depth.store_action = SG_STOREACTION_DONTCARE; - pass_action.depth.clear_value = 1.0f; - pass_action.stencil.load_action = SG_LOADACTION_CLEAR; - pass_action.stencil.store_action = SG_STOREACTION_DONTCARE; - pass_action.stencil.clear_value = 0; - sg_begin_default_pass(&pass_action, ScreenSize.x, ScreenSize.y); +#ifdef SOKOL_METAL + sokol_metal_render(&swapchain_pass.swapchain, &sokol_metal_render_callback); +#else + DrawSokol(); +#endif + + return cInterfaceRenderDevice::EndScene(); +} + +void cSokolRender::DoSokolRendering() { + //This function might be called from a callback! + + //Begin main swapchain pass + sg_begin_pass(&swapchain_pass); //Iterate each command for (auto& command : commands) { @@ -212,31 +225,8 @@ int cSokolRender::EndScene() { //End pass sg_end_pass(); - return cInterfaceRenderDevice::EndScene(); -} - -int cSokolRender::Fill(int r, int g, int b, int a) { - RenderSubmitEvent(RenderEvent::FILL); - if (ActiveScene) { - xassert(0); - EndScene(); - } - - ResetViewport(); - -#ifdef PERIMETER_DEBUG - if (r == 0 && g == 0 && b == 0) { - r = 64; - g = b = 32; - } -#endif - - fill_color.r = static_cast(r) / 255.f; - fill_color.g = static_cast(g) / 255.f; - fill_color.b = static_cast(b) / 255.f; - fill_color.a = static_cast(a) / 255.f; - - return 0; + //Commit it + sg_commit(); } int cSokolRender::Flush(bool wnd) { @@ -251,8 +241,6 @@ int cSokolRender::Flush(bool wnd) { EndScene(); } - sg_commit(); - //Swap the window #ifdef SOKOL_GL SDL_GL_SwapWindow(sdl_window); @@ -260,6 +248,9 @@ int cSokolRender::Flush(bool wnd) { #ifdef SOKOL_D3D11 d3d_context->swap_chain->Present(1, 0); #endif +#ifdef SOKOL_METAL + sokol_metal_draw(); +#endif ClearCommands(); @@ -272,6 +263,32 @@ int cSokolRender::Flush(bool wnd) { return 0; } +int cSokolRender::Fill(int r, int g, int b, int a) { + RenderSubmitEvent(RenderEvent::FILL); + if (ActiveScene) { + xassert(0); + EndScene(); + } + + ResetViewport(); + +#ifdef PERIMETER_DEBUG + if (r == 0 && g == 0 && b == 0) { + r = 64; + g = b = 32; + } +#endif + + sg_color fill_color; + fill_color.r = static_cast(r) / 255.f; + fill_color.g = static_cast(g) / 255.f; + fill_color.b = static_cast(b) / 255.f; + fill_color.a = static_cast(a) / 255.f; + swapchain_pass.action.colors[0].clear_value = fill_color; + + return 0; +} + void CreateSokolBuffer(SokolBuffer*& buffer_ptr, MemoryResource* resource, size_t len, bool dynamic, sg_buffer_type type) { MT_IS_GRAPH(); xassert(!resource->locked); diff --git a/Source/Render/sokol/shaders/normal.h b/Source/Render/sokol/shaders/normal.h index 0e565563..e515b500 100644 --- a/Source/Render/sokol/shaders/normal.h +++ b/Source/Render/sokol/shaders/normal.h @@ -225,7 +225,7 @@ static const char normal_vs_source_glsl330[839] = { int material; }; - uniform normal_texture_fs_params _127; + uniform normal_texture_fs_params _129; uniform sampler2D un_tex0_un_sampler0; @@ -236,52 +236,52 @@ static const char normal_vs_source_glsl330[839] = { vec4 phong(vec3 pos, vec3 nrm, vec3 l, vec3 eye, vec3 l_ambient, vec3 l_diffuse, vec3 l_specular, vec3 ambient, vec3 diffuse, vec3 specular, float spec_power) { - vec3 _47 = normalize(nrm); - float _58 = max(dot(_47, l), 0.0); - return vec4((l_ambient * ambient + ((l_diffuse * diffuse) * _58)) + ((l_specular * specular) * (pow(max(dot(reflect(-l, _47), normalize(eye - pos)), 0.0), spec_power) * _58)), 1.0); + vec3 _48 = normalize(nrm); + float _59 = max(dot(_48, l), 0.0); + return vec4((l_ambient * ambient + ((l_diffuse * diffuse) * _59)) + ((l_specular * specular) * (pow(abs(max(dot(reflect(-l, _48), normalize(eye - pos)), 0.0)), spec_power) * _59)), 1.0); } vec4 gamma(vec4 c) { - return vec4(pow(c.xyz, vec3(0.4545454680919647216796875)), c.w); + return vec4(pow(abs(c.xyz), vec3(0.4545454680919647216796875)), c.w); } void main() { frag_color = texture(un_tex0_un_sampler0, fs_uv0); - if (_127.material > 0) + if (_129.material > 0) { vec3 param = fs_position; vec3 param_1 = fs_normal; - vec3 param_2 = -_127.light_dir; + vec3 param_2 = -_129.light_dir; vec3 param_3 = vec3(0.0); - vec3 param_4 = _127.light_ambient; - vec3 param_5 = _127.light_diffuse; - vec3 param_6 = _127.light_specular; - vec3 param_7 = _127.ambient.xyz; - vec3 param_8 = _127.diffuse.xyz; - vec3 param_9 = _127.specular.xyz; - float param_10 = _127.spec_power; + vec3 param_4 = _129.light_ambient; + vec3 param_5 = _129.light_diffuse; + vec3 param_6 = _129.light_specular; + vec3 param_7 = _129.ambient.xyz; + vec3 param_8 = _129.diffuse.xyz; + vec3 param_9 = _129.specular.xyz; + float param_10 = _129.spec_power; vec4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); frag_color *= gamma(param_11); - frag_color.w *= _127.diffuse.w; + frag_color.w *= _129.diffuse.w; } else { - vec4 _197 = frag_color; - vec3 _202 = _197.xyz * _127.ambient.xyz; - frag_color.x = _202.x; - frag_color.y = _202.y; - frag_color.z = _202.z; + vec4 _199 = frag_color; + vec3 _204 = _199.xyz * _129.ambient.xyz; + frag_color.x = _204.x; + frag_color.y = _204.y; + frag_color.z = _204.z; } - if (_127.un_alpha_test >= frag_color.w) + if (_129.un_alpha_test >= frag_color.w) { discard; } } */ -static const char normal_fs_source_glsl330[2002] = { +static const char normal_fs_source_glsl330[2012] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x73,0x74, 0x72,0x75,0x63,0x74,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74, 0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x0a,0x7b,0x0a, @@ -302,7 +302,7 @@ static const char normal_fs_source_glsl330[2002] = { 0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66, 0x6f,0x72,0x6d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75, 0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x31,0x32, - 0x37,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70, + 0x39,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x73,0x61,0x6d,0x70, 0x6c,0x65,0x72,0x32,0x44,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e, 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x3b,0x0a,0x0a,0x6c,0x61,0x79,0x6f, 0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x30,0x29, @@ -321,93 +321,93 @@ static const char normal_fs_source_glsl330[2002] = { 0x65,0x63,0x33,0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2c,0x20,0x76,0x65,0x63, 0x33,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61, 0x74,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29,0x0a,0x7b,0x0a, - 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x6e, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x6e, 0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x6d, - 0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20,0x6c,0x29,0x2c,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x6d, + 0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20,0x6c,0x29,0x2c,0x20, 0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, 0x20,0x76,0x65,0x63,0x34,0x28,0x28,0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, 0x20,0x2a,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2b,0x20,0x28,0x28,0x6c, 0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a,0x20,0x64,0x69,0x66,0x66,0x75, - 0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x20,0x2b,0x20,0x28,0x28, + 0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28, 0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x73,0x70,0x65, - 0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x6d,0x61, - 0x78,0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c, - 0x2c,0x20,0x5f,0x34,0x37,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, - 0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20,0x30, - 0x2e,0x30,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29, - 0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x76,0x65,0x63,0x34,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x76,0x65, - 0x63,0x34,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x77,0x28,0x63,0x2e,0x78,0x79, - 0x7a,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35, - 0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36, - 0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74, - 0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75, - 0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32, - 0x37,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x66, - 0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, - 0x20,0x2d,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72, + 0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x61,0x62, + 0x73,0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63, + 0x74,0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70, + 0x6f,0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20,0x31, + 0x2e,0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x65,0x63,0x34,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x76,0x65,0x63,0x34,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x77, + 0x28,0x61,0x62,0x73,0x28,0x63,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63, + 0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31, + 0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c, + 0x20,0x63,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d, + 0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65, + 0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65, + 0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e, - 0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74, - 0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d, - 0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63, - 0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65, - 0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32, - 0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75, - 0x73,0x65,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f, - 0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e, - 0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31, - 0x39,0x37,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32, - 0x30,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20, - 0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x78,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x79,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x7a,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32, - 0x37,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20, - 0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29, - 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64, - 0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a, - 0x0a,0x00, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x39, + 0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33, + 0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20, + 0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75, + 0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e, + 0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69, + 0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20, + 0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x78,0x79,0x7a, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70, + 0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f,0x70, + 0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x76,0x65, + 0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68, + 0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75, + 0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x39,0x39,0x20,0x3d,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x30,0x34,0x20,0x3d,0x20,0x5f, + 0x31,0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61, + 0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78, + 0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20, + 0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d, + 0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61, + 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* SOKOL_GLCORE33 */ #if defined(SOKOL_GLES3) @@ -507,7 +507,7 @@ static const char normal_vs_source_glsl300es[842] = { int material; }; - uniform normal_texture_fs_params _127; + uniform normal_texture_fs_params _129; uniform highp sampler2D un_tex0_un_sampler0; @@ -518,52 +518,52 @@ static const char normal_vs_source_glsl300es[842] = { highp vec4 phong(highp vec3 pos, highp vec3 nrm, highp vec3 l, highp vec3 eye, highp vec3 l_ambient, highp vec3 l_diffuse, highp vec3 l_specular, highp vec3 ambient, highp vec3 diffuse, highp vec3 specular, highp float spec_power) { - highp vec3 _47 = normalize(nrm); - highp float _58 = max(dot(_47, l), 0.0); - return vec4((l_ambient * ambient + ((l_diffuse * diffuse) * _58)) + ((l_specular * specular) * (pow(max(dot(reflect(-l, _47), normalize(eye - pos)), 0.0), spec_power) * _58)), 1.0); + highp vec3 _48 = normalize(nrm); + highp float _59 = max(dot(_48, l), 0.0); + return vec4((l_ambient * ambient + ((l_diffuse * diffuse) * _59)) + ((l_specular * specular) * (pow(abs(max(dot(reflect(-l, _48), normalize(eye - pos)), 0.0)), spec_power) * _59)), 1.0); } highp vec4 gamma(highp vec4 c) { - return vec4(pow(c.xyz, vec3(0.4545454680919647216796875)), c.w); + return vec4(pow(abs(c.xyz), vec3(0.4545454680919647216796875)), c.w); } void main() { frag_color = texture(un_tex0_un_sampler0, fs_uv0); - if (_127.material > 0) + if (_129.material > 0) { highp vec3 param = fs_position; highp vec3 param_1 = fs_normal; - highp vec3 param_2 = -_127.light_dir; + highp vec3 param_2 = -_129.light_dir; highp vec3 param_3 = vec3(0.0); - highp vec3 param_4 = _127.light_ambient; - highp vec3 param_5 = _127.light_diffuse; - highp vec3 param_6 = _127.light_specular; - highp vec3 param_7 = _127.ambient.xyz; - highp vec3 param_8 = _127.diffuse.xyz; - highp vec3 param_9 = _127.specular.xyz; - highp float param_10 = _127.spec_power; + highp vec3 param_4 = _129.light_ambient; + highp vec3 param_5 = _129.light_diffuse; + highp vec3 param_6 = _129.light_specular; + highp vec3 param_7 = _129.ambient.xyz; + highp vec3 param_8 = _129.diffuse.xyz; + highp vec3 param_9 = _129.specular.xyz; + highp float param_10 = _129.spec_power; highp vec4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); frag_color *= gamma(param_11); - frag_color.w *= _127.diffuse.w; + frag_color.w *= _129.diffuse.w; } else { - highp vec4 _197 = frag_color; - highp vec3 _202 = _197.xyz * _127.ambient.xyz; - frag_color.x = _202.x; - frag_color.y = _202.y; - frag_color.z = _202.z; + highp vec4 _199 = frag_color; + highp vec3 _204 = _199.xyz * _129.ambient.xyz; + frag_color.x = _204.x; + frag_color.y = _204.y; + frag_color.z = _204.z; } - if (_127.un_alpha_test >= frag_color.w) + if (_129.un_alpha_test >= frag_color.w) { discard; } } */ -static const char normal_fs_source_glsl300es[2321] = { +static const char normal_fs_source_glsl300es[2331] = { 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, @@ -590,7 +590,7 @@ static const char normal_fs_source_glsl300es[2321] = { 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x6d,0x61,0x74,0x65,0x72, 0x69,0x61,0x6c,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d, 0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f, - 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x31,0x32,0x37,0x3b,0x0a, + 0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x20,0x5f,0x31,0x32,0x39,0x3b,0x0a, 0x0a,0x75,0x6e,0x69,0x66,0x6f,0x72,0x6d,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x73, 0x61,0x6d,0x70,0x6c,0x65,0x72,0x32,0x44,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30, 0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x3b,0x0a,0x0a,0x6c, @@ -617,99 +617,99 @@ static const char normal_fs_source_glsl300es[2321] = { 0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2c,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66, 0x6c,0x6f,0x61,0x74,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, - 0x33,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, + 0x33,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, 0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x6d,0x61, - 0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20,0x6c,0x29,0x2c,0x20,0x30, + 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x6d,0x61, + 0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20,0x6c,0x29,0x2c,0x20,0x30, 0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, 0x76,0x65,0x63,0x34,0x28,0x28,0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20, 0x2a,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x20,0x2b,0x20,0x28,0x28,0x6c,0x5f, 0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a,0x20,0x64,0x69,0x66,0x66,0x75,0x73, - 0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x6c, + 0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x20,0x2b,0x20,0x28,0x28,0x6c, 0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x73,0x70,0x65,0x63, - 0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x6d,0x61,0x78, - 0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c, - 0x20,0x5f,0x34,0x37,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a,0x65, - 0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20,0x30,0x2e, - 0x30,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29,0x20, - 0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x29,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x67,0x61,0x6d, - 0x6d,0x61,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x63,0x29, - 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x65, - 0x63,0x34,0x28,0x70,0x6f,0x77,0x28,0x63,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x76,0x65, - 0x63,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39, - 0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29, - 0x2c,0x20,0x63,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20, - 0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72, - 0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37,0x2e,0x6d,0x61,0x74, - 0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, - 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70, - 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,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,0x32,0x20,0x3d,0x20,0x2d,0x5f, - 0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,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,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x33, - 0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68, - 0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61, - 0x6d,0x62,0x69,0x65,0x6e,0x74,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,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, - 0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x36,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74, - 0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x61,0x62,0x73, + 0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74, + 0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29, + 0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f, + 0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20,0x31,0x2e, + 0x30,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63, + 0x34,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65, + 0x63,0x34,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, + 0x72,0x6e,0x20,0x76,0x65,0x63,0x34,0x28,0x70,0x6f,0x77,0x28,0x61,0x62,0x73,0x28, + 0x63,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x34, + 0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32, + 0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,0x29, + 0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74, + 0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c, + 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20, + 0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, + 0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x76,0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, + 0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,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,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62, - 0x69,0x65,0x6e,0x74,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,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69, + 0x67,0x68,0x74,0x5f,0x64,0x69,0x72,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,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75, - 0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65, - 0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, - 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f, - 0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20, - 0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, - 0x70,0x20,0x76,0x65,0x63,0x34,0x20,0x5f,0x31,0x39,0x37,0x20,0x3d,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x30, - 0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f, - 0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76, + 0x65,0x63,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31, + 0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, + 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,0x35,0x20,0x3d,0x20,0x5f, + 0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73, + 0x65,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,0x36,0x20,0x3d,0x20, + 0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75, + 0x6c,0x61,0x72,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,0x37,0x20, + 0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,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,0x5f,0x38,0x20,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x39,0x20,0x3d,0x20, + 0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79, + 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20, + 0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70, + 0x20,0x76,0x65,0x63,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d, + 0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20, + 0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x78,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x79,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37, - 0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e, - 0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, - 0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a, - 0x00, + 0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69, + 0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68,0x70,0x20,0x76,0x65,0x63,0x34, + 0x20,0x5f,0x31,0x39,0x39,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x68,0x69,0x67,0x68, + 0x70,0x20,0x76,0x65,0x63,0x33,0x20,0x5f,0x32,0x30,0x34,0x20,0x3d,0x20,0x5f,0x31, + 0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d, + 0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20, + 0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d, + 0x20,0x5f,0x32,0x30,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c, + 0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67, + 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* SOKOL_GLES3 */ #if defined(SOKOL_D3D11) @@ -861,17 +861,17 @@ static const char normal_vs_source_hlsl5[1410] = { /* cbuffer normal_texture_fs_params : register(b0) { - float4 _127_diffuse : packoffset(c0); - float4 _127_ambient : packoffset(c1); - float4 _127_specular : packoffset(c2); - float4 _127_emissive : packoffset(c3); - float3 _127_light_dir : packoffset(c4); - float3 _127_light_diffuse : packoffset(c5); - float3 _127_light_ambient : packoffset(c6); - float3 _127_light_specular : packoffset(c7); - float _127_spec_power : packoffset(c7.w); - float _127_un_alpha_test : packoffset(c8); - int _127_material : packoffset(c8.y); + float4 _129_diffuse : packoffset(c0); + float4 _129_ambient : packoffset(c1); + float4 _129_specular : packoffset(c2); + float4 _129_emissive : packoffset(c3); + float3 _129_light_dir : packoffset(c4); + float3 _129_light_diffuse : packoffset(c5); + float3 _129_light_ambient : packoffset(c6); + float3 _129_light_specular : packoffset(c7); + float _129_spec_power : packoffset(c7.w); + float _129_un_alpha_test : packoffset(c8); + int _129_material : packoffset(c8.y); }; Texture2D un_tex0 : register(t0); @@ -896,45 +896,45 @@ static const char normal_vs_source_hlsl5[1410] = { float4 phong(float3 pos, float3 nrm, float3 l, float3 eye, float3 l_ambient, float3 l_diffuse, float3 l_specular, float3 ambient, float3 diffuse, float3 specular, float spec_power) { - float3 _47 = normalize(nrm); - float _58 = max(dot(_47, l), 0.0f); - return float4(mad(l_ambient, ambient, (l_diffuse * diffuse) * _58) + ((l_specular * specular) * (pow(max(dot(reflect(-l, _47), normalize(eye - pos)), 0.0f), spec_power) * _58)), 1.0f); + float3 _48 = normalize(nrm); + float _59 = max(dot(_48, l), 0.0f); + return float4(mad(l_ambient, ambient, (l_diffuse * diffuse) * _59) + ((l_specular * specular) * (pow(abs(max(dot(reflect(-l, _48), normalize(eye - pos)), 0.0f)), spec_power) * _59)), 1.0f); } float4 gamma(float4 c) { - return float4(pow(c.xyz, 0.4545454680919647216796875f.xxx), c.w); + return float4(pow(abs(c.xyz), 0.4545454680919647216796875f.xxx), c.w); } void frag_main() { frag_color = un_tex0.Sample(un_sampler0, fs_uv0); - if (_127_material > 0) + if (_129_material > 0) { float3 param = fs_position; float3 param_1 = fs_normal; - float3 param_2 = -_127_light_dir; + float3 param_2 = -_129_light_dir; float3 param_3 = 0.0f.xxx; - float3 param_4 = _127_light_ambient; - float3 param_5 = _127_light_diffuse; - float3 param_6 = _127_light_specular; - float3 param_7 = _127_ambient.xyz; - float3 param_8 = _127_diffuse.xyz; - float3 param_9 = _127_specular.xyz; - float param_10 = _127_spec_power; + float3 param_4 = _129_light_ambient; + float3 param_5 = _129_light_diffuse; + float3 param_6 = _129_light_specular; + float3 param_7 = _129_ambient.xyz; + float3 param_8 = _129_diffuse.xyz; + float3 param_9 = _129_specular.xyz; + float param_10 = _129_spec_power; float4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); frag_color *= gamma(param_11); - frag_color.w *= _127_diffuse.w; + frag_color.w *= _129_diffuse.w; } else { - float4 _197 = frag_color; - float3 _202 = _197.xyz * _127_ambient.xyz; - frag_color.x = _202.x; - frag_color.y = _202.y; - frag_color.z = _202.z; + float4 _199 = frag_color; + float3 _204 = _199.xyz * _129_ambient.xyz; + frag_color.x = _204.x; + frag_color.y = _204.y; + frag_color.z = _204.z; } - if (_127_un_alpha_test >= frag_color.w) + if (_129_un_alpha_test >= frag_color.w) { discard; } @@ -951,40 +951,40 @@ static const char normal_vs_source_hlsl5[1410] = { return stage_output; } */ -static const char normal_fs_source_hlsl5[2829] = { +static const char normal_fs_source_hlsl5[2839] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32, - 0x37,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b, + 0x39,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b, 0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32,0x37,0x5f,0x61,0x6d,0x62,0x69, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32,0x39,0x5f,0x61,0x6d,0x62,0x69, 0x65,0x6e,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74, 0x28,0x63,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34, - 0x20,0x5f,0x31,0x32,0x37,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x3a, + 0x20,0x5f,0x31,0x32,0x39,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x3a, 0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x32,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32,0x37, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x32,0x39, 0x5f,0x65,0x6d,0x69,0x73,0x73,0x69,0x76,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b, 0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x33,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68, 0x74,0x5f,0x64,0x69,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73, 0x65,0x74,0x28,0x63,0x34,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x20,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69, + 0x74,0x33,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69, 0x66,0x66,0x75,0x73,0x65,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73, 0x65,0x74,0x28,0x63,0x35,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x20,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d, + 0x74,0x33,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d, 0x62,0x69,0x65,0x6e,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73, 0x65,0x74,0x28,0x63,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, - 0x74,0x33,0x20,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70, + 0x74,0x33,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70, 0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66, 0x73,0x65,0x74,0x28,0x63,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, - 0x61,0x74,0x20,0x5f,0x31,0x32,0x37,0x5f,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, + 0x61,0x74,0x20,0x5f,0x31,0x32,0x39,0x5f,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, 0x65,0x72,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28, 0x63,0x37,0x2e,0x77,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x5f,0x31,0x32,0x37,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74, + 0x20,0x5f,0x31,0x32,0x39,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74, 0x65,0x73,0x74,0x20,0x3a,0x20,0x70,0x61,0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74, 0x28,0x63,0x38,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x6e,0x74,0x20,0x5f,0x31, - 0x32,0x37,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3a,0x20,0x70,0x61, + 0x32,0x39,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3a,0x20,0x70,0x61, 0x63,0x6b,0x6f,0x66,0x66,0x73,0x65,0x74,0x28,0x63,0x38,0x2e,0x79,0x29,0x3b,0x0a, 0x7d,0x3b,0x0a,0x0a,0x54,0x65,0x78,0x74,0x75,0x72,0x65,0x32,0x44,0x3c,0x66,0x6c, 0x6f,0x61,0x74,0x34,0x3e,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x20,0x3a,0x20, @@ -1022,113 +1022,114 @@ static const char normal_fs_source_hlsl5[2829] = { 0x66,0x66,0x75,0x73,0x65,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x73,0x70, 0x65,0x63,0x75,0x6c,0x61,0x72,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x73,0x70, 0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x6e,0x6f,0x72, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x6e,0x6f,0x72, 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x6d,0x61,0x78, - 0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20,0x6c,0x29,0x2c,0x20,0x30,0x2e, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20,0x6c,0x29,0x2c,0x20,0x30,0x2e, 0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20, 0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x6d,0x61,0x64,0x28,0x6c,0x5f,0x61,0x6d,0x62, 0x69,0x65,0x6e,0x74,0x2c,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2c,0x20,0x28, 0x6c,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a,0x20,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x20,0x2b,0x20,0x28,0x28, + 0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x20,0x2b,0x20,0x28,0x28, 0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20,0x2a,0x20,0x73,0x70,0x65, - 0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x6d,0x61, - 0x78,0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c, - 0x2c,0x20,0x5f,0x34,0x37,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69,0x7a, - 0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20,0x30, - 0x2e,0x30,0x66,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72, - 0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29, - 0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x67,0x61,0x6d,0x6d, - 0x61,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28, - 0x70,0x6f,0x77,0x28,0x63,0x2e,0x78,0x79,0x7a,0x2c,0x20,0x30,0x2e,0x34,0x35,0x34, - 0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36, - 0x37,0x39,0x36,0x38,0x37,0x35,0x66,0x2e,0x78,0x78,0x78,0x29,0x2c,0x20,0x63,0x2e, - 0x77,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65, - 0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37,0x5f,0x6d,0x61,0x74, - 0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,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,0x66,0x73, - 0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20, - 0x3d,0x20,0x2d,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69, - 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x30,0x2e,0x30,0x66, - 0x2e,0x78,0x78,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, - 0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f, - 0x31,0x32,0x37,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e, - 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a, + 0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70,0x6f,0x77,0x28,0x61,0x62, + 0x73,0x28,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63, + 0x74,0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x6e,0x6f,0x72,0x6d, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29, + 0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20, + 0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6c,0x6f,0x61,0x74,0x34, + 0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x63,0x29, + 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x63,0x2e,0x78, + 0x79,0x7a,0x29,0x2c,0x20,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38, + 0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37,0x35, + 0x66,0x2e,0x78,0x78,0x78,0x29,0x2c,0x20,0x63,0x2e,0x77,0x29,0x3b,0x0a,0x7d,0x0a, + 0x0a,0x76,0x6f,0x69,0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, + 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x53,0x61,0x6d, + 0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c, + 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, + 0x20,0x28,0x5f,0x31,0x32,0x39,0x5f,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20, + 0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, + 0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, + 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32, + 0x39,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x33,0x20,0x3d,0x20,0x30,0x2e,0x30,0x66,0x2e,0x78,0x78,0x78,0x3b,0x0a, 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x5f,0x6c,0x69, - 0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20,0x20, + 0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69, + 0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68,0x74, + 0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36, + 0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70, + 0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,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,0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39, + 0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x5f,0x61,0x6d,0x62,0x69, - 0x65,0x6e,0x74,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,0x5f,0x38,0x20, - 0x3d,0x20,0x5f,0x31,0x32,0x37,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32, - 0x37,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x5f,0x73,0x70, - 0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39, - 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20, - 0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31, - 0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20, - 0x5f,0x31,0x39,0x37,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79, - 0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32,0x37,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, - 0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72, - 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30, - 0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32, - 0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e, - 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, - 0x28,0x5f,0x31,0x32,0x37,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74, - 0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73, - 0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49, - 0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, - 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d, - 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73, - 0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, - 0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, - 0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f, - 0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65, - 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67, - 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, + 0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x73,0x70,0x65,0x63, + 0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30, + 0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, + 0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61, + 0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68, + 0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c, + 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x39,0x5f,0x64,0x69,0x66,0x66,0x75, + 0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, + 0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x39,0x20,0x3d, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x30,0x34, + 0x20,0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31, + 0x32,0x39,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x5f, + 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20, + 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, + 0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53, + 0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75, + 0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, + 0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, + 0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75, + 0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74, + 0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f, + 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61, + 0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e, + 0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70, + 0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75, + 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70, + 0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, }; #endif /* SOKOL_D3D11 */ #if defined(SOKOL_METAL) @@ -1268,47 +1269,47 @@ static const char normal_vs_source_metal_macos[910] = { static inline __attribute__((always_inline)) float4 phong(thread const float3& pos, thread const float3& nrm, thread const float3& l, thread const float3& eye, thread const float3& l_ambient, thread const float3& l_diffuse, thread const float3& l_specular, thread const float3& ambient, thread const float3& diffuse, thread const float3& specular, thread const float& spec_power) { - float3 _47 = fast::normalize(nrm); - float _58 = fast::max(dot(_47, l), 0.0); - return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _58) + ((l_specular * specular) * (pow(fast::max(dot(reflect(-l, _47), fast::normalize(eye - pos)), 0.0), spec_power) * _58)), 1.0); + float3 _48 = fast::normalize(nrm); + float _59 = fast::max(dot(_48, l), 0.0); + return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _59) + ((l_specular * specular) * (pow(abs(fast::max(dot(reflect(-l, _48), fast::normalize(eye - pos)), 0.0)), spec_power) * _59)), 1.0); } static inline __attribute__((always_inline)) float4 gamma(thread const float4& c) { - return float4(pow(c.xyz, float3(0.4545454680919647216796875)), c.w); + return float4(pow(abs(c.xyz), float3(0.4545454680919647216796875)), c.w); } - fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _127 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _129 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0); - if (_127.material > 0) + if (_129.material > 0) { float3 param = in.fs_position; float3 param_1 = in.fs_normal; - float3 param_2 = -_127.light_dir; + float3 param_2 = -_129.light_dir; float3 param_3 = float3(0.0); - float3 param_4 = _127.light_ambient; - float3 param_5 = _127.light_diffuse; - float3 param_6 = float3(_127.light_specular); - float3 param_7 = _127.ambient.xyz; - float3 param_8 = _127.diffuse.xyz; - float3 param_9 = _127.specular.xyz; - float param_10 = _127.spec_power; + float3 param_4 = _129.light_ambient; + float3 param_5 = _129.light_diffuse; + float3 param_6 = float3(_129.light_specular); + float3 param_7 = _129.ambient.xyz; + float3 param_8 = _129.diffuse.xyz; + float3 param_9 = _129.specular.xyz; + float param_10 = _129.spec_power; float4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); out.frag_color *= gamma(param_11); - out.frag_color.w *= _127.diffuse.w; + out.frag_color.w *= _129.diffuse.w; } else { - float4 _197 = out.frag_color; - float3 _202 = _197.xyz * _127.ambient.xyz; - out.frag_color.x = _202.x; - out.frag_color.y = _202.y; - out.frag_color.z = _202.z; + float4 _199 = out.frag_color; + float3 _204 = _199.xyz * _129.ambient.xyz; + out.frag_color.x = _204.x; + out.frag_color.y = _204.y; + out.frag_color.z = _204.z; } - if (_127.un_alpha_test >= out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1316,7 +1317,7 @@ static const char normal_vs_source_metal_macos[910] = { } */ -static const char normal_fs_source_metal_macos[2768] = { +static const char normal_fs_source_metal_macos[2778] = { 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, @@ -1380,117 +1381,117 @@ static const char normal_fs_source_metal_macos[2768] = { 0x61,0x72,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, 0x65,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x66,0x61,0x73, - 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20, 0x6c,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, 0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x6d,0x61,0x28, 0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2c,0x20,0x61,0x6d,0x62,0x69,0x65, 0x6e,0x74,0x2c,0x20,0x28,0x6c,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a, - 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29, + 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29, 0x20,0x2b,0x20,0x28,0x28,0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20, 0x2a,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70, - 0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x37, - 0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, - 0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20, - 0x30,0x2e,0x30,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72, - 0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x77,0x28,0x63,0x2e, - 0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35, - 0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31, - 0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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, - 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66, - 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x37,0x20,0x5b, - 0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, - 0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78, - 0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, - 0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37,0x2e,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c, + 0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73, + 0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20, + 0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x63,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36, + 0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37, + 0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65, + 0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30, + 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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30, + 0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30, + 0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20, + 0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,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,0x69,0x6e,0x2e, + 0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c, - 0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68, - 0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61, + 0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66, + 0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x36,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b, + 0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, + 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,0x5f,0x38,0x20,0x3d,0x20,0x5f, + 0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61, - 0x6d,0x62,0x69,0x65,0x6e,0x74,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, - 0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73, - 0x65,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,0x5f,0x39,0x20,0x3d,0x20, - 0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79, - 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x2e,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x37,0x20, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79,0x7a, - 0x20,0x2a,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e, - 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, - 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20, - 0x5f,0x32,0x30,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79, - 0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37, - 0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x2e,0x77,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, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, - + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73, + 0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d, + 0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x39,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x30,0x34,0x20, + 0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32, + 0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30, + 0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c, + 0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,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,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* SOKOL_METAL */ #if defined(SOKOL_METAL) @@ -1630,47 +1631,47 @@ static const char normal_vs_source_metal_ios[910] = { static inline __attribute__((always_inline)) float4 phong(thread const float3& pos, thread const float3& nrm, thread const float3& l, thread const float3& eye, thread const float3& l_ambient, thread const float3& l_diffuse, thread const float3& l_specular, thread const float3& ambient, thread const float3& diffuse, thread const float3& specular, thread const float& spec_power) { - float3 _47 = fast::normalize(nrm); - float _58 = fast::max(dot(_47, l), 0.0); - return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _58) + ((l_specular * specular) * (pow(fast::max(dot(reflect(-l, _47), fast::normalize(eye - pos)), 0.0), spec_power) * _58)), 1.0); + float3 _48 = fast::normalize(nrm); + float _59 = fast::max(dot(_48, l), 0.0); + return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _59) + ((l_specular * specular) * (pow(abs(fast::max(dot(reflect(-l, _48), fast::normalize(eye - pos)), 0.0)), spec_power) * _59)), 1.0); } static inline __attribute__((always_inline)) float4 gamma(thread const float4& c) { - return float4(pow(c.xyz, float3(0.4545454680919647216796875)), c.w); + return float4(pow(abs(c.xyz), float3(0.4545454680919647216796875)), c.w); } - fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _127 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _129 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0); - if (_127.material > 0) + if (_129.material > 0) { float3 param = in.fs_position; float3 param_1 = in.fs_normal; - float3 param_2 = -_127.light_dir; + float3 param_2 = -_129.light_dir; float3 param_3 = float3(0.0); - float3 param_4 = _127.light_ambient; - float3 param_5 = _127.light_diffuse; - float3 param_6 = float3(_127.light_specular); - float3 param_7 = _127.ambient.xyz; - float3 param_8 = _127.diffuse.xyz; - float3 param_9 = _127.specular.xyz; - float param_10 = _127.spec_power; + float3 param_4 = _129.light_ambient; + float3 param_5 = _129.light_diffuse; + float3 param_6 = float3(_129.light_specular); + float3 param_7 = _129.ambient.xyz; + float3 param_8 = _129.diffuse.xyz; + float3 param_9 = _129.specular.xyz; + float param_10 = _129.spec_power; float4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); out.frag_color *= gamma(param_11); - out.frag_color.w *= _127.diffuse.w; + out.frag_color.w *= _129.diffuse.w; } else { - float4 _197 = out.frag_color; - float3 _202 = _197.xyz * _127.ambient.xyz; - out.frag_color.x = _202.x; - out.frag_color.y = _202.y; - out.frag_color.z = _202.z; + float4 _199 = out.frag_color; + float3 _204 = _199.xyz * _129.ambient.xyz; + out.frag_color.x = _204.x; + out.frag_color.y = _204.y; + out.frag_color.z = _204.z; } - if (_127.un_alpha_test >= out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1678,7 +1679,7 @@ static const char normal_vs_source_metal_ios[910] = { } */ -static const char normal_fs_source_metal_ios[2768] = { +static const char normal_fs_source_metal_ios[2778] = { 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, @@ -1742,117 +1743,117 @@ static const char normal_fs_source_metal_ios[2768] = { 0x61,0x72,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, 0x65,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x66,0x61,0x73, - 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20, 0x6c,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, 0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x6d,0x61,0x28, 0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2c,0x20,0x61,0x6d,0x62,0x69,0x65, 0x6e,0x74,0x2c,0x20,0x28,0x6c,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a, - 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29, + 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29, 0x20,0x2b,0x20,0x28,0x28,0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20, 0x2a,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70, - 0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x37, - 0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, - 0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20, - 0x30,0x2e,0x30,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72, - 0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x77,0x28,0x63,0x2e, - 0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35, - 0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31, - 0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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, - 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66, - 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x37,0x20,0x5b, - 0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, - 0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78, - 0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, - 0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37,0x2e,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c, + 0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73, + 0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20, + 0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x63,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36, + 0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37, + 0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65, + 0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30, + 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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30, + 0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30, + 0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20, + 0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,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,0x69,0x6e,0x2e, + 0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c, - 0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68, - 0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61, + 0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66, + 0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x36,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b, + 0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, + 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,0x5f,0x38,0x20,0x3d,0x20,0x5f, + 0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61, - 0x6d,0x62,0x69,0x65,0x6e,0x74,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, - 0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73, - 0x65,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,0x5f,0x39,0x20,0x3d,0x20, - 0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79, - 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x2e,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x37,0x20, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79,0x7a, - 0x20,0x2a,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e, - 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, - 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20, - 0x5f,0x32,0x30,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79, - 0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37, - 0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x2e,0x77,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, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, - + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73, + 0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d, + 0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x39,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x30,0x34,0x20, + 0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32, + 0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30, + 0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c, + 0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,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,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* SOKOL_METAL */ #if defined(SOKOL_METAL) @@ -1992,47 +1993,47 @@ static const char normal_vs_source_metal_sim[910] = { static inline __attribute__((always_inline)) float4 phong(thread const float3& pos, thread const float3& nrm, thread const float3& l, thread const float3& eye, thread const float3& l_ambient, thread const float3& l_diffuse, thread const float3& l_specular, thread const float3& ambient, thread const float3& diffuse, thread const float3& specular, thread const float& spec_power) { - float3 _47 = fast::normalize(nrm); - float _58 = fast::max(dot(_47, l), 0.0); - return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _58) + ((l_specular * specular) * (pow(fast::max(dot(reflect(-l, _47), fast::normalize(eye - pos)), 0.0), spec_power) * _58)), 1.0); + float3 _48 = fast::normalize(nrm); + float _59 = fast::max(dot(_48, l), 0.0); + return float4(fma(l_ambient, ambient, (l_diffuse * diffuse) * _59) + ((l_specular * specular) * (pow(abs(fast::max(dot(reflect(-l, _48), fast::normalize(eye - pos)), 0.0)), spec_power) * _59)), 1.0); } static inline __attribute__((always_inline)) float4 gamma(thread const float4& c) { - return float4(pow(c.xyz, float3(0.4545454680919647216796875)), c.w); + return float4(pow(abs(c.xyz), float3(0.4545454680919647216796875)), c.w); } - fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _127 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) + fragment main0_out main0(main0_in in [[stage_in]], constant normal_texture_fs_params& _129 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0); - if (_127.material > 0) + if (_129.material > 0) { float3 param = in.fs_position; float3 param_1 = in.fs_normal; - float3 param_2 = -_127.light_dir; + float3 param_2 = -_129.light_dir; float3 param_3 = float3(0.0); - float3 param_4 = _127.light_ambient; - float3 param_5 = _127.light_diffuse; - float3 param_6 = float3(_127.light_specular); - float3 param_7 = _127.ambient.xyz; - float3 param_8 = _127.diffuse.xyz; - float3 param_9 = _127.specular.xyz; - float param_10 = _127.spec_power; + float3 param_4 = _129.light_ambient; + float3 param_5 = _129.light_diffuse; + float3 param_6 = float3(_129.light_specular); + float3 param_7 = _129.ambient.xyz; + float3 param_8 = _129.diffuse.xyz; + float3 param_9 = _129.specular.xyz; + float param_10 = _129.spec_power; float4 param_11 = phong(param, param_1, param_2, param_3, param_4, param_5, param_6, param_7, param_8, param_9, param_10); out.frag_color *= gamma(param_11); - out.frag_color.w *= _127.diffuse.w; + out.frag_color.w *= _129.diffuse.w; } else { - float4 _197 = out.frag_color; - float3 _202 = _197.xyz * _127.ambient.xyz; - out.frag_color.x = _202.x; - out.frag_color.y = _202.y; - out.frag_color.z = _202.z; + float4 _199 = out.frag_color; + float3 _204 = _199.xyz * _129.ambient.xyz; + out.frag_color.x = _204.x; + out.frag_color.y = _204.y; + out.frag_color.z = _204.z; } - if (_127.un_alpha_test >= out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -2040,7 +2041,7 @@ static const char normal_vs_source_metal_sim[910] = { } */ -static const char normal_fs_source_metal_sim[2768] = { +static const char normal_fs_source_metal_sim[2778] = { 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, @@ -2104,117 +2105,117 @@ static const char normal_fs_source_metal_sim[2768] = { 0x61,0x72,0x2c,0x20,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74, 0x20,0x66,0x6c,0x6f,0x61,0x74,0x26,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77, 0x65,0x72,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x34,0x37,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x20,0x5f,0x34,0x38,0x20,0x3d,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x6e,0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x38,0x20,0x3d,0x20,0x66,0x61,0x73, - 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x37,0x2c,0x20, + 0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x5f,0x35,0x39,0x20,0x3d,0x20,0x66,0x61,0x73, + 0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x5f,0x34,0x38,0x2c,0x20, 0x6c,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, 0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x66,0x6d,0x61,0x28, 0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2c,0x20,0x61,0x6d,0x62,0x69,0x65, 0x6e,0x74,0x2c,0x20,0x28,0x6c,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x20,0x2a, - 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29, + 0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29, 0x20,0x2b,0x20,0x28,0x28,0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x20, 0x2a,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x20,0x2a,0x20,0x28,0x70, - 0x6f,0x77,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c,0x20,0x5f,0x34,0x37, - 0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x69, - 0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73,0x29,0x29,0x2c,0x20, - 0x30,0x2e,0x30,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72, - 0x29,0x20,0x2a,0x20,0x5f,0x35,0x38,0x29,0x29,0x2c,0x20,0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x74,0x68, - 0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70,0x6f,0x77,0x28,0x63,0x2e, - 0x78,0x79,0x7a,0x2c,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35, - 0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31, - 0x36,0x37,0x39,0x36,0x38,0x37,0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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, - 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66, - 0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x37,0x20,0x5b, - 0x5b,0x62,0x75,0x66,0x66,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x32,0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,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,0x75, - 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x6d,0x61,0x69,0x6e,0x30,0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d, - 0x20,0x7b,0x7d,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78, - 0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, - 0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37,0x2e,0x6d, - 0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20, - 0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f, - 0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,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,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6d,0x61,0x78, + 0x28,0x64,0x6f,0x74,0x28,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28,0x2d,0x6c,0x2c, + 0x20,0x5f,0x34,0x38,0x29,0x2c,0x20,0x66,0x61,0x73,0x74,0x3a,0x3a,0x6e,0x6f,0x72, + 0x6d,0x61,0x6c,0x69,0x7a,0x65,0x28,0x65,0x79,0x65,0x20,0x2d,0x20,0x70,0x6f,0x73, + 0x29,0x29,0x2c,0x20,0x30,0x2e,0x30,0x29,0x29,0x2c,0x20,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x29,0x20,0x2a,0x20,0x5f,0x35,0x39,0x29,0x29,0x2c,0x20, + 0x31,0x2e,0x30,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,0x34,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x28,0x74,0x68,0x72,0x65,0x61,0x64,0x20,0x63,0x6f,0x6e,0x73,0x74,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x34,0x26,0x20,0x63,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x28,0x70, + 0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x63,0x2e,0x78,0x79,0x7a,0x29,0x2c,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36, + 0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x37,0x39,0x36,0x38,0x37, + 0x35,0x29,0x29,0x2c,0x20,0x63,0x2e,0x77,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,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x73,0x26,0x20,0x5f,0x31,0x32,0x39,0x20,0x5b,0x5b,0x62,0x75,0x66,0x66,0x65, + 0x72,0x28,0x30,0x29,0x5d,0x5d,0x2c,0x20,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x32, + 0x64,0x3c,0x66,0x6c,0x6f,0x61,0x74,0x3e,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30, + 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,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x72,0x30,0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30, + 0x29,0x5d,0x5d,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6d,0x61,0x69,0x6e,0x30, + 0x5f,0x6f,0x75,0x74,0x20,0x6f,0x75,0x74,0x20,0x3d,0x20,0x7b,0x7d,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70, + 0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20, + 0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61, + 0x6c,0x20,0x3e,0x20,0x30,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69, + 0x6f,0x6e,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,0x69,0x6e,0x2e, + 0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x33,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c, - 0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68, - 0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x32,0x20,0x3d,0x20,0x2d,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x30,0x2e,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x34,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61, + 0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66, + 0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f, + 0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3d,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f, + 0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x36,0x20,0x3d,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x28,0x5f,0x31,0x32,0x37,0x2e, - 0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b, + 0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74, + 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,0x5f,0x38,0x20,0x3d,0x20,0x5f, + 0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,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,0x5f,0x37,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61, - 0x6d,0x62,0x69,0x65,0x6e,0x74,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, - 0x5f,0x38,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73, - 0x65,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,0x5f,0x39,0x20,0x3d,0x20, - 0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79, - 0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x37, - 0x2e,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x32,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x34,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x37,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x39,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28, - 0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x20,0x2a,0x3d,0x20,0x5f,0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, - 0x20,0x65,0x6c,0x73,0x65,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x37,0x20, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33, - 0x20,0x5f,0x32,0x30,0x32,0x20,0x3d,0x20,0x5f,0x31,0x39,0x37,0x2e,0x78,0x79,0x7a, - 0x20,0x2a,0x20,0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e, - 0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, - 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20, - 0x5f,0x32,0x30,0x32,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79, - 0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x32,0x2e,0x7a,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x37, - 0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e, - 0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x2e,0x77,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, - 0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, - + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73, + 0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x30,0x20,0x3d,0x20,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66, + 0x6c,0x6f,0x61,0x74,0x34,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d, + 0x20,0x70,0x68,0x6f,0x6e,0x67,0x28,0x70,0x61,0x72,0x61,0x6d,0x2c,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x2c,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34, + 0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x36,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x2c,0x20,0x70,0x61,0x72, + 0x61,0x6d,0x5f,0x38,0x2c,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x2c,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x2a,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, + 0x31,0x31,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20,0x2a,0x3d, + 0x20,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x65,0x6c,0x73,0x65,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x66,0x6c, + 0x6f,0x61,0x74,0x34,0x20,0x5f,0x31,0x39,0x39,0x20,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x66,0x6c,0x6f,0x61,0x74,0x33,0x20,0x5f,0x32,0x30,0x34,0x20, + 0x3d,0x20,0x5f,0x31,0x39,0x39,0x2e,0x78,0x79,0x7a,0x20,0x2a,0x20,0x5f,0x31,0x32, + 0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x2e,0x78,0x79,0x7a,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x78, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20,0x5f,0x32,0x30, + 0x34,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x6f,0x75,0x74, + 0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, + 0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, + 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c, + 0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e, + 0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,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,0x72,0x65,0x74,0x75,0x72,0x6e, + 0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* SOKOL_METAL */ #if defined(SOKOL_WGPU) @@ -2431,13 +2432,13 @@ static const char normal_vs_source_wgsl[1708] = { var fs_uv0 : vec2f; - @group(0) @binding(4) var x_127 : normal_texture_fs_params; + @group(0) @binding(4) var x_129 : normal_texture_fs_params; var fs_position : vec3f; var fs_normal : vec3f; - const x_82 = vec3f(1.0f, 1.0f, 1.0f); + const x_84 = vec3f(1.0f, 1.0f, 1.0f); fn phong_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_f1_(pos : ptr, nrm : ptr, l : ptr, eye : ptr, l_ambient : ptr, l_diffuse : ptr, l_specular : ptr, ambient : ptr, diffuse : ptr, specular : ptr, spec_power : ptr) -> vec4f { var n : vec3f; @@ -2450,50 +2451,50 @@ static const char normal_vs_source_wgsl[1708] = { var ambient_v : vec3f; var diffuse_v : vec3f; var specular_v : vec3f; - let x_46 : vec3f = *(nrm); - n = normalize(x_46); - let x_49 : vec3f = *(eye); - let x_50 : vec3f = *(pos); - v = normalize((x_49 - x_50)); - let x_54 : vec3f = n; - let x_55 : vec3f = *(l); - n_dot_l = max(dot(x_54, x_55), 0.0f); - let x_60 : vec3f = *(l); - let x_61 : vec3f = -(x_60); - let x_62 : vec3f = n; - r = reflect(x_61, x_62); - let x_65 : vec3f = r; - let x_66 : vec3f = v; - r_dot_v = max(dot(x_65, x_66), 0.0f); - let x_70 : f32 = n_dot_l; - diff = x_70; - let x_72 : f32 = r_dot_v; - let x_73 : f32 = *(spec_power); - let x_75 : f32 = n_dot_l; - spec = (pow(x_72, x_73) * x_75); - let x_78 : vec3f = *(l_ambient); - let x_79 : vec3f = *(ambient); - ambient_v = ((x_78 * x_79) * x_82); - let x_85 : vec3f = *(l_diffuse); - let x_86 : vec3f = *(diffuse); - let x_88 : f32 = diff; - diffuse_v = ((x_85 * x_86) * x_88); - let x_91 : vec3f = *(l_specular); - let x_92 : vec3f = *(specular); - let x_94 : f32 = spec; - specular_v = ((x_91 * x_92) * x_94); - let x_96 : vec3f = ambient_v; - let x_97 : vec3f = diffuse_v; - let x_99 : vec3f = specular_v; - let x_100 : vec3f = ((x_96 + x_97) + x_99); - return vec4f(x_100.x, x_100.y, x_100.z, 1.0f); + let x_47 : vec3f = *(nrm); + n = normalize(x_47); + let x_50 : vec3f = *(eye); + let x_51 : vec3f = *(pos); + v = normalize((x_50 - x_51)); + let x_55 : vec3f = n; + let x_56 : vec3f = *(l); + n_dot_l = max(dot(x_55, x_56), 0.0f); + let x_61 : vec3f = *(l); + let x_62 : vec3f = -(x_61); + let x_63 : vec3f = n; + r = reflect(x_62, x_63); + let x_66 : vec3f = r; + let x_67 : vec3f = v; + r_dot_v = max(dot(x_66, x_67), 0.0f); + let x_71 : f32 = n_dot_l; + diff = x_71; + let x_73 : f32 = r_dot_v; + let x_75 : f32 = *(spec_power); + let x_77 : f32 = n_dot_l; + spec = (pow(abs(x_73), x_75) * x_77); + let x_80 : vec3f = *(l_ambient); + let x_81 : vec3f = *(ambient); + ambient_v = ((x_80 * x_81) * x_84); + let x_87 : vec3f = *(l_diffuse); + let x_88 : vec3f = *(diffuse); + let x_90 : f32 = diff; + diffuse_v = ((x_87 * x_88) * x_90); + let x_93 : vec3f = *(l_specular); + let x_94 : vec3f = *(specular); + let x_96 : f32 = spec; + specular_v = ((x_93 * x_94) * x_96); + let x_98 : vec3f = ambient_v; + let x_99 : vec3f = diffuse_v; + let x_101 : vec3f = specular_v; + let x_102 : vec3f = ((x_98 + x_99) + x_101); + return vec4f(x_102.x, x_102.y, x_102.z, 1.0f); } fn gamma_vf4_(c : ptr) -> vec4f { let x_30 : vec4f = *(c); - let x_34 : vec3f = pow(vec3f(x_30.x, x_30.y, x_30.z), vec3f(0.45454546809196472168f, 0.45454546809196472168f, 0.45454546809196472168f)); - let x_38 : f32 = (*(c)).w; - return vec4f(x_34.x, x_34.y, x_34.z, x_38); + let x_35 : vec3f = pow(abs(vec3f(x_30.x, x_30.y, x_30.z)), vec3f(0.45454546809196472168f, 0.45454546809196472168f, 0.45454546809196472168f)); + let x_39 : f32 = (*(c)).w; + return vec4f(x_35.x, x_35.y, x_35.z, x_39); } fn main_1() { @@ -2509,51 +2510,51 @@ static const char normal_vs_source_wgsl[1708] = { var param_9 : vec3f; var param_10 : f32; var param_11 : vec4f; - let x_122 : vec2f = fs_uv0; - let x_123 : vec4f = textureSample(un_tex0, un_sampler0, x_122); - frag_color = x_123; - let x_131 : i32 = x_127.material; - if ((x_131 > 0i)) { - let x_137 : vec4f = frag_color; - let x_144 : vec3f = x_127.light_dir; - let x_154 : vec3f = fs_position; - param = x_154; - let x_156 : vec3f = fs_normal; - param_1 = x_156; - param_2 = -(x_144); + let x_124 : vec2f = fs_uv0; + let x_125 : vec4f = textureSample(un_tex0, un_sampler0, x_124); + frag_color = x_125; + let x_133 : i32 = x_129.material; + if ((x_133 > 0i)) { + let x_139 : vec4f = frag_color; + let x_146 : vec3f = x_129.light_dir; + let x_156 : vec3f = fs_position; + param = x_156; + let x_158 : vec3f = fs_normal; + param_1 = x_158; + param_2 = -(x_146); param_3 = vec3f(0.0f, 0.0f, 0.0f); - let x_161 : vec3f = x_127.light_ambient; - param_4 = x_161; - let x_164 : vec3f = x_127.light_diffuse; - param_5 = x_164; - let x_167 : vec3f = x_127.light_specular; - param_6 = x_167; - let x_171 : vec4f = x_127.ambient; - param_7 = vec3f(x_171.x, x_171.y, x_171.z); - let x_175 : vec4f = x_127.diffuse; - param_8 = vec3f(x_175.x, x_175.y, x_175.z); - let x_179 : vec4f = x_127.specular; - param_9 = vec3f(x_179.x, x_179.y, x_179.z); - let x_184 : f32 = x_127.spec_power; - param_10 = x_184; - let x_185 : vec4f = phong_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_f1_(&(param), &(param_1), &(param_2), &(param_3), &(param_4), &(param_5), &(param_6), &(param_7), &(param_8), &(param_9), &(param_10)); - param_11 = x_185; - let x_187 : vec4f = gamma_vf4_(&(param_11)); - frag_color = (x_137 * x_187); - let x_190 : f32 = x_127.diffuse.w; - let x_193 : f32 = frag_color.w; - frag_color.w = (x_193 * x_190); + let x_163 : vec3f = x_129.light_ambient; + param_4 = x_163; + let x_166 : vec3f = x_129.light_diffuse; + param_5 = x_166; + let x_169 : vec3f = x_129.light_specular; + param_6 = x_169; + let x_173 : vec4f = x_129.ambient; + param_7 = vec3f(x_173.x, x_173.y, x_173.z); + let x_177 : vec4f = x_129.diffuse; + param_8 = vec3f(x_177.x, x_177.y, x_177.z); + let x_181 : vec4f = x_129.specular; + param_9 = vec3f(x_181.x, x_181.y, x_181.z); + let x_186 : f32 = x_129.spec_power; + param_10 = x_186; + let x_187 : vec4f = phong_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_vf3_f1_(&(param), &(param_1), &(param_2), &(param_3), &(param_4), &(param_5), &(param_6), &(param_7), &(param_8), &(param_9), &(param_10)); + param_11 = x_187; + let x_189 : vec4f = gamma_vf4_(&(param_11)); + frag_color = (x_139 * x_189); + let x_192 : f32 = x_129.diffuse.w; + let x_195 : f32 = frag_color.w; + frag_color.w = (x_195 * x_192); } else { - let x_197 : vec4f = frag_color; - let x_200 : vec4f = x_127.ambient; - let x_203 : vec3f = ((vec3f(x_197.x, x_197.y, x_197.z) * vec3f(x_200.x, x_200.y, x_200.z)) * x_82); - frag_color.x = x_203.x; - frag_color.y = x_203.y; - frag_color.z = x_203.z; + let x_199 : vec4f = frag_color; + let x_202 : vec4f = x_129.ambient; + let x_205 : vec3f = ((vec3f(x_199.x, x_199.y, x_199.z) * vec3f(x_202.x, x_202.y, x_202.z)) * x_84); + frag_color.x = x_205.x; + frag_color.y = x_205.y; + frag_color.z = x_205.z; } - let x_215 : f32 = x_127.un_alpha_test; - let x_217 : f32 = frag_color.w; - if ((x_215 >= x_217)) { + let x_217 : f32 = x_129.un_alpha_test; + let x_219 : f32 = frag_color.w; + if ((x_217 >= x_219)) { discard; } return; @@ -2574,7 +2575,7 @@ static const char normal_vs_source_wgsl[1708] = { } */ -static const char normal_fs_source_wgsl[5367] = { +static const char normal_fs_source_wgsl[5379] = { 0x64,0x69,0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x28,0x6f,0x66,0x66,0x2c,0x20, 0x64,0x65,0x72,0x69,0x76,0x61,0x74,0x69,0x76,0x65,0x5f,0x75,0x6e,0x69,0x66,0x6f, 0x72,0x6d,0x69,0x74,0x79,0x29,0x3b,0x0a,0x0a,0x73,0x74,0x72,0x75,0x63,0x74,0x20, @@ -2621,14 +2622,14 @@ static const char normal_fs_source_wgsl[5367] = { 0x3e,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66, 0x3b,0x0a,0x0a,0x40,0x67,0x72,0x6f,0x75,0x70,0x28,0x30,0x29,0x20,0x40,0x62,0x69, 0x6e,0x64,0x69,0x6e,0x67,0x28,0x34,0x29,0x20,0x76,0x61,0x72,0x3c,0x75,0x6e,0x69, - 0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x32,0x37,0x20,0x3a,0x20,0x6e,0x6f, + 0x66,0x6f,0x72,0x6d,0x3e,0x20,0x78,0x5f,0x31,0x32,0x39,0x20,0x3a,0x20,0x6e,0x6f, 0x72,0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f, 0x70,0x61,0x72,0x61,0x6d,0x73,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c,0x70,0x72,0x69, 0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, 0x6e,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x0a,0x76,0x61,0x72,0x3c, 0x70,0x72,0x69,0x76,0x61,0x74,0x65,0x3e,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d, 0x61,0x6c,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x0a,0x63,0x6f,0x6e, - 0x73,0x74,0x20,0x78,0x5f,0x38,0x32,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28, + 0x73,0x74,0x20,0x78,0x5f,0x38,0x34,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28, 0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66,0x2c,0x20,0x31,0x2e,0x30,0x66, 0x29,0x3b,0x0a,0x0a,0x66,0x6e,0x20,0x70,0x68,0x6f,0x6e,0x67,0x5f,0x76,0x66,0x33, 0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33, @@ -2669,248 +2670,249 @@ static const char normal_fs_source_wgsl[5367] = { 0x73,0x65,0x5f,0x76,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20, 0x76,0x61,0x72,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x5f,0x76,0x20,0x3a, 0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, - 0x34,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x6e, + 0x34,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x6e, 0x72,0x6d,0x29,0x3b,0x0a,0x20,0x20,0x6e,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d,0x61, - 0x6c,0x69,0x7a,0x65,0x28,0x78,0x5f,0x34,0x36,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x34,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, + 0x6c,0x69,0x7a,0x65,0x28,0x78,0x5f,0x34,0x37,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, + 0x74,0x20,0x78,0x5f,0x35,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, 0x20,0x2a,0x28,0x65,0x79,0x65,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, - 0x5f,0x35,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28, + 0x5f,0x35,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28, 0x70,0x6f,0x73,0x29,0x3b,0x0a,0x20,0x20,0x76,0x20,0x3d,0x20,0x6e,0x6f,0x72,0x6d, - 0x61,0x6c,0x69,0x7a,0x65,0x28,0x28,0x78,0x5f,0x34,0x39,0x20,0x2d,0x20,0x78,0x5f, - 0x35,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x34, + 0x61,0x6c,0x69,0x7a,0x65,0x28,0x28,0x78,0x5f,0x35,0x30,0x20,0x2d,0x20,0x78,0x5f, + 0x35,0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x35, 0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x6e,0x3b,0x0a,0x20,0x20, - 0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, + 0x6c,0x65,0x74,0x20,0x78,0x5f,0x35,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, 0x20,0x3d,0x20,0x2a,0x28,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x6e,0x5f,0x64,0x6f,0x74, 0x5f,0x6c,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74,0x28,0x78,0x5f,0x35, - 0x34,0x2c,0x20,0x78,0x5f,0x35,0x35,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x3b, - 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x30,0x20,0x3a,0x20,0x76,0x65, + 0x35,0x2c,0x20,0x78,0x5f,0x35,0x36,0x29,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29,0x3b, + 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x31,0x20,0x3a,0x20,0x76,0x65, 0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x6c,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x36,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, - 0x20,0x2d,0x28,0x78,0x5f,0x36,0x30,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x36,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x6e, + 0x74,0x20,0x78,0x5f,0x36,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, + 0x20,0x2d,0x28,0x78,0x5f,0x36,0x31,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, + 0x78,0x5f,0x36,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x6e, 0x3b,0x0a,0x20,0x20,0x72,0x20,0x3d,0x20,0x72,0x65,0x66,0x6c,0x65,0x63,0x74,0x28, - 0x78,0x5f,0x36,0x31,0x2c,0x20,0x78,0x5f,0x36,0x32,0x29,0x3b,0x0a,0x20,0x20,0x6c, - 0x65,0x74,0x20,0x78,0x5f,0x36,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, - 0x3d,0x20,0x72,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x36,0x20, + 0x78,0x5f,0x36,0x32,0x2c,0x20,0x78,0x5f,0x36,0x33,0x29,0x3b,0x0a,0x20,0x20,0x6c, + 0x65,0x74,0x20,0x78,0x5f,0x36,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, + 0x3d,0x20,0x72,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x36,0x37,0x20, 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x76,0x3b,0x0a,0x20,0x20,0x72, 0x5f,0x64,0x6f,0x74,0x5f,0x76,0x20,0x3d,0x20,0x6d,0x61,0x78,0x28,0x64,0x6f,0x74, - 0x28,0x78,0x5f,0x36,0x35,0x2c,0x20,0x78,0x5f,0x36,0x36,0x29,0x2c,0x20,0x30,0x2e, - 0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x30,0x20, + 0x28,0x78,0x5f,0x36,0x36,0x2c,0x20,0x78,0x5f,0x36,0x37,0x29,0x2c,0x20,0x30,0x2e, + 0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x31,0x20, 0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x6e,0x5f,0x64,0x6f,0x74,0x5f,0x6c,0x3b, - 0x0a,0x20,0x20,0x64,0x69,0x66,0x66,0x20,0x3d,0x20,0x78,0x5f,0x37,0x30,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x32,0x20,0x3a,0x20,0x66,0x33,0x32, + 0x0a,0x20,0x20,0x64,0x69,0x66,0x66,0x20,0x3d,0x20,0x78,0x5f,0x37,0x31,0x3b,0x0a, + 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x33,0x20,0x3a,0x20,0x66,0x33,0x32, 0x20,0x3d,0x20,0x72,0x5f,0x64,0x6f,0x74,0x5f,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x37,0x33,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a, + 0x74,0x20,0x78,0x5f,0x37,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x2a, 0x28,0x73,0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x29,0x3b,0x0a,0x20,0x20, - 0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, + 0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, 0x20,0x6e,0x5f,0x64,0x6f,0x74,0x5f,0x6c,0x3b,0x0a,0x20,0x20,0x73,0x70,0x65,0x63, - 0x20,0x3d,0x20,0x28,0x70,0x6f,0x77,0x28,0x78,0x5f,0x37,0x32,0x2c,0x20,0x78,0x5f, - 0x37,0x33,0x29,0x20,0x2a,0x20,0x78,0x5f,0x37,0x35,0x29,0x3b,0x0a,0x20,0x20,0x6c, - 0x65,0x74,0x20,0x78,0x5f,0x37,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, - 0x3d,0x20,0x2a,0x28,0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x29,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x37,0x39,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x29,0x3b, - 0x0a,0x20,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x76,0x20,0x3d,0x20,0x28, - 0x28,0x78,0x5f,0x37,0x38,0x20,0x2a,0x20,0x78,0x5f,0x37,0x39,0x29,0x20,0x2a,0x20, - 0x78,0x5f,0x38,0x32,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38, - 0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x6c,0x5f, - 0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x38,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a, - 0x28,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74, - 0x20,0x78,0x5f,0x38,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x64,0x69, - 0x66,0x66,0x3b,0x0a,0x20,0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x5f,0x76,0x20, - 0x3d,0x20,0x28,0x28,0x78,0x5f,0x38,0x35,0x20,0x2a,0x20,0x78,0x5f,0x38,0x36,0x29, - 0x20,0x2a,0x20,0x78,0x5f,0x38,0x38,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x39,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a, - 0x28,0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b,0x0a,0x20,0x20, - 0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, - 0x20,0x3d,0x20,0x2a,0x28,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x29,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x34,0x20,0x3a,0x20,0x66,0x33,0x32, - 0x20,0x3d,0x20,0x73,0x70,0x65,0x63,0x3b,0x0a,0x20,0x20,0x73,0x70,0x65,0x63,0x75, - 0x6c,0x61,0x72,0x5f,0x76,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x39,0x31,0x20,0x2a, - 0x20,0x78,0x5f,0x39,0x32,0x29,0x20,0x2a,0x20,0x78,0x5f,0x39,0x34,0x29,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x36,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x20,0x3d,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f,0x76,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x37,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x20,0x3d,0x20,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x5f,0x76,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x39,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x20,0x3d,0x20,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x5f,0x76,0x3b, - 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x30,0x20,0x3a,0x20,0x76, - 0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x39,0x36,0x20,0x2b,0x20, - 0x78,0x5f,0x39,0x37,0x29,0x20,0x2b,0x20,0x78,0x5f,0x39,0x39,0x29,0x3b,0x0a,0x20, - 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f, - 0x31,0x30,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x30,0x30,0x2e,0x79,0x2c,0x20, - 0x78,0x5f,0x31,0x30,0x30,0x2e,0x7a,0x2c,0x20,0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a, - 0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x67,0x61,0x6d,0x6d,0x61,0x5f,0x76,0x66,0x34,0x5f, - 0x28,0x63,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c,0x66,0x75,0x6e,0x63,0x74,0x69,0x6f, - 0x6e,0x2c,0x20,0x76,0x65,0x63,0x34,0x66,0x3e,0x29,0x20,0x2d,0x3e,0x20,0x76,0x65, - 0x63,0x34,0x66,0x20,0x7b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x30, - 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x2a,0x28,0x63,0x29,0x3b, - 0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x33,0x34,0x20,0x3a,0x20,0x76,0x65, - 0x63,0x33,0x66,0x20,0x3d,0x20,0x70,0x6f,0x77,0x28,0x76,0x65,0x63,0x33,0x66,0x28, - 0x78,0x5f,0x33,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x30,0x2e,0x79,0x2c,0x20, - 0x78,0x5f,0x33,0x30,0x2e,0x7a,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x30, - 0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34, - 0x37,0x32,0x31,0x36,0x38,0x66,0x2c,0x20,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35, - 0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x38,0x66,0x2c, - 0x20,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39, - 0x36,0x34,0x37,0x32,0x31,0x36,0x38,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x33,0x38,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x28, - 0x2a,0x28,0x63,0x29,0x29,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72, - 0x6e,0x20,0x76,0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x34,0x2e,0x78,0x2c,0x20, - 0x78,0x5f,0x33,0x34,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x33,0x34,0x2e,0x7a,0x2c,0x20, - 0x78,0x5f,0x33,0x38,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69, - 0x6e,0x5f,0x31,0x28,0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61, - 0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76, - 0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72, - 0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, - 0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20, + 0x20,0x3d,0x20,0x28,0x70,0x6f,0x77,0x28,0x61,0x62,0x73,0x28,0x78,0x5f,0x37,0x33, + 0x29,0x2c,0x20,0x78,0x5f,0x37,0x35,0x29,0x20,0x2a,0x20,0x78,0x5f,0x37,0x37,0x29, + 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x30,0x20,0x3a,0x20,0x76, + 0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x6c,0x5f,0x61,0x6d,0x62,0x69,0x65, + 0x6e,0x74,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x31,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x61,0x6d,0x62,0x69, + 0x65,0x6e,0x74,0x29,0x3b,0x0a,0x20,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x5f, + 0x76,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x38,0x30,0x20,0x2a,0x20,0x78,0x5f,0x38, + 0x31,0x29,0x20,0x2a,0x20,0x78,0x5f,0x38,0x34,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65, + 0x74,0x20,0x78,0x5f,0x38,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, + 0x20,0x2a,0x28,0x6c,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x3b,0x0a,0x20, + 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x38,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, + 0x66,0x20,0x3d,0x20,0x2a,0x28,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x29,0x3b,0x0a, + 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x30,0x20,0x3a,0x20,0x66,0x33,0x32, + 0x20,0x3d,0x20,0x64,0x69,0x66,0x66,0x3b,0x0a,0x20,0x20,0x64,0x69,0x66,0x66,0x75, + 0x73,0x65,0x5f,0x76,0x20,0x3d,0x20,0x28,0x28,0x78,0x5f,0x38,0x37,0x20,0x2a,0x20, + 0x78,0x5f,0x38,0x38,0x29,0x20,0x2a,0x20,0x78,0x5f,0x39,0x30,0x29,0x3b,0x0a,0x20, + 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, + 0x66,0x20,0x3d,0x20,0x2a,0x28,0x6c,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72, + 0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x34,0x20,0x3a,0x20, + 0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x2a,0x28,0x73,0x70,0x65,0x63,0x75,0x6c, + 0x61,0x72,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x36,0x20, + 0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x73,0x70,0x65,0x63,0x3b,0x0a,0x20,0x20, + 0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x5f,0x76,0x20,0x3d,0x20,0x28,0x28,0x78, + 0x5f,0x39,0x33,0x20,0x2a,0x20,0x78,0x5f,0x39,0x34,0x29,0x20,0x2a,0x20,0x78,0x5f, + 0x39,0x36,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x38,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x61,0x6d,0x62,0x69,0x65,0x6e, + 0x74,0x5f,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x39,0x39,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x64,0x69,0x66,0x66,0x75,0x73, + 0x65,0x5f,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x30,0x31, + 0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x73,0x70,0x65,0x63,0x75, + 0x6c,0x61,0x72,0x5f,0x76,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, + 0x30,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x28,0x28,0x78, + 0x5f,0x39,0x38,0x20,0x2b,0x20,0x78,0x5f,0x39,0x39,0x29,0x20,0x2b,0x20,0x78,0x5f, + 0x31,0x30,0x31,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76, + 0x65,0x63,0x34,0x66,0x28,0x78,0x5f,0x31,0x30,0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f, + 0x31,0x30,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x30,0x32,0x2e,0x7a,0x2c,0x20, + 0x31,0x2e,0x30,0x66,0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x67,0x61,0x6d, + 0x6d,0x61,0x5f,0x76,0x66,0x34,0x5f,0x28,0x63,0x20,0x3a,0x20,0x70,0x74,0x72,0x3c, + 0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e,0x2c,0x20,0x76,0x65,0x63,0x34,0x66,0x3e, + 0x29,0x20,0x2d,0x3e,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x7b,0x0a,0x20,0x20,0x6c, + 0x65,0x74,0x20,0x78,0x5f,0x33,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, + 0x3d,0x20,0x2a,0x28,0x63,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, + 0x33,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x70,0x6f,0x77, + 0x28,0x61,0x62,0x73,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x33,0x30,0x2e, + 0x78,0x2c,0x20,0x78,0x5f,0x33,0x30,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x33,0x30,0x2e, + 0x7a,0x29,0x29,0x2c,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x30,0x2e,0x34,0x35,0x34, + 0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36, + 0x38,0x66,0x2c,0x20,0x30,0x2e,0x34,0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30, + 0x39,0x31,0x39,0x36,0x34,0x37,0x32,0x31,0x36,0x38,0x66,0x2c,0x20,0x30,0x2e,0x34, + 0x35,0x34,0x35,0x34,0x35,0x34,0x36,0x38,0x30,0x39,0x31,0x39,0x36,0x34,0x37,0x32, + 0x31,0x36,0x38,0x66,0x29,0x29,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, + 0x33,0x39,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x28,0x2a,0x28,0x63,0x29, + 0x29,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x76,0x65, + 0x63,0x34,0x66,0x28,0x78,0x5f,0x33,0x35,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x33,0x35, + 0x2e,0x79,0x2c,0x20,0x78,0x5f,0x33,0x35,0x2e,0x7a,0x2c,0x20,0x78,0x5f,0x33,0x39, + 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28, + 0x29,0x20,0x7b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x20, 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a, - 0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3a,0x20, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a, + 0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3a,0x20, 0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72, - 0x61,0x6d,0x5f,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20, - 0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3a,0x20,0x76,0x65, + 0x61,0x6d,0x5f,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20, + 0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3a,0x20,0x76,0x65, 0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61, - 0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3a,0x20,0x66,0x33,0x32, - 0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31, - 0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x31,0x32,0x32,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, - 0x31,0x32,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65, - 0x78,0x74,0x75,0x72,0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x74, - 0x65,0x78,0x30,0x2c,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, - 0x2c,0x20,0x78,0x5f,0x31,0x32,0x32,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67, - 0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x33,0x3b,0x0a, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x33,0x31,0x20,0x3a,0x20,0x69,0x33, - 0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69, - 0x61,0x6c,0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x31,0x33,0x31, - 0x20,0x3e,0x20,0x30,0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x31,0x33,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20, - 0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x34,0x34,0x20,0x3a,0x20,0x76,0x65, - 0x63,0x33,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68, - 0x74,0x5f,0x64,0x69,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, - 0x5f,0x31,0x35,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x66, - 0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x3d,0x20,0x78,0x5f,0x31,0x35,0x34,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x36,0x20,0x3a,0x20,0x76, - 0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20, - 0x78,0x5f,0x31,0x35,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x32,0x20,0x3d,0x20,0x2d,0x28,0x78,0x5f,0x31,0x34,0x34,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x76,0x65,0x63, - 0x33,0x66,0x28,0x30,0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x30, - 0x2e,0x30,0x66,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, - 0x31,0x36,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x78,0x5f, - 0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e, - 0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d, - 0x20,0x78,0x5f,0x31,0x36,0x31,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x31,0x36,0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20, - 0x78,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66, - 0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35, - 0x20,0x3d,0x20,0x78,0x5f,0x31,0x36,0x34,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, - 0x74,0x20,0x78,0x5f,0x31,0x36,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, - 0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70, - 0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61, - 0x6d,0x5f,0x36,0x20,0x3d,0x20,0x78,0x5f,0x31,0x36,0x37,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x31,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65, - 0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20, - 0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x31,0x2e,0x78,0x2c, - 0x20,0x78,0x5f,0x31,0x37,0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37,0x31,0x2e, - 0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37, - 0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32, - 0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78, - 0x5f,0x31,0x37,0x35,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x35,0x2e,0x79,0x2c, - 0x20,0x78,0x5f,0x31,0x37,0x35,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c, - 0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66, - 0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61, - 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d, - 0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x39,0x2e,0x78,0x2c,0x20, - 0x78,0x5f,0x31,0x37,0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37,0x39,0x2e,0x7a, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x34, - 0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x73, - 0x70,0x65,0x63,0x5f,0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3d,0x20,0x78,0x5f,0x31,0x38,0x34,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x35,0x20,0x3a, - 0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x5f,0x76, + 0x5f,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61, + 0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33, + 0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37, + 0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20, + 0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x3b, + 0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3a, + 0x20,0x76,0x65,0x63,0x33,0x66,0x3b,0x0a,0x20,0x20,0x76,0x61,0x72,0x20,0x70,0x61, + 0x72,0x61,0x6d,0x5f,0x31,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x3b,0x0a,0x20,0x20, + 0x76,0x61,0x72,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3a,0x20,0x76, + 0x65,0x63,0x34,0x66,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32, + 0x34,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x20,0x3d,0x20,0x66,0x73,0x5f,0x75, + 0x76,0x30,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x32,0x35,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x74,0x65,0x78,0x74,0x75,0x72, + 0x65,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2c, + 0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x78,0x5f, + 0x31,0x32,0x34,0x29,0x3b,0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, + 0x6f,0x72,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x35,0x3b,0x0a,0x20,0x20,0x6c,0x65, + 0x74,0x20,0x78,0x5f,0x31,0x33,0x33,0x20,0x3a,0x20,0x69,0x33,0x32,0x20,0x3d,0x20, + 0x78,0x5f,0x31,0x32,0x39,0x2e,0x6d,0x61,0x74,0x65,0x72,0x69,0x61,0x6c,0x3b,0x0a, + 0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x31,0x33,0x33,0x20,0x3e,0x20,0x30, + 0x69,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, + 0x31,0x33,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65, + 0x74,0x20,0x78,0x5f,0x31,0x34,0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20, + 0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x36, + 0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f, + 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3d,0x20,0x78,0x5f,0x31,0x35,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c, + 0x65,0x74,0x20,0x78,0x5f,0x31,0x35,0x38,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66, + 0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x20,0x3d,0x20,0x78,0x5f,0x31,0x35, + 0x38,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x20,0x3d, + 0x20,0x2d,0x28,0x78,0x5f,0x31,0x34,0x36,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x33,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x30, + 0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x2c,0x20,0x30,0x2e,0x30,0x66,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x36,0x33,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e, + 0x6c,0x69,0x67,0x68,0x74,0x5f,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x20,0x3d,0x20,0x78,0x5f,0x31, + 0x36,0x33,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x36, + 0x36,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32, + 0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x20,0x3d,0x20,0x78, + 0x5f,0x31,0x36,0x36,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, + 0x31,0x36,0x39,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d,0x20,0x78,0x5f, + 0x31,0x32,0x39,0x2e,0x6c,0x69,0x67,0x68,0x74,0x5f,0x73,0x70,0x65,0x63,0x75,0x6c, + 0x61,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x20, + 0x3d,0x20,0x78,0x5f,0x31,0x36,0x39,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, + 0x20,0x78,0x5f,0x31,0x37,0x33,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d, + 0x20,0x78,0x5f,0x31,0x32,0x39,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x37,0x20,0x3d,0x20,0x76,0x65, + 0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x33,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31, + 0x37,0x33,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x37,0x33,0x2e,0x7a,0x29,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x37,0x37,0x20,0x3a,0x20, + 0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e,0x64,0x69, + 0x66,0x66,0x75,0x73,0x65,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x38,0x20,0x3d,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x37,0x37, + 0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x37,0x37,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31, + 0x37,0x37,0x2e,0x7a,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, + 0x5f,0x31,0x38,0x31,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78, + 0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x75,0x6c,0x61,0x72,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x20,0x3d,0x20,0x76,0x65,0x63, + 0x33,0x66,0x28,0x78,0x5f,0x31,0x38,0x31,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x38, + 0x31,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x38,0x31,0x2e,0x7a,0x29,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x36,0x20,0x3a,0x20,0x66, + 0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e,0x73,0x70,0x65,0x63,0x5f, + 0x70,0x6f,0x77,0x65,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x31,0x30,0x20,0x3d,0x20,0x78,0x5f,0x31,0x38,0x36,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x37,0x20,0x3a,0x20,0x76,0x65,0x63, + 0x34,0x66,0x20,0x3d,0x20,0x70,0x68,0x6f,0x6e,0x67,0x5f,0x76,0x66,0x33,0x5f,0x76, 0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76, 0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x76, - 0x66,0x33,0x5f,0x76,0x66,0x33,0x5f,0x66,0x31,0x5f,0x28,0x26,0x28,0x70,0x61,0x72, - 0x61,0x6d,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x2c, - 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x2c,0x20,0x26,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x33,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x34,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x2c, - 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x26,0x28,0x70, - 0x61,0x72,0x61,0x6d,0x5f,0x37,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d, - 0x5f,0x38,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x29,0x2c, - 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x29,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x78,0x5f, - 0x31,0x38,0x35,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31, - 0x38,0x37,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x67,0x61,0x6d, - 0x6d,0x61,0x5f,0x76,0x66,0x34,0x5f,0x28,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f, - 0x31,0x31,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x28,0x78,0x5f,0x31,0x33,0x37,0x20,0x2a,0x20, - 0x78,0x5f,0x31,0x38,0x37,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20, - 0x78,0x5f,0x31,0x39,0x30,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f, - 0x31,0x32,0x37,0x2e,0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x33,0x20,0x3a,0x20,0x66, - 0x33,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, - 0x72,0x2e,0x77,0x20,0x3d,0x20,0x28,0x78,0x5f,0x31,0x39,0x33,0x20,0x2a,0x20,0x78, - 0x5f,0x31,0x39,0x30,0x29,0x3b,0x0a,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x37,0x20, - 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f, - 0x32,0x30,0x30,0x20,0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f, - 0x31,0x32,0x37,0x2e,0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x33,0x20,0x3a,0x20,0x76,0x65,0x63, - 0x33,0x66,0x20,0x3d,0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31, - 0x39,0x37,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x31,0x39,0x37,0x2e,0x79,0x2c,0x20,0x78, - 0x5f,0x31,0x39,0x37,0x2e,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x66,0x28, - 0x78,0x5f,0x32,0x30,0x30,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x30,0x30,0x2e,0x79, - 0x2c,0x20,0x78,0x5f,0x32,0x30,0x30,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x78,0x5f, - 0x38,0x32,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x78,0x20,0x3d,0x20,0x78,0x5f,0x32,0x30,0x33,0x2e,0x78,0x3b, + 0x66,0x33,0x5f,0x66,0x31,0x5f,0x28,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x29,0x2c, + 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x29,0x2c,0x20,0x26,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x32,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x33,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x34,0x29,0x2c, + 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x35,0x29,0x2c,0x20,0x26,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x36,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d, + 0x5f,0x37,0x29,0x2c,0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x38,0x29,0x2c, + 0x20,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x39,0x29,0x2c,0x20,0x26,0x28,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x30,0x29,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x70, + 0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x20,0x3d,0x20,0x78,0x5f,0x31,0x38,0x37,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x38,0x39,0x20,0x3a, + 0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x67,0x61,0x6d,0x6d,0x61,0x5f,0x76, + 0x66,0x34,0x5f,0x28,0x26,0x28,0x70,0x61,0x72,0x61,0x6d,0x5f,0x31,0x31,0x29,0x29, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x20,0x3d,0x20,0x28,0x78,0x5f,0x31,0x33,0x39,0x20,0x2a,0x20,0x78,0x5f,0x31,0x38, + 0x39,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39, + 0x32,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e, + 0x64,0x69,0x66,0x66,0x75,0x73,0x65,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c, + 0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x20, + 0x3d,0x20,0x28,0x78,0x5f,0x31,0x39,0x35,0x20,0x2a,0x20,0x78,0x5f,0x31,0x39,0x32, + 0x29,0x3b,0x0a,0x20,0x20,0x7d,0x20,0x65,0x6c,0x73,0x65,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x31,0x39,0x39,0x20,0x3a,0x20,0x76,0x65, + 0x63,0x34,0x66,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x30,0x32,0x20, + 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x20,0x3d,0x20,0x78,0x5f,0x31,0x32,0x39,0x2e, + 0x61,0x6d,0x62,0x69,0x65,0x6e,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x6c,0x65,0x74, + 0x20,0x78,0x5f,0x32,0x30,0x35,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x20,0x3d, + 0x20,0x28,0x28,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x31,0x39,0x39,0x2e,0x78, + 0x2c,0x20,0x78,0x5f,0x31,0x39,0x39,0x2e,0x79,0x2c,0x20,0x78,0x5f,0x31,0x39,0x39, + 0x2e,0x7a,0x29,0x20,0x2a,0x20,0x76,0x65,0x63,0x33,0x66,0x28,0x78,0x5f,0x32,0x30, + 0x32,0x2e,0x78,0x2c,0x20,0x78,0x5f,0x32,0x30,0x32,0x2e,0x79,0x2c,0x20,0x78,0x5f, + 0x32,0x30,0x32,0x2e,0x7a,0x29,0x29,0x20,0x2a,0x20,0x78,0x5f,0x38,0x34,0x29,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x79,0x20,0x3d,0x20,0x78,0x5f,0x32,0x30,0x33,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20, - 0x78,0x5f,0x32,0x30,0x33,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x6c, - 0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x35,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d, - 0x20,0x78,0x5f,0x31,0x32,0x37,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f, - 0x74,0x65,0x73,0x74,0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31, - 0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78, - 0x5f,0x32,0x31,0x35,0x20,0x3e,0x3d,0x20,0x78,0x5f,0x32,0x31,0x37,0x29,0x29,0x20, - 0x7b,0x0a,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20, - 0x20,0x7d,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a, - 0x73,0x74,0x72,0x75,0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20, - 0x7b,0x0a,0x20,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29, - 0x0a,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20, - 0x3a,0x20,0x76,0x65,0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c, - 0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x66,0x73,0x5f,0x75,0x76, - 0x30,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c, - 0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x32,0x29,0x20,0x66,0x73, - 0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20, - 0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69, - 0x6f,0x6e,0x28,0x30,0x29,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f, - 0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x29,0x20,0x2d, - 0x3e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x66, - 0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x70, - 0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74, - 0x69,0x6f,0x6e,0x20,0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f, - 0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x6e,0x6f, - 0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c, - 0x5f,0x70,0x61,0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31, - 0x28,0x29,0x3b,0x0a,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69, - 0x6e,0x5f,0x6f,0x75,0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x29,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x78,0x20,0x3d,0x20,0x78,0x5f,0x32,0x30,0x35,0x2e,0x78,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x79,0x20,0x3d,0x20, + 0x78,0x5f,0x32,0x30,0x35,0x2e,0x79,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61, + 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x78,0x5f,0x32,0x30, + 0x35,0x2e,0x7a,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78, + 0x5f,0x32,0x31,0x37,0x20,0x3a,0x20,0x66,0x33,0x32,0x20,0x3d,0x20,0x78,0x5f,0x31, + 0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74, + 0x3b,0x0a,0x20,0x20,0x6c,0x65,0x74,0x20,0x78,0x5f,0x32,0x31,0x39,0x20,0x3a,0x20, + 0x66,0x33,0x32,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x3b,0x0a,0x20,0x20,0x69,0x66,0x20,0x28,0x28,0x78,0x5f,0x32,0x31,0x37, + 0x20,0x3e,0x3d,0x20,0x78,0x5f,0x32,0x31,0x39,0x29,0x29,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x7d,0x0a,0x20, + 0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x3b,0x0a,0x7d,0x0a,0x0a,0x73,0x74,0x72,0x75, + 0x63,0x74,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20, + 0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30,0x29,0x0a,0x20,0x20,0x66, + 0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f,0x31,0x20,0x3a,0x20,0x76,0x65, + 0x63,0x34,0x66,0x2c,0x0a,0x7d,0x0a,0x0a,0x40,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e, + 0x74,0x0a,0x66,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x28,0x40,0x6c,0x6f,0x63,0x61,0x74, + 0x69,0x6f,0x6e,0x28,0x31,0x29,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x32,0x66,0x2c,0x20,0x40,0x6c,0x6f, + 0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x32,0x29,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73, + 0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61,0x72,0x61,0x6d,0x20,0x3a,0x20,0x76,0x65, + 0x63,0x33,0x66,0x2c,0x20,0x40,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x28,0x30, + 0x29,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x70,0x61,0x72,0x61, + 0x6d,0x20,0x3a,0x20,0x76,0x65,0x63,0x33,0x66,0x29,0x20,0x2d,0x3e,0x20,0x6d,0x61, + 0x69,0x6e,0x5f,0x6f,0x75,0x74,0x20,0x7b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x75,0x76, + 0x30,0x20,0x3d,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x5f,0x70,0x61,0x72,0x61,0x6d, + 0x3b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20, + 0x3d,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x5f,0x70,0x61, + 0x72,0x61,0x6d,0x3b,0x0a,0x20,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c, + 0x20,0x3d,0x20,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x5f,0x70,0x61,0x72, + 0x61,0x6d,0x3b,0x0a,0x20,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x31,0x28,0x29,0x3b,0x0a, + 0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6d,0x61,0x69,0x6e,0x5f,0x6f,0x75, + 0x74,0x28,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x29,0x3b,0x0a,0x7d, + 0x0a,0x0a,0x00, }; #endif /* SOKOL_WGPU */ #if !defined(SOKOL_GFX_INCLUDED) @@ -2937,37 +2939,37 @@ static inline const sg_shader_desc* normal_program_shader_desc(sg_backend backen desc.fs.entry = "main"; desc.fs.uniform_blocks[0].size = 144; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.uniform_blocks[0].uniforms[0].name = "_127.diffuse"; + desc.fs.uniform_blocks[0].uniforms[0].name = "_129.diffuse"; desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[0].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[1].name = "_127.ambient"; + desc.fs.uniform_blocks[0].uniforms[1].name = "_129.ambient"; desc.fs.uniform_blocks[0].uniforms[1].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[1].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[2].name = "_127.specular"; + desc.fs.uniform_blocks[0].uniforms[2].name = "_129.specular"; desc.fs.uniform_blocks[0].uniforms[2].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[2].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[3].name = "_127.emissive"; + desc.fs.uniform_blocks[0].uniforms[3].name = "_129.emissive"; desc.fs.uniform_blocks[0].uniforms[3].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[3].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[4].name = "_127.light_dir"; + desc.fs.uniform_blocks[0].uniforms[4].name = "_129.light_dir"; desc.fs.uniform_blocks[0].uniforms[4].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[4].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[5].name = "_127.light_diffuse"; + desc.fs.uniform_blocks[0].uniforms[5].name = "_129.light_diffuse"; desc.fs.uniform_blocks[0].uniforms[5].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[5].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[6].name = "_127.light_ambient"; + desc.fs.uniform_blocks[0].uniforms[6].name = "_129.light_ambient"; desc.fs.uniform_blocks[0].uniforms[6].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[6].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[7].name = "_127.light_specular"; + desc.fs.uniform_blocks[0].uniforms[7].name = "_129.light_specular"; desc.fs.uniform_blocks[0].uniforms[7].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[7].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[8].name = "_127.spec_power"; + desc.fs.uniform_blocks[0].uniforms[8].name = "_129.spec_power"; desc.fs.uniform_blocks[0].uniforms[8].type = SG_UNIFORMTYPE_FLOAT; desc.fs.uniform_blocks[0].uniforms[8].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[9].name = "_127.un_alpha_test"; + desc.fs.uniform_blocks[0].uniforms[9].name = "_129.un_alpha_test"; desc.fs.uniform_blocks[0].uniforms[9].type = SG_UNIFORMTYPE_FLOAT; desc.fs.uniform_blocks[0].uniforms[9].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[10].name = "_127.material"; + desc.fs.uniform_blocks[0].uniforms[10].name = "_129.material"; desc.fs.uniform_blocks[0].uniforms[10].type = SG_UNIFORMTYPE_INT; desc.fs.uniform_blocks[0].uniforms[10].array_count = 1; desc.fs.images[0].used = true; @@ -3005,37 +3007,37 @@ static inline const sg_shader_desc* normal_program_shader_desc(sg_backend backen desc.fs.entry = "main"; desc.fs.uniform_blocks[0].size = 144; desc.fs.uniform_blocks[0].layout = SG_UNIFORMLAYOUT_STD140; - desc.fs.uniform_blocks[0].uniforms[0].name = "_127.diffuse"; + desc.fs.uniform_blocks[0].uniforms[0].name = "_129.diffuse"; desc.fs.uniform_blocks[0].uniforms[0].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[0].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[1].name = "_127.ambient"; + desc.fs.uniform_blocks[0].uniforms[1].name = "_129.ambient"; desc.fs.uniform_blocks[0].uniforms[1].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[1].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[2].name = "_127.specular"; + desc.fs.uniform_blocks[0].uniforms[2].name = "_129.specular"; desc.fs.uniform_blocks[0].uniforms[2].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[2].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[3].name = "_127.emissive"; + desc.fs.uniform_blocks[0].uniforms[3].name = "_129.emissive"; desc.fs.uniform_blocks[0].uniforms[3].type = SG_UNIFORMTYPE_FLOAT4; desc.fs.uniform_blocks[0].uniforms[3].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[4].name = "_127.light_dir"; + desc.fs.uniform_blocks[0].uniforms[4].name = "_129.light_dir"; desc.fs.uniform_blocks[0].uniforms[4].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[4].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[5].name = "_127.light_diffuse"; + desc.fs.uniform_blocks[0].uniforms[5].name = "_129.light_diffuse"; desc.fs.uniform_blocks[0].uniforms[5].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[5].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[6].name = "_127.light_ambient"; + desc.fs.uniform_blocks[0].uniforms[6].name = "_129.light_ambient"; desc.fs.uniform_blocks[0].uniforms[6].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[6].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[7].name = "_127.light_specular"; + desc.fs.uniform_blocks[0].uniforms[7].name = "_129.light_specular"; desc.fs.uniform_blocks[0].uniforms[7].type = SG_UNIFORMTYPE_FLOAT3; desc.fs.uniform_blocks[0].uniforms[7].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[8].name = "_127.spec_power"; + desc.fs.uniform_blocks[0].uniforms[8].name = "_129.spec_power"; desc.fs.uniform_blocks[0].uniforms[8].type = SG_UNIFORMTYPE_FLOAT; desc.fs.uniform_blocks[0].uniforms[8].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[9].name = "_127.un_alpha_test"; + desc.fs.uniform_blocks[0].uniforms[9].name = "_129.un_alpha_test"; desc.fs.uniform_blocks[0].uniforms[9].type = SG_UNIFORMTYPE_FLOAT; desc.fs.uniform_blocks[0].uniforms[9].array_count = 1; - desc.fs.uniform_blocks[0].uniforms[10].name = "_127.material"; + desc.fs.uniform_blocks[0].uniforms[10].name = "_129.material"; desc.fs.uniform_blocks[0].uniforms[10].type = SG_UNIFORMTYPE_INT; desc.fs.uniform_blocks[0].uniforms[10].array_count = 1; desc.fs.images[0].used = true; diff --git a/perimeter.nix b/perimeter.nix index 6e21b2c3..dee9495d 100644 --- a/perimeter.nix +++ b/perimeter.nix @@ -31,7 +31,7 @@ }); sokol_git = builtins.fetchGit { url = https://github.com/floooh/sokol; - rev = "c0e54485457b2e1645f2d809394753b53bf50cd4"; + rev = "7f7cd64c6d9d1d4ed08d88a3879b1d69841bf0a4"; ref = "master"; }; gamemath_git = builtins.fetchGit {