From cf1329d6759723a5840b58b00a7660ccb16b1f94 Mon Sep 17 00:00:00 2001 From: SkyLoaderr Date: Fri, 30 Nov 2018 11:30:11 +0300 Subject: [PATCH] OpenGL: some changes in shaders for ATI video cards #2 Added info about OpenGL version --- res/gamedata/shaders/gl/accum_emissive.ps | Bin 137 -> 147 bytes res/gamedata/shaders/gl/accum_emissivel.ps | Bin 136 -> 146 bytes res/gamedata/shaders/gl/accum_indirect.ps | Bin 1385 -> 1389 bytes .../shaders/gl/accum_omni_unshadowed.ps | Bin 960 -> 959 bytes res/gamedata/shaders/gl/accum_sun.ps | Bin 1315 -> 1139 bytes res/gamedata/shaders/gl/combine_2_naa.ps | Bin 2499 -> 2497 bytes res/gamedata/shaders/gl/common_functions.h | 8 +- .../shaders/gl/deffer_detail_s_flat.vs | 2 +- .../shaders/gl/deffer_detail_w_flat.vs | 2 +- res/gamedata/shaders/gl/distort.ps | Bin 438 -> 413 bytes res/gamedata/shaders/gl/fxaa_main.ps | Bin 1329 -> 1293 bytes res/gamedata/shaders/gl/gather.ps | Bin 1164 -> 1160 bytes res/gamedata/shaders/gl/hud_crosshair.vs | 10 +- res/gamedata/shaders/gl/lod.ps | Bin 2844 -> 2844 bytes res/gamedata/shaders/gl/lod.vs | 6 +- .../shaders/gl/model_distort4glass.vs | 2 +- res/gamedata/shaders/gl/particle.ps | Bin 1197 -> 1199 bytes res/gamedata/shaders/gl/postprocess.ps | Bin 863 -> 862 bytes res/gamedata/shaders/gl/shadow.h | 120 +++++++++--------- res/gamedata/shaders/gl/shared/cloudconfig.h | 10 +- res/gamedata/shaders/gl/shared/waterconfig.h | 50 ++++---- res/gamedata/shaders/gl/shared/watermove.h | 6 +- res/gamedata/shaders/gl/sload.h | 28 ++-- res/gamedata/shaders/gl/ssao_blur.ps | Bin 1431 -> 1430 bytes res/gamedata/shaders/gl/ssao_calc.ps | Bin 1857 -> 1852 bytes res/gamedata/shaders/gl/ssao_hbao.ps | Bin 15213 -> 15189 bytes res/gamedata/shaders/gl/ssao_hdao.ps | Bin 12868 -> 12784 bytes res/gamedata/shaders/gl/ssao_hdao_new.ps | Bin 21699 -> 21676 bytes .../shaders/gl/stub_notransform_t_m4.vs | 2 +- res/gamedata/shaders/gl/yuv2rgb.ps | Bin 715 -> 453 bytes src/Layers/xrRenderGL/glHW.cpp | 3 +- 31 files changed, 125 insertions(+), 124 deletions(-) diff --git a/res/gamedata/shaders/gl/accum_emissive.ps b/res/gamedata/shaders/gl/accum_emissive.ps index 8eab64c734f57736bbf85cfdf8e3fad4d28a76d1..19905ba208054f7e277422863eb3980cc261accf 100644 GIT binary patch delta 34 fcmeBVoXj|(LR!y2N5K%8(9|+C(=)K{T(w*PfSd-~ delta 23 ccmbQl*uglVLO{n52n{r~4D}4sths8r07hj6UjP6A diff --git a/res/gamedata/shaders/gl/accum_indirect.ps b/res/gamedata/shaders/gl/accum_indirect.ps index b76b228080b03d8e17e402841bb99af32baab590..657313b11fe86112f39b7236d976487c56c7d877 100644 GIT binary patch delta 28 jcmaFK^_FWx0Sl9!!Q=v#cf5KA3Yt0!CCLh!)?Bp!h`I;e?8ReM(Avy$A delta 14 Vcmdnbet><$0!GHP%?lXinE)wW1iJtL diff --git a/res/gamedata/shaders/gl/accum_sun.ps b/res/gamedata/shaders/gl/accum_sun.ps index 6a1af3b9ed4bfdbcaec8b21911e104c160c7d372..0046efe9e73d64ed16e382df1c778b4ea3958737 100644 GIT binary patch delta 11 ScmZ3?^_gQr!e#+RVHN-yR|9ka delta 186 zcmey&v6yQ@LcP8gS8+*EX>y4IXMAQ}L1_tBH5X@EPJUvEkpgE)vI3`-LWpaGv%i0k zi-9#%#snnerGStzgvl6j`h+0qFhYn2A&VQs#q~LToRBn_z$FwogODXmt+{HgxwP~* I#)+~30C7t)eEsd{B5pJR`5BjzXnvN@_t#hK8Qu<~+u&%xwBbrlxuZo3&ZPS(x+;CO2_90suPz B43z)? delta 46 zcmX>od{}rxJR^UarjA0TZAxlENrr}=VcO;##;wd8Y5GQ{rg{cxo7GvvStd7dIsyP! CTn)(p diff --git a/res/gamedata/shaders/gl/common_functions.h b/res/gamedata/shaders/gl/common_functions.h index 77a315a0c5b..df8582cd7d7 100644 --- a/res/gamedata/shaders/gl/common_functions.h +++ b/res/gamedata/shaders/gl/common_functions.h @@ -95,7 +95,7 @@ float get_sun( float4 lmh) float3 v_hemi(float3 n) { - return L_hemi_color.rgb*(.5f + .5f*n.y); + return L_hemi_color.rgb*(0.5 + 0.5*n.y); } float3 v_sun(float3 n) @@ -155,8 +155,8 @@ float2 gbuf_pack_normal( float3 norm ) float2 res; res.x = norm.z; - res.y = 0.5f * ( norm.x + 1.0f ) ; - res.y *= ( norm.y < 0.0f ? -1.0f : 1.0f ); + res.y = 0.5 * ( norm.x + 1.0 ) ; + res.y *= ( norm.y < 0.0 ? -1.0 : 1.0 ); return res; } @@ -166,7 +166,7 @@ float3 gbuf_unpack_normal( float2 norm ) float3 res; res.z = norm.x; - res.x = ( 2.0f * abs( norm.y ) ) - 1.0f; + res.x = ( 2.0 * abs( norm.y ) ) - 1.0; res.y = ( norm.y < 0 ? -1.0 : 1.0 ) * sqrt( abs( 1 - res.x * res.x - res.z * res.z ) ); return res; diff --git a/res/gamedata/shaders/gl/deffer_detail_s_flat.vs b/res/gamedata/shaders/gl/deffer_detail_s_flat.vs index c0c38e4b367..59adaa0a086 100644 --- a/res/gamedata/shaders/gl/deffer_detail_s_flat.vs +++ b/res/gamedata/shaders/gl/deffer_detail_s_flat.vs @@ -28,7 +28,7 @@ v2p_flat _main (v_detail v) // Normal in world coords float3 norm; norm.x = pos.x - m0.w ; - norm.y = pos.y - m1.w + .75f; // avoid zero + norm.y = pos.y - m1.w + 0.75; // avoid zero norm.z = pos.z - m2.w ; // Final out diff --git a/res/gamedata/shaders/gl/deffer_detail_w_flat.vs b/res/gamedata/shaders/gl/deffer_detail_w_flat.vs index dfd18cad95a..fab5e99eb8a 100644 --- a/res/gamedata/shaders/gl/deffer_detail_w_flat.vs +++ b/res/gamedata/shaders/gl/deffer_detail_w_flat.vs @@ -39,7 +39,7 @@ v2p_flat _main (v_detail v) // Normal in world coords float3 norm; // = float3(0,1,0); norm.x = pos.x - m0.w ; - norm.y = pos.y - m1.w + .75f; // avoid zero + norm.y = pos.y - m1.w + 0.75; // avoid zero norm.z = pos.z - m2.w ; // Final out diff --git a/res/gamedata/shaders/gl/distort.ps b/res/gamedata/shaders/gl/distort.ps index b76a37def076b2c8e9c9636f4297d6965abb8aec..0c3cf43120fd1b5a9c46bbc3051e8bf6f0d32df6 100644 GIT binary patch delta 42 vcmdnSJePTb;Y9z}Yzn#x270EG?HJQU6%6$ZG_5&7Kwn=$J2$_KtCkA@^ScTK delta 50 zcmbQsyp4H+A+x@|!bC$+)}+MZRO^WbZ&-BoOw%SSF{TL_YFcxG08oK;Zhje8Ef)Y- C8w_y( diff --git a/res/gamedata/shaders/gl/fxaa_main.ps b/res/gamedata/shaders/gl/fxaa_main.ps index 78d5283d5deb6779affa67ff62e254aef27a8cc4..cd2f6567276566c30df1683a38604d4151ab45ae 100644 GIT binary patch delta 216 zcmdnU)yp+ul~i$ZQEF;ld{Jt#UX_jl60dyXIXiwG1p_?;1hHA3(UcKgaI!q3?Bv@_ z+>`s6WN^r7U==rJR-8PMS!r@Pvm}sqVAPo$&a5!`Ggwr5vH^=KP!vRSPu|PIIk}ZZ W5Q(oLfN&L+Q>Cwm5QOBL7IMXa#3n(UVKq%v0jCa0=iJ;#3OdXX*vo9K&8m!W07cr^hlsn3#fm2SBS&=bqvK6y6m{giPomq}4O=q$VvjULGJ9!z4APdMLKo!!H hg;-RprZVqKOX9NHYiwp$- delta 40 ocmeC+?BSfy&Y}PWlXo$xZCuCA1mmbO>noT{Tobd|f!Tu*0Obt|`2YX_ diff --git a/res/gamedata/shaders/gl/hud_crosshair.vs b/res/gamedata/shaders/gl/hud_crosshair.vs index 56b4cb5cfcb..4d478216ba5 100644 --- a/res/gamedata/shaders/gl/hud_crosshair.vs +++ b/res/gamedata/shaders/gl/hud_crosshair.vs @@ -11,11 +11,11 @@ v2p_TL0uv _main ( v_TL0uv I ) v2p_TL0uv O; { - I.P.xy += 0.5f; -// O.HPos.x = I.P.x/1024 * 2 - 1; -// O.HPos.y = (I.P.y/768 * 2 - 1)*-1; - O.HPos.x = I.P.x * screen_res.z * 2 - 1; - O.HPos.y = (I.P.y * screen_res.w * 2 - 1)*-1; + I.P.xy += 0.5; +// O.HPos.x = I.P.x/1024.0 * 2.0 - 1.0; +// O.HPos.y = (I.P.y/768.0 * 2.0 - 1.0) * -1.0; + O.HPos.x = I.P.x * screen_res.z * 2.0 - 1.0; + O.HPos.y = (I.P.y * screen_res.w * 2.0 - 1.0) * -1.0; O.HPos.zw = I.P.zw; } diff --git a/res/gamedata/shaders/gl/lod.ps b/res/gamedata/shaders/gl/lod.ps index ac7888aad7bbb7b1151fc6a7e736fc96eb763cf4..34deb1ce2b1e7d5bb3f2b36817f2c2772d6bae9b 100644 GIT binary patch delta 21 bcmbOuHb-njJPV`2<^-0NOhAf@U5Et$N6Q6v delta 21 bcmbOuHb-njJPTvm<^-0NOhAf@U5Et$OU(u1 diff --git a/res/gamedata/shaders/gl/lod.vs b/res/gamedata/shaders/gl/lod.vs index 0109be86448..43c16249c36 100644 --- a/res/gamedata/shaders/gl/lod.vs +++ b/res/gamedata/shaders/gl/lod.vs @@ -1,7 +1,7 @@ #include "common.h" #include "iostructs\v_lod.h" -#define L_SCALE (2.0f*1.55f) +#define L_SCALE (2.0*1.55) v2p _main ( v_lod I ) { v2p o; @@ -12,7 +12,7 @@ v2p _main ( v_lod I ) // lerp pos float factor = I.sun_af.w; - float4 pos = float4 (lerp(I.pos0,I.pos1,factor), 1.f); + float4 pos = float4 (lerp(I.pos0,I.pos1,factor), 1.0); float h = lerp (I.rgbh0.w,I.rgbh1.w,factor)*L_SCALE; @@ -24,7 +24,7 @@ v2p _main ( v_lod I ) o.tc1 = I.tc1; // calc normal & lighting - o.af = float4 (h,h,I.sun_af.z,factor); + o.af = float4 (h, h, I.sun_af.z, factor); return o; } diff --git a/res/gamedata/shaders/gl/model_distort4glass.vs b/res/gamedata/shaders/gl/model_distort4glass.vs index 84856055452..2f81223a205 100644 --- a/res/gamedata/shaders/gl/model_distort4glass.vs +++ b/res/gamedata/shaders/gl/model_distort4glass.vs @@ -12,7 +12,7 @@ vf _main (v_model v) // calculate fade float3 dir_v = normalize (mul(m_WV,v.P)); float3 norm_v = normalize (mul(m_WV,v.N)); - float fade = 0.9f*abs (dot(dir_v,norm_v)); + float fade = 0.9*abs (dot(dir_v,norm_v)); o.c0 = float4 (fade); return o; diff --git a/res/gamedata/shaders/gl/particle.ps b/res/gamedata/shaders/gl/particle.ps index 5330d992fbb8565fd63daecb55ab10014fb9361b..c8adae970ec2a79a3557a5d27c1cb3c13d559eb8 100644 GIT binary patch delta 91 zcmZ3>xt?=E!N$TUCMG?D$)}mrCVyfIo$SGE$fl{IU<4GZV>X5{w=o;Qn6H^5c=Zgd hxs+4$QZmyx_4Ow^Fp5l0Vi9H2H!?K^YO80_0|2fo7$g7y delta 75 zcmZ3_xt4Q60b|<6f+(iRXPDF&(p=7`De TEG8Uj`bMUvdIo8e8(H)KaP$?t diff --git a/res/gamedata/shaders/gl/postprocess.ps b/res/gamedata/shaders/gl/postprocess.ps index b81e42607dd5f8b3f6b4c5ae526373da98102f80..8164bd1e4ad99c7b038e49d8ebb30783db6041d8 100644 GIT binary patch delta 35 ocmcc5c8_g?GqZGNZen_>j)I|{fu=Pl2%M6;d+O(iChJ4D}2)d$KNIocxL{901^P3y}Z- delta 45 ycmdnPcaU#`8w+FFWH**;KvITPmM=|HAtf^{O~F>dP|qN3vn%TYMxe}7wr~JCm<@;k diff --git a/res/gamedata/shaders/gl/ssao_hbao.ps b/res/gamedata/shaders/gl/ssao_hbao.ps index 3a04c7191cc045dff7ed88cae2e40139d0c0de28..26312cc56439d2eeb32764d9f174ed435dcd3c05 100644 GIT binary patch delta 160 zcmaD`cC~DSGvj0zM&ro}OmdT_Gn#&X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MLGDf}x&4+T=V{WjOn@N*SCD6z7GiQP2cJtH}ncvXcc=*%u#B zW#&l(i7045jIh@f2ip2jBLqX(7^F@U=!jY_phJR7b8}NuT=Gj4^lcR^fR=+?hY-}Z zRWQ&qO`F`NsVoK3XAd+VNm^gQ&;Y1s^Fd7sMxZBdYVBr%+Xs@EJWtmNMPTzQT}?*m zG@v;kX`pj+Qi}>Sz#ORGwe+QAVJ=hvf;9i+zQ$Lou*04*yvJ^-|H zva#tjAm^m1IOF6;W=5OE%xxH9;k7y3;<*4&iJhk_3&^O+EuNErYQ?-Jv!gg_^5#H0 c6oJjZ1H}lsQWEA$3>Qw0*O%U05^TW;07|=%2LJ#7 diff --git a/res/gamedata/shaders/gl/stub_notransform_t_m4.vs b/res/gamedata/shaders/gl/stub_notransform_t_m4.vs index 29464da6159..fae43ceb03b 100644 --- a/res/gamedata/shaders/gl/stub_notransform_t_m4.vs +++ b/res/gamedata/shaders/gl/stub_notransform_t_m4.vs @@ -12,7 +12,7 @@ v2p_TL _main ( v_TL I ) // O.HPos = P; { - I.P.xy += 0.5f; + I.P.xy += 0.5; // O.HPos.x = I.P.x/1024.0 * 2.0 - 1.0; // O.HPos.y = (I.P.y/768.0 * 2.0 - 1.0)*-1.0; O.HPos.x = I.P.x * screen_res.z * 2.0 - 1.0; diff --git a/res/gamedata/shaders/gl/yuv2rgb.ps b/res/gamedata/shaders/gl/yuv2rgb.ps index be657b76514740b2f2ee872381d68297478f80ed..0d3f36dcafc6850064e5604d8175be23dfbd2b35 100644 GIT binary patch literal 453 zcmYk2U2lRg6o#+cUvc7YK(J}~C>rC{+_lLNGOik|%#k2X6pe1#f8XgQjGJD(eV+HU z=c#UWbJS+|Z$zbN^=3Q3XWWCdMy3)aLrt6h1neB@oWJDgDZ!$^S) zlI(NYC)p#p4~gxu%(bmC~A5MmGQPKyy_`v-_K?gMf&&cX$k zLF^MRU|hs9aA6AB$g{5)JWsHAkx0a?Iu};NF6-nYCmlN$lnW`)@i>b^o=Bg}1mnqE Zy7p_s{(CEORN<-2Q@N*7A4$Z%=?@G6bVUFF literal 715 zcmZXSO>crg5Qfjoub9{i-|m8-#&~IMdNffX<+MQrB|%6Ojkf83?<}yCq>vDpd7t@s z*_XUbirXQDQBs}HRcW6_ic;NbxTnbkwjtlemt$Hl6s3rt7*~rbiR-*7VF|nU&$sn@ zv!WX0C1gbv*ACq7sJ&PD0nTw=s+#hxkW*Y_E{TGWETK*x&Wfm4zK^e|iE_=}A1}y^ z$Bm9eC_<_ISoEQw3qAirqLfg5E!y%u)&~YqTUa7kSRrG*zstezgV@H8BO=JQEGy^k^UyhDaeb#b#DN zuL*`6LL+)GpoD9ZGNcdK2HBZd&Lp(y6b_i}fDyXJEo2O7fk~`xLuAG8=nopYF1k%r Z9vM6^cxdpg$+Y%-{8urP;w|z&$}eCcsYw6; diff --git a/src/Layers/xrRenderGL/glHW.cpp b/src/Layers/xrRenderGL/glHW.cpp index 6967b0bad90..9bb317168ec 100644 --- a/src/Layers/xrRenderGL/glHW.cpp +++ b/src/Layers/xrRenderGL/glHW.cpp @@ -72,7 +72,8 @@ void CHW::CreateDevice(SDL_Window* hWnd) #endif // DEBUG Msg("* GPU vendor: [%s] device: [%s]", glGetString(GL_VENDOR), glGetString(GL_RENDERER)); - Msg("* GPU OpenGL version: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); + Msg("* GPU OpenGL version: %s", glGetString(GL_VERSION)); + Msg("* GPU OpenGL shading language version: %s", glGetString(GL_SHADING_LANGUAGE_VERSION)); // Clip control ensures compatibility with D3D device coordinates. // TODO: OGL: Fix these differences in the blenders/shaders.