Skip to main content

VirtualRealityDeviceLifecycle

An abstract class in Root.Township, the global namespace.

Base DeviceLifecycle for VR headsets (SteamVRDeviceLifecycle and OpenXRDeviceLifecycle build on it), adding adaptive render resolution. Client only.

Constructors​

MemberWhat it is
VirtualRealityDeviceLifecycle(IPlatformPlayer player, IPlatformDevice platformDevice)Creates a VirtualRealityDeviceLifecycle from player and platformDevice.

Fields​

MemberWhat it is
protected List<Pose> posesTracked poses list for subclasses. SteamVRDeviceLifecycle hides it with its own list.
3 private and internal fields
MemberWhat it is
private static Logger loggerLogger for this class.
private float maximumAdaptiveResolutionHighest render scale (1.0), raised if the eye texture scale is already higher.
private float minimumAdaptiveResolutionLowest render scale allowed (0.7).

Properties​

MemberWhat it is
bool IsAdaptiveResolutionEnabled { get; private set; }Turns on adaptive viewport scaling each frame. Its setter is private and never called, so it's always false.

Methods​

MemberWhat it is
override void Update()Runs UpdateAdaptiveResolution each frame when adaptive resolution is on.
protected virtual float CalculateRecommendedResolutionScale(float minimum, float maximum)Override to pick a render scale between the minimum and maximum. The base returns the maximum.
1 private and internal method
MemberWhat it is
private void UpdateAdaptiveResolution()Raises the eye texture scale to the maximum, then sets XRSettings.renderViewportScale from the recommended scale.