File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed
Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,7 @@ OpenXRCompositionLayer::~OpenXRCompositionLayer() {
8585 composition_layer_nodes.erase (this );
8686
8787 if (openxr_layer_provider != nullptr ) {
88+ _clear_composition_layer_provider ();
8889 memdelete (openxr_layer_provider);
8990 openxr_layer_provider = nullptr ;
9091 }
@@ -374,16 +375,7 @@ void OpenXRCompositionLayer::_reset_fallback_material() {
374375
375376 material->set_flag (StandardMaterial3D::FLAG_DISABLE_DEPTH_TEST, !enable_hole_punch);
376377 material->set_transparency (get_alpha_blend () ? StandardMaterial3D::TRANSPARENCY_ALPHA : StandardMaterial3D::TRANSPARENCY_DISABLED);
377-
378- Ref<ViewportTexture> texture = material->get_texture (StandardMaterial3D::TEXTURE_ALBEDO);
379- if (texture.is_null ()) {
380- texture = layer_viewport->get_texture ();
381- }
382-
383- Node *loc_scene = texture->get_local_scene ();
384- NodePath viewport_path = loc_scene->get_path_to (layer_viewport);
385- texture->set_viewport_path_in_scene (viewport_path);
386- material->set_texture (StandardMaterial3D::TEXTURE_ALBEDO, texture);
378+ material->set_texture (StandardMaterial3D::TEXTURE_ALBEDO, layer_viewport->get_texture ());
387379 } else {
388380 fallback->set_surface_override_material (0 , Ref<Material>());
389381 }
You can’t perform that action at this time.
0 commit comments