private static void SetRenderScale(float renderScale, float renderViewportScale)
 {
     if (Mathf.Abs(VRTK_SharedMethods.GetEyeTextureResolutionScale() - renderScale) > float.Epsilon)
     {
         VRTK_SharedMethods.SetEyeTextureResolutionScale(renderScale);
     }
     if (Mathf.Abs(XRSettings.renderViewportScale - renderViewportScale) > float.Epsilon)
     {
         XRSettings.renderViewportScale = renderViewportScale;
     }
 }
        /// <summary>
        /// Calculates and returns the biggest allowed maximum render scale to be used for `maximumRenderScale`
        /// given the current `maximumRenderTargetDimension`.
        /// </summary>
        /// <returns>
        /// The biggest allowed maximum render scale.
        /// </returns>
        public float BiggestAllowedMaximumRenderScale()
        {
            if (XRSettings.eyeTextureWidth == 0 || XRSettings.eyeTextureHeight == 0)
            {
                return(renderScaleLimits.maximum);
            }

            float maximumHorizontalRenderScale = maximumRenderTargetDimension * VRTK_SharedMethods.GetEyeTextureResolutionScale()
                                                 / XRSettings.eyeTextureWidth;
            float maximumVerticalRenderScale = maximumRenderTargetDimension * VRTK_SharedMethods.GetEyeTextureResolutionScale()
                                               / XRSettings.eyeTextureHeight;

            return(Mathf.Min(maximumHorizontalRenderScale, maximumVerticalRenderScale));
        }
 /// <summary>
 /// Calculates and returns the render target resolution for a given render scale.
 /// </summary>
 /// <param name="renderScale">
 /// The render scale to calculate the render target resolution with.
 /// </param>
 /// <returns>
 /// The render target resolution for `renderScale`.
 /// </returns>
 public static Vector2 RenderTargetResolutionForRenderScale(float renderScale)
 {
     return(new Vector2((int)(XRSettings.eyeTextureWidth / VRTK_SharedMethods.GetEyeTextureResolutionScale() * renderScale),
                        (int)(XRSettings.eyeTextureHeight / VRTK_SharedMethods.GetEyeTextureResolutionScale() * renderScale)));
 }