Skip to content

Commit

Permalink
Fix #20: set HDR on galaxycam
Browse files Browse the repository at this point in the history
-I'm not really sure if this actually makes a difference, but it might
  • Loading branch information
JonnyOThan committed Jul 23, 2024
1 parent df20615 commit c64dde5
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions Source/TexturesUnlimitedFXLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -497,13 +497,19 @@ public string GetProfileNameForScene(TUFXScene tufxScene)
}
}

private PostProcessLayer SetCameraHDR(Camera camera, bool hdr)
{
var layer = camera.gameObject.AddOrGetComponent<PostProcessLayer>();
layer.Init(Resources);
camera.allowHDR = hdr;
return layer;
}

private void ApplyProfileToCamera(Camera camera, TUFXProfile tufxProfile, bool isFinalCamera, bool isPrimaryCamera)
{
if (camera == null) return;

var layer = camera.gameObject.AddOrGetComponent<PostProcessLayer>();
layer.Init(Resources);
camera.allowHDR = tufxProfile.HDREnabled;
PostProcessLayer layer = SetCameraHDR(camera, tufxProfile.HDREnabled);

// In general all postprocessing should be done on the "final" camera - local when in flight, internal when in IVA, etc.
// But we don't want to apply TAA (and possibly motion blur and DoF) to anything but the local space camera since
Expand Down Expand Up @@ -532,6 +538,12 @@ private void ApplyProfile(TUFXProfile profile, TUFXScene tufxScene)

mainVolume.sharedProfile = currentProfile.CreatePostProcessProfile();

Camera galaxyCamera = ScaledCamera.Instance?.galaxyCamera;
if (galaxyCamera != null)
{
SetCameraHDR(galaxyCamera, profile.HDREnabled);
}

if (tufxScene == TUFXScene.Editor)
{
var editorCameras = EditorCamera.Instance.cam.gameObject.GetComponentsInChildren<Camera>();
Expand Down

0 comments on commit c64dde5

Please sign in to comment.