mirror of
https://github.com/XProger/OpenLara.git
synced 2025-07-31 18:30:19 +02:00
fix shadow for split-screen mode, minor fixes
This commit is contained in:
@@ -1422,7 +1422,7 @@ struct Lara : Character {
|
|||||||
|
|
||||||
// flip left and right by relative target direction
|
// flip left and right by relative target direction
|
||||||
if (count > 1) {
|
if (count > 1) {
|
||||||
int side[2] = { 0, 0 };
|
float side[2] = { 0, 0 };
|
||||||
vec3 dir = getDir();
|
vec3 dir = getDir();
|
||||||
dir.y = 0.0f;
|
dir.y = 0.0f;
|
||||||
|
|
||||||
|
11
src/level.h
11
src/level.h
@@ -80,6 +80,8 @@ struct Level : IGame {
|
|||||||
vec4 underwaterFogParams;
|
vec4 underwaterFogParams;
|
||||||
vec4 levelFogParams;
|
vec4 levelFogParams;
|
||||||
|
|
||||||
|
mat4 mLightProj[2];
|
||||||
|
|
||||||
// IGame implementation ========
|
// IGame implementation ========
|
||||||
virtual void loadLevel(TR::LevelID id) {
|
virtual void loadLevel(TR::LevelID id) {
|
||||||
sndWater = sndTrack = NULL;
|
sndWater = sndTrack = NULL;
|
||||||
@@ -2538,7 +2540,8 @@ struct Level : IGame {
|
|||||||
Core::mView = Core::mViewInv.inverseOrtho();
|
Core::mView = Core::mViewInv.inverseOrtho();
|
||||||
Core::mProj = GAPI::perspective(90.0f, 1.0f, znear, zfar, 0.0f);
|
Core::mProj = GAPI::perspective(90.0f, 1.0f, znear, zfar, 0.0f);
|
||||||
|
|
||||||
Core::mLightProj = Core::mProj * Core::mView;
|
mat4 &m = mLightProj[player->camera->cameraIndex];
|
||||||
|
m = Core::mProj * Core::mView;
|
||||||
|
|
||||||
mat4 bias;
|
mat4 bias;
|
||||||
bias.identity();
|
bias.identity();
|
||||||
@@ -2546,7 +2549,9 @@ struct Level : IGame {
|
|||||||
#if defined(_GAPI_D3D9) || defined(_GAPI_GXM)
|
#if defined(_GAPI_D3D9) || defined(_GAPI_GXM)
|
||||||
bias.e11 = -bias.e11;
|
bias.e11 = -bias.e11;
|
||||||
#endif
|
#endif
|
||||||
Core::mLightProj = bias * Core::mLightProj;
|
m = bias * m;
|
||||||
|
|
||||||
|
Core::mLightProj = m;
|
||||||
|
|
||||||
camera->frustum->pos = Core::viewPos.xyz();
|
camera->frustum->pos = Core::viewPos.xyz();
|
||||||
camera->frustum->calcPlanes(Core::mViewProj);
|
camera->frustum->calcPlanes(Core::mViewProj);
|
||||||
@@ -3033,6 +3038,8 @@ struct Level : IGame {
|
|||||||
player = players[view];
|
player = players[view];
|
||||||
camera = player->camera;
|
camera = player->camera;
|
||||||
|
|
||||||
|
Core::mLightProj = mLightProj[view];
|
||||||
|
|
||||||
Core::pass = Core::passCompose;
|
Core::pass = Core::passCompose;
|
||||||
|
|
||||||
setDefaultTarget(eye, view, invBG);
|
setDefaultTarget(eye, view, invBG);
|
||||||
|
@@ -661,7 +661,9 @@ static LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPara
|
|||||||
}
|
}
|
||||||
|
|
||||||
//VR Support
|
//VR Support
|
||||||
#define VR_SUPPORT
|
#ifdef _GAPI_GL
|
||||||
|
#define VR_SUPPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef VR_SUPPORT
|
#ifdef VR_SUPPORT
|
||||||
// TODO: fix depth precision
|
// TODO: fix depth precision
|
||||||
|
@@ -129,8 +129,8 @@ inline const T& clamp(const T &x, const T &a, const T &b) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
inline const int sign(const T &x) {
|
inline const T sign(const T &x) {
|
||||||
return x > 0 ? 1 : (x < 0 ? -1 : 0);
|
return (T)(x > 0 ? 1 : (x < 0 ? -1 : 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
|
Reference in New Issue
Block a user