From 262699a3e12fbe9bbb1f46b9f784309856d96780 Mon Sep 17 00:00:00 2001 From: Ion Agorria Date: Wed, 30 Oct 2024 21:32:01 +0100 Subject: [PATCH] Revert "sokol: alpha test is always "CMP_GREATER" in dx9 renderer, fix it" This reverts commit 64b8fab02a2f4443ee43993753eca041dd40b8cd. --- Source/Render/sokol/shaders/mesh_color_tex1.h | 114 ++++++++--------- Source/Render/sokol/shaders/mesh_color_tex2.h | 120 +++++++++--------- .../sokol/shaders/mesh_color_texture.glsl | 4 +- .../Render/sokol/shaders/mesh_normal_tex1.h | 120 +++++++++--------- .../sokol/shaders/mesh_normal_texture.glsl | 2 +- .../Render/sokol/shaders/shadow_normal_tex1.h | 114 ++++++++--------- Source/Render/sokol/shaders/shadow_tex1.h | 114 ++++++++--------- .../Render/sokol/shaders/shadow_texture.glsl | 4 +- 8 files changed, 294 insertions(+), 298 deletions(-) diff --git a/Source/Render/sokol/shaders/mesh_color_tex1.h b/Source/Render/sokol/shaders/mesh_color_tex1.h index 8cb7249d..3a7547a4 100644 --- a/Source/Render/sokol/shaders/mesh_color_tex1.h +++ b/Source/Render/sokol/shaders/mesh_color_tex1.h @@ -153,7 +153,7 @@ static const uint8_t mesh_color_tex1_vs_source_glsl410[675] = { void main() { frag_color = texture(un_tex0_un_sampler0, fs_uv0) * fs_color; - if (_32.un_alpha_test > frag_color.w) + if (_32.un_alpha_test >= frag_color.w) { discard; } @@ -161,7 +161,7 @@ static const uint8_t mesh_color_tex1_vs_source_glsl410[675] = { */ #if defined(SOKOL_GLCORE) -static const uint8_t mesh_color_tex1_fs_source_glsl410[485] = { +static const uint8_t mesh_color_tex1_fs_source_glsl410[486] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x73,0x74, 0x72,0x75,0x63,0x74,0x20,0x6d,0x65,0x73,0x68,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, @@ -189,10 +189,10 @@ static const uint8_t mesh_color_tex1_fs_source_glsl410[485] = { 0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x20,0x2a,0x20, 0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66, 0x20,0x28,0x5f,0x33,0x32,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74, - 0x65,0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -280,7 +280,7 @@ static const uint8_t mesh_color_tex1_vs_source_glsl300es[636] = { void main() { frag_color = texture(un_tex0_un_sampler0, fs_uv0) * fs_color; - if (_32.un_alpha_test > frag_color.w) + if (_32.un_alpha_test >= frag_color.w) { discard; } @@ -288,7 +288,7 @@ static const uint8_t mesh_color_tex1_vs_source_glsl300es[636] = { */ #if defined(SOKOL_GLES3) -static const uint8_t mesh_color_tex1_fs_source_glsl300es[528] = { +static const uint8_t mesh_color_tex1_fs_source_glsl300es[529] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, @@ -319,10 +319,10 @@ static const uint8_t mesh_color_tex1_fs_source_glsl300es[528] = { 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x20,0x2a,0x20,0x66,0x73,0x5f,0x63,0x6f, 0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32, 0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e, - 0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20, - 0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73, - 0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, - + 0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a, + 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, + 0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a, + 0x00, }; #endif /* @@ -484,7 +484,7 @@ static const uint8_t mesh_color_tex1_vs_source_hlsl5[1201] = { void frag_main() { frag_color = un_tex0.Sample(un_sampler0, fs_uv0) * fs_color; - if (_32_un_alpha_test > frag_color.w) + if (_32_un_alpha_test >= frag_color.w) { discard; } @@ -501,7 +501,7 @@ static const uint8_t mesh_color_tex1_vs_source_hlsl5[1201] = { } */ #if defined(SOKOL_D3D11) -static const uint8_t mesh_color_tex1_fs_source_hlsl5[926] = { +static const uint8_t mesh_color_tex1_fs_source_hlsl5[927] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6d,0x65,0x73,0x68,0x5f,0x63,0x6f,0x6c, 0x6f,0x72,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61, 0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28, @@ -541,25 +541,25 @@ static const uint8_t mesh_color_tex1_fs_source_hlsl5[926] = { 0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x20,0x2a,0x20,0x66, 0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20, 0x28,0x5f,0x33,0x32,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f, - 0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61, - 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, - 0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, - 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28, - 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, - 0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, - 0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67, - 0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61, - 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, + 0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52, + 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e, + 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72, + 0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, }; #endif /* @@ -680,7 +680,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_macos[777] = { { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0) * in.fs_color; - if (_32.un_alpha_test > out.frag_color.w) + if (_32.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -689,7 +689,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_macos[777] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex1_fs_source_metal_macos[732] = { +static const uint8_t mesh_color_tex1_fs_source_metal_macos[733] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -730,12 +730,12 @@ static const uint8_t mesh_color_tex1_fs_source_metal_macos[732] = { 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76, 0x30,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x2e,0x75,0x6e, - 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x6f,0x75, - 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, - 0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f, + 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64, + 0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -856,7 +856,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_ios[777] = { { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0) * in.fs_color; - if (_32.un_alpha_test > out.frag_color.w) + if (_32.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -865,7 +865,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_ios[777] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex1_fs_source_metal_ios[732] = { +static const uint8_t mesh_color_tex1_fs_source_metal_ios[733] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -906,12 +906,12 @@ static const uint8_t mesh_color_tex1_fs_source_metal_ios[732] = { 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76, 0x30,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x2e,0x75,0x6e, - 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x6f,0x75, - 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, - 0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f, + 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64, + 0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -1032,7 +1032,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_sim[777] = { { main0_out out = {}; out.frag_color = un_tex0.sample(un_sampler0, in.fs_uv0) * in.fs_color; - if (_32.un_alpha_test > out.frag_color.w) + if (_32.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1041,7 +1041,7 @@ static const uint8_t mesh_color_tex1_vs_source_metal_sim[777] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex1_fs_source_metal_sim[732] = { +static const uint8_t mesh_color_tex1_fs_source_metal_sim[733] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1082,12 +1082,12 @@ static const uint8_t mesh_color_tex1_fs_source_metal_sim[732] = { 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x75,0x76, 0x30,0x29,0x20,0x2a,0x20,0x69,0x6e,0x2e,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x33,0x32,0x2e,0x75,0x6e, - 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x6f,0x75, - 0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a, - 0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69, - 0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29, - 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75, - 0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f, + 0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29, + 0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64, + 0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28, + 0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74, + 0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif static inline const sg_shader_desc* mesh_color_tex1_program_shader_desc(sg_backend backend) { diff --git a/Source/Render/sokol/shaders/mesh_color_tex2.h b/Source/Render/sokol/shaders/mesh_color_tex2.h index f0105218..6147e1e9 100644 --- a/Source/Render/sokol/shaders/mesh_color_tex2.h +++ b/Source/Render/sokol/shaders/mesh_color_tex2.h @@ -215,7 +215,7 @@ static const uint8_t mesh_color_tex2_vs_source_glsl410[945] = { break; } } - if (_29.un_alpha_test > frag_color.w) + if (_29.un_alpha_test >= frag_color.w) { discard; } @@ -223,7 +223,7 @@ static const uint8_t mesh_color_tex2_vs_source_glsl410[945] = { */ #if defined(SOKOL_GLCORE) -static const uint8_t mesh_color_tex2_fs_source_glsl410[1288] = { +static const uint8_t mesh_color_tex2_fs_source_glsl410[1289] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x73,0x74, 0x72,0x75,0x63,0x74,0x20,0x6d,0x65,0x73,0x68,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x5f, 0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d, @@ -301,10 +301,10 @@ static const uint8_t mesh_color_tex2_fs_source_glsl410[1288] = { 0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20, 0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68, - 0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20, - 0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, + 0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20, + 0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -442,7 +442,7 @@ static const uint8_t mesh_color_tex2_vs_source_glsl300es[885] = { break; } } - if (_29.un_alpha_test > frag_color.w) + if (_29.un_alpha_test >= frag_color.w) { discard; } @@ -450,7 +450,7 @@ static const uint8_t mesh_color_tex2_vs_source_glsl300es[885] = { */ #if defined(SOKOL_GLES3) -static const uint8_t mesh_color_tex2_fs_source_glsl300es[1337] = { +static const uint8_t mesh_color_tex2_fs_source_glsl300es[1338] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, @@ -531,10 +531,10 @@ static const uint8_t mesh_color_tex2_fs_source_glsl300es[1337] = { 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20, 0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, 0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70, - 0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, + 0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -751,7 +751,7 @@ static const uint8_t mesh_color_tex2_vs_source_hlsl5[1467] = { break; } } - if (_29_un_alpha_test > frag_color.w) + if (_29_un_alpha_test >= frag_color.w) { discard; } @@ -769,7 +769,7 @@ static const uint8_t mesh_color_tex2_vs_source_hlsl5[1467] = { } */ #if defined(SOKOL_D3D11) -static const uint8_t mesh_color_tex2_fs_source_hlsl5[1794] = { +static const uint8_t mesh_color_tex2_fs_source_hlsl5[1795] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6d,0x65,0x73,0x68,0x5f,0x63,0x6f,0x6c, 0x6f,0x72,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61, 0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28, @@ -861,28 +861,28 @@ static const uint8_t mesh_color_tex2_fs_source_hlsl5[1794] = { 0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65,0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20, 0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20, 0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61, - 0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c, - 0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73, - 0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50, - 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, - 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x31,0x20,0x3d,0x20,0x73,0x74,0x61, - 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x31,0x3b, - 0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d, - 0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74, - 0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20, - 0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61, - 0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63, - 0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e, - 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x00, + 0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, + 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x7d,0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f, + 0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53, + 0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61, + 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x31,0x20,0x3d,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x31, + 0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f, + 0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52, + 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73, + 0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20, + 0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72, + 0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f, + 0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72, + 0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x00, }; #endif /* @@ -1045,7 +1045,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_macos[926] = { break; } } - if (_29.un_alpha_test > out.frag_color.w) + if (_29.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1054,7 +1054,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_macos[926] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex2_fs_source_metal_macos[1566] = { +static const uint8_t mesh_color_tex2_fs_source_metal_macos[1567] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1147,12 +1147,12 @@ static const uint8_t mesh_color_tex2_fs_source_metal_macos[1566] = { 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65, 0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x2e, - 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74, - 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d, + 0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e, + 0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -1315,7 +1315,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_ios[926] = { break; } } - if (_29.un_alpha_test > out.frag_color.w) + if (_29.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1324,7 +1324,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_ios[926] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex2_fs_source_metal_ios[1566] = { +static const uint8_t mesh_color_tex2_fs_source_metal_ios[1567] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1417,12 +1417,12 @@ static const uint8_t mesh_color_tex2_fs_source_metal_ios[1566] = { 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65, 0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x2e, - 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74, - 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d, + 0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e, + 0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -1585,7 +1585,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_sim[926] = { break; } } - if (_29.un_alpha_test > out.frag_color.w) + if (_29.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1594,7 +1594,7 @@ static const uint8_t mesh_color_tex2_vs_source_metal_sim[926] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_color_tex2_fs_source_metal_sim[1566] = { +static const uint8_t mesh_color_tex2_fs_source_metal_sim[1567] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -1687,12 +1687,12 @@ static const uint8_t mesh_color_tex2_fs_source_metal_sim[1566] = { 0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x62,0x72,0x65, 0x61,0x6b,0x3b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20, 0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x39,0x2e, - 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20, - 0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74, - 0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72,0x65, - 0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, + 0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d, + 0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61,0x67,0x6d,0x65,0x6e, + 0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x72, + 0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif static inline const sg_shader_desc* mesh_color_tex2_program_shader_desc(sg_backend backend) { diff --git a/Source/Render/sokol/shaders/mesh_color_texture.glsl b/Source/Render/sokol/shaders/mesh_color_texture.glsl index 4c78fb3d..8b97bd1d 100644 --- a/Source/Render/sokol/shaders/mesh_color_texture.glsl +++ b/Source/Render/sokol/shaders/mesh_color_texture.glsl @@ -91,9 +91,7 @@ void main() { //Modulate each other frag_color = texture(sampler2D(un_tex0, un_sampler0), fs_uv0) * fs_color; #endif //SHADER_TEX_2 - if (un_alpha_test > frag_color.a) { - discard; - } + if (un_alpha_test >= frag_color.a) discard; } @end diff --git a/Source/Render/sokol/shaders/mesh_normal_tex1.h b/Source/Render/sokol/shaders/mesh_normal_tex1.h index 85427c1c..f8300ea8 100644 --- a/Source/Render/sokol/shaders/mesh_normal_tex1.h +++ b/Source/Render/sokol/shaders/mesh_normal_tex1.h @@ -231,7 +231,7 @@ static const uint8_t mesh_normal_tex1_vs_source_glsl410[967] = { frag_color.y = _204.y; frag_color.z = _204.z; } - if (_129.un_alpha_test > frag_color.w) + if (_129.un_alpha_test >= frag_color.w) { discard; } @@ -239,7 +239,7 @@ static const uint8_t mesh_normal_tex1_vs_source_glsl410[967] = { */ #if defined(SOKOL_GLCORE) -static const uint8_t mesh_normal_tex1_fs_source_glsl410[2083] = { +static const uint8_t mesh_normal_tex1_fs_source_glsl410[2084] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x73,0x74, 0x72,0x75,0x63,0x74,0x20,0x6d,0x65,0x73,0x68,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c, 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, @@ -367,10 +367,10 @@ static const uint8_t mesh_normal_tex1_fs_source_glsl410[2083] = { 0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a,0x3b, 0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f, 0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73, - 0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -524,7 +524,7 @@ static const uint8_t mesh_normal_tex1_vs_source_glsl300es[907] = { frag_color.y = _204.y; frag_color.z = _204.z; } - if (_129.un_alpha_test > frag_color.w) + if (_129.un_alpha_test >= frag_color.w) { discard; } @@ -532,7 +532,7 @@ static const uint8_t mesh_normal_tex1_vs_source_glsl300es[907] = { */ #if defined(SOKOL_GLES3) -static const uint8_t mesh_normal_tex1_fs_source_glsl300es[2340] = { +static const uint8_t mesh_normal_tex1_fs_source_glsl300es[2341] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, @@ -676,10 +676,10 @@ static const uint8_t mesh_normal_tex1_fs_source_glsl300es[2340] = { 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, 0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x7d,0x0a,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -905,7 +905,7 @@ static const uint8_t mesh_normal_tex1_vs_source_hlsl5[1415] = { frag_color.y = _204.y; frag_color.z = _204.z; } - if (_129_un_alpha_test > frag_color.w) + if (_129_un_alpha_test >= frag_color.w) { discard; } @@ -923,7 +923,7 @@ static const uint8_t mesh_normal_tex1_vs_source_hlsl5[1415] = { } */ #if defined(SOKOL_D3D11) -static const uint8_t mesh_normal_tex1_fs_source_hlsl5[2843] = { +static const uint8_t mesh_normal_tex1_fs_source_hlsl5[2844] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x6d,0x65,0x73,0x68,0x5f,0x6e,0x6f,0x72, 0x6d,0x61,0x6c,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70, 0x61,0x72,0x61,0x6d,0x73,0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72, @@ -1080,28 +1080,28 @@ static const uint8_t mesh_normal_tex1_fs_source_hlsl5[2843] = { 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, 0x5f,0x31,0x32,0x39,0x5f,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x2e, - 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x4f, - 0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52,0x56, - 0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74,0x61, - 0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20, - 0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, - 0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20,0x20, - 0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x70,0x6f, - 0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f,0x6e, - 0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e, - 0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a, - 0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, - 0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75,0x74, - 0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f, - 0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, - 0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, - 0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72, + 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f, + 0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49,0x52, + 0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73,0x74, + 0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20, + 0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20,0x20, + 0x20,0x20,0x66,0x73,0x5f,0x70,0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x70, + 0x6f,0x73,0x69,0x74,0x69,0x6f,0x6e,0x3b,0x0a,0x20,0x20,0x20,0x20,0x66,0x73,0x5f, + 0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x69, + 0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x6e,0x6f,0x72,0x6d,0x61,0x6c,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b, + 0x0a,0x20,0x20,0x20,0x20,0x53,0x50,0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73, + 0x5f,0x4f,0x75,0x74,0x70,0x75,0x74,0x20,0x73,0x74,0x61,0x67,0x65,0x5f,0x6f,0x75, + 0x74,0x70,0x75,0x74,0x3b,0x0a,0x20,0x20,0x20,0x20,0x73,0x74,0x61,0x67,0x65,0x5f, + 0x6f,0x75,0x74,0x70,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f, + 0x72,0x20,0x3d,0x20,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f,0x6c,0x6f,0x72,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x73,0x74,0x61,0x67,0x65, + 0x5f,0x6f,0x75,0x74,0x70,0x75,0x74,0x3b,0x0a,0x7d,0x0a,0x00, }; #endif /* @@ -1283,7 +1283,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_macos[920] = { out.frag_color.y = _204.y; out.frag_color.z = _204.z; } - if (_129.un_alpha_test > out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1292,7 +1292,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_macos[920] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_normal_tex1_fs_source_metal_macos[2787] = { +static const uint8_t mesh_normal_tex1_fs_source_metal_macos[2788] = { 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, @@ -1462,12 +1462,12 @@ static const uint8_t mesh_normal_tex1_fs_source_metal_macos[2787] = { 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, 0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72, + 0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -1649,7 +1649,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_ios[920] = { out.frag_color.y = _204.y; out.frag_color.z = _204.z; } - if (_129.un_alpha_test > out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -1658,7 +1658,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_ios[920] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_normal_tex1_fs_source_metal_ios[2787] = { +static const uint8_t mesh_normal_tex1_fs_source_metal_ios[2788] = { 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, @@ -1828,12 +1828,12 @@ static const uint8_t mesh_normal_tex1_fs_source_metal_ios[2787] = { 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, 0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72, + 0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -2015,7 +2015,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_sim[920] = { out.frag_color.y = _204.y; out.frag_color.z = _204.z; } - if (_129.un_alpha_test > out.frag_color.w) + if (_129.un_alpha_test >= out.frag_color.w) { discard_fragment(); } @@ -2024,7 +2024,7 @@ static const uint8_t mesh_normal_tex1_vs_source_metal_sim[920] = { */ #if defined(SOKOL_METAL) -static const uint8_t mesh_normal_tex1_fs_source_metal_sim[2787] = { +static const uint8_t mesh_normal_tex1_fs_source_metal_sim[2788] = { 0x23,0x70,0x72,0x61,0x67,0x6d,0x61,0x20,0x63,0x6c,0x61,0x6e,0x67,0x20,0x64,0x69, 0x61,0x67,0x6e,0x6f,0x73,0x74,0x69,0x63,0x20,0x69,0x67,0x6e,0x6f,0x72,0x65,0x64, 0x20,0x22,0x2d,0x57,0x6d,0x69,0x73,0x73,0x69,0x6e,0x67,0x2d,0x70,0x72,0x6f,0x74, @@ -2194,12 +2194,12 @@ static const uint8_t mesh_normal_tex1_fs_source_metal_sim[2787] = { 0x63,0x6f,0x6c,0x6f,0x72,0x2e,0x7a,0x20,0x3d,0x20,0x5f,0x32,0x30,0x34,0x2e,0x7a, 0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28, 0x5f,0x31,0x32,0x39,0x2e,0x75,0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65, - 0x73,0x74,0x20,0x3e,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63,0x6f, - 0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20, - 0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72,0x61, - 0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x20, - 0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x73,0x74,0x20,0x3e,0x3d,0x20,0x6f,0x75,0x74,0x2e,0x66,0x72,0x61,0x67,0x5f,0x63, + 0x6f,0x6c,0x6f,0x72,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20, + 0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66,0x72, + 0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x20,0x20,0x20,0x20,0x72,0x65,0x74,0x75,0x72,0x6e,0x20,0x6f,0x75,0x74,0x3b,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif static inline const sg_shader_desc* mesh_normal_tex1_program_shader_desc(sg_backend backend) { diff --git a/Source/Render/sokol/shaders/mesh_normal_texture.glsl b/Source/Render/sokol/shaders/mesh_normal_texture.glsl index fbe2898f..b08bae53 100644 --- a/Source/Render/sokol/shaders/mesh_normal_texture.glsl +++ b/Source/Render/sokol/shaders/mesh_normal_texture.glsl @@ -89,7 +89,7 @@ void main() { } else { frag_color.xyz = frag_color.xyz * ambient.xyz * ambient_k; } - if (un_alpha_test > frag_color.a) { + if (un_alpha_test >= frag_color.a) { discard; } } diff --git a/Source/Render/sokol/shaders/shadow_normal_tex1.h b/Source/Render/sokol/shaders/shadow_normal_tex1.h index 85b002f9..0b9c6d20 100644 --- a/Source/Render/sokol/shaders/shadow_normal_tex1.h +++ b/Source/Render/sokol/shaders/shadow_normal_tex1.h @@ -125,7 +125,7 @@ static const uint8_t shadow_normal_tex1_vs_source_glsl410[487] = { void main() { - if (shadow_texture_fs_params[0].x > texture(un_tex0_un_sampler0, fs_uv0).w) + if (shadow_texture_fs_params[0].x >= texture(un_tex0_un_sampler0, fs_uv0).w) { discard; } @@ -133,7 +133,7 @@ static const uint8_t shadow_normal_tex1_vs_source_glsl410[487] = { */ #if defined(SOKOL_GLCORE) -static const uint8_t shadow_normal_tex1_fs_source_glsl410[261] = { +static const uint8_t shadow_normal_tex1_fs_source_glsl410[262] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x68,0x61,0x64,0x6f, 0x77,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72, @@ -145,12 +145,12 @@ static const uint8_t shadow_normal_tex1_fs_source_glsl410[261] = { 0x75,0x76,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28, 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x73,0x68,0x61,0x64, 0x6f,0x77,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61, - 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x74,0x65,0x78,0x74, - 0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, - 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30, + 0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -216,7 +216,7 @@ static const uint8_t shadow_normal_tex1_vs_source_glsl300es[469] = { void main() { - if (shadow_texture_fs_params[0].x > texture(un_tex0_un_sampler0, fs_uv0).w) + if (shadow_texture_fs_params[0].x >= texture(un_tex0_un_sampler0, fs_uv0).w) { discard; } @@ -224,7 +224,7 @@ static const uint8_t shadow_normal_tex1_vs_source_glsl300es[469] = { */ #if defined(SOKOL_GLES3) -static const uint8_t shadow_normal_tex1_fs_source_glsl300es[307] = { +static const uint8_t shadow_normal_tex1_fs_source_glsl300es[308] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, @@ -239,12 +239,12 @@ static const uint8_t shadow_normal_tex1_fs_source_glsl300es[307] = { 0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x73,0x68,0x61,0x64,0x6f,0x77, 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x74,0x65,0x78,0x74,0x75,0x72, - 0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -372,7 +372,7 @@ static const uint8_t shadow_normal_tex1_vs_source_hlsl5[931] = { void frag_main() { - if (_27_un_alpha_test > un_tex0.Sample(un_sampler0, fs_uv0).w) + if (_27_un_alpha_test >= un_tex0.Sample(un_sampler0, fs_uv0).w) { discard; } @@ -385,7 +385,7 @@ static const uint8_t shadow_normal_tex1_vs_source_hlsl5[931] = { } */ #if defined(SOKOL_D3D11) -static const uint8_t shadow_normal_tex1_fs_source_hlsl5[483] = { +static const uint8_t shadow_normal_tex1_fs_source_hlsl5[484] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a, @@ -405,18 +405,18 @@ static const uint8_t shadow_normal_tex1_fs_source_hlsl5[483] = { 0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69, 0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a, 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x5f,0x75,0x6e,0x5f,0x61, - 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75,0x6e,0x5f,0x74, - 0x65,0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e, - 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49, - 0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, - 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a, - 0x7d,0x0a,0x00, + 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x75,0x6e,0x5f, + 0x74,0x65,0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, + 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50, + 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b, + 0x0a,0x7d,0x0a,0x00, }; #endif /* @@ -510,7 +510,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_macos[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -518,7 +518,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_macos[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_normal_tex1_fs_source_metal_macos[485] = { +static const uint8_t shadow_normal_tex1_fs_source_metal_macos[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -543,13 +543,13 @@ static const uint8_t shadow_normal_tex1_fs_source_metal_macos[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -643,7 +643,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_ios[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -651,7 +651,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_ios[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_normal_tex1_fs_source_metal_ios[485] = { +static const uint8_t shadow_normal_tex1_fs_source_metal_ios[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -676,13 +676,13 @@ static const uint8_t shadow_normal_tex1_fs_source_metal_ios[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -776,7 +776,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_sim[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -784,7 +784,7 @@ static const uint8_t shadow_normal_tex1_vs_source_metal_sim[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_normal_tex1_fs_source_metal_sim[485] = { +static const uint8_t shadow_normal_tex1_fs_source_metal_sim[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -809,13 +809,13 @@ static const uint8_t shadow_normal_tex1_fs_source_metal_sim[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif static inline const sg_shader_desc* shadow_normal_tex1_program_shader_desc(sg_backend backend) { diff --git a/Source/Render/sokol/shaders/shadow_tex1.h b/Source/Render/sokol/shaders/shadow_tex1.h index c59c0f89..eb3f9c85 100644 --- a/Source/Render/sokol/shaders/shadow_tex1.h +++ b/Source/Render/sokol/shaders/shadow_tex1.h @@ -119,7 +119,7 @@ static const uint8_t shadow_tex1_vs_source_glsl410[447] = { void main() { - if (shadow_texture_fs_params[0].x > texture(un_tex0_un_sampler0, fs_uv0).w) + if (shadow_texture_fs_params[0].x >= texture(un_tex0_un_sampler0, fs_uv0).w) { discard; } @@ -127,7 +127,7 @@ static const uint8_t shadow_tex1_vs_source_glsl410[447] = { */ #if defined(SOKOL_GLCORE) -static const uint8_t shadow_tex1_fs_source_glsl410[261] = { +static const uint8_t shadow_tex1_fs_source_glsl410[262] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x34,0x31,0x30,0x0a,0x0a,0x75,0x6e, 0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x73,0x68,0x61,0x64,0x6f, 0x77,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72, @@ -139,12 +139,12 @@ static const uint8_t shadow_tex1_fs_source_glsl410[261] = { 0x75,0x76,0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28, 0x29,0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x73,0x68,0x61,0x64, 0x6f,0x77,0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61, - 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x74,0x65,0x78,0x74, - 0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73, - 0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, - 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x72,0x61,0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x74,0x65,0x78, + 0x74,0x75,0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f, + 0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30, + 0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -206,7 +206,7 @@ static const uint8_t shadow_tex1_vs_source_glsl300es[429] = { void main() { - if (shadow_texture_fs_params[0].x > texture(un_tex0_un_sampler0, fs_uv0).w) + if (shadow_texture_fs_params[0].x >= texture(un_tex0_un_sampler0, fs_uv0).w) { discard; } @@ -214,7 +214,7 @@ static const uint8_t shadow_tex1_vs_source_glsl300es[429] = { */ #if defined(SOKOL_GLES3) -static const uint8_t shadow_tex1_fs_source_glsl300es[307] = { +static const uint8_t shadow_tex1_fs_source_glsl300es[308] = { 0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x30,0x30,0x20,0x65,0x73,0x0a, 0x70,0x72,0x65,0x63,0x69,0x73,0x69,0x6f,0x6e,0x20,0x6d,0x65,0x64,0x69,0x75,0x6d, 0x70,0x20,0x66,0x6c,0x6f,0x61,0x74,0x3b,0x0a,0x70,0x72,0x65,0x63,0x69,0x73,0x69, @@ -229,12 +229,12 @@ static const uint8_t shadow_tex1_fs_source_glsl300es[307] = { 0x30,0x3b,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a, 0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x73,0x68,0x61,0x64,0x6f,0x77, 0x5f,0x74,0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61, - 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x20,0x74,0x65,0x78,0x74,0x75,0x72, - 0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61,0x6d, - 0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77, - 0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a,0x7d, - 0x0a,0x0a,0x00, + 0x6d,0x73,0x5b,0x30,0x5d,0x2e,0x78,0x20,0x3e,0x3d,0x20,0x74,0x65,0x78,0x74,0x75, + 0x72,0x65,0x28,0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x5f,0x75,0x6e,0x5f,0x73,0x61, + 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e, + 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, + 0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -353,7 +353,7 @@ static const uint8_t shadow_tex1_vs_source_hlsl5[833] = { void frag_main() { - if (_27_un_alpha_test > un_tex0.Sample(un_sampler0, fs_uv0).w) + if (_27_un_alpha_test >= un_tex0.Sample(un_sampler0, fs_uv0).w) { discard; } @@ -366,7 +366,7 @@ static const uint8_t shadow_tex1_vs_source_hlsl5[833] = { } */ #if defined(SOKOL_D3D11) -static const uint8_t shadow_tex1_fs_source_hlsl5[483] = { +static const uint8_t shadow_tex1_fs_source_hlsl5[484] = { 0x63,0x62,0x75,0x66,0x66,0x65,0x72,0x20,0x73,0x68,0x61,0x64,0x6f,0x77,0x5f,0x74, 0x65,0x78,0x74,0x75,0x72,0x65,0x5f,0x66,0x73,0x5f,0x70,0x61,0x72,0x61,0x6d,0x73, 0x20,0x3a,0x20,0x72,0x65,0x67,0x69,0x73,0x74,0x65,0x72,0x28,0x62,0x30,0x29,0x0a, @@ -386,18 +386,18 @@ static const uint8_t shadow_tex1_fs_source_hlsl5[483] = { 0x58,0x43,0x4f,0x4f,0x52,0x44,0x30,0x3b,0x0a,0x7d,0x3b,0x0a,0x0a,0x76,0x6f,0x69, 0x64,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x0a,0x7b,0x0a, 0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x5f,0x75,0x6e,0x5f,0x61, - 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75,0x6e,0x5f,0x74, - 0x65,0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73,0x61, - 0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29,0x2e, - 0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20,0x20, - 0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d,0x0a, - 0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50,0x49, - 0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20,0x73, - 0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20,0x20, - 0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67,0x65, - 0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a,0x20, - 0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b,0x0a, - 0x7d,0x0a,0x00, + 0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20,0x75,0x6e,0x5f, + 0x74,0x65,0x78,0x30,0x2e,0x53,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e,0x5f,0x73, + 0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x29, + 0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, + 0x0a,0x7d,0x0a,0x0a,0x76,0x6f,0x69,0x64,0x20,0x6d,0x61,0x69,0x6e,0x28,0x53,0x50, + 0x49,0x52,0x56,0x5f,0x43,0x72,0x6f,0x73,0x73,0x5f,0x49,0x6e,0x70,0x75,0x74,0x20, + 0x73,0x74,0x61,0x67,0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x29,0x0a,0x7b,0x0a,0x20, + 0x20,0x20,0x20,0x66,0x73,0x5f,0x75,0x76,0x30,0x20,0x3d,0x20,0x73,0x74,0x61,0x67, + 0x65,0x5f,0x69,0x6e,0x70,0x75,0x74,0x2e,0x66,0x73,0x5f,0x75,0x76,0x30,0x3b,0x0a, + 0x20,0x20,0x20,0x20,0x66,0x72,0x61,0x67,0x5f,0x6d,0x61,0x69,0x6e,0x28,0x29,0x3b, + 0x0a,0x7d,0x0a,0x00, }; #endif /* @@ -491,7 +491,7 @@ static const uint8_t shadow_tex1_vs_source_metal_macos[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -499,7 +499,7 @@ static const uint8_t shadow_tex1_vs_source_metal_macos[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_tex1_fs_source_metal_macos[485] = { +static const uint8_t shadow_tex1_fs_source_metal_macos[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -524,13 +524,13 @@ static const uint8_t shadow_tex1_fs_source_metal_macos[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -624,7 +624,7 @@ static const uint8_t shadow_tex1_vs_source_metal_ios[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -632,7 +632,7 @@ static const uint8_t shadow_tex1_vs_source_metal_ios[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_tex1_fs_source_metal_ios[485] = { +static const uint8_t shadow_tex1_fs_source_metal_ios[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -657,13 +657,13 @@ static const uint8_t shadow_tex1_fs_source_metal_ios[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif /* @@ -757,7 +757,7 @@ static const uint8_t shadow_tex1_vs_source_metal_sim[578] = { fragment void main0(main0_in in [[stage_in]], constant shadow_texture_fs_params& _27 [[buffer(0)]], texture2d un_tex0 [[texture(0)]], sampler un_sampler0 [[sampler(0)]]) { - if (_27.un_alpha_test > un_tex0.sample(un_sampler0, in.fs_uv0).w) + if (_27.un_alpha_test >= un_tex0.sample(un_sampler0, in.fs_uv0).w) { discard_fragment(); } @@ -765,7 +765,7 @@ static const uint8_t shadow_tex1_vs_source_metal_sim[578] = { */ #if defined(SOKOL_METAL) -static const uint8_t shadow_tex1_fs_source_metal_sim[485] = { +static const uint8_t shadow_tex1_fs_source_metal_sim[486] = { 0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x20,0x3c,0x6d,0x65,0x74,0x61,0x6c,0x5f, 0x73,0x74,0x64,0x6c,0x69,0x62,0x3e,0x0a,0x23,0x69,0x6e,0x63,0x6c,0x75,0x64,0x65, 0x20,0x3c,0x73,0x69,0x6d,0x64,0x2f,0x73,0x69,0x6d,0x64,0x2e,0x68,0x3e,0x0a,0x0a, @@ -790,13 +790,13 @@ static const uint8_t shadow_tex1_fs_source_metal_sim[485] = { 0x70,0x6c,0x65,0x72,0x20,0x75,0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30, 0x20,0x5b,0x5b,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x28,0x30,0x29,0x5d,0x5d,0x29, 0x0a,0x7b,0x0a,0x20,0x20,0x20,0x20,0x69,0x66,0x20,0x28,0x5f,0x32,0x37,0x2e,0x75, - 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x20,0x75, - 0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75,0x6e, - 0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66,0x73, - 0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a,0x20, - 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f,0x66, - 0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20,0x7d, - 0x0a,0x7d,0x0a,0x0a,0x00, + 0x6e,0x5f,0x61,0x6c,0x70,0x68,0x61,0x5f,0x74,0x65,0x73,0x74,0x20,0x3e,0x3d,0x20, + 0x75,0x6e,0x5f,0x74,0x65,0x78,0x30,0x2e,0x73,0x61,0x6d,0x70,0x6c,0x65,0x28,0x75, + 0x6e,0x5f,0x73,0x61,0x6d,0x70,0x6c,0x65,0x72,0x30,0x2c,0x20,0x69,0x6e,0x2e,0x66, + 0x73,0x5f,0x75,0x76,0x30,0x29,0x2e,0x77,0x29,0x0a,0x20,0x20,0x20,0x20,0x7b,0x0a, + 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x64,0x69,0x73,0x63,0x61,0x72,0x64,0x5f, + 0x66,0x72,0x61,0x67,0x6d,0x65,0x6e,0x74,0x28,0x29,0x3b,0x0a,0x20,0x20,0x20,0x20, + 0x7d,0x0a,0x7d,0x0a,0x0a,0x00, }; #endif static inline const sg_shader_desc* shadow_tex1_program_shader_desc(sg_backend backend) { diff --git a/Source/Render/sokol/shaders/shadow_texture.glsl b/Source/Render/sokol/shaders/shadow_texture.glsl index 5e737ca5..bd2e317f 100644 --- a/Source/Render/sokol/shaders/shadow_texture.glsl +++ b/Source/Render/sokol/shaders/shadow_texture.glsl @@ -43,9 +43,7 @@ layout(location=0) in vec2 fs_uv0; void main() { vec4 color = texture(sampler2D(un_tex0, un_sampler0), fs_uv0); - if (un_alpha_test > color.a) { - discard; - } + if (un_alpha_test >= color.a) discard; } @end