Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,6 +1131,16 @@ namespace Hooks
stl::write_thunk_call<Main_Update_Begin>(REL::RelocationID(35565, 36564).address() + REL::Relocate(0x53, 0x6E));
stl::write_thunk_call<Main_Update_Swap>(REL::RelocationID(35565, 36564).address() + REL::Relocate(0x5D2, 0xA97));
}

// Patch eye position in BSLightingShader::SetupGeometry to always update due to additional effects which may require it
// The variable updateEyePosition is set to false by default. By patching to be true it will always update the eye position
// SE and AE use a 7-byte instruction whereas VR uses a 8-byte instruction
// We offset from the base address of the containing function to the instruction itself and then to the value the instruction sets
{
logger::info("Patching BSLightingShader::SetupGeometry::updateEyePosition");
uintptr_t setupGeometryUpdateEyePosition = REL::RelocationID(100565, 107300).address() + REL::Relocate(0x50, 0x75, 0x78);
REL::safe_write(setupGeometryUpdateEyePosition + REL::Relocate(6, 6, 7), bool{ true });
}
}

/**
Expand Down