mirror of
https://github.com/mitch030504/Wiicompiled_VR_Frame.git
synced 2026-10-06 10:00:27 +02:00
Centre foveation on the player's gaze on headsets with eye tracking
With [vr] eye_tracked_foveation (on by default on the Steam Frame, off elsewhere) the runtime asks for XR_EXT_eye_gaze_interaction. When the system reports an eye tracker, OpenXRInput binds the gaze pose and locates it for each packet's display time, in the space the eye views are located in; vr/eye_gaze.h turns it into tangents of each eye's own view, which AuroraStereoFrame now carries (appended, after the existing prefix). Aurora centres the eye's fragment density map on the gaze snapped to a cell of two map texels (about 3 degrees). Each eye keeps up to 32 maps, one per cell looked at, so a glance back reuses its map; a new map is bound once its upload completes, and until then the eye keeps the map it had. Without a tracked gaze (a blink, no tracker, the setting off) foveation centres on the forward direction exactly as before: the forward maps are byte-identical. Also logs every extension the OpenXR runtime offers at startup, so the first Steam Frame session shows what SteamVR's Android runtime has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019HBRGKTE1GnN2ah8gcZKr3
This commit is contained in:
16 files changed
+616
-47
No files matched your search
@@ -92,6 +92,7 @@ struct RuntimeUserConfig {
|
||||
std::optional<bool> vrWheelHaptics;
|
||||
std::optional<std::string> vrPerformanceLevel;
|
||||
std::optional<std::string> vrFoveation;
|
||||
std::optional<bool> vrEyeTrackedFoveation;
|
||||
std::optional<std::string> vrRecenterKey;
|
||||
std::optional<float> vrLeanBackDegrees;
|
||||
// F10 > Diagnostics: OpenXR pacing and presentation logging in console.log.
|
||||
@@ -320,6 +321,16 @@ inline bool IsSupportedVrFoveation(std::string_view value) {
|
||||
return std::find(kVrFoveationLevels.begin(), kVrFoveationLevels.end(), value) != kVrFoveationLevels.end();
|
||||
}
|
||||
|
||||
// Eye-tracked foveation: with a headset that tracks the eyes (XR_EXT_eye_gaze_interaction, the Steam
|
||||
// Frame's), the foveation level's full-density region follows the gaze instead of staying on each
|
||||
// eye's forward direction. Live while the session's runtime offered the gaze at launch. On by
|
||||
// default on the Steam Frame; elsewhere off, since Horizon OS asks for an eye tracking permission.
|
||||
#if defined(MKW_HEADSET_STEAM_FRAME)
|
||||
inline constexpr bool kVrEyeTrackedFoveationDefault = true;
|
||||
#else
|
||||
inline constexpr bool kVrEyeTrackedFoveationDefault = false;
|
||||
#endif
|
||||
|
||||
// The level aurora_set_stereo_foveation takes; anything unknown is off.
|
||||
inline uint32_t VrFoveationLevelIndex(std::string_view value) {
|
||||
const auto it = std::find(kVrFoveationLevels.begin(), kVrFoveationLevels.end(), value);
|
||||
@@ -891,6 +902,7 @@ inline RuntimeUserConfig ParseConfigDocument(const toml::value& document) {
|
||||
value && IsSupportedVrFoveation(*value)) {
|
||||
config.vrFoveation = *value;
|
||||
}
|
||||
config.vrEyeTrackedFoveation = FindConfigValue<bool>(document, "vr", "eye_tracked_foveation");
|
||||
if (auto value = FindConfigValue<std::string>(document, "vr", "mirror_view");
|
||||
value && IsSupportedVrMirrorView(*value)) {
|
||||
config.vrMirrorView = *value;
|
||||
@@ -1303,6 +1315,11 @@ inline bool SetVrFoveation(std::string value) {
|
||||
return WriteSetting("vr", "foveation", FormatString(value));
|
||||
}
|
||||
|
||||
inline bool SetVrEyeTrackedFoveation(bool value) {
|
||||
Mutable().vrEyeTrackedFoveation = value;
|
||||
return WriteSetting("vr", "eye_tracked_foveation", value ? "true" : "false");
|
||||
}
|
||||
|
||||
inline bool SetVrFirstPersonSeat(std::string value) {
|
||||
if (!IsSupportedVrFirstPersonSeat(value)) {
|
||||
return false;
|
||||
@@ -1828,6 +1845,10 @@ inline std::string VrFoveation(std::string fallback = kVrFoveationDefault) {
|
||||
return value && IsSupportedVrFoveation(*value) ? *value : std::move(fallback);
|
||||
}
|
||||
|
||||
inline bool VrEyeTrackedFoveation(bool fallback = kVrEyeTrackedFoveationDefault) {
|
||||
return Get().vrEyeTrackedFoveation.value_or(fallback);
|
||||
}
|
||||
|
||||
inline int32_t VrFirstPersonHiddenModel(int32_t fallback = kVrFirstPersonHiddenModelDefault) {
|
||||
return std::clamp(Get().vrFirstPersonHiddenModel.value_or(fallback), -1, 31);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user