better compositor shader
authorTerri00 <thrustmediaproductions@gmail.com>
Tue, 12 Mar 2019 02:49:04 +0000 (02:49 +0000)
committerTerri00 <thrustmediaproductions@gmail.com>
Tue, 12 Mar 2019 02:49:04 +0000 (02:49 +0000)
MCDV/1whammy.png
MCDV/buyzone-bombtargets.png
MCDV/de_tavr_test.txt
MCDV/main.cpp
MCDV/playable-space.png
MCDV/shaders/ss_precomp_objectives.fs
MCDV/shaders/ss_precomp_playspace.fs
MCDV/shaders/ss_test.fs

index 276895e840647660360f006af8183544f1596990..51629779c659fdc39cbb80774747e85d7f695f2c 100644 (file)
Binary files a/MCDV/1whammy.png and b/MCDV/1whammy.png differ
index 85f457b597f86bcb26c5aca8f9ffa55d9999786f..0257a6d9df450c6233e11bcd724f70605458ad8e 100644 (file)
Binary files a/MCDV/buyzone-bombtargets.png and b/MCDV/buyzone-bombtargets.png differ
index efdf1b42f9a98b9ce589dbefe4f371df5f47b7db..449d681ed3142f6293a89724729b4b1545187036 100644 (file)
@@ -1,12 +1,10 @@
 // TAVR - AUTO RADAR. v 2.0.0
 de_tavr_test
 {
-       "CTSpawn_x" "0.400000"
-       "CTSpawn_y" "0.060000"
-       "TSpawn_x" "0.300000"
-       "TSpawn_y" "0.880000"
+       "TSpawn_x" "0.700000"
+       "TSpawn_y" "0.330000"
        "material" "overviews/de_tavr_test"
-       "pos_x" "-1832.000000"
-       "pos_y" "1728.000000"
-       "scale" "5.190000"
+       "pos_x" "-2432.000000"
+       "pos_y" "3531.000000"
+       "scale" "4.880000"
 }
index 5c1bc3724b4a3f0920adc1eecd945874e334d0f6..3e1f01c94c8842ee0f8bfcbeba73835078368180 100644 (file)
@@ -39,7 +39,7 @@ void render_to_png(int x, int y, const char* filepath){
 
 int main(int argc, char* argv[]) {
        std::cout << "Loading VMF\n";
-       vmf::vmf vmf_main("map_01.vmf");
+       vmf::vmf vmf_main("de_tavr_test.vmf");
 
        std::cout << "Initializing OpenGL\n";
 
index e4bc264b0c3b09143113df94b1bfc368a26476d0..66186d9492799c25750334db82f1f38c227899c3 100644 (file)
Binary files a/MCDV/playable-space.png and b/MCDV/playable-space.png differ
index aa692267a22a708594f185de2b59bf36fd42c6c6..d096411082c5c8532d914f6696570c027f1e1873 100644 (file)
@@ -1,6 +1,4 @@
 #version 330 core
-// Note:: All channels marked with an ** are currently not filled out by the engine.
-
 //                                         OPENGL
 // ____________________________________________________________________________________________
 in vec2 TexCoords;
@@ -13,7 +11,7 @@ uniform sampler2D tex_in;     // Background texture
 
 //                                       SHADER HELPERS
 // ____________________________________________________________________________________________
-//     ( A collection of simple blend modes )
+//     ( Simple sample with offset )
 vec2 pixel_size = 1.0 / vec2(textureSize(tex_in, 0));
 vec4 getSample(vec2 offset)
 {
@@ -28,20 +26,22 @@ void main()
 {
        vec4 sIn = getSample(vec2(0,0));
 
-       int sampleCount = 32;
+       //Temp
+       int sampleCount = 64;
        int outlineWidth = 1;
 
        vec2 sT = vec2(0, 0);
-       vec2 thisHeight = vec2(1, 1)-getSample(vec2(0,0)).rg;
 
+       // Glow sampler ==========================================================
        for(int x = 0; x <= sampleCount; x++)
        {
                for(int y = 0; y <= sampleCount; y++)
                {
-                       sT +=  vec2(1, 1)-getSample(vec2(-16 + x,-16 + y)).rg;
+                       sT += (vec2(1, 1)-getSample(vec2(-32 + x,-32 + y)).rg) * (1 - ((abs(-32 +x) * abs(-32 +y)) / 512));
                }
        }
 
+       // Outline sampler =======================================================
        vec2 olT = vec2(0, 0);
        for(int x = 0; x <= outlineWidth * 2; x++)
        {
@@ -54,9 +54,7 @@ void main()
        float global_opacity = 0.25;
 
        sT /= (sampleCount * sampleCount);
-       sT *= 0.5;
+       sT = vec2(pow(sT.r, 1.5), pow(sT.g, 1.5));
+       sT *= 0.75;
        FragColor = vec4((sIn.r * olT.r) + (sIn.r * sT.r) + (sIn.r * global_opacity), (sIn.g * olT.g) + (sIn.g * sT.g) + (sIn.g * global_opacity), 0, sIn.r + sIn.g);
-       //r: sIn
-       //g: olT
-       //b: sT
 }
\ No newline at end of file
index d9fa6b548947f86117f1831e3ec47389e3ae4f8f..3940ef9e8a12f7c12b9138efdf14dc4ed4c603cf 100644 (file)
@@ -1,6 +1,4 @@
 #version 330 core
-// Note:: All channels marked with an ** are currently not filled out by the engine.
-
 //                                         OPENGL
 // ____________________________________________________________________________________________
 in vec2 TexCoords;
@@ -13,7 +11,7 @@ uniform sampler2D tex_in;     // Background texture
 
 //                                       SHADER HELPERS
 // ____________________________________________________________________________________________
-//     ( A collection of simple blend modes )
+//     ( Simple sample with offset )
 vec2 pixel_size = 1.0 / vec2(textureSize(tex_in, 0));
 vec4 getSample(vec2 offset)
 {
@@ -33,12 +31,12 @@ void main()
        } 
        else
        {
+               //Temp
                int sampleCount = 32;
                int outlineWidth = 2;
 
+               // Glow sampler ==========================================================
                float sT = 0;
-               float thisHeight = getSample(vec2(0,0)).g;
-
                for(int x = 0; x <= sampleCount; x++)
                {
                        for(int y = 0; y <= sampleCount; y++)
@@ -47,8 +45,11 @@ void main()
                        }
                }
 
+               //Adjust slightly
                sT *= 2;
+               sT /= (sampleCount * sampleCount);
 
+               // Outline sampler =======================================================
                float olT = 0;
                for(int x = 0; x <= outlineWidth * 2; x++)
                {
@@ -57,10 +58,7 @@ void main()
                                olT += getSample(vec2(-outlineWidth + x,-outlineWidth + y)).r;
                        }
                }
-
-               clamp(olT, 0, 1);
-
-               sT /= (sampleCount * sampleCount);
+               
                FragColor = vec4(sIn.r, sIn.g, sT, olT);
        }
 }
\ No newline at end of file
index b8f3b1fb60e34eb0b584ed91cac54bb7c2282e08..de8a4807feaeb4e17baf143f5d3ccfdf62ce3472 100644 (file)
@@ -84,6 +84,12 @@ void main()
        vec4 sPlayspace = vec4(texture(tex_playspace, TexCoords));
        vec4 sObjectives = vec4(texture(tex_objectives, TexCoords));
 
+       vec4 final = sBackground;
+       final = blend_normal(final, ao_color, sPlayspace.b);
+       final = blend_normal(final, sample_gradient(sPlayspace.g), sPlayspace.r);
+       final = blend_normal(final, outline_color, sPlayspace.a - sPlayspace.r);
+       final = blend_add(final, sObjectives, sObjectives.a);
+
        // Return the final output color
-       FragColor = blend_add(blend_normal(blend_normal(blend_normal(sBackground, ao_color, sPlayspace.b), sample_gradient(sPlayspace.g), sPlayspace.r), outline_color, sPlayspace.a -sPlayspace.r), sObjectives, sObjectives.a * 0.75);
+       FragColor = final;
 }
\ No newline at end of file