diff --git a/res/gamedata/shaders/gl/common_defines.h b/res/gamedata/shaders/gl/common_defines.h index 92dd68a11e8..ae49a02cc76 100644 --- a/res/gamedata/shaders/gl/common_defines.h +++ b/res/gamedata/shaders/gl/common_defines.h @@ -2,35 +2,23 @@ #define common_defines_h_included ////////////////////////////////////////////////////////////////////////////////////////// -// Defines +// Defines // #define def_gloss float(2.f /255.f) #define def_aref float(200.f/255.f) #define def_dbumph float(0.333f) #define def_virtualh float(0.05f) // 5cm -#define def_distort float(0.05f) // we get -0.5 .. 0.5 range, this is -512 .. 512 for 1024, so scale it -#define def_hdr float(9.f) // hight luminance range float(3.h) -#define def_hdr_clip float(0.75f) // +#define def_distort float(0.05f) // we get -0.5 .. 0.5 range, this is -512 .. 512 for 1024, so scale it +#define def_hdr float(9.f) // hight luminance range float(3.h) +#define def_hdr_clip float(0.75f) // #define LUMINANCE_VECTOR float3(0.3f, 0.38f, 0.22f) ////////////////////////////////////////////////////////////////////////////////////////// -// skyloader: if you want to resize smaps in renderer, then do not forget to change this file too -#ifndef SMAP_QUALITY -const float SMAP_size = 2048.f; -#elif SMAP_QUALITY == 1 -const float SMAP_size = 1536.f; -#elif SMAP_QUALITY == 2 -const float SMAP_size = 2048.f; -#elif SMAP_QUALITY == 3 -const float SMAP_size = 2560.f; -#elif SMAP_QUALITY == 4 -const float SMAP_size = 3072.f; -#elif SMAP_QUALITY == 5 -const float SMAP_size = 4096.f; +#ifndef SMAP_size +#define SMAP_size 1024 #endif -////////////////////////////////////////////////////////////////////////////////////////// -#define PARALLAX_H float(0.02f) -#define parallax float2(PARALLAX_H, -PARALLAX_H/2) +#define PARALLAX_H 0.02 +#define parallax float2(PARALLAX_H, -PARALLAX_H/2) ////////////////////////////////////////////////////////////////////////////////////////// -#endif // common_defines_h_included +#endif // common_defines_h_included \ No newline at end of file diff --git a/src/Layers/xrRenderPC_GL/rgl.cpp b/src/Layers/xrRenderPC_GL/rgl.cpp index 03b4addbbb1..ac162923e16 100644 --- a/src/Layers/xrRenderPC_GL/rgl.cpp +++ b/src/Layers/xrRenderPC_GL/rgl.cpp @@ -225,7 +225,7 @@ void CRender::create() o.nvdbt = false; if (o.nvdbt) Msg("* NV-DBT supported and used"); - // options (smap-pool-size) // skyloader: if you want to resize smaps, then do not forget to change them in shaders too (common_defines.h) + // options (smap-pool-size) if (strstr(Core.Params, "-smap1536")) o.smapsize = 1536; if (strstr(Core.Params, "-smap2048")) o.smapsize = 2048; if (strstr(Core.Params, "-smap2560")) o.smapsize = 2560; @@ -798,22 +798,13 @@ HRESULT CRender::shader_compile( u32 len = 0; // options { - // skyloader: smap size changed to smap quality because something wrong happens with the conversion of defines to float data on amd videocards - u8 uSmapQuality = 2; - switch (o.smapsize) - { - case 1536: uSmapQuality = 1; break; - case 2048: uSmapQuality = 2; break; - case 2560: uSmapQuality = 3; break; - case 3072: uSmapQuality = 4; break; - case 4096: uSmapQuality = 5; break; - } - xr_sprintf (c_smapsize, "%d", uSmapQuality); - defines[def_it].Name = "SMAP_QUALITY"; - defines[def_it].Definition = c_smapsize; + xr_sprintf(c_smapsize, "%04d", u32(o.smapsize)); + defines[def_it].Name = "SMAP_size"; + defines[def_it].Definition = c_smapsize; def_it++; - xr_strcat (sh_name, c_smapsize); - ++len; + VERIFY(xr_strlen(c_smapsize) == 4); + xr_strcat(sh_name, c_smapsize); + len += 4; } if (o.fp16_filter)