From dbb43422f76853eaaa882a8f6e305a9029a84613 Mon Sep 17 00:00:00 2001 From: SkyLoaderr Date: Sun, 6 May 2018 15:20:21 +0300 Subject: [PATCH] Try to fix "SMAP_size" crash in OpenGL render on AMD video cards part #2 --- res/gamedata/shaders/gl/common_defines.h | 30 +++++++++++++++++------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/res/gamedata/shaders/gl/common_defines.h b/res/gamedata/shaders/gl/common_defines.h index ae49a02cc76..92dd68a11e8 100644 --- a/res/gamedata/shaders/gl/common_defines.h +++ b/res/gamedata/shaders/gl/common_defines.h @@ -2,23 +2,35 @@ #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) ////////////////////////////////////////////////////////////////////////////////////////// -#ifndef SMAP_size -#define SMAP_size 1024 +// 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; #endif -#define PARALLAX_H 0.02 -#define parallax float2(PARALLAX_H, -PARALLAX_H/2) +////////////////////////////////////////////////////////////////////////////////////////// +#define PARALLAX_H float(0.02f) +#define parallax float2(PARALLAX_H, -PARALLAX_H/2) ////////////////////////////////////////////////////////////////////////////////////////// -#endif // common_defines_h_included \ No newline at end of file +#endif // common_defines_h_included