diff --git a/README.md b/README.md index 7310c53..8cccbe5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # Cinematic Unity Explorer

- +

@@ -227,6 +227,29 @@ Alongside all of this, you can also open each character game object by clicking - Added assignable hotkeys on the Options panel, all of which are displayed on the freecam panel. - Made the mod UI scale with higher resolutions. +# IGCSDOF Support + +The mod also supports [IGCSConnector](https://github.com/FransBouma/IgcsConnector/releases), and therefore [IGCSDOF](https://opm.fransbouma.com/igcsdof.htm), the best modded DOF available. This is an accumulated DOF solution similar to Forza Horizon's or other offline rendering software. This accumulated solution brings some advantages compared to real-time solutions, such as: +- Accurate near-plane bleed. +- Particle & alpha effects in DOF. +- Depth-accurate reflections. +- Layered defocusing of transparent and translucent materials. + +![IGCSDOF demo](img/igcsdof_demo.gif) + +[Before and after](https://framedsc.com/ReshadeGuides/Addons/MSADOF.htm#advantages) showing the advantages of accumulated DOFs over real-time DOFs. + +You can download it, read how to install it, and how to use it [here](https://opm.fransbouma.com/igcsdof.htm). + +>[!IMPORTANT] +> To be able to use IGCSDOF, besides following the instructions above, make sure to download [UnityIGCSConnector.dll](https://github.com/originalnicodr/CinematicUnityExplorer/releases/latest/download/UnityIGCSConnector.dll) and put it in the same folder as the games .exe. +> This is a necessary middleware so the Reshade add-on can communicate with the mod. + +>[!IMPORTANT] +> Be sure to select `Classic (slower)` mode instead of `Fast`, as the latter one seems to render the image out of focus. However `Fast` might still work in some games. + +Huge shout out to [etra0](https://github.com/etra0) for implementing this! + # Why a fork instead of making a new mod? It wasn't the original intention to develop this fork to its current state. I just wanted to make it easier for me and my friends to take screenshots of Unity games and it rolled from there. It is in fact true that me modifying an already existing generic mod streamlined things instead of doing everything from zero, but it's also true that some of UnityExplorer vanilla functionality is useful for doing marketing-related stuff as well (as well as allowing some features to work by letting the user get their hands dirty, e.g. unlocking the gameplay freecam). diff --git a/UnityEditorPackage/package.json b/UnityEditorPackage/package.json index 7c485be..0c912d0 100644 --- a/UnityEditorPackage/package.json +++ b/UnityEditorPackage/package.json @@ -1,6 +1,6 @@ { "name": "com.originalnicodr.cinematicunityexplorer", - "version": "1.0.0", + "version": "1.1.0", "displayName": "CinematicUnityExplorer", "description": "UnityExplorer fork focused on providing tools for creating marketing material for Unity games.", "unity": "2017.1", diff --git a/img/icon.png b/img/icon.png index c5661c9..1b81f15 100644 Binary files a/img/icon.png and b/img/icon.png differ diff --git a/img/icon_big.png b/img/icon_big.png new file mode 100644 index 0000000..c5661c9 Binary files /dev/null and b/img/icon_big.png differ diff --git a/img/igcsdof_demo.gif b/img/igcsdof_demo.gif new file mode 100644 index 0000000..d34720c Binary files /dev/null and b/img/igcsdof_demo.gif differ diff --git a/src/Cinematic/UnityIGCSConnector.cs b/src/Cinematic/UnityIGCSConnector.cs index 4879fdc..791e55c 100644 --- a/src/Cinematic/UnityIGCSConnector.cs +++ b/src/Cinematic/UnityIGCSConnector.cs @@ -120,8 +120,9 @@ namespace CinematicUnityExplorer.Cinematic delegates.Add(new SessionCallback(EndSession)); CameraStatus = initFunc((MoveCameraCallback)delegates[0], (SessionCallback)delegates[1], (SessionCallback)delegates[2]); - if (CameraStatus == IntPtr.Zero) + if (CameraStatus == IntPtr.Zero){ throw new InvalidDataException("IGCSDof returned an invalid pointer which means something went wrong"); + } isValid = true; } diff --git a/src/ExplorerCore.cs b/src/ExplorerCore.cs index 711ef4a..95597bd 100644 --- a/src/ExplorerCore.cs +++ b/src/ExplorerCore.cs @@ -20,7 +20,7 @@ namespace UnityExplorer public static class ExplorerCore { public const string NAME = "CinematicUnityExplorer"; - public const string VERSION = "1.0.0"; + public const string VERSION = "1.1.0"; public const string AUTHOR = "originalnicodr, Sinai, yukieiji"; public const string GUID = "com.originalnicodr.cinematicunityexplorer"; diff --git a/src/UI/Panels/FreeCamPanel.cs b/src/UI/Panels/FreeCamPanel.cs index 690f699..2d802b1 100644 --- a/src/UI/Panels/FreeCamPanel.cs +++ b/src/UI/Panels/FreeCamPanel.cs @@ -20,6 +20,12 @@ namespace UnityExplorer.UI.Panels { public FreeCamPanel(UIBase owner) : base(owner) { + try { + connector = new(); + } + catch (Exception ex) { + ExplorerCore.LogWarning($"Failed to initialize UnityIGCSConnector: {ex}"); + } } public override string Name => "Freecam"; @@ -79,12 +85,12 @@ namespace UnityExplorer.UI.Panels private static FreecamCursorUnlocker freecamCursorUnlocker = null; - public static UnityIGCSConnector connector = new(); + public static UnityIGCSConnector connector = null; internal static void BeginFreecam() { inFreeCamMode = true; - connector.UpdateFreecamStatus(true); + connector?.UpdateFreecamStatus(true); previousMousePosition = IInputManager.MousePosition; @@ -183,7 +189,7 @@ namespace UnityExplorer.UI.Panels internal static void EndFreecam() { inFreeCamMode = false; - connector.UpdateFreecamStatus(false); + connector?.UpdateFreecamStatus(false); if (usingGameCamera) { @@ -261,7 +267,7 @@ namespace UnityExplorer.UI.Panels if (positionInput.Component.isFocused) return; - if (connector.IsActive) + if (connector != null && connector.IsActive) return; lastSetCameraPosition = ourCamera.transform.position; @@ -682,7 +688,7 @@ namespace UnityExplorer.UI.Panels Transform transform = FreeCamPanel.ourCamera.transform; - if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && !FreeCamPanel.connector.IsActive) { + if (!FreeCamPanel.blockFreecamMovementToggle.isOn && !FreeCamPanel.cameraPathMover.playingPath && FreeCamPanel.connector?.IsActive != true) { ProcessInput(); } @@ -702,7 +708,7 @@ namespace UnityExplorer.UI.Panels FreeCamPanel.followObjectLastRotation = FreeCamPanel.followObject.transform.rotation; } - FreeCamPanel.connector.ExecuteCameraCommand(FreeCamPanel.ourCamera); + FreeCamPanel.connector?.ExecuteCameraCommand(FreeCamPanel.ourCamera); FreeCamPanel.UpdatePositionInput(); }