From d6b3fcccc0b8c36edaa6512d562f0adc8a04eed3 Mon Sep 17 00:00:00 2001 From: Attila Kocsis Date: Wed, 19 Jun 2019 21:37:35 +0200 Subject: [PATCH] added geometryv --- scripts/genie.lua | 1 + scripts/geometryv.lua | 172 +++++ tools/geometryv/fs_mesh.bin.h | 426 +++++++++++ tools/geometryv/fs_mesh.sc | 64 ++ tools/geometryv/geometryv.cpp | 1242 ++++++++++++++++++++++++++++++++ tools/geometryv/makefile | 6 + tools/geometryv/varying.def.sc | 4 + tools/geometryv/vs_mesh.bin.h | 269 +++++++ tools/geometryv/vs_mesh.sc | 17 + 9 files changed, 2201 insertions(+) create mode 100644 scripts/geometryv.lua create mode 100644 tools/geometryv/fs_mesh.bin.h create mode 100644 tools/geometryv/fs_mesh.sc create mode 100644 tools/geometryv/geometryv.cpp create mode 100644 tools/geometryv/makefile create mode 100644 tools/geometryv/varying.def.sc create mode 100644 tools/geometryv/vs_mesh.bin.h create mode 100644 tools/geometryv/vs_mesh.sc diff --git a/scripts/genie.lua b/scripts/genie.lua index 5876caa5a..1ae2829bb 100644 --- a/scripts/genie.lua +++ b/scripts/genie.lua @@ -508,4 +508,5 @@ if _OPTIONS["with-tools"] then dofile "texturec.lua" dofile "texturev.lua" dofile "geometryc.lua" + dofile "geometryv.lua" end diff --git a/scripts/geometryv.lua b/scripts/geometryv.lua new file mode 100644 index 000000000..e852342a2 --- /dev/null +++ b/scripts/geometryv.lua @@ -0,0 +1,172 @@ +project ("geometryv") + uuid (os.uuid("geometryv") ) + kind "ConsoleApp" + + configuration {} + + includedirs { + path.join(BX_DIR, "include"), + path.join(BIMG_DIR, "include"), + path.join(BGFX_DIR, "include"), + path.join(BGFX_DIR, "3rdparty"), + path.join(BGFX_DIR, "examples/common"), + path.join(MODULE_DIR, "include"), + path.join(MODULE_DIR, "3rdparty"), + } + + files { + path.join(MODULE_DIR, "tools/geometryv/**"), + } + + links { + "example-common", + "bimg_decode", + "bimg", + "bgfx", + "bx", + } + + if _OPTIONS["with-sdl"] then + defines { "ENTRY_CONFIG_USE_SDL=1" } + links { "SDL2" } + + configuration { "x32", "windows" } + libdirs { "$(SDL2_DIR)/lib/x86" } + + configuration { "x64", "windows" } + libdirs { "$(SDL2_DIR)/lib/x64" } + + configuration {} + end + + if _OPTIONS["with-glfw"] then + defines { "ENTRY_CONFIG_USE_GLFW=1" } + links { "glfw3" } + + configuration { "linux or freebsd" } + links { + "Xrandr", + "Xinerama", + "Xi", + "Xxf86vm", + "Xcursor", + } + + configuration { "osx" } + linkoptions { + "-framework CoreVideo", + "-framework IOKit", + } + + configuration {} + end + + configuration { "vs*" } + linkoptions { + "/ignore:4199", -- LNK4199: /DELAYLOAD:*.dll ignored; no imports found from *.dll + } + links { -- this is needed only for testing with GLES2/3 on Windows with VS2008 + "DelayImp", + } + + configuration { "vs201*" } + linkoptions { -- this is needed only for testing with GLES2/3 on Windows with VS201x + "/DELAYLOAD:\"libEGL.dll\"", + "/DELAYLOAD:\"libGLESv2.dll\"", + } + + configuration { "mingw-*" } + targetextension ".exe" + + configuration { "vs20* or mingw*" } + links { + "comdlg32", + "gdi32", + "psapi", + } + + configuration { "winstore*" } + removelinks { + "DelayImp", + "gdi32", + "psapi" + } + links { + "d3d11", + "d3d12", + "dxgi" + } + linkoptions { + "/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata + } + -- WinRT targets need their own output directories are build files stomp over each other + targetdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "bin", _name)) + objdir (path.join(BGFX_BUILD_DIR, "arm_" .. _ACTION, "obj", _name)) + + configuration { "mingw-clang" } + kind "ConsoleApp" + + configuration { "android*" } + kind "ConsoleApp" + targetextension ".so" + linkoptions { + "-shared", + } + links { + "EGL", + "GLESv2", + } + + configuration { "asmjs" } + kind "ConsoleApp" + targetextension ".bc" + + configuration { "linux-* or freebsd" } + links { + "X11", + "GL", + "pthread", + } + + configuration { "rpi" } + links { + "X11", + "GLESv2", + "EGL", + "bcm_host", + "vcos", + "vchiq_arm", + "pthread", + } + + configuration { "osx" } + linkoptions { + "-framework Cocoa", + "-framework Metal", + "-framework QuartzCore", + "-framework OpenGL", + } + + configuration { "ios*" } + kind "ConsoleApp" + linkoptions { + "-framework CoreFoundation", + "-framework Foundation", + "-framework OpenGLES", + "-framework UIKit", + "-framework QuartzCore", + } + + configuration { "xcode4", "ios" } + kind "WindowedApp" + + configuration { "qnx*" } + targetextension "" + links { + "EGL", + "GLESv2", + } + + configuration {} + + strip() diff --git a/tools/geometryv/fs_mesh.bin.h b/tools/geometryv/fs_mesh.bin.h new file mode 100644 index 000000000..5ad51b410 --- /dev/null +++ b/tools/geometryv/fs_mesh.bin.h @@ -0,0 +1,426 @@ +static const uint8_t fs_mesh_glsl[1025] = +{ + 0x46, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0xf2, 0x03, 0x00, 0x00, 0x76, 0x61, // FSH....e......va + 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, // rying highp vec3 + 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x76, 0x6f, 0x69, 0x64, 0x20, // v_normal;.void + 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, // main ().{. high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x3b, // p vec3 tmpvar_1; + 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x6e, 0x6f, // . tmpvar_1 = no + 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x28, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // rmalize(v_normal + 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, // );. highp vec3 + 0x72, 0x67, 0x62, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, // rgb_2;. rgb_2 = + 0x20, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x37, 0x32, 0x39, 0x39, 0x39, 0x32, // (vec3(0.2729992 + 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x37, 0x35, 0x34, 0x37, 0x30, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x32, // , 0.2754701, 0.2 + 0x35, 0x31, 0x34, 0x30, 0x38, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, // 51408) + ((vec3( + 0x30, 0x2e, 0x33, 0x37, 0x35, 0x34, 0x30, 0x36, 0x35, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x33, // 0.3754065, 0.413 + 0x38, 0x33, 0x38, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x35, 0x38, 0x33, 0x32, 0x37, 0x29, // 8388, 0.4158327) + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x29, 0x20, 0x2f, // * tmpvar_1.x) / + 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, // 2.5));. rgb_2 + 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x76, 0x65, 0x63, // = (rgb_2 + ((vec + 0x33, 0x28, 0x30, 0x2e, 0x30, 0x35, 0x34, 0x36, 0x33, 0x31, 0x39, 0x31, 0x2c, 0x20, 0x30, 0x2e, // 3(0.05463191, 0. + 0x30, 0x35, 0x35, 0x33, 0x33, 0x36, 0x36, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x36, 0x38, 0x33, // 05533662, 0.0683 + 0x37, 0x34, 0x39, 0x38, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 7498) * tmpvar_1 + 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .y) / 2.5));. r + 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, // gb_2 = (rgb_2 + + 0x28, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x31, 0x38, 0x32, 0x32, 0x37, // ((vec3(-0.118227 + 0x33, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x31, 0x36, 0x35, 0x37, 0x38, 0x36, 0x2c, 0x20, 0x2d, // 3, -0.1165786, - + 0x30, 0x2e, 0x31, 0x31, 0x34, 0x34, 0x34, 0x32, 0x34, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, // 0.1144424) * tmp + 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x29, 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, // var_1.z) / 2.5)) + 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, // ;. rgb_2 = (rgb + 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // _2 + ((tmpvar_1. + 0x78, 0x20, 0x2a, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, // x * . (vec3(- + 0x30, 0x2e, 0x31, 0x39, 0x33, 0x30, 0x36, 0x36, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x38, 0x36, // 0.193066, -0.186 + 0x30, 0x39, 0x35, 0x33, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x36, 0x35, 0x33, 0x35, 0x31, 0x38, // 0953, -0.1653518 + 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x29, 0x0a, // ) * tmpvar_1.z). + 0x20, 0x20, 0x29, 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // ) / 2.5));. r + 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, // gb_2 = (rgb_2 + + 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x76, // ((tmpvar_1.x * v + 0x65, 0x63, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x36, 0x38, 0x31, 0x31, 0x30, 0x36, 0x33, 0x2c, 0x20, // ec3(0.06811063, + 0x30, 0x2e, 0x30, 0x36, 0x35, 0x31, 0x39, 0x32, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x32, // 0.0651928, 0.052 + 0x36, 0x30, 0x36, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // 6064)) * tmpvar_ + 0x31, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, // 1.y));. rgb_2 = + 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x76, 0x65, 0x63, 0x33, 0x28, // (rgb_2 + (vec3( + 0x30, 0x2e, 0x30, 0x30, 0x30, 0x32, 0x39, 0x32, 0x31, 0x31, 0x32, 0x33, 0x2c, 0x20, 0x2d, 0x30, // 0.0002921123, -0 + 0x2e, 0x30, 0x30, 0x35, 0x31, 0x33, 0x39, 0x37, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, // .005139745, -0.0 + 0x31, 0x33, 0x39, 0x30, 0x39, 0x34, 0x38, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, // 1390948) * (. + 0x20, 0x28, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ((3.0 * tmpvar_ + 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // 1.y) * tmpvar_1. + 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, 0x0a, // y). - 1.0)));. + 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, // rgb_2 = (rgb_2 + 0x20, 0x2b, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x20, // + ((tmpvar_1.z + 0x2a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x36, 0x31, 0x38, 0x39, 0x36, // * vec3(-0.161896 + 0x38, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x33, 0x36, 0x34, 0x39, 0x38, 0x2c, 0x20, 0x2d, // 8, -0.1536498, - + 0x30, 0x2e, 0x31, 0x33, 0x32, 0x39, 0x32, 0x33, 0x39, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, // 0.1329239)) * tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, // pvar_1.y));. rg + 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, // b_2 = (rgb_2 + ( + 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x30, 0x32, 0x31, 0x38, 0x30, 0x33, 0x36, 0x33, // vec3(-0.02180363 + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x32, 0x39, 0x38, 0x36, 0x35, 0x30, 0x37, 0x2c, 0x20, 0x2d, // , -0.02986507, - + 0x30, 0x2e, 0x30, 0x34, 0x32, 0x39, 0x33, 0x39, 0x35, 0x38, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x0a, // 0.04293958) * (. + 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x20, // (tmpvar_1.z + 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x29, 0x0a, 0x20, 0x20, // * tmpvar_1.z). + 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // - . (tmpvar_ + 0x31, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, // 1.x * tmpvar_1.x + 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, // ). )));. gl_Fr + 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x72, 0x67, // agColor.xyz = rg + 0x62, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // b_2;. gl_FragCo + 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, // lor.w = 1.0;.}.. + 0x00, // . +}; +static const uint8_t fs_mesh_spv[2562] = +{ + 0x46, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0xf0, 0x09, 0x00, 0x00, 0x03, 0x02, // FSH....e........ + 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x08, 0x00, 0x15, 0x02, 0x00, 0x00, 0x00, 0x00, // #............... + 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x06, 0x00, 0x01, 0x00, // ................ + 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, 0x35, 0x30, 0x00, 0x00, // ..GLSL.std.450.. + 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x07, 0x00, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x10, 0x00, 0x03, 0x00, 0x04, 0x00, // ......"......... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ................ + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x19, 0x01, 0x00, 0x00, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // ..........v_norm + 0x61, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x06, 0x00, 0x22, 0x01, 0x00, 0x00, 0x62, 0x67, // al........"...bg + 0x66, 0x78, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x44, 0x61, 0x74, 0x61, 0x30, 0x00, 0x00, 0x47, 0x00, // fx_FragData0..G. + 0x04, 0x00, 0x19, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..............G. + 0x04, 0x00, 0x22, 0x01, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // .."............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... + 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ + 0x04, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x14, 0xb1, 0xc4, 0xbe, 0x2b, 0x00, // ......7.......+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xfb, 0xd3, 0xd8, 0xbe, 0x2b, 0x00, // ......8.......+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x6d, 0xdf, 0xd9, 0xbe, 0x2c, 0x00, // ......9...m...,. + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x38, 0x00, // ......:...7...8. + 0x00, 0x00, 0x39, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..9...+.......=. + 0x00, 0x00, 0x00, 0xfe, 0x64, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3e, 0x00, // ....d=+.......>. + 0x00, 0x00, 0x2c, 0xf2, 0x67, 0x3d, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3f, 0x00, // ..,.g=+.......?. + 0x00, 0x00, 0x66, 0x4c, 0x8f, 0x3d, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x40, 0x00, // ..fL.=,.......@. + 0x00, 0x00, 0x3d, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..=...>...?...+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x11, 0xc7, 0xf7, 0x3d, 0x2b, 0x00, // ......C......=+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x82, 0x52, 0xf4, 0x3d, 0x2b, 0x00, // ......D....R.=+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x66, 0xd8, 0xef, 0x3d, 0x2c, 0x00, // ......E...f..=,. + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x44, 0x00, // ......F...C...D. + 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x49, 0x00, // ..E...+.......I. + 0x00, 0x00, 0xe5, 0xf3, 0x34, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4a, 0x00, // ....4.+.......J. + 0x00, 0x00, 0x5b, 0x6b, 0x2e, 0xbe, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4b, 0x00, // ..[k..+.......K. + 0x00, 0x00, 0x30, 0xfa, 0x1a, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4c, 0x00, // ..0...,.......L. + 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..I...J...K...+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x56, 0x59, 0xff, 0xbd, 0x2b, 0x00, // ......O...VY..+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0xf1, 0x68, 0xf4, 0xbd, 0x2b, 0x00, // ......P....h..+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x1f, 0x39, 0xc5, 0xbd, 0x2c, 0x00, // ......Q....9..,. + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x50, 0x00, // ......R...O...P. + 0x00, 0x00, 0x51, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x55, 0x00, // ..Q...+.......U. + 0x00, 0x00, 0x83, 0xcb, 0xf2, 0x3a, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x56, 0x00, // .....:+.......V. + 0x00, 0x00, 0x03, 0x80, 0x05, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x57, 0x00, // ......+.......W. + 0x00, 0x00, 0x8f, 0xa4, 0xb4, 0xbd, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x58, 0x00, // ......,.......X. + 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x57, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..U...V...W...+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x37, 0xbd, 0x97, 0x3e, 0x2b, 0x00, // ......[...7..>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x73, 0x02, 0x90, 0x3e, 0x2b, 0x00, // ..........s..>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x09, 0x2b, 0x79, 0x3e, 0x2c, 0x00, // ......]....+y>,. + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x5b, 0x00, 0x00, 0x00, 0x5c, 0x00, // ......^...[..... + 0x00, 0x00, 0x5d, 0x00, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x61, 0x00, // ..]...+.......a. + 0x00, 0x00, 0x2a, 0x7c, 0xa3, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x62, 0x00, // ..*|..+.......b. + 0x00, 0x00, 0x27, 0xee, 0xdf, 0xbd, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x63, 0x00, // ..'...+.......c. + 0x00, 0x00, 0x5c, 0xfb, 0x20, 0xbe, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x64, 0x00, // .... .,.......d. + 0x00, 0x00, 0x61, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x63, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..a...b...c...+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x1c, 0x2a, 0xfa, 0xbe, 0x2b, 0x00, // ......n....*..+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x1c, 0x2a, 0xfa, 0x3e, 0x2b, 0x00, // ......t....*.>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x8b, 0x3f, 0x2b, 0x00, // .............?+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x8b, 0xbf, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x01, 0x7b, 0xa1, 0x3e, 0x2b, 0x00, // ...........{.>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x2b, 0x00, // ............@@+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, // .............?+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0xa1, 0xd8, 0x0b, 0x3f, 0x2b, 0x00, // .............?+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x2b, 0x00, // .............@+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x20, 0x00, // .............? . + 0x04, 0x00, 0x18, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..............;. + 0x04, 0x00, 0x18, 0x01, 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // .............. . + 0x04, 0x00, 0x21, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..!...........;. + 0x04, 0x00, 0x21, 0x01, 0x00, 0x00, 0x22, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..!...".......+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x8e, 0xc6, 0x8b, 0x3e, 0x2b, 0x00, // .............>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0e, 0x02, 0x00, 0x00, 0x6b, 0x0a, 0x8d, 0x3e, 0x2b, 0x00, // ..........k..>+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x8e, 0xb8, 0x80, 0x3e, 0x2c, 0x00, // .............>,. + 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0x0d, 0x02, 0x00, 0x00, 0x0e, 0x02, // ................ + 0x00, 0x00, 0x0f, 0x02, 0x00, 0x00, 0x2b, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x12, 0x02, // ......+......... + 0x00, 0x00, 0xcd, 0xcc, 0xcc, 0x3e, 0x2c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x13, 0x02, // .....>,......... + 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x12, 0x02, 0x00, 0x00, 0x01, 0x00, // ................ + 0x03, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, // ..........6..... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, // ................ + 0x02, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x08, 0x00, 0x00, 0x00, 0x1a, 0x01, // ......=......... + 0x00, 0x00, 0x19, 0x01, 0x00, 0x00, 0x0c, 0x00, 0x06, 0x00, 0x08, 0x00, 0x00, 0x00, 0x3c, 0x01, // ..............<. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00, 0x1a, 0x01, 0x00, 0x00, 0x51, 0x00, // ......E.......Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, // ......[...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5c, 0x01, 0x00, 0x00, 0x6e, 0x00, // ..............n. + 0x00, 0x00, 0x5b, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x5f, 0x01, // ..[...Q......._. + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..<............. + 0x00, 0x00, 0x60, 0x01, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x51, 0x00, // ..`...t..._...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, // ......c...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x64, 0x01, 0x00, 0x00, 0x6e, 0x00, // ..........d...n. + 0x00, 0x00, 0x63, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x67, 0x01, // ..c...Q.......g. + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..<............. + 0x00, 0x00, 0x68, 0x01, 0x00, 0x00, 0x7f, 0x00, 0x00, 0x00, 0x67, 0x01, 0x00, 0x00, 0x51, 0x00, // ..h.......g...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, // ......j...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6b, 0x01, 0x00, 0x00, 0x68, 0x01, // ..........k...h. + 0x00, 0x00, 0x6a, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6e, 0x01, // ..j...Q.......n. + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..<............. + 0x00, 0x00, 0x6f, 0x01, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x6e, 0x01, 0x00, 0x00, 0x51, 0x00, // ..o.......n...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, // ......q...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x72, 0x01, 0x00, 0x00, 0x6f, 0x01, // ..........r...o. + 0x00, 0x00, 0x71, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x75, 0x01, // ..q...Q.......u. + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..<............. + 0x00, 0x00, 0x76, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x75, 0x01, 0x00, 0x00, 0x51, 0x00, // ..v.......u...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, // ......x...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x76, 0x01, // ..........y...v. + 0x00, 0x00, 0x78, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7a, 0x01, // ..x...........z. + 0x00, 0x00, 0x79, 0x01, 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..y............. + 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x7a, 0x01, 0x00, 0x00, 0x51, 0x00, // ..{.......z...Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, // ......~...<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x87, 0x00, // ................ + 0x00, 0x00, 0x7e, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x81, 0x01, // ..~...Q......... + 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ..<............. + 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x7f, 0x01, 0x00, 0x00, 0x81, 0x01, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x02, 0x00, // ..........<..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x3c, 0x01, // ..Q...........<. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x88, 0x01, // ................ + 0x00, 0x00, 0x85, 0x01, 0x00, 0x00, 0x87, 0x01, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..........Q..... + 0x00, 0x00, 0x8a, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ......<.......Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, // ..........<..... + 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x8a, 0x01, // ................ + 0x00, 0x00, 0x8c, 0x01, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x8e, 0x01, // ................ + 0x00, 0x00, 0x88, 0x01, 0x00, 0x00, 0x8d, 0x01, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x06, 0x00, // ................ + 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x00, 0x8e, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x9e, 0x01, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x00, 0x5c, 0x01, // ..........:..... + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x9e, 0x01, // ................ + 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xa1, 0x01, // ................ + 0x00, 0x00, 0x9f, 0x01, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0x10, 0x02, 0x00, 0x00, 0xa1, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x60, 0x01, // ..........@...`. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0xa8, 0x01, // ................ + 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xab, 0x01, // ................ + 0x00, 0x00, 0xa9, 0x01, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xa3, 0x01, 0x00, 0x00, 0xab, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb2, 0x01, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x64, 0x01, // ..........F...d. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0xb2, 0x01, // ................ + 0x00, 0x00, 0xc1, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xb5, 0x01, // ................ + 0x00, 0x00, 0xb3, 0x01, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xad, 0x01, 0x00, 0x00, 0xb5, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbc, 0x01, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x6b, 0x01, // ..........L...k. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0xbc, 0x01, // ................ + 0x00, 0x00, 0x97, 0x00, 0x00, 0x00, 0x85, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xbf, 0x01, // ................ + 0x00, 0x00, 0xbd, 0x01, 0x00, 0x00, 0x13, 0x02, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xb7, 0x01, 0x00, 0x00, 0xbf, 0x01, 0x00, 0x00, 0x8e, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc6, 0x01, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x72, 0x01, // ..........R...r. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0xc6, 0x01, // ................ + 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xc9, 0x01, // ................ + 0x00, 0x00, 0xc1, 0x01, 0x00, 0x00, 0xc7, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x7b, 0x01, 0x00, 0x00, 0x8e, 0x00, // ......X...{..... + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0xce, 0x01, 0x00, 0x00, 0xeb, 0x00, // ................ + 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xc9, 0x01, // ................ + 0x00, 0x00, 0xcf, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd6, 0x01, // ................ + 0x00, 0x00, 0x5e, 0x00, 0x00, 0x00, 0x82, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, // ..^............. + 0x00, 0x00, 0xd7, 0x01, 0x00, 0x00, 0xd6, 0x01, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ + 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xd1, 0x01, 0x00, 0x00, 0xd7, 0x01, // ................ + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0x64, 0x00, // ..............d. + 0x00, 0x00, 0x8f, 0x01, 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x08, 0x00, 0x00, 0x00, 0xdf, 0x01, // ................ + 0x00, 0x00, 0xde, 0x01, 0x00, 0x00, 0xeb, 0x00, 0x00, 0x00, 0x81, 0x00, 0x05, 0x00, 0x08, 0x00, // ................ + 0x00, 0x00, 0xe1, 0x01, 0x00, 0x00, 0xd9, 0x01, 0x00, 0x00, 0xdf, 0x01, 0x00, 0x00, 0x4f, 0x00, // ..............O. + 0x09, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x14, 0x02, 0x00, 0x00, 0xe1, 0x01, // ......@......... + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, // ................ + 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0x97, 0x00, // ..R............. + 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x22, 0x01, // ..@.......>...". + 0x00, 0x00, 0x0a, 0x02, 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x00, // ..........8..... + 0x00, 0x00, // .. +}; +static const uint8_t fs_mesh_dx9[671] = +{ + 0x46, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x90, 0x02, 0x00, 0x00, 0x00, 0x03, // FSH....e........ + 0xff, 0xff, 0xfe, 0xff, 0x17, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, 0x00, 0x00, 0x23, 0x00, // ......CTAB....#. + 0x00, 0x00, 0x00, 0x03, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x91, // ................ + 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x70, 0x73, 0x5f, 0x33, 0x5f, 0x30, 0x00, 0x4d, 0x69, 0x63, // ......ps_3_0.Mic + 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, // rosoft (R) HLSL + 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, // Shader Compiler + 0x36, 0x2e, 0x33, 0x2e, 0x39, 0x36, 0x30, 0x30, 0x2e, 0x31, 0x38, 0x36, 0x31, 0x31, 0x00, 0xab, // 6.3.9600.18611.. + 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x00, 0x00, 0x0f, 0xa0, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, // ..Q.........@@.. + 0x80, 0xbf, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x01, 0x00, // .....?....Q..... + 0x0f, 0xa0, 0x8e, 0xc6, 0x8b, 0x3e, 0x6b, 0x0a, 0x8d, 0x3e, 0x8e, 0xb8, 0x80, 0x3e, 0x00, 0x00, // .....>k..>...>.. + 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x02, 0x00, 0x0f, 0xa0, 0x3a, 0xc4, 0x19, 0x3e, 0x25, 0x82, // ..Q.......:..>%. + 0x29, 0x3e, 0x39, 0x53, 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x03, 0x00, // )>9S*>....Q..... + 0x0f, 0xa0, 0x92, 0x04, 0xb3, 0x3c, 0xb8, 0x53, 0xb5, 0x3c, 0x16, 0x0d, 0xe0, 0x3c, 0x00, 0x00, // .....<.S.<...<.. + 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x04, 0x00, 0x0f, 0xa0, 0x20, 0xb4, 0x41, 0xbd, 0x9c, 0x00, // ..Q....... .A... + 0x3f, 0xbd, 0xa0, 0x80, 0x3b, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x05, 0x00, // ?...;.....Q..... + 0x0f, 0xa0, 0xe2, 0x28, 0x9e, 0xbd, 0x04, 0x73, 0x98, 0xbd, 0xc8, 0x74, 0x87, 0xbd, 0x00, 0x00, // ...(...s...t.... + 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x06, 0x00, 0x0f, 0xa0, 0x96, 0x7d, 0x8b, 0x3d, 0xcd, 0x83, // ..Q........}.=.. + 0x85, 0x3d, 0xd0, 0x79, 0x57, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x07, 0x00, // .=.yW=....Q..... + 0x0f, 0xa0, 0xa6, 0x26, 0x99, 0x39, 0x4e, 0x6b, 0xa8, 0xbb, 0x93, 0xe4, 0x63, 0xbc, 0x00, 0x00, // ...&.9Nk....c... + 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x08, 0x00, 0x0f, 0xa0, 0x48, 0xc8, 0x25, 0xbe, 0x62, 0x56, // ..Q.......H.%.bV + 0x1d, 0xbe, 0x37, 0x1d, 0x08, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x00, 0x05, 0x09, 0x00, // ..7.......Q..... + 0x0f, 0xa0, 0x85, 0x9d, 0xb2, 0xbc, 0x9a, 0xa7, 0xf4, 0xbc, 0x69, 0xe1, 0x2f, 0xbd, 0x00, 0x00, // ..........i./... + 0x00, 0x00, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x07, 0x90, 0x08, 0x00, // ................ + 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0xe4, 0x90, 0x00, 0x00, 0xe4, 0x90, 0x07, 0x00, // ................ + 0x00, 0x02, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, 0x00, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, // ................ + 0x0f, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x90, 0x90, 0x01, 0x00, 0x00, 0x02, 0x01, 0x00, // ................ + 0x07, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, // ................ + 0x55, 0x80, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, // U............... + 0x07, 0x80, 0x00, 0x00, 0xaa, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, // ................ + 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0xff, 0x80, 0x04, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................ + 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x02, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0x80, 0x00, 0x00, // ................ + 0xab, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0x00, 0x80, 0x05, 0x00, // ................ + 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, // ................ + 0x55, 0x80, 0x06, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // U............... + 0x01, 0x80, 0x02, 0x00, 0xaa, 0x80, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x55, 0xa0, 0x04, 0x00, // ............U... + 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x00, 0x00, 0x00, 0x80, 0x07, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................ + 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x01, 0x00, 0x07, 0x80, 0x02, 0x00, 0xff, 0x80, 0x08, 0x00, // ................ + 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x05, 0x00, 0x00, 0x03, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // ................ + 0x55, 0x80, 0x00, 0x00, 0x55, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x80, 0x00, 0x00, // U...U........... + 0xff, 0x80, 0x00, 0x00, 0xff, 0x80, 0x00, 0x00, 0x00, 0x81, 0x04, 0x00, 0x00, 0x04, 0x00, 0x08, // ................ + 0x07, 0x80, 0x00, 0x00, 0x00, 0x80, 0x09, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0xe4, 0x80, 0x01, 0x00, // ................ + 0x00, 0x02, 0x00, 0x08, 0x08, 0x80, 0x00, 0x00, 0xaa, 0xa0, 0xff, 0xff, 0x00, 0x00, 0x00, // ............... +}; +static const uint8_t fs_mesh_dx11[874] = +{ + 0x46, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0x44, 0x58, // FSH....e..X...DX + 0x42, 0x43, 0x44, 0x44, 0xd1, 0x1e, 0x9d, 0xd3, 0x3f, 0xa4, 0x1f, 0x99, 0x9d, 0x06, 0x1d, 0x10, // BCDD....?....... + 0x35, 0xc7, 0x01, 0x00, 0x00, 0x00, 0x58, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // 5.....X.......,. + 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x49, 0x53, 0x47, 0x4e, 0x4c, 0x00, // ..........ISGNL. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........8..... + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, // ................ + 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, // ..D............. + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x4f, 0x53, // ..........SV_POS + 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, 0x00, 0xab, 0x4f, 0x53, // ITION.NORMAL..OS + 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, // GN,........... . + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, // ......SV_TARGET. + 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0x9c, 0x02, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0xa7, 0x00, // ..SHDR....@..... + 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, // ..b...r.......e. + 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x03, 0x00, // ... ......h..... + 0x00, 0x00, 0x10, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, // ..............F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x44, 0x00, // ......F.......D. + 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, // ..8............. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x19, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, // ..............2. + 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, // ..r.......V..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x3a, 0xc4, 0x19, 0x3e, 0x25, 0x82, 0x29, 0x3e, 0x39, 0x53, // ...@..:..>%.)>9S + 0x2a, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x8e, 0xc6, 0x8b, 0x3e, 0x6b, 0x0a, // *>.....@.....>k. + 0x8d, 0x3e, 0x8e, 0xb8, 0x80, 0x3e, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // .>...>....2...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ + 0x00, 0x00, 0x92, 0x04, 0xb3, 0x3c, 0xb8, 0x53, 0xb5, 0x3c, 0x16, 0x0d, 0xe0, 0x3c, 0x00, 0x00, // .....<.S.<...<.. + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // ..F.......2...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ + 0x00, 0x00, 0x20, 0xb4, 0x41, 0xbd, 0x9c, 0x00, 0x3f, 0xbd, 0xa0, 0x80, 0x3b, 0xbd, 0x00, 0x00, // .. .A...?...;... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, // ..F.......8..... + 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x0a, // ......F......... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2...r..... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xe2, 0x28, // ...........@...( + 0x9e, 0xbd, 0x04, 0x73, 0x98, 0xbd, 0xc8, 0x74, 0x87, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // ...s...t......F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, // ......2...r..... + 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x96, 0x7d, // ..V........@...} + 0x8b, 0x3d, 0xcd, 0x83, 0x85, 0x3d, 0xd0, 0x79, 0x57, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, // .=...=.yW=....F. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ..*........@.... + 0x40, 0x40, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // @@.@......2...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ + 0x00, 0x00, 0xa6, 0x26, 0x99, 0x39, 0x4e, 0x6b, 0xa8, 0xbb, 0x93, 0xe4, 0x63, 0xbc, 0x00, 0x00, // ...&.9Nk....c... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0x72, 0x00, // ..F.......2...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, // ...............@ + 0x00, 0x00, 0x48, 0xc8, 0x25, 0xbe, 0x62, 0x56, 0x1d, 0xbe, 0x37, 0x1d, 0x08, 0xbe, 0x00, 0x00, // ..H.%.bV..7..... + 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x12, 0x00, // ..F.......8..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, // ................ + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x00, 0x00, // ..:.......:..... + 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, // ......A.......2. + 0x00, 0x0c, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, // ..r ............ + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x85, 0x9d, 0xb2, 0xbc, 0x9a, 0xa7, 0xf4, 0xbc, 0x69, 0xe1, // ...@..........i. + 0x2f, 0xbd, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, // /.....F.......6. + 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, // ... .......@.... + 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, // .?>....... +}; +static const uint8_t fs_mesh_mtl[1365] = +{ + 0x46, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x00, 0x00, 0x46, 0x05, 0x00, 0x00, 0x75, 0x73, // FSH....e..F...us + 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, 0x65, 0x20, 0x6d, 0x65, // ing namespace me + 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // tal;.struct xlat + 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x7b, // MtlShaderInput { + 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // . float3 v_norm + 0x61, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, // al;.};.struct xl + 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, // atMtlShaderOutpu + 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, // t {. float4 gl_ + 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, // FragColor;.};.st + 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ruct xlatMtlShad + 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x7d, 0x3b, 0x0a, 0x66, // erUniform {.};.f + 0x72, 0x61, 0x67, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, // ragment xlatMtlS + 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, // haderOutput xlat + 0x4d, 0x74, 0x6c, 0x4d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // MtlMain (xlatMtl + 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ShaderInput _mtl + 0x5f, 0x69, 0x20, 0x5b, 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, // _i [[stage_in]], + 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // constant xlatMt + 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, // lShaderUniform& + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, // _mtl_u [[buffer( + 0x30, 0x29, 0x5d, 0x5d, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, // 0)]]).{. xlatMt + 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, // lShaderOutput _m + 0x74, 0x6c, 0x5f, 0x6f, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x74, // tl_o;. float3 t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // mpvar_1 = 0;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // mpvar_1 = normal + 0x69, 0x7a, 0x65, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // ize(_mtl_i.v_nor + 0x6d, 0x61, 0x6c, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x72, // mal);. float3 r + 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, // gb_2 = 0;. rgb_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x32, 0x37, // 2 = (float3(0.27 + 0x32, 0x39, 0x39, 0x39, 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x37, 0x35, 0x34, 0x37, 0x30, 0x31, // 29992, 0.2754701 + 0x2c, 0x20, 0x30, 0x2e, 0x32, 0x35, 0x31, 0x34, 0x30, 0x38, 0x29, 0x20, 0x2b, 0x20, 0x28, 0x28, // , 0.251408) + (( + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x33, 0x37, 0x35, 0x34, 0x30, 0x36, 0x35, // float3(0.3754065 + 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x31, 0x33, 0x38, 0x33, 0x38, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x34, // , 0.4138388, 0.4 + 0x31, 0x35, 0x38, 0x33, 0x32, 0x37, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // 158327) * tmpvar + 0x5f, 0x31, 0x2e, 0x78, 0x29, 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, // _1.x) / 2.5));. + 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, // rgb_2 = (rgb_2 + 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x35, 0x34, // + ((float3(0.054 + 0x36, 0x33, 0x31, 0x39, 0x31, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x35, 0x33, 0x33, 0x36, 0x36, // 63191, 0.0553366 + 0x32, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x36, 0x38, 0x33, 0x37, 0x34, 0x39, 0x38, 0x29, 0x20, 0x2a, // 2, 0.06837498) * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2f, 0x20, 0x32, // tmpvar_1.y) / 2 + 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, // .5));. rgb_2 = + 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, // (rgb_2 + ((float + 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x31, 0x38, 0x32, 0x32, 0x37, 0x33, 0x2c, 0x20, 0x2d, 0x30, // 3(-0.1182273, -0 + 0x2e, 0x31, 0x31, 0x36, 0x35, 0x37, 0x38, 0x36, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x31, 0x34, // .1165786, -0.114 + 0x34, 0x34, 0x32, 0x34, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 4424) * tmpvar_1 + 0x2e, 0x7a, 0x29, 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, // .z) / 2.5));. r + 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, // gb_2 = (rgb_2 + + 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x0a, // ((tmpvar_1.x * . + 0x20, 0x20, 0x20, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, // (float3(-0.1 + 0x39, 0x33, 0x30, 0x36, 0x36, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x38, 0x36, 0x30, 0x39, 0x35, // 93066, -0.186095 + 0x33, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x36, 0x35, 0x33, 0x35, 0x31, 0x38, 0x29, 0x20, 0x2a, // 3, -0.1653518) * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, 0x29, 0x0a, 0x20, 0x20, 0x29, // tmpvar_1.z). ) + 0x20, 0x2f, 0x20, 0x32, 0x2e, 0x35, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, // / 2.5));. rgb_ + 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x74, // 2 = (rgb_2 + ((t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, // mpvar_1.x * floa + 0x74, 0x33, 0x28, 0x30, 0x2e, 0x30, 0x36, 0x38, 0x31, 0x31, 0x30, 0x36, 0x33, 0x2c, 0x20, 0x30, // t3(0.06811063, 0 + 0x2e, 0x30, 0x36, 0x35, 0x31, 0x39, 0x32, 0x38, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x35, 0x32, 0x36, // .0651928, 0.0526 + 0x30, 0x36, 0x34, 0x29, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // 064)) * tmpvar_1 + 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, // .y));. rgb_2 = + 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x2b, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, // (rgb_2 + (float3 + 0x28, 0x30, 0x2e, 0x30, 0x30, 0x30, 0x32, 0x39, 0x32, 0x31, 0x31, 0x32, 0x33, 0x2c, 0x20, 0x2d, // (0.0002921123, - + 0x30, 0x2e, 0x30, 0x30, 0x35, 0x31, 0x33, 0x39, 0x37, 0x34, 0x35, 0x2c, 0x20, 0x2d, 0x30, 0x2e, // 0.005139745, -0. + 0x30, 0x31, 0x33, 0x39, 0x30, 0x39, 0x34, 0x38, 0x29, 0x20, 0x2a, 0x20, 0x28, 0x0a, 0x20, 0x20, // 01390948) * (. + 0x20, 0x20, 0x28, 0x28, 0x33, 0x2e, 0x30, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // ((3.0 * tmpvar + 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, // _1.y) * tmpvar_1 + 0x2e, 0x79, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x3b, // .y). - 1.0))); + 0x0a, 0x20, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, // . rgb_2 = (rgb_ + 0x32, 0x20, 0x2b, 0x20, 0x28, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x7a, // 2 + ((tmpvar_1.z + 0x20, 0x2a, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x31, 0x36, 0x31, // * float3(-0.161 + 0x38, 0x39, 0x36, 0x38, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x35, 0x33, 0x36, 0x34, 0x39, 0x38, // 8968, -0.1536498 + 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x31, 0x33, 0x32, 0x39, 0x32, 0x33, 0x39, 0x29, 0x29, 0x20, 0x2a, // , -0.1329239)) * + 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x79, 0x29, 0x29, 0x3b, 0x0a, 0x20, // tmpvar_1.y));. + 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, 0x3d, 0x20, 0x28, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x20, // rgb_2 = (rgb_2 + 0x2b, 0x20, 0x28, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x28, 0x2d, 0x30, 0x2e, 0x30, 0x32, 0x31, // + (float3(-0.021 + 0x38, 0x30, 0x33, 0x36, 0x33, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x32, 0x39, 0x38, 0x36, 0x35, // 80363, -0.029865 + 0x30, 0x37, 0x2c, 0x20, 0x2d, 0x30, 0x2e, 0x30, 0x34, 0x32, 0x39, 0x33, 0x39, 0x35, 0x38, 0x29, // 07, -0.04293958) + 0x20, 0x2a, 0x20, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // * (. (tmpvar + 0x5f, 0x31, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, // _1.z * tmpvar_1. + 0x7a, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x2d, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x28, 0x74, 0x6d, // z). - . (tm + 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // pvar_1.x * tmpva + 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x29, 0x0a, 0x20, 0x20, 0x29, 0x29, 0x29, 0x3b, 0x0a, 0x20, 0x20, // r_1.x). )));. + 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, 0x67, 0x43, 0x6f, // _mtl_o.gl_FragCo + 0x6c, 0x6f, 0x72, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x72, 0x67, 0x62, 0x5f, 0x32, 0x3b, // lor.xyz = rgb_2; + 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x46, 0x72, 0x61, // . _mtl_o.gl_Fra + 0x67, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, // gColor.w = 1.0;. + 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x3b, // return _mtl_o; + 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // .}... +}; +extern const uint8_t* fs_mesh_pssl; +extern const uint32_t fs_mesh_pssl_size; diff --git a/tools/geometryv/fs_mesh.sc b/tools/geometryv/fs_mesh.sc new file mode 100644 index 000000000..67f5d248d --- /dev/null +++ b/tools/geometryv/fs_mesh.sc @@ -0,0 +1,64 @@ +$input v_normal + +/* + * Copyright 2019 Attila Kocsis. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + */ + +#include + + +// this is from 28-wireframe/fs_wf_mesh.sc by Dario Manesku +vec3 evalSh(vec3 _dir) +{ +# define k01 0.2820947918 // sqrt( 1/PI)/2 +# define k02 0.4886025119 // sqrt( 3/PI)/2 +# define k03 1.0925484306 // sqrt(15/PI)/2 +# define k04 0.3153915652 // sqrt( 5/PI)/4 +# define k05 0.5462742153 // sqrt(15/PI)/4 + + vec3 shEnv[9]; + shEnv[0] = vec3( 0.967757057878229854, 0.976516067990363390, 0.891218272348969998); /* Band 0 */ + shEnv[1] = vec3(-0.384163503608655643, -0.423492289131209787, -0.425532726148547868); /* Band 1 */ + shEnv[2] = vec3( 0.055906294587354334, 0.056627436881069373, 0.069969936396987467); + shEnv[3] = vec3( 0.120985157386215209, 0.119297994074027414, 0.117111965829213599); + shEnv[4] = vec3(-0.176711633774331106, -0.170331404095516392, -0.151345020570876621); /* Band 2 */ + shEnv[5] = vec3(-0.124682114349692147, -0.119340785411183953, -0.096300354204368860); + shEnv[6] = vec3( 0.001852378550138503, -0.032592784164597745, -0.088204495001329680); + shEnv[7] = vec3( 0.296365482782109446, 0.281268696656263029, 0.243328223888495510); + shEnv[8] = vec3(-0.079826665303240341, -0.109340956251195970, -0.157208859664677764); + + vec3 nn = _dir.zxy; + + float sh[9]; + sh[0] = k01; + sh[1] = -k02*nn.y; + sh[2] = k02*nn.z; + sh[3] = -k02*nn.x; + sh[4] = k03*nn.y*nn.x; + sh[5] = -k03*nn.y*nn.z; + sh[6] = k04*(3.0*nn.z*nn.z-1.0); + sh[7] = -k03*nn.x*nn.z; + sh[8] = k05*(nn.x*nn.x-nn.y*nn.y); + + vec3 rgb = vec3_splat(0.0); + rgb += shEnv[0] * sh[0] * 1.0; + rgb += shEnv[1] * sh[1] * 2.0/2.5; + rgb += shEnv[2] * sh[2] * 2.0/2.5; + rgb += shEnv[3] * sh[3] * 2.0/2.5; + rgb += shEnv[4] * sh[4] * 1.0/2.5; + rgb += shEnv[5] * sh[5] * 0.5; + rgb += shEnv[6] * sh[6] * 0.5; + rgb += shEnv[7] * sh[7] * 0.5; + rgb += shEnv[8] * sh[8] * 0.5; + + return rgb; +} + +void main() +{ + vec3 nn = normalize(v_normal); + + gl_FragColor.xyz = evalSh(nn); + gl_FragColor.w = 1.0; +} diff --git a/tools/geometryv/geometryv.cpp b/tools/geometryv/geometryv.cpp new file mode 100644 index 000000000..bde6f8d00 --- /dev/null +++ b/tools/geometryv/geometryv.cpp @@ -0,0 +1,1242 @@ +/* + * Copyright 2019-2019 Attila Kocsis. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + */ + +#include "common.h" + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +namespace stl = tinystl; +#include +#include + +#include + +#include "vs_mesh.bin.h" +#include "fs_mesh.bin.h" + +#define SCENE_VIEW_ID 0 + +#define BGFX_GEOMETRYV_VERSION_MAJOR 1 +#define BGFX_GEOMETRYV_VERSION_MINOR 0 + +static const bgfx::EmbeddedShader s_embeddedShaders[] = +{ + BGFX_EMBEDDED_SHADER(vs_mesh), + BGFX_EMBEDDED_SHADER(fs_mesh), + + BGFX_EMBEDDED_SHADER_END() +}; + +static const char* s_supportedExt[] = +{ + "bin", +}; + +struct Binding +{ + enum Enum + { + App, + View, + Help, + About, + + Count + }; +}; + +static const InputBinding s_bindingApp[] = +{ + { entry::Key::KeyQ, entry::Modifier::None, 1, NULL, "exit" }, + { entry::Key::KeyF, entry::Modifier::None, 1, NULL, "graphics fullscreen" }, + + INPUT_BINDING_END +}; + +const char* s_resetCmd = + "view dolly\n" + "view orbit\n" + ; + +static const InputBinding s_bindingView[] = +{ + { entry::Key::Esc, entry::Modifier::None, 1, NULL, "exit" }, + + { entry::Key::Key1, entry::Modifier::None, 1, NULL, "view dolly" }, + + { entry::Key::Key0, entry::Modifier::None, 1, NULL, s_resetCmd }, + { entry::Key::Plus, entry::Modifier::None, 1, NULL, "view dolly +0.1" }, + { entry::Key::Minus, entry::Modifier::None, 1, NULL, "view dolly -0.1" }, + + { entry::Key::KeyW, entry::Modifier::None, 1, NULL, "view orbit y -0.1" }, + { entry::Key::KeyS, entry::Modifier::None, 1, NULL, "view orbit y +0.1" }, + { entry::Key::KeyA, entry::Modifier::None, 1, NULL, "view orbit x +0.1" }, + { entry::Key::KeyD, entry::Modifier::None, 1, NULL, "view orbit x -0.1" }, + + { entry::Key::Up, entry::Modifier::None, 1, NULL, "view file-up" }, + { entry::Key::Down, entry::Modifier::None, 1, NULL, "view file-down" }, + + { entry::Key::KeyI, entry::Modifier::None, 1, NULL, "view info" }, + + { entry::Key::KeyH, entry::Modifier::None, 1, NULL, "view help" }, + + { entry::Key::Return, entry::Modifier::None, 1, NULL, "view files" }, + + { entry::Key::Space, entry::Modifier::None, 1, NULL, "view geo\n" }, + + INPUT_BINDING_END +}; + +static const InputBinding s_bindingHelp[] = +{ + { entry::Key::Esc, entry::Modifier::None, 1, NULL, "view help" }, + { entry::Key::KeyH, entry::Modifier::None, 1, NULL, "view help" }, + INPUT_BINDING_END +}; + +static const InputBinding s_bindingAbout[] = +{ + { entry::Key::Esc, entry::Modifier::None, 1, NULL, "view about" }, + INPUT_BINDING_END +}; + +static const char* s_bindingName[] = +{ + "App", + "View", + "Help", + "About", +}; +BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_bindingName) ); + +static const InputBinding* s_binding[] = +{ + s_bindingApp, + s_bindingView, + s_bindingHelp, + s_bindingAbout, +}; +BX_STATIC_ASSERT(Binding::Count == BX_COUNTOF(s_binding) ); + +static const char* s_filter = "" + "Bgfx geometry (bin) | *.bin\n" + ; + +struct Camera +{ + Camera() + { + init(bx::Vec3(0.0f,0.0f,0.0f), 2.0f); + } + + void init(const bx::Vec3& _center, float _distance) + { + m_target.curr = _center; + m_target.dest = _center; + + m_pos.curr = _center; + m_pos.curr.z -= _distance; + m_pos.dest = _center; + m_pos.dest.z -= _distance; + + m_orbit[0] = 0.0f; + m_orbit[1] = 0.0f; + } + + void mtxLookAt(float* _outViewMtx) + { + bx::mtxLookAt(_outViewMtx, m_pos.curr, m_target.curr); + } + + void orbit(float _dx, float _dy) + { + m_orbit[0] += _dx; + m_orbit[1] += _dy; + } + + void distance(float _z) + { + const float cnear = 1.0f; + const float cfar = 100.0f; + + _z = bx::clamp(_z, cnear, cfar); + + bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest); + bx::Vec3 toTargetNorm = bx::normalize(toTarget); + + m_pos.dest = bx::mad(toTargetNorm, -_z, m_target.dest); + } + + void dolly(float _dz) + { + const float cnear = 1.0f; + const float cfar = 100.0f; + + const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest); + const float toTargetLen = bx::length(toTarget); + const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin); + const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen); + + float delta = toTargetLen * _dz; + float newLen = toTargetLen + delta; + if ( (cnear < newLen || _dz < 0.0f) + && (newLen < cfar || _dz > 0.0f) ) + { + m_pos.dest = bx::mad(toTargetNorm, delta, m_pos.dest); + } + } + + void consumeOrbit(float _amount) + { + float consume[2]; + consume[0] = m_orbit[0] * _amount; + consume[1] = m_orbit[1] * _amount; + m_orbit[0] -= consume[0]; + m_orbit[1] -= consume[1]; + + const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr); + const float toPosLen = bx::length(toPos); + const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin); + const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen); + + float ll[2]; + bx::toLatLong(&ll[0], &ll[1], toPosNorm); + ll[0] += consume[0]; + ll[1] -= consume[1]; + ll[1] = bx::clamp(ll[1], 0.02f, 0.98f); + + const bx::Vec3 tmp = bx::fromLatLong(ll[0], ll[1]); + const bx::Vec3 diff = bx::mul(bx::sub(tmp, toPosNorm), toPosLen); + + m_pos.curr = bx::add(m_pos.curr, diff); + m_pos.dest = bx::add(m_pos.dest, diff); + } + + void update(float _dt) + { + const float amount = bx::min(_dt / 0.12f, 1.0f); + + consumeOrbit(amount); + + m_target.curr = bx::lerp(m_target.curr, m_target.dest, amount); + m_pos.curr = bx::lerp(m_pos.curr, m_pos.dest, amount); + } + + struct Interp3f + { + bx::Vec3 curr; + bx::Vec3 dest; + }; + + Interp3f m_target; + Interp3f m_pos; + float m_orbit[2]; +}; + +struct Mouse +{ + Mouse() + { + m_dx = 0.0f; + m_dy = 0.0f; + m_prevMx = 0.0f; + m_prevMx = 0.0f; + m_scroll = 0; + m_scrollPrev = 0; + } + + void update(float _mx, float _my, int32_t _mz, uint32_t _width, uint32_t _height) + { + const float widthf = float(int32_t(_width)); + const float heightf = float(int32_t(_height)); + + // Delta movement. + m_dx = float(_mx - m_prevMx)/widthf; + m_dy = float(_my - m_prevMy)/heightf; + + m_prevMx = _mx; + m_prevMy = _my; + + // Scroll. + m_scroll = _mz - m_scrollPrev; + m_scrollPrev = _mz; + } + + float m_dx; // Screen space. + float m_dy; + float m_prevMx; + float m_prevMy; + int32_t m_scroll; + int32_t m_scrollPrev; +}; + +struct View +{ + View() + : m_fileIndex(0) + , m_width(1280) + , m_height(720) + , m_help(false) + , m_about(false) + , m_info(false) + , m_files(false) + , m_meshCenter(0.0f,0.0f,0.0f) + , m_meshRadius(1.0f) + , m_idleTimer(0.0f) + { + load(); + } + + ~View() + { + } + int32_t cmd(int32_t _argc, char const* const* _argv) + { + if (_argc >= 2) + { + if (0 == bx::strCmp(_argv[1], "file-up") ) + { + m_fileIndex = bx::uint32_satsub(m_fileIndex, 1); + } + else if (0 == bx::strCmp(_argv[1], "file-down") ) + { + uint32_t numFiles = bx::uint32_satsub(uint32_t(m_fileList.size() ), 1); + ++m_fileIndex; + m_fileIndex = bx::uint32_min(m_fileIndex, numFiles); + } + else if (0 == bx::strCmp(_argv[1], "help") ) + { + m_help ^= true; + } + else if (0 == bx::strCmp(_argv[1], "about") ) + { + m_about ^= true; + } + else if (0 == bx::strCmp(_argv[1], "save") ) + { + save(); + } + else if (0 == bx::strCmp(_argv[1], "info") ) + { + m_info ^= true; + } + else if (0 == bx::strCmp(_argv[1], "files") ) + { + m_files ^= true; + } + else if (0 == bx::strCmp(_argv[1], "dolly") ) + { + if (_argc >= 3) + { + float dolly; + bx::fromString(&dolly, _argv[2]); + + if (_argv[2][0] == '+' + || _argv[2][0] == '-') + { + m_camera.dolly(dolly); + m_idleTimer = 0.0f; + } + } + else + { + m_camera.distance(m_meshRadius * 2.0f); + } + } + else if (0 == bx::strCmp(_argv[1], "orbit") ) + { + if (_argc >= 4) + { + int axis = (_argv[2][0] == 'x' ? 0 : 1); + float orbit[2] = { 0.0f, 0.0f}; + bx::fromString(&orbit[axis], _argv[3]); + + m_camera.orbit(orbit[0], orbit[1]); + m_idleTimer = 0.0f; + } + else + { + m_camera.m_target.dest = m_meshCenter; + + m_camera.m_pos.dest = m_meshCenter; + m_camera.m_pos.dest.z -= m_meshRadius * 2.0f; + + m_camera.m_orbit[0] = 0.0f; + m_camera.m_orbit[1] = 0.0f; + } + } + } + + return 0; + } + + static bool sortNameAscending(const std::string& _lhs, const std::string& _rhs) + { + return 0 > bx::strCmpV(_lhs.c_str(), _rhs.c_str() ); + } + + void updateFileList(const bx::FilePath& _filePath) + { + bx::DirectoryReader dr; + + if (bx::open(&dr, _filePath) ) + { + m_path = _filePath; + } + else if (bx::open(&dr, _filePath.getPath() ) ) + { + m_path = _filePath.getPath(); + } + else + { + DBG("File path `%s` not found.", _filePath.getCPtr() ); + return; + } + + bx::Error err; + + m_fileList.clear(); + + while (err.isOk() ) + { + bx::FileInfo fi; + bx::read(&dr, fi, &err); + + if (err.isOk() + && bx::FileType::File == fi.type) + { + bx::StringView ext = fi.filePath.getExt(); + + if (!ext.isEmpty() ) + { + ext.set(ext.getPtr()+1, ext.getTerm() ); + + bool supported = false; + for (uint32_t ii = 0; ii < BX_COUNTOF(s_supportedExt); ++ii) + { + const bx::StringView supportedExt(s_supportedExt[ii]); + + if (0 == bx::strCmpI(bx::max(ext.getPtr(), ext.getTerm() - supportedExt.getLength() ), supportedExt) ) + { + supported = true; + break; + } + } + + if (supported) + { + const bx::StringView fileName = fi.filePath.getFileName(); + m_fileList.push_back(std::string(fileName.getPtr(), fileName.getTerm() ) ); + } + } + } + } + + bx::close(&dr); + + std::sort(m_fileList.begin(), m_fileList.end(), sortNameAscending); + + m_fileIndex = 0; + uint32_t idx = 0; + + const bx::StringView fileName = _filePath.getFileName(); + + for (FileList::const_iterator it = m_fileList.begin(); it != m_fileList.end(); ++it, ++idx) + { + if (0 == bx::strCmpI(it->c_str(), fileName) ) + { + // If it is case-insensitive match then might be correct one, but keep + // searching. + m_fileIndex = idx; + + if (0 == bx::strCmp(it->c_str(), fileName) ) + { + // If it is exact match we're done. + break; + } + } + } + } + + void load() + { + bx::FilePath filePath(bx::Dir::Home); + filePath.join(".config/bgfx/geometryv.ini"); + + bx::Settings settings(entry::getAllocator() ); + + bx::FileReader reader; + if (bx::open(&reader, filePath) ) + { + bx::read(&reader, settings); + bx::close(&reader); + + if (!bx::fromString(&m_width, settings.get("view/width") ) ) + { + m_width = 1280; + } + + if (!bx::fromString(&m_height, settings.get("view/height") ) ) + { + m_height = 720; + } + } + } + + void save() + { + bx::FilePath filePath(bx::Dir::Home); + filePath.join(".config/bgfx/geometryv.ini"); + + if (bx::makeAll(filePath.getPath() ) ) + { + bx::Settings settings(entry::getAllocator() ); + + char tmp[256]; + + bx::toString(tmp, sizeof(tmp), m_width); + settings.set("view/width", tmp); + + bx::toString(tmp, sizeof(tmp), m_height); + settings.set("view/height", tmp); + + bx::FileWriter writer; + if (bx::open(&writer, filePath) ) + { + bx::write(&writer, settings); + bx::close(&writer); + } + } + } + + bx::FilePath m_path; + + typedef stl::vector FileList; + FileList m_fileList; + + uint32_t m_fileIndex; + uint32_t m_width; + uint32_t m_height; + bool m_help; + bool m_about; + bool m_info; + bool m_files; + + Camera m_camera; + Mouse m_mouse; + bx::Vec3 m_meshCenter; + float m_meshRadius; + float m_idleTimer; + +}; + +int cmdView(CmdContext* /*_context*/, void* _userData, int _argc, char const* const* _argv) +{ + View* view = static_cast(_userData); + return view->cmd(_argc, _argv); +} + +template +struct InterpolatorT +{ + float from; + float to; + float duration; + int64_t offset; + + InterpolatorT(float _value) + { + reset(_value); + } + + void reset(float _value) + { + from = _value; + to = _value; + duration = 0.0; + offset = bx::getHPCounter(); + } + + void set(float _value, float _duration) + { + if (_value != to) + { + from = getValue(); + to = _value; + duration = _duration; + offset = bx::getHPCounter(); + } + } + + float getValue() + { + if (isActive() ) + { + const double freq = double(bx::getHPFrequency() ); + int64_t now = bx::getHPCounter(); + float time = (float)(double(now - offset) / freq); + float lerp = bx::clamp(time, 0.0f, duration) / duration; + return lerpT(from, to, easeT(lerp) ); + } + + return to; + } + + bool isActive() const + { + const double freq = double(bx::getHPFrequency() ); + int64_t now = bx::getHPCounter(); + float time = (float)(double(now - offset) / freq); + float lerp = bx::clamp(time, 0.0f, duration) / duration; + return lerp < 1.0f; + } +}; + +typedef InterpolatorT Interpolator; + +void keyBindingHelp(const char* _bindings, const char* _description) +{ + ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), _bindings); + ImGui::SameLine(140); + ImGui::Text(_description); +} + +void help(const char* _error = NULL) +{ + if (NULL != _error) + { + fprintf(stderr, "Error:\n%s\n\n", _error); + } + + fprintf(stderr + , "geometryv, bgfx geometry viewer tool, version %d.%d.%d.\n" + "Copyright 2019-2019 Attila Kocsis. All rights reserved.\n" + "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n" + , BGFX_GEOMETRYV_VERSION_MAJOR + , BGFX_GEOMETRYV_VERSION_MINOR + , BGFX_API_VERSION + ); + + fprintf(stderr + , "Usage: geometryv \n" + "\n" + "Supported input file types:\n" + ); + + for (uint32_t ii = 0; ii < BX_COUNTOF(s_supportedExt); ++ii) + { + fprintf(stderr, " *.%s\n", s_supportedExt[ii]); + } + + fprintf(stderr + , "\n" + "Options:\n" + " -h, --help Help.\n" + " -v, --version Version information only.\n" + "\n" + "For additional information, see https://github.com/bkaradzic/bgfx\n" + ); +} + +int _main_(int _argc, char** _argv) +{ + bx::CommandLine cmdLine(_argc, _argv); + + if (cmdLine.hasArg('v', "version") ) + { + fprintf(stderr + , "geometryv, bgfx geometry viewer tool, version %d.%d.%d.\n" + , BGFX_GEOMETRYV_VERSION_MAJOR + , BGFX_GEOMETRYV_VERSION_MINOR + , BGFX_API_VERSION + ); + return bx::kExitSuccess; + } + + if (cmdLine.hasArg('h', "help") ) + { + help(); + return bx::kExitFailure; + } + + uint32_t debug = BGFX_DEBUG_TEXT; + + inputAddBindings(s_bindingName[Binding::App], s_binding[Binding::App]); + inputAddBindings(s_bindingName[Binding::View], s_binding[Binding::View]); + + View view; + cmdAdd("view", cmdView, &view); + + entry::setWindowFlags(entry::WindowHandle{0}, ENTRY_WINDOW_FLAG_ASPECT_RATIO, false); + entry::setWindowSize(entry::WindowHandle{0}, view.m_width, view.m_height); + + bgfx::Init init; + init.resolution.width = view.m_width; + init.resolution.width = view.m_height; + init.resolution.reset = 0 + | BGFX_RESET_VSYNC + | BGFX_RESET_MSAA_X16 + ; + + bgfx::init(init); + + // Set view 0 clear state. + bgfx::setViewClear(SCENE_VIEW_ID + , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH + , 0x000000ff + , 1.0f + , 0 + ); + + imguiCreate(); + + const bgfx::Caps* caps = bgfx::getCaps(); + bgfx::RendererType::Enum type = caps->rendererType; + + bgfx::ShaderHandle vsMesh = bgfx::createEmbeddedShader(s_embeddedShaders, type, "vs_mesh"); + bgfx::ShaderHandle fsMesh = bgfx::createEmbeddedShader(s_embeddedShaders, type, "fs_mesh"); + + bgfx::ProgramHandle meshProgram = bgfx::createProgram( + vsMesh + , fsMesh + , true + ); + + float speed = 0.37f; + float time = 0.0f; + + Interpolator menuFade(5.0f); + + auto anyActive = [&]() -> bool + { + return false + || ImGui::MouseOverArea() + || menuFade.isActive() + ; + }; + + const char* filePath = _argc < 2 ? "" : _argv[1]; + + std::string path = filePath; + { + bx::FilePath fp(filePath); + view.updateFileList(fp); + } + + int exitcode = bx::kExitSuccess; + Mesh* mesh = NULL; + + { + uint32_t fileIndex = 0; + + entry::WindowState windowState; + while (!entry::processWindowEvents(windowState, debug, init.resolution.reset) ) + { + const entry::MouseState& mouseState = windowState.m_mouse; + view.m_width = windowState.m_width; + view.m_height = windowState.m_height; + + if (!windowState.m_dropFile.isEmpty() ) + { + view.updateFileList(windowState.m_dropFile); + windowState.m_dropFile.clear(); + } + + imguiBeginFrame(mouseState.m_mx + , mouseState.m_my + , (mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0) + | (mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0) + | (mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0) + , mouseState.m_mz + , uint16_t(view.m_width) + , uint16_t(view.m_height) + ); + + bool modalWindow = view.m_help || view.m_about; + bool overArea = false + || ImGui::GetMousePos().y <= ImGui::GetTextLineHeightWithSpacing() + || ImGui::MouseOverArea() + ; + overArea &= !modalWindow; + + if (overArea) + { + menuFade.set(5.0f, 0.25f); + } + else if (modalWindow) + { + menuFade.reset(0.0f); + } + else + { + menuFade.set(0.0f, 2.0f); + } + + ImGui::PushStyleVar(ImGuiStyleVar_Alpha, bx::clamp(menuFade.getValue(), 0.0f, 1.0f) ); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 0.0f); + + if (ImGui::BeginMainMenuBar() ) + { + if (ImGui::BeginMenu("File")) + { + if (ImGui::MenuItem("Open File") ) + { + bx::FilePath tmp = view.m_path; + if (openFileSelectionDialog( + tmp + , FileSelectionDialogType::Open + , "geometryv: Open File" + , s_filter + ) ) + { + view.updateFileList(tmp); + } + } + + if (ImGui::MenuItem("Show File List", NULL, view.m_files) ) + { + cmdExec("view files"); + } + + ImGui::Separator(); + if (ImGui::MenuItem("Exit") ) + { + cmdExec("exit"); + } + + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("View") ) + { + if (ImGui::MenuItem("Info", NULL, view.m_info) ) + { + cmdExec("view info"); + } + + if (ImGui::MenuItem("Reset") ) + { + cmdExec(s_resetCmd); + } + + ImGui::Separator(); + + if (ImGui::MenuItem("Save Options") ) + { + cmdExec("view save"); + } + + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Help") ) + { + if (ImGui::MenuItem("View Help") ) + { + cmdExec("view help"); + } + + ImGui::Separator(); + if (ImGui::MenuItem("About") ) + { + cmdExec("view about"); + } + + ImGui::EndMenu(); + } + + if (0 != view.m_fileList.size() ) + { + ImGui::Separator(); + ImGui::TextColored( + ImVec4(0.0f, 1.0f, 1.0f, 1.0f) + , view.m_fileList[view.m_fileIndex].c_str() + ); + } + + ImGui::EndMainMenuBar(); + } + + ImGui::PopStyleVar(2); + + static bool help = false; + static bool about = false; + + view.m_mouse.update(float(mouseState.m_mx), float(mouseState.m_my), mouseState.m_mz, view.m_width, view.m_height); + if (!overArea) + { + if (mouseState.m_buttons[entry::MouseButton::Left]) + { + view.m_idleTimer = 0.0f; + view.m_camera.orbit(view.m_mouse.m_dx, view.m_mouse.m_dy); + } + else if (mouseState.m_buttons[entry::MouseButton::Right]) + { + view.m_idleTimer = 0.0f; + view.m_camera.dolly(view.m_mouse.m_dx + view.m_mouse.m_dy); + } + else if (0 != view.m_mouse.m_scroll) + { + view.m_idleTimer = 0.0f; + view.m_camera.dolly(float(view.m_mouse.m_scroll)*0.1f); + } + } + + if (help != view.m_help) + { + if (!help) + { + ImGui::OpenPopup("Help"); + inputRemoveBindings(s_bindingName[Binding::View]); + inputAddBindings(s_bindingName[Binding::Help], s_binding[Binding::Help]); + } + else + { + inputRemoveBindings(s_bindingName[Binding::Help]); + inputAddBindings(s_bindingName[Binding::View], s_binding[Binding::View]); + } + + help = view.m_help; + } + + if (about != view.m_about) + { + if (!about) + { + ImGui::OpenPopup("About"); + inputRemoveBindings(s_bindingName[Binding::View]); + inputAddBindings(s_bindingName[Binding::About], s_binding[Binding::About]); + } + else + { + inputRemoveBindings(s_bindingName[Binding::About]); + inputAddBindings(s_bindingName[Binding::View], s_binding[Binding::View]); + } + + about = view.m_about; + } + + if (view.m_info) + { + ImGui::SetNextWindowSize( + ImVec2(300.0f, 320.0f) + , ImGuiCond_FirstUseEver + ); + + if (ImGui::Begin("Info", &view.m_info) ) + { + if (ImGui::BeginChild("##info", ImVec2(0.0f, 0.0f) ) ) + { + if (NULL == mesh) + { + ImGui::Text("Geometry is not loaded."); + } + else + { + ImGui::Text("Name: %s", view.m_fileList[view.m_fileIndex].c_str() ); + + ImGui::Indent(); + for (GroupArray::const_iterator itGroup = mesh->m_groups.begin(), itGroupEnd = mesh->m_groups.end(); itGroup != itGroupEnd; ++itGroup) + { + ImGui::Text("Group v %d i %d", itGroup->m_numVertices, itGroup->m_numIndices); + ImGui::Indent(); + for (PrimitiveArray::const_iterator itPrim = itGroup->m_prims.begin(), itPrimEnd = itGroup->m_prims.end(); itPrim != itPrimEnd; ++itPrim) + { + ImGui::Text("Primitive v %d i %d", itPrim->m_numVertices, itPrim->m_numIndices); + } + ImGui::Unindent(); + } + ImGui::Unindent(); + + ImGui::Separator(); + } + + ImGui::EndChild(); + } + + } + + ImGui::End(); + } + + if (view.m_files) + { + char temp[bx::kMaxFilePath]; + bx::snprintf(temp, BX_COUNTOF(temp), "%s##File", view.m_path.getCPtr() ); + + ImGui::SetNextWindowSize( + ImVec2(400.0f, 400.0f) + , ImGuiCond_FirstUseEver + ); + + if (ImGui::Begin(temp, &view.m_files) ) + { + if (ImGui::BeginChild("##file_list", ImVec2(0.0f, 0.0f) ) ) + { + ImGui::PushFont(ImGui::Font::Mono); + const float itemHeight = ImGui::GetTextLineHeightWithSpacing(); + const float listHeight = + bx::max(1.0f, bx::floor(ImGui::GetWindowHeight()/itemHeight) ) + * itemHeight + ; + + ImGui::PushItemWidth(-1); + if (ImGui::ListBoxHeader("##empty", ImVec2(0.0f, listHeight) ) ) + { + const int32_t itemCount = int32_t(view.m_fileList.size() ); + + int32_t start, end; + ImGui::CalcListClipping(itemCount, itemHeight, &start, &end); + + const int32_t index = int32_t(view.m_fileIndex); + if (index <= start) + { + ImGui::SetScrollY(ImGui::GetScrollY() - (start-index+1)*itemHeight); + } + else if (index >= end) + { + ImGui::SetScrollY(ImGui::GetScrollY() + (index-end+1)*itemHeight); + } + + ImGuiListClipper clipper(itemCount, itemHeight); + + for (int32_t pos = clipper.DisplayStart; pos < clipper.DisplayEnd; ++pos) + { + ImGui::PushID(pos); + + bool isSelected = uint32_t(pos) == view.m_fileIndex; + if (ImGui::Selectable(view.m_fileList[pos].c_str(), &isSelected) ) + { + view.m_fileIndex = pos; + } + + ImGui::PopID(); + } + + clipper.End(); + + ImGui::ListBoxFooter(); + } + + ImGui::PopFont(); + ImGui::EndChild(); + } + } + + ImGui::End(); + } + + if (ImGui::BeginPopupModal("About", &view.m_about, ImGuiWindowFlags_AlwaysAutoResize) ) + { + ImGui::SetWindowFontScale(1.0f); + + ImGui::Text( + "geometryv, bgfx geometry viewer tool " ICON_KI_WRENCH ", version %d.%d.%d.\n" + "Copyright 2019-2019 Attila Kocsis. All rights reserved.\n" + "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n" + , BGFX_GEOMETRYV_VERSION_MAJOR + , BGFX_GEOMETRYV_VERSION_MINOR + , BGFX_API_VERSION + ); + + ImGui::Dummy(ImVec2(0.0f, 0.0f) ); + ImGui::SameLine(ImGui::GetWindowWidth() - 136.0f); + if (ImGui::Button("Close", ImVec2(128.0f, 0.0f) ) + || !view.m_about) + { + view.m_about = false; + ImGui::CloseCurrentPopup(); + } + + ImGui::EndPopup(); + } + + if (ImGui::BeginPopupModal("Help", &view.m_help, ImGuiWindowFlags_AlwaysAutoResize) ) + { + ImGui::SetWindowFontScale(1.0f); + + ImGui::Text("Key bindings:\n\n"); + + ImGui::PushFont(ImGui::Font::Mono); + keyBindingHelp("ESC", "Exit."); + keyBindingHelp("h", "Toggle help screen."); + keyBindingHelp("i", "Toggle info screen."); + keyBindingHelp("f", "Toggle full-screen."); + ImGui::NextLine(); + + keyBindingHelp("LMB+drag", "Orbit."); + keyBindingHelp("W/A/S/D", "Orbit."); + keyBindingHelp("RMB+drag or MW", "Dolly."); + keyBindingHelp("=/-", "Dolly."); + keyBindingHelp("0", "Reset."); + keyBindingHelp("1", "Fit to window."); + ImGui::NextLine(); + + keyBindingHelp("up", "Previous geometry."); + keyBindingHelp("down", "Next geometry."); + ImGui::NextLine(); + + ImGui::NextLine(); + + ImGui::PopFont(); + + ImGui::Dummy(ImVec2(0.0f, 0.0f) ); + ImGui::SameLine(ImGui::GetWindowWidth() - 136.0f); + if (ImGui::Button("Close", ImVec2(128.0f, 0.0f) ) + || !view.m_help) + { + view.m_help = false; + ImGui::CloseCurrentPopup(); + } + + ImGui::EndPopup(); + } + + imguiEndFrame(); + + if ( (NULL == mesh || view.m_fileIndex != fileIndex) + && 0 != view.m_fileList.size() ) + { + if (NULL != mesh ) + { + meshUnload(mesh); + } + + fileIndex = view.m_fileIndex; + + bx::FilePath fp = view.m_path; + fp.join(view.m_fileList[view.m_fileIndex].c_str() ); + + mesh = meshLoad(fp.getCPtr()); + + std::string title; + if (NULL != mesh ) + { + uint32_t numPrimitives = 0; + uint32_t numVertices = 0; + uint32_t numIndices = 0; + Aabb boundingBox = {}; + + for (GroupArray::const_iterator it = mesh->m_groups.begin(), itEnd = mesh->m_groups.end(); it != itEnd; ++it) + { + if ( it == mesh->m_groups.begin()) + { + boundingBox = it->m_aabb; + } + else + { + aabbExpand(boundingBox, it->m_aabb.min); + aabbExpand(boundingBox, it->m_aabb.max); + } + + numPrimitives += (uint32_t)it->m_prims.size(); + numVertices += (uint32_t)it->m_numVertices; + numIndices += (uint32_t)it->m_numIndices; + } + + bx::stringPrintf(title, "%s (g %d, p %d, v %d, i %d)" + , fp.getCPtr() + , mesh->m_groups.size() + , numPrimitives + , numVertices + , numIndices + ); + + view.m_meshCenter = getCenter(boundingBox); + view.m_meshRadius = bx::length(getExtents(boundingBox)); + + view.m_camera.init( view.m_meshCenter, view.m_meshRadius * 2.0f); + } + else + { + bx::stringPrintf(title, "Failed to load %s!", filePath); + } + + entry::WindowHandle handle = { 0 }; + entry::setWindowTitle(handle, title.c_str() ); + } + + int64_t now = bx::getHPCounter(); + static int64_t last = now; + const int64_t frameTime = now - last; + last = now; + const double freq = double(bx::getHPFrequency() ); + const float deltaTime = float(frameTime/freq); + + time += (float)(frameTime*speed/freq); + + // Update camera. + float viewMatrix[16]; + view.m_camera.update(deltaTime); + view.m_camera.mtxLookAt(viewMatrix); + + float projMatrix[16]; + const float aspect = float(view.m_width)/float(view.m_height); + bx::mtxProj(projMatrix, 60.0f, aspect, 0.1f, 1000.0f, caps->homogeneousDepth); + + bgfx::setViewTransform(SCENE_VIEW_ID, viewMatrix, projMatrix); + bgfx::setViewRect(SCENE_VIEW_ID, 0, 0, uint16_t(view.m_width), uint16_t(view.m_height) ); + + bgfx::touch(SCENE_VIEW_ID); + + bgfx::dbgTextClear(); + + float orientation[16]; + bx::mtxIdentity(orientation); + bgfx::setTransform(orientation); + + float mtx[16]; + bx::mtxIdentity(mtx); + + if (NULL != mesh) + { + meshSubmit(mesh + , SCENE_VIEW_ID + , meshProgram + , mtx); + } + + bgfx::frame(); + + // Slow down when nothing is animating... + if (view.m_idleTimer > 2.0f + && !anyActive() ) + { + bx::sleep(100); + } + + view.m_idleTimer += deltaTime; + } + } + + if (NULL != mesh ) + { + meshUnload(mesh); + } + + bgfx::destroy(meshProgram); + + imguiDestroy(); + + bgfx::shutdown(); + + return exitcode; +} diff --git a/tools/geometryv/makefile b/tools/geometryv/makefile new file mode 100644 index 000000000..77d05f9ad --- /dev/null +++ b/tools/geometryv/makefile @@ -0,0 +1,6 @@ +# +# Copyright 2019-2019 Attila Kocsis. All rights reserved. +# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause +# + +include ../../../bgfx/scripts/shader-embeded.mk diff --git a/tools/geometryv/varying.def.sc b/tools/geometryv/varying.def.sc new file mode 100644 index 000000000..4282621c4 --- /dev/null +++ b/tools/geometryv/varying.def.sc @@ -0,0 +1,4 @@ +vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0); + +vec3 a_position : POSITION; +vec3 a_normal : NORMAL; diff --git a/tools/geometryv/vs_mesh.bin.h b/tools/geometryv/vs_mesh.bin.h new file mode 100644 index 000000000..d024a810c --- /dev/null +++ b/tools/geometryv/vs_mesh.bin.h @@ -0,0 +1,269 @@ +static const uint8_t vs_mesh_glsl[470] = +{ + 0x56, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod + 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0xa3, 0x01, // ViewProj........ + 0x00, 0x00, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, // ..attribute high + 0x70, 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, // p vec3 a_normal; + 0x0a, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, // .attribute highp + 0x20, 0x76, 0x65, 0x63, 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, // vec3 a_position + 0x3b, 0x0a, 0x76, 0x61, 0x72, 0x79, 0x69, 0x6e, 0x67, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, // ;.varying highp + 0x76, 0x65, 0x63, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x75, // vec3 v_normal;.u + 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, // niform mat4 u_mo + 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, // del[32];.uniform + 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x6d, 0x61, 0x74, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, // highp mat4 u_mo + 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x76, 0x6f, 0x69, // delViewProj;.voi + 0x64, 0x20, 0x6d, 0x61, 0x69, 0x6e, 0x20, 0x28, 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x68, 0x69, // d main ().{. hi + 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // ghp vec4 tmpvar_ + 0x31, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, // 1;. tmpvar_1.w + 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, // = 1.0;. tmpvar_ + 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, // 1.xyz = a_positi + 0x6f, 0x6e, 0x3b, 0x0a, 0x20, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, // on;. gl_Positio + 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, // n = (u_modelView + 0x50, 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, // Proj * tmpvar_1) + 0x3b, 0x0a, 0x20, 0x20, 0x68, 0x69, 0x67, 0x68, 0x70, 0x20, 0x76, 0x65, 0x63, 0x34, 0x20, 0x74, // ;. highp vec4 t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // mpvar_2;. tmpva + 0x72, 0x5f, 0x32, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // r_2.w = 0.0;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x28, // mpvar_2.xyz = (( + 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, 0x29, 0x20, // a_normal * 2.0) + 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, // - 1.0);. v_norm + 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, // al = (u_model[0] + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, // * tmpvar_2).xyz + 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // ;.}... +}; +static const uint8_t vs_mesh_spv[1538] = +{ + 0x56, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod + 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x08, 0x04, 0x00, // elViewProj...... + 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0xc8, 0x05, // .u_model........ + 0x00, 0x00, 0x03, 0x02, 0x23, 0x07, 0x00, 0x00, 0x01, 0x00, 0x07, 0x00, 0x08, 0x00, 0x9b, 0x00, // ....#........... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, // ................ + 0x06, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x4c, 0x53, 0x4c, 0x2e, 0x73, 0x74, 0x64, 0x2e, 0x34, // ......GLSL.std.4 + 0x35, 0x30, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, // 50.............. + 0x00, 0x00, 0x0f, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, // ..............ma + 0x69, 0x6e, 0x00, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x52, 0x00, // in....F...I...R. + 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf4, 0x01, // ..V............. + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6d, 0x61, 0x69, 0x6e, 0x00, 0x00, // ..........main.. + 0x00, 0x00, 0x05, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, // ......"...$Globa + 0x6c, 0x00, 0x06, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, // l.....".......u_ + 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x06, 0x00, 0x07, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, // model....."..... + 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, // ..u_modelViewPro + 0x6a, 0x00, 0x05, 0x00, 0x03, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, // j.....$......... + 0x05, 0x00, 0x46, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x00, 0x00, // ..F...a_normal.. + 0x00, 0x00, 0x05, 0x00, 0x05, 0x00, 0x49, 0x00, 0x00, 0x00, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, // ......I...a_posi + 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x05, 0x00, 0x0a, 0x00, 0x52, 0x00, 0x00, 0x00, 0x40, 0x65, // tion......R...@e + 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, // ntryPointOutput. + 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x00, 0x00, 0x05, 0x00, // gl_Position..... + 0x09, 0x00, 0x56, 0x00, 0x00, 0x00, 0x40, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x50, 0x6f, 0x69, 0x6e, // ..V...@entryPoin + 0x74, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, // tOutput.v_normal + 0x00, 0x00, 0x47, 0x00, 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x40, 0x00, // ..G...!.......@. + 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, // ..H..."......... + 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, // ..H...".......#. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, // ......H..."..... + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x48, 0x00, 0x04, 0x00, 0x22, 0x00, // ..........H...". + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x05, 0x00, 0x22, 0x00, // ..........H...". + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x48, 0x00, // ......#.......H. + 0x05, 0x00, 0x22, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x10, 0x00, // .."............. + 0x00, 0x00, 0x47, 0x00, 0x03, 0x00, 0x22, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x47, 0x00, // ..G...".......G. + 0x04, 0x00, 0x24, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..$...".......G. + 0x04, 0x00, 0x46, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..F...........G. + 0x04, 0x00, 0x49, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x47, 0x00, // ..I...........G. + 0x04, 0x00, 0x52, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x00, // ..R...........G. + 0x04, 0x00, 0x56, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, // ..V............. + 0x02, 0x00, 0x02, 0x00, 0x00, 0x00, 0x21, 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, // ......!......... + 0x00, 0x00, 0x16, 0x00, 0x03, 0x00, 0x06, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x17, 0x00, // .......... ..... + 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x17, 0x00, // ................ + 0x04, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, // ................ + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ...... .......+. + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..............+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x2b, 0x00, // .............?+. + 0x04, 0x00, 0x12, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, // ................ + 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x15, 0x00, // ................ + 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2b, 0x00, // ...... .......+. + 0x04, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1c, 0x00, // ...... ... ..... + 0x04, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1e, 0x00, // ..!....... ..... + 0x04, 0x00, 0x22, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x20, 0x00, // .."...!....... . + 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x22, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..#......."...;. + 0x04, 0x00, 0x23, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x20, 0x00, // ..#...$....... . + 0x04, 0x00, 0x25, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x2b, 0x00, // ..%...........+. + 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x20, 0x00, // ......-......@ . + 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..E...........;. + 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x46, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..E...F.......;. + 0x04, 0x00, 0x45, 0x00, 0x00, 0x00, 0x49, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, // ..E...I....... . + 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..Q...........;. + 0x04, 0x00, 0x51, 0x00, 0x00, 0x00, 0x52, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x20, 0x00, // ..Q...R....... . + 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x3b, 0x00, // ..U...........;. + 0x04, 0x00, 0x55, 0x00, 0x00, 0x00, 0x56, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2c, 0x00, // ..U...V.......,. + 0x06, 0x00, 0x07, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x15, 0x00, // ................ + 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x36, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, // ......6......... + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf8, 0x00, 0x02, 0x00, 0x05, 0x00, // ................ + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x46, 0x00, // ..=.......G...F. + 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x07, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x49, 0x00, // ..=.......J...I. + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x4a, 0x00, // ..Q.......j...J. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x6b, 0x00, // ......Q.......k. + 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..J.......Q..... + 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x4a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, // ..l...J.......P. + 0x07, 0x00, 0x09, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6a, 0x00, 0x00, 0x00, 0x6b, 0x00, // ......m...j...k. + 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x41, 0x00, 0x05, 0x00, 0x25, 0x00, // ..l.......A...%. + 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x3d, 0x00, // ..n...$.......=. + 0x04, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x6f, 0x00, 0x00, 0x00, 0x6e, 0x00, 0x00, 0x00, 0x90, 0x00, // ......o...n..... + 0x05, 0x00, 0x09, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x00, 0x00, 0x6f, 0x00, // ......p...m...o. + 0x00, 0x00, 0x8e, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x47, 0x00, // ..........s...G. + 0x00, 0x00, 0x2d, 0x00, 0x00, 0x00, 0x83, 0x00, 0x05, 0x00, 0x07, 0x00, 0x00, 0x00, 0x75, 0x00, // ..-...........u. + 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x9a, 0x00, 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, // ..s.......Q..... + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x51, 0x00, // ..w...u.......Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x75, 0x00, 0x00, 0x00, 0x01, 0x00, // ......x...u..... + 0x00, 0x00, 0x51, 0x00, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x75, 0x00, // ..Q.......y...u. + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x50, 0x00, 0x07, 0x00, 0x09, 0x00, 0x00, 0x00, 0x7a, 0x00, // ......P.......z. + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x79, 0x00, 0x00, 0x00, 0x14, 0x00, // ..w...x...y..... + 0x00, 0x00, 0x41, 0x00, 0x06, 0x00, 0x25, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x24, 0x00, // ..A...%...{...$. + 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x3d, 0x00, 0x04, 0x00, 0x1e, 0x00, // ..........=..... + 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x7b, 0x00, 0x00, 0x00, 0x90, 0x00, 0x05, 0x00, 0x09, 0x00, // ..|...{......... + 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x4f, 0x00, // ..}...z...|...O. + 0x08, 0x00, 0x07, 0x00, 0x00, 0x00, 0x7e, 0x00, 0x00, 0x00, 0x7d, 0x00, 0x00, 0x00, 0x7d, 0x00, // ......~...}...}. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x51, 0x00, // ..............Q. + 0x05, 0x00, 0x06, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, // ..........p..... + 0x00, 0x00, 0x7f, 0x00, 0x04, 0x00, 0x06, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0x81, 0x00, // ................ + 0x00, 0x00, 0x52, 0x00, 0x06, 0x00, 0x09, 0x00, 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x82, 0x00, // ..R............. + 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x52, 0x00, // ..p.......>...R. + 0x00, 0x00, 0x99, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x03, 0x00, 0x56, 0x00, 0x00, 0x00, 0x7e, 0x00, // ......>...V...~. + 0x00, 0x00, 0xfd, 0x00, 0x01, 0x00, 0x38, 0x00, 0x01, 0x00, 0x00, 0x02, 0x02, 0x00, 0x01, 0x00, // ......8......... + 0x80, 0x00, // .. +}; +static const uint8_t vs_mesh_dx9[471] = +{ + 0x56, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod + 0x65, 0x6c, 0x04, 0x20, 0x04, 0x00, 0x03, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x04, 0x00, 0xa4, 0x01, // ViewProj........ + 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0xfe, 0xff, 0x2f, 0x00, 0x43, 0x54, 0x41, 0x42, 0x1c, 0x00, // ......../.CTAB.. + 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x00, 0x03, 0xfe, 0xff, 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, // ................ + 0x00, 0x00, 0x00, 0x91, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, // ......|...D..... + 0x04, 0x00, 0x03, 0x00, 0x00, 0x00, 0x4c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, // ......L......... + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x00, // ..........l..... + 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, // ..u_model....... + 0x04, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, // .. .......u_mode + 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x00, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, // lViewProj....... + 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x76, 0x73, 0x5f, 0x33, 0x5f, 0x30, // ..........vs_3_0 + 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, // .Microsoft (R) H + 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, // LSL Shader Compi + 0x6c, 0x65, 0x72, 0x20, 0x36, 0x2e, 0x33, 0x2e, 0x39, 0x36, 0x30, 0x30, 0x2e, 0x31, 0x38, 0x36, // ler 6.3.9600.186 + 0x31, 0x31, 0x00, 0xab, 0xab, 0xab, 0x51, 0x00, 0x00, 0x05, 0x07, 0x00, 0x0f, 0xa0, 0x00, 0x00, // 11....Q......... + 0x00, 0x40, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, // .@.............. + 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x00, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, // ................ + 0x00, 0x80, 0x01, 0x00, 0x0f, 0x90, 0x1f, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, // ................ + 0x0f, 0xe0, 0x1f, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 0x80, 0x01, 0x00, 0x07, 0xe0, 0x05, 0x00, // ................ + 0x00, 0x03, 0x00, 0x00, 0x0f, 0x80, 0x01, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x55, 0x90, 0x04, 0x00, // ............U... + 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x00, 0x00, 0xe4, 0xa0, 0x01, 0x00, 0x00, 0x90, 0x00, 0x00, // ................ + 0xe4, 0x80, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x0f, 0x80, 0x02, 0x00, 0xe4, 0xa0, 0x01, 0x00, // ................ + 0xaa, 0x90, 0x00, 0x00, 0xe4, 0x80, 0x02, 0x00, 0x00, 0x03, 0x00, 0x00, 0x0f, 0xe0, 0x00, 0x00, // ................ + 0xe4, 0x80, 0x03, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x80, 0x00, 0x00, // ................ + 0xe4, 0x90, 0x07, 0x00, 0x00, 0xa0, 0x07, 0x00, 0x55, 0xa0, 0x05, 0x00, 0x00, 0x03, 0x01, 0x00, // ........U....... + 0x07, 0x80, 0x00, 0x00, 0x55, 0x80, 0x05, 0x00, 0xe4, 0xa0, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, // ....U........... + 0x0b, 0x80, 0x04, 0x00, 0xa4, 0xa0, 0x00, 0x00, 0x00, 0x80, 0x01, 0x00, 0xa4, 0x80, 0x04, 0x00, // ................ + 0x00, 0x04, 0x01, 0x00, 0x07, 0xe0, 0x06, 0x00, 0xe4, 0xa0, 0x00, 0x00, 0xaa, 0x80, 0x00, 0x00, // ................ + 0xf4, 0x80, 0xff, 0xff, 0x00, 0x00, 0x00, // ....... +}; +static const uint8_t vs_mesh_dx11[678] = +{ + 0x56, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod + 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x80, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .....u_model + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x00, 0x00, 0x08, 0x04, 0x00, 0x6c, 0x02, // ViewProj......l. + 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0xb4, 0x48, 0x12, 0xfe, 0xc5, 0x93, 0x9f, 0x35, 0x29, 0x47, // ..DXBC.H.....5)G + 0xbd, 0x09, 0x87, 0xcd, 0x71, 0xa2, 0x01, 0x00, 0x00, 0x00, 0x6c, 0x02, 0x00, 0x00, 0x03, 0x00, // ....q.....l..... + 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x49, 0x53, // ..,...|.......IS + 0x47, 0x4e, 0x48, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNH...........8. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......?......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x07, 0x00, 0x00, 0x4e, 0x4f, // ..............NO + 0x52, 0x4d, 0x41, 0x4c, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4f, 0x53, // RMAL.POSITION.OS + 0x47, 0x4e, 0x4c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, // GNL...........8. + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, // ................ + 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......D......... + 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x08, 0x00, 0x00, 0x53, 0x56, // ..............SV + 0x5f, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e, 0x00, 0x4e, 0x4f, 0x52, 0x4d, 0x41, 0x4c, // _POSITION.NORMAL + 0x00, 0xab, 0x53, 0x48, 0x44, 0x52, 0x94, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x65, 0x00, // ..SHDR....@...e. + 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, // ..Y...F. ....... + 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, // .._...r......._. + 0x00, 0x03, 0x72, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, // ..r.......g.... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0x72, 0x20, // ..........e...r + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, // ......h.......8. + 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x56, 0x15, 0x10, 0x00, 0x01, 0x00, // ..........V..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, // ..........F. ... + 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, // ..............F. + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, // ......2......... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x82, 0x00, 0x00, 0x00, 0xa6, 0x1a, // ..F. ........... + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F......... + 0x00, 0x08, 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, // ... ......F..... + 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x83, 0x00, 0x00, 0x00, 0x32, 0x00, // ..F. .........2. + 0x00, 0x0f, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x12, 0x10, 0x00, 0x00, 0x00, // ..r.......F..... + 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // ...@.....@...@.. + 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, // .@.....@........ + 0x80, 0xbf, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, // ..........8...r. + 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x82, // ......V.......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0xb2, 0x00, // .........2..... + 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // ......F. ....... + 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x08, 0x10, 0x00, 0x01, 0x00, // ..........F..... + 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, // ..2...r ......F. + 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x00, 0x00, // ............... + 0x00, 0x00, 0x46, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01, 0x00, 0x02, // ..F.......>..... + 0x02, 0x00, 0x01, 0x00, 0x40, 0x08, // ....@. +}; +static const uint8_t vs_mesh_mtl[823] = +{ + 0x56, 0x53, 0x48, 0x05, 0xe3, 0xc2, 0x5c, 0x65, 0x02, 0x00, 0x07, 0x75, 0x5f, 0x6d, 0x6f, 0x64, // VSH....e...u_mod + 0x65, 0x6c, 0x04, 0x20, 0x00, 0x00, 0x20, 0x00, 0x0f, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // el. .. ..u_model + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x04, 0x01, 0x00, 0x00, 0x01, 0x00, 0x04, 0x03, // ViewProj........ + 0x00, 0x00, 0x75, 0x73, 0x69, 0x6e, 0x67, 0x20, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x70, 0x61, 0x63, // ..using namespac + 0x65, 0x20, 0x6d, 0x65, 0x74, 0x61, 0x6c, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, // e metal;.struct + 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x49, 0x6e, 0x70, // xlatMtlShaderInp + 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x61, 0x5f, // ut {. float3 a_ + 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x5b, 0x5b, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, // normal [[attribu + 0x74, 0x65, 0x28, 0x30, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, // te(0)]];. float + 0x33, 0x20, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x61, // 3 a_position [[a + 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x28, 0x31, 0x29, 0x5d, 0x5d, 0x3b, 0x0a, 0x7d, // ttribute(1)]];.} + 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, // ;.struct xlatMtl + 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, // ShaderOutput {. + 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74, // float4 gl_Posit + 0x69, 0x6f, 0x6e, 0x20, 0x5b, 0x5b, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x5d, 0x5d, // ion [[position]] + 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x20, 0x76, 0x5f, 0x6e, 0x6f, 0x72, // ;. float3 v_nor + 0x6d, 0x61, 0x6c, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x78, // mal;.};.struct x + 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, // latMtlShaderUnif + 0x6f, 0x72, 0x6d, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, // orm {. float4x4 + 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x33, 0x32, 0x5d, 0x3b, 0x0a, 0x20, 0x20, // u_model[32];. + 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78, 0x34, 0x20, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, // float4x4 u_model + 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x3b, 0x0a, 0x7d, 0x3b, 0x0a, 0x76, 0x65, 0x72, // ViewProj;.};.ver + 0x74, 0x65, 0x78, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, 0x65, // tex xlatMtlShade + 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x4d, // rOutput xlatMtlM + 0x61, 0x69, 0x6e, 0x20, 0x28, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, 0x64, // ain (xlatMtlShad + 0x65, 0x72, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x69, 0x20, 0x5b, // erInput _mtl_i [ + 0x5b, 0x73, 0x74, 0x61, 0x67, 0x65, 0x5f, 0x69, 0x6e, 0x5d, 0x5d, 0x2c, 0x20, 0x63, 0x6f, 0x6e, // [stage_in]], con + 0x73, 0x74, 0x61, 0x6e, 0x74, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // stant xlatMtlSha + 0x64, 0x65, 0x72, 0x55, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d, 0x26, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // derUniform& _mtl + 0x5f, 0x75, 0x20, 0x5b, 0x5b, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x28, 0x30, 0x29, 0x5d, 0x5d, // _u [[buffer(0)]] + 0x29, 0x0a, 0x7b, 0x0a, 0x20, 0x20, 0x78, 0x6c, 0x61, 0x74, 0x4d, 0x74, 0x6c, 0x53, 0x68, 0x61, // ).{. xlatMtlSha + 0x64, 0x65, 0x72, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, // derOutput _mtl_o + 0x3b, 0x0a, 0x20, 0x20, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // ;. float4 tmpva + 0x72, 0x5f, 0x31, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, // r_1 = 0;. tmpva + 0x72, 0x5f, 0x31, 0x2e, 0x77, 0x20, 0x3d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, // r_1.w = 1.0;. t + 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x5f, 0x6d, // mpvar_1.xyz = _m + 0x74, 0x6c, 0x5f, 0x69, 0x2e, 0x61, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3b, // tl_i.a_position; + 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x6f, 0x2e, 0x67, 0x6c, 0x5f, 0x50, 0x6f, 0x73, // . _mtl_o.gl_Pos + 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, // ition = (_mtl_u. + 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x6a, 0x20, // u_modelViewProj + 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x31, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x66, // * tmpvar_1);. f + 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x20, 0x3d, // loat4 tmpvar_2 = + 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x2e, 0x77, // 0;. tmpvar_2.w + 0x20, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, // = 0.0;. tmpvar + 0x5f, 0x32, 0x2e, 0x78, 0x79, 0x7a, 0x20, 0x3d, 0x20, 0x28, 0x28, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // _2.xyz = ((_mtl_ + 0x69, 0x2e, 0x61, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x2a, 0x20, 0x32, 0x2e, 0x30, // i.a_normal * 2.0 + 0x29, 0x20, 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x5f, 0x6d, 0x74, 0x6c, // ) - 1.0);. _mtl + 0x5f, 0x6f, 0x2e, 0x76, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x20, 0x3d, 0x20, 0x28, 0x5f, // _o.v_normal = (_ + 0x6d, 0x74, 0x6c, 0x5f, 0x75, 0x2e, 0x75, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, // mtl_u.u_model[0] + 0x20, 0x2a, 0x20, 0x74, 0x6d, 0x70, 0x76, 0x61, 0x72, 0x5f, 0x32, 0x29, 0x2e, 0x78, 0x79, 0x7a, // * tmpvar_2).xyz + 0x3b, 0x0a, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x5f, 0x6d, 0x74, 0x6c, 0x5f, // ;. return _mtl_ + 0x6f, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x00, // o;.}... +}; +extern const uint8_t* vs_mesh_pssl; +extern const uint32_t vs_mesh_pssl_size; diff --git a/tools/geometryv/vs_mesh.sc b/tools/geometryv/vs_mesh.sc new file mode 100644 index 000000000..6049de743 --- /dev/null +++ b/tools/geometryv/vs_mesh.sc @@ -0,0 +1,17 @@ +$input a_position, a_normal +$output v_normal + +/* + * Copyright 2019-2019 Attila Kocsis. All rights reserved. + * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause + */ + +#include + +void main() +{ + gl_Position = mul(u_modelViewProj, vec4(a_position, 1.0) ); + + vec3 normal = a_normal.xyz*2.0 - 1.0; + v_normal = mul(u_model[0], vec4(normal, 0.0) ).xyz; +}