From 1285c69094a095f5ab6e118e5a9b8dd190302f35 Mon Sep 17 00:00:00 2001 From: SkyLoaderr Date: Mon, 24 Dec 2018 18:52:32 +0300 Subject: [PATCH] xrRenderGL: r2_parallax_h works now Fixed two crashes on mixed when msaa is on --- res/gamedata/shaders/gl/combine_1.ps | Bin 6717 -> 6731 bytes res/gamedata/shaders/gl/common_defines.h | 2 -- res/gamedata/shaders/gl/mark_msaa_edges.ps | Bin 772 -> 777 bytes res/gamedata/shaders/gl/shared/common.h | 1 + .../gl_rendertarget_mark_msaa_edges.cpp | 10 +++++----- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/res/gamedata/shaders/gl/combine_1.ps b/res/gamedata/shaders/gl/combine_1.ps index 25d927e7cc66f09681b6a2fbe11fbb2e5f529d89..c0a49c3ab4e357e086833c662c95ca72a0542368 100644 GIT binary patch delta 52 zcmdmMa@u4=FB4<@=3b^iMj&;M`4~H!p`L-YzW(GT+yz_^W^!Uq^5iw#&YPoo9`OPI D(MJ&= delta 30 mcmX?Yve#roFVp5era;Ec515a!PhP`aFj$wDab5t%XABPj diff --git a/res/gamedata/shaders/gl/common_defines.h b/res/gamedata/shaders/gl/common_defines.h index debc3bc05bf..24a95eb35cc 100644 --- a/res/gamedata/shaders/gl/common_defines.h +++ b/res/gamedata/shaders/gl/common_defines.h @@ -17,8 +17,6 @@ #ifndef SMAP_size #define SMAP_size 1024.0 #endif -#define PARALLAX_H 0.02 -#define parallax float2(PARALLAX_H, -PARALLAX_H/2) ////////////////////////////////////////////////////////////////////////////////////////// #endif // common_defines_h_included \ No newline at end of file diff --git a/res/gamedata/shaders/gl/mark_msaa_edges.ps b/res/gamedata/shaders/gl/mark_msaa_edges.ps index 3af3db26486ee3e40022f2b41af329b042ebb015..34383fd00cde609d23bb039a6a5e34be04294f3e 100644 GIT binary patch delta 21 ccmZo+>tx%oiiuNGK}}5|F(*f3@;at407A0{E&u=k delta 16 XcmeBVYhl~4iit%*O-*6)W~MLzD3b)F diff --git a/res/gamedata/shaders/gl/shared/common.h b/res/gamedata/shaders/gl/shared/common.h index b0cb16d723e..9db5106ffbd 100644 --- a/res/gamedata/shaders/gl/shared/common.h +++ b/res/gamedata/shaders/gl/shared/common.h @@ -118,6 +118,7 @@ void sincos(float x, out float s, out float c) { s = sin(x); c = cos(x); } uniform float4 pos_decompression_params; uniform float4 pos_decompression_params2; + uniform float4 parallax; // uniform float4 screen_res; // Screen resolution (x-Width,y-Height, zw - 1/resolution) //} diff --git a/src/Layers/xrRenderPC_GL/gl_rendertarget_mark_msaa_edges.cpp b/src/Layers/xrRenderPC_GL/gl_rendertarget_mark_msaa_edges.cpp index 647277e9042..b56a28d0209 100644 --- a/src/Layers/xrRenderPC_GL/gl_rendertarget_mark_msaa_edges.cpp +++ b/src/Layers/xrRenderPC_GL/gl_rendertarget_mark_msaa_edges.cpp @@ -8,16 +8,16 @@ void CRenderTarget::mark_msaa_edges() // Fill vertex buffer FVF::TL2uv* pv = (FVF::TL2uv*)RCache.Vertex.Lock(4, g_combine_2UV->vb_stride, Offset); - pv->set(-1, -1, 0, d_W, C, 0, 1, 0, 0); + pv->set(-1, -1, 0, d_W, C, 0, 0, 0, 0); pv++; - pv->set(-1, 1, d_Z, d_W, C, 0, 0, 0, 0); + pv->set(-1, 1, d_Z, d_W, C, 0, 1, 0, 0); pv++; - pv->set(1, -1, d_Z, d_W, C, 1, 1, 0, 0); + pv->set(1, -1, d_Z, d_W, C, 1, 0, 0, 0); pv++; - pv->set(1, 1, d_Z, d_W, C, 1, 0, 0, 0); + pv->set(1, 1, d_Z, d_W, C, 1, 1, 0, 0); pv++; RCache.Vertex.Unlock(4, g_combine_2UV->vb_stride); - u_setrt(NULL,NULL,NULL, rt_MSAADepth->pZRT); + u_setrt(Device.dwWidth, Device.dwHeight, 0, 0, 0, rt_MSAADepth->pZRT); RCache.set_Element(s_mark_msaa_edges->E[0]); RCache.set_Geometry(g_combine_2UV); RCache.set_Stencil(TRUE, D3DCMP_ALWAYS, 0x80, 0xFF, 0x80, D3DSTENCILOP_KEEP, D3DSTENCILOP_REPLACE,