Fixes #12 [prop_statics with blank model reference]
authorTerri00 <thrustmediaproductions@gmail.com>
Tue, 25 Jun 2019 20:19:35 +0000 (21:19 +0100)
committerTerri00 <thrustmediaproductions@gmail.com>
Tue, 25 Jun 2019 20:19:35 +0000 (21:19 +0100)
13 files changed:
MCDV/dds.hpp
MCDV/layer0.png
MCDV/layer1.png
MCDV/layerx.png
MCDV/main2.cpp
MCDV/sample_stuff/de_tavr_test.vmx
MCDV/shaders/fullscreenbase.fs
MCDV/shaders/ss_comp_multilayer_blend.fs
MCDV/tar_config.hpp
MCDV/vmf_new.hpp
tar_entities/tar_color.png [new file with mode: 0644]
tar_entities/tar_color.psd [new file with mode: 0644]
tar_entities/tar_color.vtf [new file with mode: 0644]

index b5d6383f7e00d33844307b9eede37d5764dd90f8..1997a76b87c7a6b55843afa1d827deeb418c29e8 100644 (file)
@@ -43,7 +43,8 @@ enum IMG {
        MODE_RGB888,
        MODE_RGBA8888,
        MODE_DXT1,
-       MODE_DXT5
+       MODE_DXT5,
+       MODE_DXT1_1BA
 };
 
 UINT32 SwapEndian(UINT32 val)
@@ -90,8 +91,9 @@ compressedSize: Pointer to final data size
 w: image width
 h: image height
 mode: compression mode to use
+useAlpha: Use 1 bit alpha.
 */
-uint8_t* compressImageDXT1(uint8_t* buf_RGB, uint32_t w, uint32_t h, uint32_t* cSize) {
+uint8_t* compressImageDXT1(uint8_t* buf_RGB, uint32_t w, uint32_t h, uint32_t* cSize, bool useAlpha = false) {
        *cSize = ((w / 4) * (h / 4)) * BLOCK_SIZE_DXT1;
 
        //Create output buffer
@@ -113,14 +115,23 @@ uint8_t* compressImageDXT1(uint8_t* buf_RGB, uint32_t w, uint32_t h, uint32_t* c
                        uint8_t* src = new uint8_t[64]; //Create source RGBA buffer
                        for (int _y = 0; _y < 4; _y++) {
                                for (int _x = 0; _x < 4; _x++) {
-                                       src[(_x + (_y * 4)) * 4 + 0] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 0];
-                                       src[(_x + (_y * 4)) * 4 + 1] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 1];
-                                       src[(_x + (_y * 4)) * 4 + 2] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 2];
-                                       src[(_x + (_y * 4)) * 4 + 3] = 0xFF;
+                                       src[(_x + (_y * 4)) * 4 + 0] = buf_RGB[(globalX + _x + ((h - (globalY + _y) - 1) * w)) * 4 + 0];
+                                       src[(_x + (_y * 4)) * 4 + 1] = buf_RGB[(globalX + _x + ((h - (globalY + _y) - 1) * w)) * 4 + 1];
+                                       src[(_x + (_y * 4)) * 4 + 2] = buf_RGB[(globalX + _x + ((h - (globalY + _y) - 1) * w)) * 4 + 2];
+                                       src[(_x + (_y * 4)) * 4 + 3] = buf_RGB[(globalX + _x + ((h - (globalY + _y) - 1) * w)) * 4 + 3];
                                }
                        }
 
                        stb_compress_dxt_block((unsigned char*)outBuffer + (blockindex * BLOCK_SIZE_DXT1), src, 0, STB_DXT_HIGHQUAL);
+                       
+                       // We need to do 1ba manually weeee
+                       if (useAlpha) {
+                               for (int i = 0; i < 16; i++) {
+                                       if (src[(i * 4) + 3] < 0xFFFFFFF) {
+                                               *((unsigned char*)outBuffer + (blockindex * BLOCK_SIZE_DXT1) + (i / 4) + 4) |= (0x3 << (i % 4));
+                                       }
+                               }
+                       }
 
                        free(src);
                }
@@ -158,10 +169,10 @@ uint8_t* compressImageDXT5(uint8_t* buf_RGB, uint32_t w, uint32_t h, uint32_t* c
                        uint8_t* src = new uint8_t[64]; //Create source RGBA buffer
                        for (int _y = 0; _y < 4; _y++) {
                                for (int _x = 0; _x < 4; _x++) {
-                                       src[(_x + (_y * 4)) * 4 + 0] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 0];
-                                       src[(_x + (_y * 4)) * 4 + 1] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 1];
-                                       src[(_x + (_y * 4)) * 4 + 2] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 3 + 2];
-                                       src[(_x + (_y * 4)) * 4 + 3] = 0xFF;
+                                       src[(_x + (_y * 4)) * 4 + 0] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 4 + 0];
+                                       src[(_x + (_y * 4)) * 4 + 1] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 4 + 1];
+                                       src[(_x + (_y * 4)) * 4 + 2] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 4 + 2];
+                                       src[(_x + (_y * 4)) * 4 + 3] = buf_RGB[(globalX + _x + ((h - (globalY + _y)) * w)) * 4 + 3];
                                }
                        }
 
@@ -186,12 +197,14 @@ bool dds_write(uint8_t* imageData, const char* filename, uint32_t w, uint32_t h,
        int final_image_size = 0;
 
        switch (mode) {
+       case IMG::MODE_DXT1_1BA:
+               header.ddspf.dwFlags |= DDPF_ALPHA;
        case IMG::MODE_DXT1:
                header.dwPitchOrLinearSize = SwapEndian(__max(1, ((w + 3) / 4)) * BLOCK_SIZE_DXT1);
                header.ddspf.dwFlags |= DDPF_FOURCC;
                header.ddspf.dwFourCC = SwapEndian((uint32_t)'DXT1');
                header.dwFlags |= DDSD_LINEARSIZE;
-               
+
                break;
        case IMG::MODE_DXT5:
                header.dwPitchOrLinearSize = SwapEndian(__max(1, ((w + 3) / 4)) * BLOCK_SIZE_DXT5);
@@ -247,6 +260,11 @@ bool dds_write(uint8_t* imageData, const char* filename, uint32_t w, uint32_t h,
                uint8_t* outputBuffer = compressImageDXT1(imageData, w, h, &size);
                output.write((char*)outputBuffer, size);
        }
+       else if (mode == IMG::MODE_DXT1_1BA) {
+               uint32_t size;
+               uint8_t* outputBuffer = compressImageDXT1(imageData, w, h, &size, true);
+               output.write((char*)outputBuffer, size);
+       }
        else if (mode == IMG::MODE_DXT5) {
                uint32_t size;
                uint8_t* outputBuffer = compressImageDXT5(imageData, w, h, &size);
index 0bb5b28c002624d4aef85711a4956b9f43c228e8..42af8fe471daa17d2832c993fa627072aab2fcb5 100644 (file)
Binary files a/MCDV/layer0.png and b/MCDV/layer0.png differ
index a76b4d392ceb0db1806c087083a817b289d3016b..e435f64acb7290112f5011df38781577fdf9070f 100644 (file)
Binary files a/MCDV/layer1.png and b/MCDV/layer1.png differ
index 33eaa871b569e56d36fd0fa7f57a84beb21882b8..3767dd23a5c28aec635d492fbcf48de538a6f276 100644 (file)
Binary files a/MCDV/layerx.png and b/MCDV/layerx.png differ
index 231e4e5d7532493220bd667b070b6cfa6ff9e500..ce2718b44d311393dc8fbcc8023de2f02fed7192 100644 (file)
@@ -78,7 +78,7 @@ uint32_t g_msaa_mul = 1;
 void render_to_png(int x, int y, const char* filepath);
 void save_to_dds(int x, int y, const char* filepath, IMG imgmode = IMG::MODE_DXT1);
 
-#define _DEBUG
+//#define _DEBUG
 
 int app(int argc, const char** argv) {
 #ifndef _DEBUG
@@ -261,6 +261,8 @@ int app(int argc, const char** argv) {
                        _flayers[l]->BindHeightToTexSlot(0);
 
                        g_shader_multilayer_blend->setFloat("layer_target", !above? l->layer_min: l->layer_max);
+                       g_shader_multilayer_blend->setFloat("layer_min", l->layer_min);
+                       g_shader_multilayer_blend->setFloat("layer_max", l->layer_max);
                        
                        g_mesh_screen_quad->Draw();
                }
@@ -268,6 +270,8 @@ int app(int argc, const char** argv) {
                //g_shader_multilayer_blend->setFloat("saturation", 1.0f);
                //g_shader_multilayer_blend->setFloat("value", 1.0f);
                g_shader_multilayer_blend->setFloat("active", 1.0f);
+               g_shader_multilayer_blend->setFloat("layer_min", megalayer.layer_min);
+               g_shader_multilayer_blend->setFloat("layer_max", megalayer.layer_max);
 
                _flayers[&megalayer]->BindRTToTexSlot(1);
                _flayers[&megalayer]->BindHeightToTexSlot(0);
@@ -316,73 +320,87 @@ int app(int argc, const char** argv) {
 
                // final composite
                //render_to_png(1024, 1024, ("comp" + std::to_string(i++) + ".png").c_str());
+
                if (i == 0) {
-                       save_to_dds(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name +"_radar.dds", true).c_str(), g_tar_config->m_dds_img_mode);
+                       if(g_tar_config->m_write_dds)
+                               save_to_dds(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name +"_radar.dds", true).c_str(), g_tar_config->m_dds_img_mode);
+
+                       if(g_tar_config->m_write_png)
+                               render_to_png(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + "_radar.png", true).c_str());
+
                        i++;
                }
                else {
-                       save_to_dds(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + "_layer" + std::to_string(i++) + "_radar.dds", true).c_str(), g_tar_config->m_dds_img_mode);
+                       if (g_tar_config->m_write_dds)
+                               save_to_dds(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + "_layer" + std::to_string(i) + "_radar.dds", true).c_str(), g_tar_config->m_dds_img_mode);
+
+                       if (g_tar_config->m_write_png)
+                               render_to_png(g_renderWidth, g_renderHeight, filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + "_layer" + std::to_string(i) + "_radar.png", true).c_str());
+
+                       i++;
                }
                FBuffer::Unbind();
        }
 
 #pragma endregion
-
-       std::cout << "Generating radar .TXT... ";
-
-       kv::DataBlock node_radar = kv::DataBlock();
-       node_radar.name = "\"" + g_mapfile_name + "\"";
-       node_radar.Values.insert({ "material", "overviews/" + g_mapfile_name });
-
-       node_radar.Values.insert({ "pos_x", std::to_string(g_tar_config->m_view_origin.x) });
-       node_radar.Values.insert({ "pos_y", std::to_string(g_tar_config->m_view_origin.y) });
-       node_radar.Values.insert({ "scale", std::to_string(g_tar_config->m_render_ortho_scale / g_renderWidth) });
-
-       if (g_tar_config->layers.size() > 1) {
-               kv::DataBlock node_vsections = kv::DataBlock();
-               node_vsections.name = "\"verticalsections\"";
-
-               int ln = 0;
-               for (auto && layer : g_tar_config->layers) {
-                       kv::DataBlock node_layer = kv::DataBlock();
-                       if (ln == 0) {
-                               node_layer.name = "\"default\""; ln++;
+       if (g_tar_config->m_write_txt)
+       {
+               std::cout << "Generating radar .TXT... ";
+
+               kv::DataBlock node_radar = kv::DataBlock();
+               node_radar.name = "\"" + g_mapfile_name + "\"";
+               node_radar.Values.insert({ "material", "overviews/" + g_mapfile_name });
+
+               node_radar.Values.insert({ "pos_x", std::to_string(g_tar_config->m_view_origin.x) });
+               node_radar.Values.insert({ "pos_y", std::to_string(g_tar_config->m_view_origin.y) });
+               node_radar.Values.insert({ "scale", std::to_string(g_tar_config->m_render_ortho_scale / g_renderWidth) });
+
+               if (g_tar_config->layers.size() > 1) {
+                       kv::DataBlock node_vsections = kv::DataBlock();
+                       node_vsections.name = "\"verticalsections\"";
+
+                       int ln = 0;
+                       for (auto && layer : g_tar_config->layers) {
+                               kv::DataBlock node_layer = kv::DataBlock();
+                               if (ln == 0) {
+                                       node_layer.name = "\"default\""; ln++;
+                               }
+                               else node_layer.name = "\"layer" + std::to_string(ln++) + "\"";
+
+                               node_layer.Values.insert({ "AltitudeMin", std::to_string(layer.layer_max) });
+                               node_layer.Values.insert({ "AltitudeMax", std::to_string(layer.layer_min) });
+
+                               node_vsections.SubBlocks.push_back(node_layer);
                        }
-                       else node_layer.name = "\"layer" + std::to_string(ln++) + "\"";
 
-                       node_layer.Values.insert({ "AltitudeMin", std::to_string(layer.layer_max) });
-                       node_layer.Values.insert({ "AltitudeMax", std::to_string(layer.layer_min) });
-                       
-                       node_vsections.SubBlocks.push_back(node_layer);
+                       node_radar.SubBlocks.push_back(node_vsections);
                }
 
-               node_radar.SubBlocks.push_back(node_vsections);
-       }
+               // Try resolve spawn positions
+               glm::vec3* loc_spawnCT = g_vmf_file->calculateSpawnAVG_PMIN("info_player_counterterrorist");
+               glm::vec3* loc_spawnT = g_vmf_file->calculateSpawnAVG_PMIN("info_player_terrorist");
 
-       // Try resolve spawn positions
-       glm::vec3* loc_spawnCT = g_vmf_file->calculateSpawnAVG_PMIN("info_player_counterterrorist");
-       glm::vec3* loc_spawnT = g_vmf_file->calculateSpawnAVG_PMIN("info_player_terrorist");
+               if (loc_spawnCT != NULL) {
+                       node_radar.Values.insert({ "CTSpawn_x", std::to_string(util::roundf(remap(loc_spawnCT->x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+                       node_radar.Values.insert({ "CTSpawn_y", std::to_string(util::roundf(remap(loc_spawnCT->z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+               }
+               if (loc_spawnT != NULL) {
+                       node_radar.Values.insert({ "TSpawn_x", std::to_string(util::roundf(remap(loc_spawnT->x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+                       node_radar.Values.insert({ "TSpawn_y", std::to_string(util::roundf(remap(loc_spawnT->z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+               }
 
-       if (loc_spawnCT != NULL) {
-               node_radar.Values.insert({ "CTSpawn_x", std::to_string(util::roundf(remap(loc_spawnCT->x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
-               node_radar.Values.insert({ "CTSpawn_y", std::to_string(util::roundf(remap(loc_spawnCT->z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
-       }
-       if (loc_spawnT != NULL) {
-               node_radar.Values.insert({ "TSpawn_x", std::to_string(util::roundf(remap(loc_spawnT->x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
-               node_radar.Values.insert({ "TSpawn_y", std::to_string(util::roundf(remap(loc_spawnT->z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
-       }
+               int hostn = 1;
+               for (auto && hostage : g_vmf_file->get_entities_by_classname("info_hostage_spawn")) {
+                       node_radar.Values.insert({ "Hostage" + std::to_string(hostn) + "_x", std::to_string(util::roundf(remap(hostage->m_origin.x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+                       node_radar.Values.insert({ "Hostage" + std::to_string(hostn++) + "_y", std::to_string(util::roundf(remap(hostage->m_origin.z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+               }
 
-       int hostn = 1;
-       for (auto && hostage : g_vmf_file->get_entities_by_classname("info_hostage_spawn")) {
-               node_radar.Values.insert({ "Hostage" + std::to_string(hostn) + "_x", std::to_string(util::roundf(remap(hostage->m_origin.x, g_tar_config->m_view_origin.x, g_tar_config->m_view_origin.x + g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
-               node_radar.Values.insert({ "Hostage" + std::to_string(hostn++) + "_y", std::to_string(util::roundf(remap(hostage->m_origin.z, g_tar_config->m_view_origin.y, g_tar_config->m_view_origin.y - g_tar_config->m_render_ortho_scale, 0.0f, 1.0f), 0.01f)) });
+               std::ofstream out(filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + ".txt", true).c_str());
+               out << "// TAVR - AUTO RADAR. v 2.5.0a\n";
+               node_radar.Serialize(out);
+               out.close();
        }
 
-       std::ofstream out(filesys->create_output_filepath("resource/overviews/" + g_mapfile_name + ".txt", true).c_str());
-       out << "// TAVR - AUTO RADAR. v 2.5.0a\n";
-       node_radar.Serialize(out);
-       out.close();
-
        IL_EXIT:
        glfwTerminate();
 #ifdef _DEBUG
@@ -462,14 +480,10 @@ void render_config(tar_config_layer layer, const std::string& layerName, FBuffer
        g_vmf_file->DrawWorld(g_shader_gBuffer);
        g_vmf_file->DrawEntities(g_shader_gBuffer);
 
-       g_vmf_file->SetFilters({ g_tar_config->m_visgroup_overlap }, { "func_detail", "prop_static" });
-       g_vmf_file->DrawWorld(g_shader_gBuffer, {}, TAR_MIBUFFER_OVERLAP);
-       g_vmf_file->DrawEntities(g_shader_gBuffer, {}, TAR_MIBUFFER_OVERLAP);
-
-       // Draw cover with cover flag set
-       g_vmf_file->SetFilters({ g_tar_config->m_visgroup_cover }, { "func_detail", "prop_static" });
-       g_vmf_file->DrawWorld(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
-       g_vmf_file->DrawEntities(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
+       //// Draw cover with cover flag set
+       //g_vmf_file->SetFilters({ g_tar_config->m_visgroup_cover }, { "func_detail", "prop_static" });
+       //g_vmf_file->DrawWorld(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
+       //g_vmf_file->DrawEntities(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
 
        GBuffer::Unbind();
 
@@ -477,10 +491,19 @@ void render_config(tar_config_layer layer, const std::string& layerName, FBuffer
        glClearColor(0.0, 0.0, 0.0, 1.0);
        glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
 
+       
        g_vmf_file->SetFilters({ g_tar_config->m_visgroup_layout, g_tar_config->m_visgroup_mask }, { "func_detail", "prop_static" });
        g_vmf_file->DrawWorld(g_shader_gBuffer);
        g_vmf_file->DrawEntities(g_shader_gBuffer);
 
+       g_vmf_file->SetFilters({ g_tar_config->m_visgroup_cover }, { "func_detail", "prop_static" });
+       g_vmf_file->DrawWorld(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
+       g_vmf_file->DrawEntities(g_shader_gBuffer, {}, TAR_MIBUFFER_COVER0);
+
+       g_vmf_file->SetFilters({ g_tar_config->m_visgroup_overlap }, { "func_detail", "prop_static" });
+       g_vmf_file->DrawWorld(g_shader_gBuffer, {}, TAR_MIBUFFER_OVERLAP);
+       g_vmf_file->DrawEntities(g_shader_gBuffer, {}, TAR_MIBUFFER_OVERLAP);
+
        GBuffer::Unbind();
 
 #pragma endregion
@@ -556,7 +579,7 @@ void render_config(tar_config_layer layer, const std::string& layerName, FBuffer
        g_gbuffer->BindNormalBufferToTexSlot      (     3 );
        g_shader_comp->setInt("gbuffer_normal",         3 );
 
-       g_gbuffer->BindInfoBufferToTexSlot                ( 4 );
+       g_gbuffer_clean->BindInfoBufferToTexSlot                  ( 4 );
        g_shader_comp->setInt("gbuffer_info",       4 );
 
        g_mask_playspace->BindMaskBufferToTexSlot (     5 );
@@ -571,7 +594,10 @@ void render_config(tar_config_layer layer, const std::string& layerName, FBuffer
        g_gbuffer_clean->BindPositionBufferToTexSlot(8);
        g_shader_comp->setInt("gbuffer_clean_position", 8);
 
-       g_gbuffer->BindOriginBufferToTexSlot(11);
+       g_gbuffer_clean->BindNormalBufferToTexSlot(12);
+       g_shader_comp->setInt("gbuffer_clean_normal", 12);
+
+       g_gbuffer_clean->BindOriginBufferToTexSlot(11);
        g_shader_comp->setInt("gbuffer_origin", 11);
 
        g_texture_modulate->bindOnSlot(10);
@@ -602,7 +628,7 @@ void render_config(tar_config_layer layer, const std::string& layerName, FBuffer
 
        g_mesh_screen_quad->Draw();
 
-       render_to_png(g_renderWidth, g_renderHeight, layerName.c_str());
+       //render_to_png(g_renderWidth, g_renderHeight, layerName.c_str());
 #pragma endregion
 }
 
@@ -631,9 +657,9 @@ void render_to_png(int x, int y, const char* filepath){
 
 void save_to_dds(int x, int y, const char* filepath, IMG imgmode)
 {
-       void* data = malloc(4 * x * y);
+       void* data = malloc(6 * x * y);
 
-       glReadPixels(0, 0, x, y, GL_RGB, GL_UNSIGNED_BYTE, data);
+       glReadPixels(0, 0, x, y, GL_RGBA, GL_UNSIGNED_BYTE, data);
 
        dds_write((uint8_t*)data, filepath, x, y, imgmode);
 
index 787a3cdf9caf54fc5f8ab61454a393f58d46e583..5409b5c261a2e15c6ec7db63fa1594035fd37536 100644 (file)
@@ -2,7 +2,7 @@ versioninfo
 {
        "editorversion" "400"
        "editorbuild" "8075"
-       "mapversion" "379"
+       "mapversion" "421"
        "formatversion" "100"
        "prefab" "0"
 }
@@ -44,13 +44,244 @@ viewsettings
 world
 {
        "id" "1"
-       "mapversion" "379"
+       "mapversion" "421"
        "classname" "worldspawn"
        "detailmaterial" "detail/detailsprites"
        "detailvbsp" "detail.vbsp"
        "maxpropscreenwidth" "-1"
        "skyname" "sky_dust"
        solid
+       {
+               "id" "3288"
+               side
+               {
+                       "id" "1219"
+                       "plane" "(-768 0 128) (-768 128 128) (-384 128 128)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[1 0 0 128] 0.25"
+                       "vaxis" "[0 -1 0 64] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1218"
+                       "plane" "(-768 128 112) (-768 0 112) (-384 0 112)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[1 0 0 128] 0.25"
+                       "vaxis" "[0 -1 0 64] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1217"
+                       "plane" "(-768 0 112) (-768 128 112) (-768 128 128)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[0 1 0 -64] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1216"
+                       "plane" "(-384 128 112) (-384 0 112) (-384 0 128)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[0 1 0 -64] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1215"
+                       "plane" "(-768 128 112) (-384 128 112) (-384 128 128)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[1 0 0 128] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1214"
+                       "plane" "(-384 0 112) (-768 0 112) (-768 0 128)"
+                       "material" "TERRI/DEV/BSP"
+                       "uaxis" "[1 0 0 128] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               editor
+               {
+                       "color" "0 175 108"
+                       "visgroupid" "15"
+                       "visgroupshown" "1"
+                       "visgroupautoshown" "1"
+               }
+       }
+       solid
+       {
+               "id" "3314"
+               side
+               {
+                       "id" "1231"
+                       "plane" "(-144 0 83.2) (-240 0 83.2) (-240 80 83.2)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 0.0146484] 0.25"
+                       "vaxis" "[1 0 0 63.9829] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1230"
+                       "plane" "(-144 80 16) (-240 80 16) (-240 0 16)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 0.0146484] 0.25"
+                       "vaxis" "[1 0 0 63.9829] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1229"
+                       "plane" "(-144 0 16) (-240 0 16) (-240 0 83.2012)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[-1 0 0 -63.9829] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1228"
+                       "plane" "(-240 80 16) (-144 80 16) (-144 80 83.1992)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[-1 0 0 -63.9829] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1227"
+                       "plane" "(-240 0 16) (-240 80 16) (-240 80 83.1992)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 0.0146484] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1226"
+                       "plane" "(-144 80 16) (-144 0 16) (-144 0 83.1992)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 0.0146484] 0.25"
+                       "vaxis" "[0 0 -1 0] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               editor
+               {
+                       "color" "0 175 108"
+                       "visgroupid" "13"
+                       "visgroupshown" "1"
+                       "visgroupautoshown" "1"
+               }
+       }
+       solid
+       {
+               "id" "3315"
+               side
+               {
+                       "id" "1243"
+                       "plane" "(128 32 191.999) (32 32 191.999) (32 112 191.999)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 -127.985] 0.25"
+                       "vaxis" "[1 0 0 -0.0170898] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1242"
+                       "plane" "(128 112 124.799) (32 112 124.799) (32 32 124.799)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 -127.985] 0.25"
+                       "vaxis" "[1 0 0 -0.0170898] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1241"
+                       "plane" "(128 32 124.799) (32 32 124.799) (32 32 192)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[-1 0 0 0.0170898] 0.25"
+                       "vaxis" "[0 0 -1 51.1953] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1240"
+                       "plane" "(32 112 124.799) (128 112 124.799) (128 112 191.998)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[-1 0 0 0.0170898] 0.25"
+                       "vaxis" "[0 0 -1 51.1953] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1239"
+                       "plane" "(32 32 124.799) (32 112 124.799) (32 112 191.998)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 -127.985] 0.25"
+                       "vaxis" "[0 0 -1 51.1953] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               side
+               {
+                       "id" "1238"
+                       "plane" "(128 112 124.799) (128 32 124.799) (128 32 191.998)"
+                       "material" "RYAN_DEV/PURE_ORANGE2"
+                       "uaxis" "[0 1 0 -127.985] 0.25"
+                       "vaxis" "[0 0 -1 51.1953] 0.25"
+                       "rotation" "0"
+                       "lightmapscale" "16"
+                       "smoothing_groups" "0"
+               }
+               editor
+               {
+                       "color" "0 175 108"
+                       "visgroupid" "13"
+                       "visgroupshown" "1"
+                       "visgroupautoshown" "1"
+               }
+       }
+       solid
        {
                "id" "2856"
                side
@@ -1574,7 +1805,7 @@ world
                side
                {
                        "id" "745"
-                       "plane" "(0 640 16) (0 896 16) (0 896 128)"
+                       "plane" "(0 640 16) (0 896 16) (0 896 224)"
                        "material" "TERRI/DEV/BSP"
                        "uaxis" "[0 1 0 128] 0.25"
                        "vaxis" "[0 0 -1 -384] 0.25"
@@ -1585,7 +1816,7 @@ world
                side
                {
                        "id" "744"
-                       "plane" "(128 896 16) (128 640 16) (128 896 128)"
+                       "plane" "(128 896 224) (128 896 16) (128 640 16)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[0 1 0 0] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
@@ -1596,7 +1827,7 @@ world
                side
                {
                        "id" "743"
-                       "plane" "(0 896 16) (128 896 16) (128 896 128)"
+                       "plane" "(0 896 224) (0 896 16) (128 896 16)"
                        "material" "TOOLS/TOOLSNODRAW"
                        "uaxis" "[1 0 0 0] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
@@ -1607,7 +1838,7 @@ world
                side
                {
                        "id" "742"
-                       "plane" "(128 640 16) (0 640 16) (0 896 128)"
+                       "plane" "(128 640 16) (0 640 16) (0 896 224)"
                        "material" "TERRI/DEV/BSP"
                        "uaxis" "[1 0 0 128] 0.25"
                        "vaxis" "[0 -1 0 -384] 0.25"
@@ -1629,10 +1860,10 @@ world
                side
                {
                        "id" "621"
-                       "plane" "(64 592 64) (-64 592 64) (-64 720 64)"
+                       "plane" "(112 666.51 64) (21.4904 576 64) (-69.0193 666.51 64)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[0 1 0 64.015] 0.25"
-                       "vaxis" "[1 0 0 -127.972] 0.25"
+                       "uaxis" "[-0.707107 0.707107 0 95.6249] 0.25"
+                       "vaxis" "[0.707107 0.707107 0 -25.93] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
@@ -1640,10 +1871,10 @@ world
                side
                {
                        "id" "620"
-                       "plane" "(64 720 16) (-64 720 16) (-64 592 16)"
+                       "plane" "(21.4903 757.019 16) (-69.0193 666.51 16) (21.4904 576 16)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[0 1 0 64.015] 0.25"
-                       "vaxis" "[1 0 0 -127.972] 0.25"
+                       "uaxis" "[-0.707107 0.707107 0 95.6249] 0.25"
+                       "vaxis" "[0.707107 0.707107 0 -25.93] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
                        "smoothing_groups" "0"
@@ -1651,9 +1882,9 @@ world
                side
                {
                        "id" "619"
-                       "plane" "(64 592 16) (-64 592 16) (-64 592 64)"
+                       "plane" "(112 666.51 16) (21.4904 576 16) (21.4904 576 64)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[-1 0 0 127.972] 0.25"
+                       "uaxis" "[-0.707107 -0.707107 0 25.93] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
@@ -1662,9 +1893,9 @@ world
                side
                {
                        "id" "618"
-                       "plane" "(-64 720 16) (64 720 16) (64 720 64)"
+                       "plane" "(-69.0193 666.51 16) (21.4903 757.019 16) (21.4903 757.019 64)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[-1 0 0 127.972] 0.25"
+                       "uaxis" "[-0.707107 -0.707107 0 25.93] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
@@ -1673,9 +1904,9 @@ world
                side
                {
                        "id" "617"
-                       "plane" "(-64 592 16) (-64 720 16) (-64 720 64)"
+                       "plane" "(21.4904 576 16) (-69.0193 666.51 16) (-69.0193 666.51 64)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[0 1 0 64.015] 0.25"
+                       "uaxis" "[-0.707107 0.707107 0 95.6249] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
@@ -1684,9 +1915,9 @@ world
                side
                {
                        "id" "616"
-                       "plane" "(64 720 16) (64 592 16) (64 592 64)"
+                       "plane" "(21.4903 757.019 16) (112 666.51 16) (112 666.51 64)"
                        "material" "RYAN_DEV/PURE_ORANGE2"
-                       "uaxis" "[0 1 0 64.015] 0.25"
+                       "uaxis" "[-0.707107 0.707107 0 95.6249] 0.25"
                        "vaxis" "[0 0 -1 0] 0.25"
                        "rotation" "0"
                        "lightmapscale" "16"
@@ -2639,36 +2870,8 @@ entity
 {
        "id" "3061"
        "classname" "tar_color"
-       "_light" "0 255 0 255"
-       "origin" "-393 -64 48"
-       editor
-       {
-               "color" "220 30 220"
-               "visgroupshown" "1"
-               "visgroupautoshown" "1"
-               "logicalpos" "[0 0]"
-       }
-}
-entity
-{
-       "id" "3159"
-       "classname" "tar_color"
-       "_light" "255 255 0 255"
-       "origin" "-393 -64 208"
-       editor
-       {
-               "color" "220 30 220"
-               "visgroupshown" "1"
-               "visgroupautoshown" "1"
-               "logicalpos" "[0 0]"
-       }
-}
-entity
-{
-       "id" "3165"
-       "classname" "tar_color"
-       "_light" "198 57 149 255"
-       "origin" "-393 -64 224"
+       "_light" "77 88 128 255"
+       "origin" "-384 48 128"
        editor
        {
                "color" "220 30 220"
@@ -2679,10 +2882,10 @@ entity
 }
 entity
 {
-       "id" "3004"
+       "id" "3191"
        "classname" "tar_color"
-       "_light" "255 0 0 255"
-       "origin" "-393 -64 80"
+       "_light" "122 80 80 255"
+       "origin" "-384 -144 16"
        editor
        {
                "color" "220 30 220"
@@ -2693,10 +2896,10 @@ entity
 }
 entity
 {
-       "id" "3026"
+       "id" "3201"
        "classname" "tar_color"
-       "_light" "0 0 255 255"
-       "origin" "-393 -64 104.5"
+       "_light" "75 43 79 255"
+       "origin" "-384 640 -192"
        editor
        {
                "color" "220 30 220"
@@ -2735,18 +2938,19 @@ entity
 {
        "id" "2809"
        "classname" "tar_config"
-       "aoSize" "1000"
+       "aoSize" "500"
        "background" "grid.png"
        "colorScheme" "-2"
        "customCol0" "104 15 15"
        "customCol1" "64 166 38"
        "customCol2" "44 199 199"
-       "ddsMode" "2"
+       "ddsMode" "1"
        "enableAO" "1"
        "enableOutline" "0"
        "ObjectiveUseStripes" "1"
        "outlineWidth" "2"
-       "ssaam" "1"
+       "outputMode" "1"
+       "ssaam" "3"
        "vgroup_cover" "tar_cover"
        "vgroup_layout" "tar_layout"
        "vgroup_negative" "tar_mask"
@@ -2754,7 +2958,7 @@ entity
        "zColAO" "0 0 0 255"
        "zColBuyzone" "46 211 57 255"
        "zColCover" "179 179 179 255"
-       "zColCover2" "85 85 85 170"
+       "zColCover2" "51 51 51 255"
        "zColObjective" "0 128 255 255"
        "zColOutline" "204 204 204 255"
        "origin" "-352 -144 33"
index dbd0d1e5278a72f2c3e9f9545fac6c795e3244c0..623d64ed08583b2f1231e25e2c3ea5e525437250 100644 (file)
@@ -22,6 +22,7 @@ uniform sampler2D gbuffer_position;
 uniform sampler2D gbuffer_origin;
 uniform sampler2D gbuffer_clean_position;
 uniform sampler2D gbuffer_normal;
+uniform sampler2D gbuffer_clean_normal;
 uniform usampler2D gbuffer_info;
 uniform usampler2D umask_playspace;
 uniform usampler2D umask_objectives;
@@ -231,7 +232,7 @@ void main()
 
        final = blend_normal(final, 
        sample_gradient(
-               lerp(s_position_clean.y, s_position.y, clamp((1 - s_modulate.r) + (float((s_info >> 1) & 0x1U) - m_playspace_clean), 0, 1))
+               lerp(s_position_clean.y, s_position.y, clamp((1 - s_modulate.r), 0, 1))
        ), m_playspace);
 
        vec2 sloc = texture(gbuffer_origin, TexCoords).xy;
@@ -244,39 +245,90 @@ void main()
 
        //FragColor = vec4(sh, sh, sh, 1);
 
+       
+       //vec4 backColorC = sample_gradient(
+       //      lerp(texture(gbuffer_clean_position, originSample.xy).y, texture(gbuffer_position, originSample.xy).y, clamp((1 - s_modulate.r) + (float((s_info >> 1) & 0x1U) - m_playspace_clean), 0, 1))
+       //);
+
+       vec4 backColorC = sample_gradient(texture(gbuffer_position, originSample.xy).y);
+
+       //final = blend_normal(
+       //      final, 
+       //      lerp(
+       //              color_cover, 
+       //              vec4(lerp(color_cover2.rgb, backColorC.rgb, 1 - color_cover2.a), 1),
+       //      (1 - ((s_position_clean.y - texture(gbuffer_position, originSample.xy).y) / 130))), 
+       //
+       //float((s_info >> 7) & 0x1U) * m_playspace);
+
+       float htt = clamp((s_position_clean.y - texture(gbuffer_position, originSample.xy).y) / 130, 0, 1);
+
+       //final = vec4(htt, htt, htt, 1);
+
+
        final = blend_normal(
-       final, 
-       lerp(color_cover, color_cover2, 
-               float((s_info >> 7) & 0x1U) * m_playspace * (1 - ((s_position.y - texture(gbuffer_clean_position, originSample.xy).y) / 196))), 
-               float((s_info >> 7) & 0x1U) * m_playspace);
+               final,
+               lerp(backColorC, color_cover, htt),
+               float(  (s_info >> 7) & 0x1U  ) * m_playspace
+       );
+
+       vec4 s_normal = 
+       lerp(
+               lerp
+               (
+                       texture(gbuffer_normal, TexCoords),
+                       texture(gbuffer_clean_normal, TexCoords),
+                       clamp((1 - s_modulate.r) + (1 - float((s_info >> 1) & 0x1U)), 0, 1)
+               ),
+               texture(gbuffer_clean_normal, TexCoords),
+               float((s_info >> 7) & 0x1U)
+       );
 
-       vec4 s_normal = texture(gbuffer_normal, TexCoords);
        vec3 randVec = texture(ssaoRotations, TexCoords * noiseScale).rgb;
 
        vec3 tangent = normalize(randVec - s_normal.rgb * dot(randVec, s_normal.rgb));
        vec3 bitangent = cross(s_normal.rgb, tangent);
        mat3 TBN = mat3(tangent, bitangent, s_normal.rgb);
 
-       hData = s_position.y;
+       hData = lerp(lerp(s_position_clean.y, s_position.y, clamp((1 - s_modulate.r), 0, 1)), texture(gbuffer_clean_position, TexCoords).y, float(  (s_info >> 7) & 0x1U  ));
 
        float occlusion = 0.0;
        for(int i = 0; i < 256; i++)
        {
                vec3 sample = TBN * samples[i];
-               sample = s_position.xyz + sample * ssaoScale;
+               sample =
+               lerp
+               (
+                       lerp
+                       (
+                               s_position_clean.xyz,
+                               s_position.xyz, 
+                               clamp((1 - s_modulate.r) + (1 - float((s_info >> 1) & 0x1U)), 0, 1)
+                       ), 
+               
+                       s_position_clean.xyz, 
+               
+                       float((s_info >> 7) & 0x1U)  
+               ) 
+               + (sample * ssaoScale);
 
                vec4 offset = vec4(sample, 1.0);
                offset = projection * view * offset;
                offset.xyz /= offset.w;
                offset.xyz = offset.xyz * 0.5 + 0.5;
 
-               float sDepth = texture(gbuffer_position, offset.xy).y;
+               float sDepth = lerp
+               (
+                       texture(gbuffer_position, offset.xy).y, 
+                       texture(gbuffer_clean_position, offset.xy).y, 
+                       float((texture(gbuffer_info, offset.xy).r >> 7) & 0x1U)
+               );
 
-               occlusion += (sDepth >= sample.y + 6 ? 1.0 : 0.0);
+               occlusion += (sDepth >= sample.y + 3 ? 1.0 : 0.0);
        }
 
        final = blend_normal(final, color_ao, (occlusion / 200) * m_playspace * blend_ao);
-
+       //FragColor = vec4(texture(gbuffer_clean_position, TexCoords).rgb * 0.01, 1);
        //aoBuffer = occlusion / 200;
 
        final = blend_normal(final, color_objective,                                                                                                                            // Objectives
index d93ce055f4a6865a6917abb296af1d54772d714d..852c31740c58513761422919ef058a15187ab6ed 100644 (file)
@@ -15,7 +15,7 @@ uniform sampler2D gbuffer_height;
 uniform float layer_target;
 
 float saturation = 0.1;
-float value = 0.666;
+float value = 0.333;
 float dist = 100;
 
 uniform float active;
@@ -82,7 +82,7 @@ void main()
        vec4 s_layer = texture(tex_layer, TexCoords);
        float s_height = texture(gbuffer_height, TexCoords).r;
 
-       float dist_from_target = remap(abs(layer_target - s_height), 0, 200, 0, 1);
+       float dist_from_target = remap(abs(layer_target - s_height), 0, 160, 0, 1);
        
        float dist_blend = 1 - active;//1 - clamp((active) + dist_from_target, 0, 1);//clamp(clamp(dist_from_max + dist_from_min, 0, 1) + ( 1 - active ), 0, 1);
        
@@ -90,6 +90,8 @@ void main()
                dist_blend -= (1 - dist_from_target);
 
        dist_blend = clamp(dist_blend, 0, 1);
+       
+       dist_blend = 1 - active;
 
        vec3 colHSV = rgb2hsv(s_layer.rgb);
        colHSV.g *= saturation;
index b7af3492bd70ce1911590cd19bd2f4b67d57e054..58a95a66a1fcbc29235e1f8066ab102cca6c74bc 100644 (file)
@@ -61,6 +61,10 @@ public:
        int                             m_outline_width;
        bool                    m_outline_stripes_enable;
 
+       bool                    m_write_dds = true;
+       bool                    m_write_txt = true;
+       bool                    m_write_png = false;
+
        // Color settings
        glm::vec4               m_color_cover;
        glm::vec4               m_color_cover2;
@@ -128,7 +132,8 @@ public:
 
                switch (hash(kv::tryGetStringValue(kvs, "ddsMode", "0").c_str())) {
                        case hash("1"): this->m_dds_img_mode = IMG::MODE_DXT5; break;
-                       case hash("2"): this->m_dds_img_mode = IMG::MODE_RGB888; break;         
+                       case hash("3"): case hash("2"): this->m_dds_img_mode = IMG::MODE_RGB888; break; 
+                       case hash("4"): this->m_dds_img_mode = IMG::MODE_DXT1_1BA; break;
                }
 
                this->m_sampling_mode = sampling_mode::FXAA;
@@ -137,6 +142,33 @@ public:
                        case hash("2"): this->m_sampling_mode = sampling_mode::MSAA16x; break;
                }
 
+               switch (hash(kv::tryGetStringValue(kvs, "outputMode", "0").c_str())) {
+               case hash("1"):
+                       this->m_write_png = true;
+               case hash("0"):
+                       this->m_write_dds = true;
+                       this->m_write_txt = true;
+                       break;
+               
+               case hash("2"):
+                       this->m_write_png = true;
+                       this->m_write_txt = true;
+                       this->m_write_dds = false;
+                       break;
+
+               case hash("3"):
+                       this->m_write_txt = false;
+                       this->m_write_png = false;
+                       this->m_write_dds = true;
+                       break;
+
+               case hash("4"):
+                       this->m_write_dds = false;
+                       this->m_write_txt = false;
+                       this->m_write_png = true;
+                       break;
+               }
+
                // Configure camera setup
                this->m_map_bounds = v->getVisgroupBounds(this->m_visgroup_layout);
 
index bd43e7bcc5479fc67184683908f98af9a6b314b0..9dd9c26c2a370269b92eb1456ee86e3862795606 100644 (file)
@@ -871,7 +871,8 @@ public:
                                                shader->setUnsigned("Info", infoFlags);
                                                shader->setVec2("origin", glm::vec2(ent.m_origin.x, ent.m_origin.z));
 
-                                               vmf::s_model_dict[kv::tryGetStringValue(ent.m_keyvalues, "model", "error.mdl")]->Draw();
+                                               if(vmf::s_model_dict.count(kv::tryGetStringValue(ent.m_keyvalues, "model", "error.mdl")))
+                                                       vmf::s_model_dict[kv::tryGetStringValue(ent.m_keyvalues, "model", "error.mdl")]->Draw();
                                        }
                                        else {
                                                model = glm::mat4();
diff --git a/tar_entities/tar_color.png b/tar_entities/tar_color.png
new file mode 100644 (file)
index 0000000..7f2f49f
Binary files /dev/null and b/tar_entities/tar_color.png differ
diff --git a/tar_entities/tar_color.psd b/tar_entities/tar_color.psd
new file mode 100644 (file)
index 0000000..bdb35d3
Binary files /dev/null and b/tar_entities/tar_color.psd differ
diff --git a/tar_entities/tar_color.vtf b/tar_entities/tar_color.vtf
new file mode 100644 (file)
index 0000000..6fca8f1
Binary files /dev/null and b/tar_entities/tar_color.vtf differ