REPOTrueUltrawide
Ultrawide without stretching.
模組介紹 作者原文
True Ultrawide Mod
This is only current mod that gives ultrawide without that awful stretching. It works by removing the black bars and then changing the vertical FOV (which is more complicated than it should be). I have only tested this on 32:9. If 21:9 looks bad, compile it yourself and change the FOV. Finally, I have taken the creative liberty to remove the post processing.
Source code:
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
namespace REPOTrueUltrawide
{
[BepInPlugin("REPOTrueUltrawide", "REPO True Ultrawide", "1.0.0")]
public class REPOTrueUltrawidePlugin: BaseUnityPlugin
{
public static ConfigEntry BaseFov;
private void Awake()
{
Logger.LogInfo("REPO True Ultrawide v1.0.0 loaded!");
Logger.LogInfo($"Aspect ratio: {(float)Screen.width / (float)Screen.height}");
BaseFov = Config.Bind(
"FOV",
"FOV",
70f,
new ConfigDescription(
"The FOV, 90 is good for 32:9.",
new AcceptableValueRange(50f, 110f)
)
);
Harmony harmony = new Harmony("REPOTrueUltrawide");
harmony.PatchAll();
}
}
[HarmonyPatch(typeof(GraphicsManager), "Update")]
public class StretchingPatch
{
public static void Postfix()
{
float aspectRatio = (float)Screen.width / (float)Screen.height;
var rto = GameObject.Find("Render Texture Overlay");
var rtm = GameObject.Find("Render Texture Main");
// Remove Black Bars!
if (rto && rtm)
{
var rtort = rto.GetComponent();
var rtmrt = rtm.GetComponent();
if (rtort && rtmrt)
{
rtort.sizeDelta = new Vector2(428 * aspectRatio, 428);
rtmrt.sizeDelta = new Vector2(428 * aspectRatio, 428);
}
else
{
rtort.sizeDelta = new Vector2(750, 750 / aspectRatio);
rtmrt.sizeDelta = new Vector2(750, 750 / aspectRatio);
}
}
// Fix Vertical FOV!
Camera mainCamera = GameDirector.instance.MainCamera;
float baseFOV = REPOTrueUltrawidePlugin.BaseFov.Value;
float correctedFOV = 2f * Mathf.Atan(
Mathf.Tan(baseFOV Mathf.Deg2Rad / 2f) (16f / 9f) / aspectRatio
) * Mathf.Rad2Deg;
mainCamera.aspect = aspectRatio;
mainCamera.fieldOfView = correctedFOV;
// DESTROY POST PROCESSING
var postprocessing = GameObject.Find("Post Processing Overlay");
if (postprocessing)
postprocessing.SetActive(false);
}
}
}
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: