Fixed height overrides
authorTerri00 <thrustmediaproductions@gmail.com>
Fri, 21 Jun 2019 13:46:01 +0000 (14:46 +0100)
committerTerri00 <thrustmediaproductions@gmail.com>
Fri, 21 Jun 2019 13:46:01 +0000 (14:46 +0100)
MCDV/sample_stuff/de_tavr_test.vmx
MCDV/shaders/fullscreenbase.fs
MCDV/tar_config.hpp
MCDV/vmf_new.hpp

index 2278daf12d9975e76335ba5c97de736d533fe8ad..8e357a0740a0328fa27675c3fcb6195c3e1ff4f3 100644 (file)
@@ -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"
index cf992c01d7debdd8f777ac802f94fabc1151fd36..dbd0d1e5278a72f2c3e9f9545fac6c795e3244c0 100644 (file)
@@ -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;
index 860bac5252dbe1c988e461a4124a3d6cf8c10e49..1adf93a97544b91f24fbbaf16689774338fa15bf 100644 (file)
@@ -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;
 
index 3ea75abc6a50daf0a573cc61517e90e30624cf3e..bd43e7bcc5479fc67184683908f98af9a6b314b0 100644 (file)
@@ -505,8 +505,8 @@ public:
                std::vector<glm::vec3> intersecting;
 
                float x, _x, y, _y, z, _z;
-               _x = _y = _z = 99999.0f;// std::numeric_limits<float>::max();
-               x = y = z = -99999.0f;// std::numeric_limits<float>::min();
+               x = _y = _z = 99999.0f;// std::numeric_limits<float>::max();
+               _x = y = z = -99999.0f;// std::numeric_limits<float>::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));
                                }