SebLague / Portals

Portals in Unity
https://www.youtube.com/watch?v=cWpFZbjtSQg
MIT License
773 stars 167 forks source link

Portals show blank texture when used in Additive Loading #23

Open mtorruella opened 8 months ago

mtorruella commented 8 months ago

I am attempting to use this portal package alongside an Additive Scene Loading system. The idea is that the user will enter the loading volume, which will cause the relevant scene to be loaded asynchronously to the game along with any portals that would also be in that scene.

The problem is that when the scene is loaded, the portals load with it but have blank gray textures on the screens instead of the correct renderTexture. Unloading and reloading the scene doesn't affect it. Oddly enough, the portals are perfectly functional otherwise. The player is able to move through them without issue. They just look like blank gray walls instead of clear portals.

When I load the scenes individually to test the portals work as expected. If I don't use Additive Loading then they work as expected. If I place a player object in the second scene facing the portal, then start the game from the first scene, walk into the loading volume, and jump back out to the editor view, I can see that the Main Camera from the first scene does indeed see the correct texture on the portal.