From: Terri00 Date: Fri, 21 Jun 2019 13:46:01 +0000 (+0100) Subject: Fixed height overrides X-Git-Url: https://harrygodden.com/git/?a=commitdiff_plain;h=6c79d7353d2ba7149deb31bb8e17849ac99aa94a;p=tar-legacy.git Fixed height overrides --- diff --git a/MCDV/sample_stuff/de_tavr_test.vmx b/MCDV/sample_stuff/de_tavr_test.vmx index 2278daf..8e357a0 100644 --- a/MCDV/sample_stuff/de_tavr_test.vmx +++ b/MCDV/sample_stuff/de_tavr_test.vmx @@ -2,7 +2,7 @@ versioninfo { "editorversion" "400" "editorbuild" "8075" - "mapversion" "345" + "mapversion" "357" "formatversion" "100" "prefab" "0" } @@ -44,7 +44,7 @@ viewsettings world { "id" "1" - "mapversion" "345" + "mapversion" "357" "classname" "worldspawn" "detailmaterial" "detail/detailsprites" "detailvbsp" "detail.vbsp" @@ -2637,17 +2637,28 @@ world } entity { - "id" "2894" - "classname" "tar_map_divider" - "maxs" "4096 4096 2" - "mins" "-4096 -4096 -2" - "origin" "-80 0 -64" + "id" "2969" + "classname" "tar_max" + "origin" "-368.448 -11.867 140.175" editor { "color" "127 224 0" "visgroupshown" "1" "visgroupautoshown" "1" - "logicalpos" "[0 0]" + "logicalpos" "[0 1000]" + } +} +entity +{ + "id" "2971" + "classname" "tar_min" + "origin" "-344.583 -139.156 33" + editor + { + "color" "127 224 0" + "visgroupshown" "1" + "visgroupautoshown" "1" + "logicalpos" "[0 1500]" } } entity @@ -2656,25 +2667,26 @@ entity "classname" "tar_config" "aoSize" "1000" "background" "grid.png" - "colorScheme" "5" + "colorScheme" "7" "customCol0" "104 15 15" "customCol1" "64 166 38" "customCol2" "44 199 199" - "ddsMode" "0" + "ddsMode" "2" "enableAO" "1" + "enableOutline" "0" "ObjectiveUseStripes" "1" "outlineWidth" "2" - "ssaam" "3" + "ssaam" "1" "vgroup_cover" "tar_cover" "vgroup_layout" "tar_layout" "vgroup_negative" "tar_mask" "vgroup_overlap" "tar_overlap" "zColAO" "0 0 0 255" - "zColBuyzone" "46 211 57 170" + "zColBuyzone" "46 211 57 255" "zColCover" "179 179 179 255" "zColCover2" "85 85 85 170" "zColObjective" "0 128 255 255" - "zColOutline" "204 204 204 153" + "zColOutline" "204 204 204 255" "origin" "-240 592 33" editor { @@ -3415,10 +3427,10 @@ entity side { "id" "315" - "plane" "(-384 -512 160) (-384 -128 160) (96 -128 160)" + "plane" "(-496 -576 160) (-496 -192 160) (-16 -192 160)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[1 0 0 -25.6] 3.75" - "vaxis" "[0 -1 0 -42.6667] 3" + "uaxis" "[1 0 0 4.26667] 3.75" + "vaxis" "[0 -1 0 -64] 3" "rotation" "0" "lightmapscale" "16" "smoothing_groups" "0" @@ -3426,10 +3438,10 @@ entity side { "id" "314" - "plane" "(-384 -128 16) (-384 -512 16) (96 -512 16)" + "plane" "(-496 -192 16) (-496 -576 16) (-16 -576 16)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[1 0 0 -25.6] 3.75" - "vaxis" "[0 -1 0 -42.6667] 3" + "uaxis" "[1 0 0 4.26667] 3.75" + "vaxis" "[0 -1 0 -64] 3" "rotation" "0" "lightmapscale" "16" "smoothing_groups" "0" @@ -3437,9 +3449,9 @@ entity side { "id" "313" - "plane" "(-384 -512 16) (-384 -128 16) (-384 -128 160)" + "plane" "(-496 -576 16) (-496 -192 16) (-496 -192 160)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[0 1 0 42.6667] 3" + "uaxis" "[0 1 0 64] 3" "vaxis" "[0 0 -1 14.2222] 1.125" "rotation" "0" "lightmapscale" "16" @@ -3448,9 +3460,9 @@ entity side { "id" "312" - "plane" "(96 -128 16) (96 -512 16) (96 -512 160)" + "plane" "(-16 -192 16) (-16 -576 16) (-16 -576 160)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[0 1 0 42.6667] 3" + "uaxis" "[0 1 0 64] 3" "vaxis" "[0 0 -1 14.2222] 1.125" "rotation" "0" "lightmapscale" "16" @@ -3459,9 +3471,9 @@ entity side { "id" "311" - "plane" "(-384 -128 16) (96 -128 16) (96 -128 160)" + "plane" "(-496 -192 16) (-16 -192 16) (-16 -192 160)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[1 0 0 -25.6] 3.75" + "uaxis" "[1 0 0 4.26667] 3.75" "vaxis" "[0 0 -1 14.2222] 1.125" "rotation" "0" "lightmapscale" "16" @@ -3470,9 +3482,9 @@ entity side { "id" "310" - "plane" "(96 -512 16) (-384 -512 16) (-384 -512 160)" + "plane" "(-16 -576 16) (-496 -576 16) (-496 -576 160)" "material" "TERRI/TOOLS/TOOLS_TRIGGER" - "uaxis" "[1 0 0 -25.6] 3.75" + "uaxis" "[1 0 0 4.26667] 3.75" "vaxis" "[0 0 -1 14.2222] 1.125" "rotation" "0" "lightmapscale" "16" diff --git a/MCDV/shaders/fullscreenbase.fs b/MCDV/shaders/fullscreenbase.fs index cf992c0..dbd0d1e 100644 --- a/MCDV/shaders/fullscreenbase.fs +++ b/MCDV/shaders/fullscreenbase.fs @@ -1,4 +1,6 @@ #version 330 core +// I sincerily apologize to anyone reading this mess of a shader... -Terri00 21 6 19 + // OPENGL // ____________________________________________________________________________________________ in vec2 TexCoords; @@ -147,6 +149,25 @@ float kernel_filter_glow(usampler2D sampler, int sample_size, int inverse) return r * r; } +float _kernel_filter_glow(usampler2D sampler, usampler2D samplerMask, int sample_size, int inverse) +{ + vec2 pixel_size = 1.0 / vec2(textureSize(sampler, 0)); + + uint sT = 0U; + int sample_double = sample_size * 2; + + // Process kernel + for(int x = 0; x <= sample_double; x++){ + for(int y = 0; y <= sample_double; y++){ + if(inverse == 0) + sT += (texture(sampler, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r) * texture(samplerMask, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r; + else sT += (1U - texture(sampler, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r) * texture(samplerMask, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r; + } + } + float r = float(sT) / (sample_double * sample_double); + return r * r; +} + // Given a 0-1 mask, return an outline drawn around that mask float kernel_filter_outline(usampler2D sampler, int sample_size) { @@ -167,6 +188,27 @@ float kernel_filter_outline(usampler2D sampler, int sample_size) return float(max(min(sT, 1U) - texture(sampler, TexCoords).r, 0U)); } +// Given a 0-1 mask, return an outline drawn around that mask +float _kernel_filter_outline(usampler2D sampler, usampler2D samplerMask, int sample_size) +{ + vec2 pixel_size = 1.0 / vec2(textureSize(sampler, 0)); + + float sT = 0; + int sample_double = sample_size * 2; + + // Process kernel + for(int x = 0; x <= sample_double; x++){ + for(int y = 0; y <= sample_double; y++){ + sT += + (sample_size - min(length(vec2(-sample_size + x, -sample_size + y)), sample_size)) * + float(texture(sampler, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r) * + texture(samplerMask, TexCoords + vec2((-sample_size + x) * pixel_size.x, (-sample_size + y) * pixel_size.y)).r; + } + } + + return float(max(min(sT, 1U) - (texture(sampler, TexCoords).r * texture(samplerMask, TexCoords).r), 0U)); +} + void main() { //vec4 s_background = texture(tex_background, TexCoords); @@ -239,40 +281,42 @@ void main() final = blend_normal(final, color_objective, // Objectives ( - (kernel_filter_glow(umask_objectives, 13 * mssascale, 1)) + (_kernel_filter_glow(umask_objectives, umask_playspace, 13 * mssascale, 1)) * m_objectives * ( 1 - float((s_info >> 7) & 0x1U)) ) + ( - kernel_filter_outline(umask_objectives, 3 * mssascale) * 0.9 + _kernel_filter_outline(umask_objectives, umask_playspace, 3 * mssascale) * 0.9 * ( 1 - float((s_info >> 7) & 0x1U)) * clamp(s_modulate_1_5.r + blend_objective_stripes, 0, 1) ) + ( - (kernel_filter_glow(umask_objectives, 13 * mssascale, 0)) + (_kernel_filter_glow(umask_objectives, umask_playspace, 13 * mssascale, 0)) * ( 1 - m_objectives ) * ( 1 - float((s_info >> 7) & 0x1U)) ) + + (float(texture(umask_objectives, TexCoords).r * texture(umask_playspace, TexCoords).r) * 0.08) ); - final = blend_normal(final, color_buyzone, // Objectives + final = blend_normal(final, color_buyzone, // Buyzone ( - (kernel_filter_glow(umask_buyzone, 13 * mssascale, 1)) + (_kernel_filter_glow(umask_buyzone, umask_playspace, 13 * mssascale, 1)) * m_buyzones * ( 1 - float((s_info >> 7) & 0x1U)) ) + ( - kernel_filter_outline(umask_buyzone, 3 * mssascale) * 0.9 + _kernel_filter_outline(umask_buyzone, umask_playspace, 3 * mssascale) * 0.9 * ( 1 - float((s_info >> 7) & 0x1U)) ) + ( - (kernel_filter_glow(umask_buyzone, 13 * mssascale, 0)) + (_kernel_filter_glow(umask_buyzone, umask_playspace, 13 * mssascale, 0)) * ( 1 - m_buyzones ) * ( 1 - float((s_info >> 7) & 0x1U)) ) + + (float(texture(umask_buyzone, TexCoords).r * texture(umask_playspace, TexCoords).r) * 0.07) ); FragColor = final; diff --git a/MCDV/tar_config.hpp b/MCDV/tar_config.hpp index 860bac5..1adf93a 100644 --- a/MCDV/tar_config.hpp +++ b/MCDV/tar_config.hpp @@ -139,10 +139,10 @@ public: std::cout << -this->m_map_bounds.SEL.x << "," << this->m_map_bounds.SEL.y << "," << this->m_map_bounds.SEL.z << "\n"; for (auto && min : v->get_entities_by_classname("tar_min")) - this->m_map_bounds.SEL.y = glm::min(min->m_origin.y, this->m_map_bounds.SEL.y); + this->m_map_bounds.SEL.y = glm::max(min->m_origin.y, this->m_map_bounds.SEL.y); for(auto && max : v->get_entities_by_classname("tar_max")) - this->m_map_bounds.NWU.y = glm::max(max->m_origin.y, this->m_map_bounds.NWU.y); + this->m_map_bounds.NWU.y = glm::min(max->m_origin.y, this->m_map_bounds.NWU.y); float padding = 128.0f; diff --git a/MCDV/vmf_new.hpp b/MCDV/vmf_new.hpp index 3ea75ab..bd43e7b 100644 --- a/MCDV/vmf_new.hpp +++ b/MCDV/vmf_new.hpp @@ -505,8 +505,8 @@ public: std::vector intersecting; float x, _x, y, _y, z, _z; - _x = _y = _z = 99999.0f;// std::numeric_limits::max(); - x = y = z = -99999.0f;// std::numeric_limits::min(); + x = _y = _z = 99999.0f;// std::numeric_limits::max(); + _x = y = z = -99999.0f;// std::numeric_limits::min(); for (int i = 0; i < m_sides.size(); i++) { for (int j = 0; j < m_sides.size(); j++) { @@ -548,10 +548,10 @@ public: intersecting.push_back(p); // Calculate bounds - _x = glm::round(glm::min(_x, p.x)); + _x = glm::round(glm::max(_x, p.x)); _y = glm::round(glm::min(_y, p.y)); _z = glm::round(glm::min(_z, p.z)); - x = glm::round(glm::max(x, p.x)); + x = glm::round(glm::min(x, p.x)); y = glm::round(glm::max(y, p.y)); z = glm::round(glm::max(z, p.z)); }