Browse Source

Fixed aspect ratio for dual-viewport setups

fsr2
Nico de Poel 2 years ago
parent
commit
7384b4486a
  1. 2
      Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs

2
Packages/com.unity.postprocessing@3.2.2/PostProcessing/Runtime/Effects/SuperResolution.cs

@ -156,7 +156,7 @@ namespace UnityEngine.Rendering.PostProcessing
_maxRenderSize = new Vector2Int(maxRenderWidth, maxRenderHeight);
// Render to a smaller portion of the screen by manipulating the camera's viewport rect
camera.aspect = (_displaySize.x * _originalRect.width) / (_displaySize.y * _originalRect.height);
camera.aspect = (float)_displaySize.x / _displaySize.y;
camera.rect = new Rect(0, 0, _originalRect.width * _maxRenderSize.x / _displaySize.x, _originalRect.height * _maxRenderSize.y / _displaySize.y);
}

Loading…
Cancel
Save