summaryrefslogtreecommitdiff
path: root/servers/xr/xr_interface_extension.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'servers/xr/xr_interface_extension.cpp')
-rw-r--r--servers/xr/xr_interface_extension.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/servers/xr/xr_interface_extension.cpp b/servers/xr/xr_interface_extension.cpp
index 7024a25528..f828c569e9 100644
--- a/servers/xr/xr_interface_extension.cpp
+++ b/servers/xr/xr_interface_extension.cpp
@@ -74,6 +74,15 @@ void XRInterfaceExtension::_bind_methods() {
GDVIRTUAL_BIND(_set_anchor_detection_is_enabled, "enabled");
GDVIRTUAL_BIND(_get_camera_feed_id);
+ // override output methods
+ GDVIRTUAL_BIND(_get_color_texture);
+ GDVIRTUAL_BIND(_get_depth_texture);
+ GDVIRTUAL_BIND(_get_velocity_texture);
+
+ ClassDB::bind_method(D_METHOD("get_color_texture"), &XRInterfaceExtension::get_color_texture);
+ ClassDB::bind_method(D_METHOD("get_depth_texture"), &XRInterfaceExtension::get_depth_texture);
+ ClassDB::bind_method(D_METHOD("get_velocity_texture"), &XRInterfaceExtension::get_velocity_texture);
+
// helper methods
ClassDB::bind_method(D_METHOD("add_blit", "render_target", "src_rect", "dst_rect", "use_layer", "layer", "apply_lens_distortion", "eye_center", "k1", "k2", "upscale", "aspect_ratio"), &XRInterfaceExtension::add_blit);
ClassDB::bind_method(D_METHOD("get_render_target_texture", "render_target"), &XRInterfaceExtension::get_render_target_texture);
@@ -283,6 +292,33 @@ RID XRInterfaceExtension::get_vrs_texture() {
}
}
+RID XRInterfaceExtension::get_color_texture() {
+ RID texture;
+ if (GDVIRTUAL_CALL(_get_color_texture, texture)) {
+ return texture;
+ } else {
+ return RID();
+ }
+}
+
+RID XRInterfaceExtension::get_depth_texture() {
+ RID texture;
+ if (GDVIRTUAL_CALL(_get_depth_texture, texture)) {
+ return texture;
+ } else {
+ return RID();
+ }
+}
+
+RID XRInterfaceExtension::get_velocity_texture() {
+ RID texture;
+ if (GDVIRTUAL_CALL(_get_velocity_texture, texture)) {
+ return texture;
+ } else {
+ return RID();
+ }
+}
+
void XRInterfaceExtension::add_blit(RID p_render_target, Rect2 p_src_rect, Rect2i p_dst_rect, bool p_use_layer, uint32_t p_layer, bool p_apply_lens_distortion, Vector2 p_eye_center, double p_k1, double p_k2, double p_upscale, double p_aspect_ratio) {
BlitToScreen blit;