diff options
author | aap <aap@papnet.eu> | 2020-08-19 14:36:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-19 14:36:38 +0200 |
commit | 76fe1247c86873fa548c85ae8598efd4ce1947c2 (patch) | |
tree | 0d7d5e42a8e92841af0f89dc577eb0888831fd9f /src/core | |
parent | 4d1cfb7214a4867487f128c7e3360681f47e0239 (diff) | |
parent | e3405f4be4369c98f874a2d477bd6567f1be9381 (diff) |
Merge pull request #688 from aap/master
Neo pipelines
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Game.cpp | 5 | ||||
-rw-r--r-- | src/core/config.h | 4 | ||||
-rw-r--r-- | src/core/main.cpp | 27 | ||||
-rw-r--r-- | src/core/re3.cpp | 12 |
4 files changed, 45 insertions, 3 deletions
diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 06f2c1bd..a95c479a 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -87,6 +87,7 @@ #include "Zones.h" #include "debugmenu.h" #include "postfx.h" +#include "custompipes.h" eLevelName CGame::currLevel; bool CGame::bDemoMode = true; @@ -355,6 +356,10 @@ bool CGame::Initialise(const char* datFile) CdStreamAddImage("MODELS\\GTA3.IMG"); CFileLoader::LoadLevel("DATA\\DEFAULT.DAT"); CFileLoader::LoadLevel(datFile); +#ifdef EXTENDED_PIPELINES + // for generic fallback + CustomPipes::SetTxdFindCallback(); +#endif CWorld::AddParticles(); CVehicleModelInfo::LoadVehicleColours(); CVehicleModelInfo::LoadEnvironmentMaps(); diff --git a/src/core/config.h b/src/core/config.h index 00a8076f..8e91853d 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -8,7 +8,8 @@ enum Config { MAX_CDCHANNELS = 5, MODELINFOSIZE = 5500, - TXDSTORESIZE = 850, +// TXDSTORESIZE = 850, + TXDSTORESIZE = 1024, // for Xbox map EXTRADIRSIZE = 128, CUTSCENEDIRSIZE = 512, @@ -209,6 +210,7 @@ enum Config { //#define USE_TEXTURE_POOL #define CUTSCENE_BORDERS_SWITCH //#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) +//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) #define MULTISAMPLING // adds MSAA option #ifdef LIBRW diff --git a/src/core/main.cpp b/src/core/main.cpp index 8458a248..99868dbd 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -63,6 +63,7 @@ #include "SceneEdit.h" #include "debugmenu.h" #include "Clock.h" +#include "custompipes.h" GlobalScene Scene; @@ -387,6 +388,9 @@ PluginAttach(void) return FALSE; } +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeRegister(); +#endif return TRUE; } @@ -400,7 +404,11 @@ Initialise3D(void *param) DebugMenuInit(); DebugMenuPopulate(); #endif // !DEBUGMENU - return CGame::InitialiseRenderWare(); + bool ret = CGame::InitialiseRenderWare(); +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeInit(); // need Scene.world for this +#endif + return ret; } return (FALSE); @@ -409,6 +417,9 @@ Initialise3D(void *param) static void Terminate3D(void) { +#ifdef EXTENDED_PIPELINES + CustomPipes::CustomPipeShutdown(); +#endif CGame::ShutdownRenderWare(); #ifdef DEBUGMENU DebugMenuShutdown(); @@ -1099,6 +1110,12 @@ Idle(void *arg) tbEndTimer("PreRender"); #endif +#ifdef FIX_BUGS + // This has to be done BEFORE RwCameraBeginUpdate + RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); + RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif + if(CWeather::LightningFlash && !CCullZones::CamNoRain()){ if(!DoRWStuffStartOfFrame_Horizon(255, 255, 255, 255, 255, 255, 255)) return; @@ -1111,9 +1128,10 @@ Idle(void *arg) DefinedState(); - // BUG. This has to be done BEFORE RwCameraBeginUpdate +#ifndef FIX_BUGS RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip()); RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart()); +#endif #ifdef TIMEBARS tbStartTimer(0, "RenderScene"); @@ -1122,6 +1140,11 @@ Idle(void *arg) #ifdef TIMEBARS tbEndTimer("RenderScene"); #endif + +#ifdef EXTENDED_PIPELINES + CustomPipes::EnvMapRender(); +#endif + RenderDebugShit(); RenderEffects(); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index eef30706..27ec336d 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -31,6 +31,7 @@ #include "main.h" #include "MBlur.h" #include "postfx.h" +#include "custompipes.h" #ifndef _WIN32 #include "assert.h" @@ -361,6 +362,17 @@ DebugMenuPopulate(void) DebugMenuAddVar("Render", "Intensity", &CPostFX::Intensity, nil, 0.05f, 0, 10.0f); DebugMenuAddVarBool8("Render", "Motion Blur", &CPostFX::MotionBlurOn, nil); #endif +#ifdef EXTENDED_PIPELINES + static const char *vehpipenames[] = { "MatFX", "Neo" }; + e = DebugMenuAddVar("Render", "Vehicle Pipeline", &CustomPipes::VehiclePipeSwitch, nil, + 1, CustomPipes::VEHICLEPIPE_MATFX, CustomPipes::VEHICLEPIPE_NEO, vehpipenames); + DebugMenuEntrySetWrap(e, true); + DebugMenuAddVar("Render", "Neo Vehicle Shininess", &CustomPipes::VehicleShininess, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Vehicle Specularity", &CustomPipes::VehicleSpecularity, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Ped Rim light", &CustomPipes::RimlightMult, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo World Lightmaps", &CustomPipes::LightmapMult, nil, 0.1f, 0, 1.0f); + DebugMenuAddVar("Render", "Neo Road Gloss", &CustomPipes::GlossMult, nil, 0.1f, 0, 1.0f); +#endif DebugMenuAddVarBool8("Render", "Show Ped Paths", &gbShowPedPaths, nil); DebugMenuAddVarBool8("Render", "Show Car Paths", &gbShowCarPaths, nil); DebugMenuAddVarBool8("Render", "Show Car Path Links", &gbShowCarPathsLinks, nil); |