1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Switch WebXRInterface from using external textures to using the render targets from Godot

This commit is contained in:
David Snopek
2021-12-10 11:08:58 -06:00
parent 4cae48d81c
commit f2fe60b989
4 changed files with 9 additions and 74 deletions

View File

@@ -349,18 +349,15 @@ CameraMatrix WebXRInterfaceJS::get_projection_for_eye(ARVRInterface::Eyes p_eye,
return eye;
}
unsigned int WebXRInterfaceJS::get_external_texture_for_eye(ARVRInterface::Eyes p_eye) {
if (!initialized) {
return 0;
}
return godot_webxr_get_external_texture_for_eye(p_eye);
}
void WebXRInterfaceJS::commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect) {
if (!initialized) {
return;
}
godot_webxr_commit_for_eye(p_eye);
RID texture = VSG::storage->render_target_get_texture(p_render_target);
uint32_t texture_id = VSG::storage->texture_get_texid(texture);
godot_webxr_commit_for_eye(p_eye, texture_id);
};
void WebXRInterfaceJS::process() {