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
g_shader_multilayer_blend->setFloat("value", 0.5669f);
g_shader_multilayer_blend->setFloat("active", 0.0f);
+ bool above = false;
+
for(int x = 0; x < g_tar_config->layers.size(); x++)
{
tar_config_layer* l = &g_tar_config->layers[g_tar_config->layers.size() - x - 1];
- if (l == &megalayer) continue;
+ if (l == &megalayer) { above = true; continue; }
_flayers[l]->BindRTToTexSlot(1);
_flayers[l]->BindHeightToTexSlot(0);
- g_shader_multilayer_blend->setFloat("layer_min", l->layer_min);
- g_shader_multilayer_blend->setFloat("layer_max", l->layer_max);
-
+ g_shader_multilayer_blend->setFloat("layer_target", !above? l->layer_min: l->layer_max);
+
g_mesh_screen_quad->Draw();
}
- g_shader_multilayer_blend->setFloat("layer_min", megalayer.layer_min);
- g_shader_multilayer_blend->setFloat("layer_max", megalayer.layer_max);
-
//g_shader_multilayer_blend->setFloat("saturation", 1.0f);
//g_shader_multilayer_blend->setFloat("value", 1.0f);
g_shader_multilayer_blend->setFloat("active", 1.0f);
{
"editorversion" "400"
"editorbuild" "8075"
- "mapversion" "336"
+ "mapversion" "345"
"formatversion" "100"
"prefab" "0"
}
world
{
"id" "1"
- "mapversion" "336"
+ "mapversion" "345"
"classname" "worldspawn"
"detailmaterial" "detail/detailsprites"
"detailvbsp" "detail.vbsp"
side
{
"id" "621"
- "plane" "(0 767.992 64) (-128.003 767.992 64) (-128.011 895.992 64)"
+ "plane" "(64 592 64) (-64 592 64) (-64 720 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[0 1 0 -127.985] 0.25"
+ "uaxis" "[0 1 0 64.015] 0.25"
"vaxis" "[1 0 0 -127.972] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "620"
- "plane" "(-128.008 767.997 16) (-0.00814819 767.997 16) (-0.00830078 895.997 16)"
+ "plane" "(64 720 16) (-64 720 16) (-64 592 16)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[0 1 0 -127.985] 0.25"
+ "uaxis" "[0 1 0 64.015] 0.25"
"vaxis" "[1 0 0 -127.972] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "619"
- "plane" "(-0.0055542 767.997 16) (-128.003 767.997 16) (-128.003 767.992 64)"
+ "plane" "(64 592 16) (-64 592 16) (-64 592 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
"uaxis" "[-1 0 0 127.972] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
side
{
"id" "618"
- "plane" "(-128.008 895.994 16) (-0.00674438 895.996 16) (-0.0055542 895.994 64)"
+ "plane" "(-64 720 16) (64 720 16) (64 720 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
"uaxis" "[-1 0 0 127.972] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
side
{
"id" "617"
- "plane" "(-128.006 767.994 16) (-128.006 895.997 16) (-128.006 895.997 64)"
+ "plane" "(-64 592 16) (-64 720 16) (-64 720 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[0 1 0 -127.985] 0.25"
+ "uaxis" "[0 1 0 64.015] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "616"
- "plane" "(-0.0055542 895.994 16) (-0.00552368 767.992 16) (0 767.992 64)"
+ "plane" "(64 720 16) (64 592 16) (64 592 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[0 1 0 -127.985] 0.25"
+ "uaxis" "[0 1 0 64.015] 0.25"
"vaxis" "[0 0 -1 0] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "693"
- "plane" "(-44.4096 798.574 96) (-89.5167 782.157 96) (-105.931 827.264 96)"
+ "plane" "(19.5938 622.572 96) (-25.5195 606.152 96) (-41.9375 651.264 96)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.34202 0.939693 0 -54.4103] 0.25"
- "vaxis" "[0.939693 0.34202 0 -29.5875] 0.25"
+ "uaxis" "[-0.34202 0.939693 0 54.6907] 0.25"
+ "vaxis" "[0.939693 0.34202 0 -29.3668] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
side
{
"id" "692"
- "plane" "(-89.5167 782.157 64) (-44.4099 798.574 64) (-60.8264 843.678 64)"
+ "plane" "(3.16797 667.678 64) (-41.9375 651.26 64) (-25.5195 606.154 64)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.34202 0.939693 0 -54.4103] 0.25"
- "vaxis" "[0.939693 0.34202 0 -29.5875] 0.25"
+ "uaxis" "[-0.34202 0.939693 0 54.6907] 0.25"
+ "vaxis" "[0.939693 0.34202 0 -29.3668] 0.25"
"rotation" "0"
"lightmapscale" "16"
"smoothing_groups" "0"
side
{
"id" "691"
- "plane" "(-44.4124 798.571 64) (-89.5153 782.156 64) (-89.5153 782.156 96)"
+ "plane" "(19.5898 622.572 64) (-25.5195 606.154 64) (-25.5117 606.158 96)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.939693 -0.34202 0 29.5875] 0.25"
+ "uaxis" "[-0.939693 -0.34202 0 29.3668] 0.25"
"vaxis" "[0 0 -1 64] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "690"
- "plane" "(-105.933 827.261 64) (-60.8271 843.679 64) (-60.8277 843.68 96)"
+ "plane" "(-41.9375 651.26 64) (3.17254 667.679 64) (3.17188 667.68 96)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.939693 -0.34202 0 29.5875] 0.25"
+ "uaxis" "[-0.939693 -0.34202 0 29.3668] 0.25"
"vaxis" "[0 0 -1 64] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "689"
- "plane" "(-89.5167 782.154 64) (-105.934 827.261 64) (-105.933 827.261 96)"
+ "plane" "(-25.5156 606.152 64) (-41.9335 651.261 64) (-41.9336 651.262 96)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.34202 0.939693 0 -54.4103] 0.25"
+ "uaxis" "[-0.34202 0.939693 0 54.6907] 0.25"
"vaxis" "[0 0 -1 64] 0.25"
"rotation" "0"
"lightmapscale" "16"
side
{
"id" "688"
- "plane" "(-60.8277 843.68 64) (-44.4096 798.574 64) (-44.4096 798.574 96)"
+ "plane" "(3.17383 667.68 64) (19.5918 622.574 64) (19.5918 622.57 96)"
"material" "RYAN_DEV/PURE_ORANGE2"
- "uaxis" "[-0.34202 0.939693 0 -54.4103] 0.25"
+ "uaxis" "[-0.34202 0.939693 0 54.6907] 0.25"
"vaxis" "[0 0 -1 64] 0.25"
"rotation" "0"
"lightmapscale" "16"
}
}
entity
+{
+ "id" "2894"
+ "classname" "tar_map_divider"
+ "maxs" "4096 4096 2"
+ "mins" "-4096 -4096 -2"
+ "origin" "-80 0 -64"
+ editor
+ {
+ "color" "127 224 0"
+ "visgroupshown" "1"
+ "visgroupautoshown" "1"
+ "logicalpos" "[0 0]"
+ }
+}
+entity
{
"id" "2809"
"classname" "tar_config"
uniform sampler2D tex_layer;
uniform sampler2D gbuffer_height;
-uniform float layer_min;
-uniform float layer_max;
+//uniform float layer_min;
+//uniform float layer_max;
+
+uniform float layer_target;
float saturation = 0.1;
float value = 0.666;
vec4 s_layer = texture(tex_layer, TexCoords);
float s_height = texture(gbuffer_height, TexCoords).r;
- float dist_from_min = 1 - remap(clamp(layer_min - s_height, 0, dist), 0, dist, 0, 1);
- float dist_from_max = 1 - remap(clamp(s_height - layer_max, 0, dist), 0, dist, 0, 1);
+ float dist_from_target = remap(abs(layer_target - s_height), 0, 200, 0, 1);
- float dist_blend = clamp(clamp(dist_from_max + dist_from_min, 0, 1) + ( 1 - active ), 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);
+ if(active < 0.5)
+ dist_blend -= (1 - dist_from_target);
+
+ dist_blend = clamp(dist_blend, 0, 1);
+
vec3 colHSV = rgb2hsv(s_layer.rgb);
colHSV.g *= saturation;
colHSV.b *= value;
std::vector<glm::vec3> intersecting;
float x, _x, y, _y, z, _z;
- x = _y = _z = std::numeric_limits<float>::max();
- _x = y = z = 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++) {
intersecting.push_back(p);
// Calculate bounds
- _x = glm::max(_x, p.x);
- _y = glm::min(_y, p.y);
- _z = glm::min(_z, p.z);
- x = glm::min(x, p.x);
- y = glm::max(y, p.y);
- z = glm::max(z, p.z);
+ _x = glm::round(glm::min(_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));
+ y = glm::round(glm::max(y, p.y));
+ z = glm::round(glm::max(z, p.z));
}
}
}
// Draw solids
for (auto && solid : this->m_solids) {
- if (solid.NWU.y > this->m_render_h_min || solid.NWU.y < this->m_render_h_max) continue;
+ if (solid.NWU.y < this->m_render_h_max || solid.NWU.y > this->m_render_h_min) continue;
if (check_in_whitelist(&solid.m_editorvalues.m_visgroups, this->m_whitelist_visgroups)) {
shader->setUnsigned("Info", infoFlags);
// Visgroup pre-check
if (check_in_whitelist(&ent.m_editorvalues.m_visgroups, this->m_whitelist_visgroups)) {
if (this->m_whitelist_classnames.count(ent.m_classname)) {
- if (ent.m_origin.y > this->m_render_h_min || ent.m_origin.y < this->m_render_h_max) continue;
if (ent.m_classname == "prop_static" ||
ent.m_classname == "prop_dynamic" ||
ent.m_classname == "prop_physics" ) {
+ if (ent.m_origin.y > this->m_render_h_min || ent.m_origin.y < this->m_render_h_max) continue;
model = glm::mat4();
model = glm::translate(model, ent.m_origin);
unsigned int vgroup = this->m_visgroups[visgroup];
bounds.NWU = glm::vec3(
- std::numeric_limits<float>::min(),
- std::numeric_limits<float>::min(),
- std::numeric_limits<float>::min());
+ -999999.0f,
+ -999999.0f,
+ -999999.0f);
bounds.SEL = glm::vec3(
- std::numeric_limits<float>::max(),
- std::numeric_limits<float>::max(),
- std::numeric_limits<float>::max());
+ 999999.0f,
+ 999999.0f,
+ 999999.0f);
for (auto && iSolid : this->m_solids) {
if (!check_in_whitelist(&iSolid.m_editorvalues.m_visgroups, std::set<unsigned int>{ vgroup })) continue;