eye-tracked foveation
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include "wivrn_session.h"
|
||||
|
||||
#include "accept_connection.h"
|
||||
#include "main/comp_compositor.h"
|
||||
#include "main/comp_main_interface.h"
|
||||
#include "main/comp_target.h"
|
||||
#include "util/u_builders.h"
|
||||
@@ -33,6 +34,7 @@
|
||||
#include "wivrn_controller.h"
|
||||
#include "wivrn_eye_tracker.h"
|
||||
#include "wivrn_fb_face2_tracker.h"
|
||||
#include "wivrn_foveation.h"
|
||||
#include "wivrn_hmd.h"
|
||||
|
||||
#include "xrt/xrt_session.h"
|
||||
@@ -161,6 +163,7 @@ xrt_result_t xrt::drivers::wivrn::wivrn_session::create_session(xrt::drivers::wi
|
||||
if (info.eye_gaze)
|
||||
{
|
||||
self->eye_tracker = std::make_unique<wivrn_eye_tracker>(self->hmd.get(), self);
|
||||
self->foveation = std::make_unique<wivrn_foveation>();
|
||||
usysds->base.base.static_roles.eyes = self->eye_tracker.get();
|
||||
devices->xdevs[n++] = self->eye_tracker.get();
|
||||
}
|
||||
@@ -266,6 +269,8 @@ void wivrn_session::operator()(from_headset::tracking && tracking)
|
||||
right_hand->update_tracking(tracking, offset);
|
||||
if (eye_tracker)
|
||||
eye_tracker->update_tracking(tracking, offset);
|
||||
if (foveation)
|
||||
foveation->update_tracking(tracking, offset);
|
||||
}
|
||||
|
||||
void wivrn_session::operator()(from_headset::hand_tracking && hand_tracking)
|
||||
@@ -361,9 +366,29 @@ void wivrn_session::run(std::weak_ptr<wivrn_session> weak_self)
|
||||
}
|
||||
}
|
||||
|
||||
std::array<to_headset::video_stream_description::foveation_parameter, 2> wivrn_session::set_foveated_size(uint32_t width, uint32_t height)
|
||||
std::array<to_headset::foveation_parameter, 2> wivrn_session::set_foveated_size(uint32_t width, uint32_t height)
|
||||
{
|
||||
return hmd->set_foveated_size(width, height);
|
||||
auto p = hmd->set_foveated_size(width, height);
|
||||
|
||||
if (foveation)
|
||||
foveation->set_initial_parameters(p);
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
bool wivrn_session::apply_dynamic_foveation()
|
||||
{
|
||||
if (!foveation)
|
||||
return false;
|
||||
|
||||
hmd->set_foveation_center(foveation->get_center());
|
||||
comp_target->render_dynamic_foveation(hmd->get_foveation_parameters());
|
||||
return true;
|
||||
}
|
||||
|
||||
std::array<to_headset::foveation_parameter, 2> wivrn_session::get_foveation_parameters()
|
||||
{
|
||||
return hmd->get_foveation_parameters();
|
||||
}
|
||||
|
||||
void wivrn_session::dump_time(const std::string & event, uint64_t frame, uint64_t time, uint8_t stream, const char * extra)
|
||||
|
||||
Reference in New Issue
Block a user