From bdf80f37e61b7add403123b58bdec9c6b374577b Mon Sep 17 00:00:00 2001 From: lachrymal Date: Fri, 7 Apr 2023 14:32:19 -0400 Subject: [PATCH] macgit status --- ADVect/ADVect.cpp | 8 ++++---- ADVect/Graphics.cpp | 8 ++++---- ADVect/Graphics.h | 6 +++--- .../runtime/shaders/metal/AlphaStencil.frag.bin | Bin 0 -> 652 bytes .../runtime/shaders/metal/AlphaStencil.vert.bin | Bin 0 -> 697 bytes ADVect/runtime/shaders/metal/ImageAlpha.frag.bin | Bin 0 -> 795 bytes ADVect/runtime/shaders/metal/ImageAlpha.vert.bin | Bin 0 -> 697 bytes 7 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 ADVect/runtime/shaders/metal/AlphaStencil.frag.bin create mode 100644 ADVect/runtime/shaders/metal/AlphaStencil.vert.bin create mode 100644 ADVect/runtime/shaders/metal/ImageAlpha.frag.bin create mode 100644 ADVect/runtime/shaders/metal/ImageAlpha.vert.bin diff --git a/ADVect/ADVect.cpp b/ADVect/ADVect.cpp index bc8edb1..d104f4c 100644 --- a/ADVect/ADVect.cpp +++ b/ADVect/ADVect.cpp @@ -188,11 +188,11 @@ namespace ADVect { void Render() { bgfx::touch(0); - draw_image_transition_fade(current_time, bg); + draw_image_transition_crossfade(current_time, bg); if (draw_ui) { if (dialogue_bg.current != nullptr) - ADVect::Graphics::DrawTextureImage(*dialogue_bg.current, dialogue_bg.pos_x, dialogue_bg.pos_y); + ADVect::Graphics::DrawTextureImageAlpha(*dialogue_bg.current, dialogue_bg.pos_x, dialogue_bg.pos_y, 1.0f); draw_image_transition_crossfade(current_time, avatar); ADVect::Graphics::RenderString(speaker.current, speaker.pos_x, speaker.pos_y, speaker.fill, ADVect::Graphics::TEXT_BOLD); @@ -249,8 +249,8 @@ namespace ADVect { } int main(int argc, char* argv[]) { - std::filesystem::current_path("E:\\Archive\\Projects\\NouVeL\\ADVect\\runtime"); -// std::filesystem::current_path("/Users/lachrymal/Projects/NouVeL/ADVect/runtime/"); +// std::filesystem::current_path("E:\\Archive\\Projects\\NouVeL\\ADVect\\runtime"); + std::filesystem::current_path("/Users/lachrymal/Projects/NouVeL/ADVect/runtime/"); NVL::Environment::ENVIRONMENT.enter({ { diff --git a/ADVect/Graphics.cpp b/ADVect/Graphics.cpp index 0068b43..3fb0e39 100644 --- a/ADVect/Graphics.cpp +++ b/ADVect/Graphics.cpp @@ -233,7 +233,7 @@ namespace ADVect::Graphics { ibh = bgfx::createIndexBuffer(bgfx::makeRef(quad_indices, sizeof(quad_indices))); vbh = bgfx::createVertexBuffer(bgfx::makeRef(quad_vert, sizeof(quad_vert)), pcvDecl); - img_program = load_shader_program("test"); // RGBA +// img_program = load_shader_program("test"); // RGBA imga_program = load_shader_program("ImageAlpha"); // RGBA + Opacity a_program = load_shader_program("AlphaStencil"); // A -> FFFA @@ -313,7 +313,7 @@ namespace ADVect::Graphics { } template - void RenderGlyph(NVL::Char c, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE) { + void RenderGlyph(NVL::Char c, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags) { Font* f = ResolveStyleFlags(style_flags); auto& [tx, w, h, l, t, x, y] = f->get_char(c); @@ -329,14 +329,14 @@ namespace ADVect::Graphics { } template - void RenderString(const NVL::String& s, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE) { + void RenderString(const NVL::String& s, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags) { for (const auto& c : s) { RenderGlyph(c, pos_x, pos_y, col, style_flags); } } template - void RenderString(NVL::String::const_iterator cbegin, NVL::String::const_iterator cend, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE) { + void RenderString(NVL::String::const_iterator cbegin, NVL::String::const_iterator cend, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags) { while (cbegin < cend) { RenderGlyph(*cbegin++, pos_x, pos_y, col, style_flags); } diff --git a/ADVect/Graphics.h b/ADVect/Graphics.h index 6583a45..349683c 100644 --- a/ADVect/Graphics.h +++ b/ADVect/Graphics.h @@ -34,11 +34,11 @@ namespace ADVect::Graphics { void DrawTextureStencilAlpha(const bgfx::TextureHandle& tex, i32 pos_x, i32 pos_y, u32 w, u32 h); template - void RenderGlyph(NVL::Char c, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags); + void RenderGlyph(NVL::Char c, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE); template - void RenderString(const NVL::String& s, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags); + void RenderString(const NVL::String& s, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE); template - void RenderString(NVL::String::const_iterator cbegin, NVL::String::const_iterator cend, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags); + void RenderString(NVL::String::const_iterator cbegin, NVL::String::const_iterator cend, std::conditional_t pos_x, std::conditional_t pos_y, u32 col, u32 style_flags = TEXT_NONE); i32 RenderSubstringBox(const NVL::String& s, i32& pos_x, i32& pos_y, i32 reset_x, u32 w, u32 col, u32 style_flags = TEXT_NONE, size_t s_end = NVL::String::npos); void RenderSubstringMarkupBox(const NVL::Environment::MarkupString& ms, i32 pos_x, i32 pos_y, u32 w, u32 col, size_t end = NVL::String::npos); diff --git a/ADVect/runtime/shaders/metal/AlphaStencil.frag.bin b/ADVect/runtime/shaders/metal/AlphaStencil.frag.bin new file mode 100644 index 0000000000000000000000000000000000000000..dcd76e8790126f93203aa14c7cbb6bb1f8bf9f1c GIT binary patch literal 652 zcmZuuJx{|h5KUn-3;hG=B$h-9CRA)~vw$j=PGyUt$W7c}$+0WjfuM@tUhE{2!-r*` zC*~~H86OTa;dzhq* zn{k*!tj~IZ)HKDXX>rw>vs7%5YJy7s#tqjNUehe)M z6Z%I)q+dSjKd~%1WahOA4?-OK0DkxWIKjppBiJc0Ys52gbkEQ^`IBWlSWb4 zD7G|(L}|3gZL4bu`lGhg&C>V4*)PfSIii(`LlLwJjXbU?s0I#?ippX;VLb#|jW*+; z`6e~^9YqE5jbKv8aUW8neW*_c-vG-|G3Q~4Td%zdrLJDpK{K1T6v}S~2d|}^ijTsk zJF_ZR*qRdDRs#&A4r@31FboI1I@SLpn)zNl`DD=#&kA%_mrDFNC?#hda!DS@H`Nm6 A_W%F@ literal 0 HcmV?d00001 diff --git a/ADVect/runtime/shaders/metal/ImageAlpha.frag.bin b/ADVect/runtime/shaders/metal/ImageAlpha.frag.bin new file mode 100644 index 0000000000000000000000000000000000000000..85c45f77a5f21bc0cfb75f7c7d78b4f7840b56b0 GIT binary patch literal 795 zcmZ`%!Ait15Ut|Hcu_w<1_bF!jdk%Lxb8(!FP`+aEFs&bYamUeNww?Z-}s+8X@jkT zp$%l_<-N(9xqZCfF$dF0glj9>v&@O++9*>!^72KAYH#D~Yr`jpxhK)Mx)ObEyI|&p zXVR_q5!~TP&$ZhU`0aBuiVmgDRGkZ$l)`bvtjm>LOi3TNvdmBYMxUpI)K=;xXkH47 z8Uor|mxNeX)tLi!r_6#YvL=A5P=>p6_^IcTeDu&parfZV1DBea+Wo$=SQZVtt@!eW zJD$R9mU$cEbTps;OCt4SRjf>=dyWG6OQ9Y7DP?$$hdHSMzuC+> zz7$OA`8IZ)HKDXX>rw>vs7%5YJy7s#tqjNUehe)M z6Z%I)q+dSjKd~%1WahOA4?-OK0DkxWIKjppBiJc0Ys52gbkEQ^`IBWlSWb4 zD7G|(L}|3gZL4bu`lGhg&C>V4*)PfSIii(`LlLwJjXbU?s0I#?ippX;VLb#|jW*+; z`6e~^9YqE5jbKv8aUW8neW*_c-vG-|G3Q~4Td%zdrLJDpK{K1T6v}S~2d|}^ijTsk zJF_ZR*qRdDRs#&A4r@31FboI1I@SLpn)zNl`DD=#&kA%_mrDFNC?#hda!DS@H`Nm6 A_W%F@ literal 0 HcmV?d00001