Version: Unity 6.3 Beta (6000.3)
LanguageEnglish
  • C#

XRDisplaySubsystem.appliedViewportScale

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

public float appliedViewportScale;

Description

The portion of the allocated display texture used by the active stereo device for the current frame.

The scale factor is fetched from the device and can change from frame to frame. If you access this value during gameplay logic (LateUpdate or earlier), the value is the applied viewport scale of previous frame. If you access this value during rendering logic (OnPreCull or later), the value is for the current frame.

The XRDisplaySubsystem.scaleOfAllViewports setting can influence the scale factor, but the XR device can decide to ignore or change it.

This property can range between 0 and 1. For example, a value of 0.5 indicates that one quarter of the allocated texture will be used for the display (half the width and half the height). The origin of the area used depends on the graphics API. For example, Vulkan and DirectX use the top-left portion of the texture, whereas OpenGL uses the bottom-left.