Skip to content

Commit b682c18

Browse files
committed
ReflectionResolution: allow tweaking resolution of reflections
1 parent 9a4f95c commit b682c18

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

Outrun2006Tweaks.ini

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ VSync = 1
2828
# 1 = enable xbox vibration code
2929
# 2 = ^ with L/R motors swapped
3030
# 3 = ^ with L/R motors merged together
31-
VibrationMode = 0
31+
VibrationMode = 1
3232

3333
# XInput device to send vibration to, default should work fine in most cases, but if you don't notice any vibration you can try increasing this here
3434
VibrationControllerId = 0
@@ -42,11 +42,11 @@ VibrationStrength = 10
4242
# 1 = enable impulse triggers
4343
# 2 = ^ with L/R motors swapped (recommended for impulse triggers)
4444
# 3 = ^ with L/R motors merged together
45-
ImpulseVibrationMode = 0
45+
ImpulseVibrationMode = 2
4646

4747
# Multipliers of the trigger vibration, the normal controller motor vibration is multiplied by these to set trigger value
48-
ImpulseVibrationLeftMultiplier = 0.25
49-
ImpulseVibrationRightMultiplier = 0.25
48+
ImpulseVibrationLeftMultiplier = 0.20
49+
ImpulseVibrationRightMultiplier = 0.20
5050

5151
[Window]
5252
# Forces windowed mode to become borderless. (requires "DX/WINDOWED = 1" inside outrun2006.ini)
@@ -97,6 +97,9 @@ TrackPrevious = RS+Back
9797
# 1 - 16, 0 to leave it at games default.
9898
AnisotropicFiltering = 16
9999

100+
# Resolution used for car reflections, games default is 128x128, 2048x2048 seems a reasonable improvement
101+
ReflectionResolution = 2048
102+
100103
# Allows game to enable 4x transparency supersampling, heavily reducing aliasing on things like barriers or cloth around the track edge.
101104
# For best results use this with "DX/ANTIALIASING = 2" inside outrun2006.ini
102105
TransparencySupersampling = true

src/dllmain.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ namespace Settings
7070
spdlog::info(" - CDSwitcherTrackPrevious: {}", CDSwitcherTrackPrevious);
7171

7272
spdlog::info(" - AnisotropicFiltering: {}", AnisotropicFiltering);
73+
spdlog::info(" - ReflectionResolution: {}", ReflectionResolution);
7374
spdlog::info(" - TransparencySupersampling: {}", TransparencySupersampling);
7475
spdlog::info(" - ScreenEdgeCullFix: {}", ScreenEdgeCullFix);
7576
spdlog::info(" - DisableVehicleLODs: {}", DisableVehicleLODs);
@@ -139,6 +140,8 @@ namespace Settings
139140

140141
AnisotropicFiltering = ini.Get("Graphics", "AnisotropicFiltering", std::move(AnisotropicFiltering));
141142
AnisotropicFiltering = std::clamp(AnisotropicFiltering, 0, 16);
143+
ReflectionResolution = ini.Get("Graphics", "ReflectionResolution", std::move(ReflectionResolution));
144+
ReflectionResolution = std::clamp(ReflectionResolution, 0, 8192);
142145
TransparencySupersampling = ini.Get("Graphics", "TransparencySupersampling", std::move(TransparencySupersampling));
143146
ScreenEdgeCullFix = ini.Get("Graphics", "ScreenEdgeCullFix", std::move(ScreenEdgeCullFix));
144147
DisableVehicleLODs = ini.Get("Graphics", "DisableVehicleLODs", std::move(DisableVehicleLODs));

src/hooks_graphics.cpp

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,45 @@
11
#include "hook_mgr.hpp"
22
#include "plugin.hpp"
33
#include "game_addrs.hpp"
4+
#include <array>
5+
6+
class ReflectionResolution : public Hook
7+
{
8+
inline static std::array<int, 6> ReflectionResolution_Addrs =
9+
{
10+
// Envmap_Init
11+
0x13B50 + 1,
12+
0x13BA1 + 1,
13+
0x13BA6 + 1,
14+
// D3D_CreateTemporaries
15+
0x17A69 + 1,
16+
0x17A88 + 1,
17+
0x17A8D + 1,
18+
};
19+
20+
public:
21+
std::string_view description() override
22+
{
23+
return "ReflectionResolution";
24+
}
25+
26+
bool validate() override
27+
{
28+
return Settings::ReflectionResolution >= 2;
29+
}
30+
31+
bool apply() override
32+
{
33+
for (const int& addr : ReflectionResolution_Addrs)
34+
{
35+
Memory::VP::Patch(Module::exe_ptr<int>(addr), Settings::ReflectionResolution);
36+
}
37+
return true;
38+
}
39+
40+
static ReflectionResolution instance;
41+
};
42+
ReflectionResolution ReflectionResolution::instance;
443

544
class DisableDPIScaling : public Hook
645
{

src/plugin.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ namespace Settings
6363
inline std::vector<std::pair<std::string, std::string>> CDTracks;
6464

6565
inline int AnisotropicFiltering = 16;
66+
inline int ReflectionResolution = 1024;
6667
inline bool TransparencySupersampling = true;
6768
inline bool ScreenEdgeCullFix = true;
6869
inline bool DisableVehicleLODs = true;

0 commit comments

Comments
 (0)