# Recursive Rendering

In the scenes folder there is a scene named Recursive Rendering that showcases the following functional upgrades to this package:&#x20;

* Recursive rendering
* Optimized portal screen rendering

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcB38PuT6cFpuKyrQxIKJL5cURs5q135RgNOubaQW4cKwghYo_2RUCHEQhrV-qKJheD5VZSwovoBqtk8XU4vThMg6856xwblbqtFhvd9PsYRhuOtPBzkcRmllcptGpofvPK5TXMXg?key=usi2H2xKHRHHROBafeGPKw" alt=""><figcaption></figcaption></figure>

When starting the scene you canopen the scene view next to the game view to see the optimized screen rendering effect. All portal screens that are not visible by the player camera will remain black until the player sees them for the first time, then the screens will start to render. When the player leaves the portal and the screen is not visible anymore, the portal screen will stop rendering. This will drastically improve performance when using multiple portals within the same scene, since only the stuff is rendered that is really needed.



When you click on a portal in the scene hierarchy, you will see that the portals are not using the `Portal.cs` script anymore. Instead now the `PortalPro.cs` script is used, which has an additional property called “Recursion Limit”.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfR-q2DszoxNLktRbLiZzSe_-ROclkLVxZl6GApic2CY6No1BhbmGR1CdpiGZIqdUwvPX87DSJ6LhrixAzIvuaKmGOJezgdkfV08-BfQUKkJ_sC8OogorEP7OFgX7FNkPsqrlRcMg?key=usi2H2xKHRHHROBafeGPKw" alt=""><figcaption></figcaption></figure>



With this property you can specify the max recursion depth to be rendered (how often you want the screen to be rendered). Here you have an example with a recursion limit of 1, 2 and 4:

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfhVHCGchSTu13CjK5vbVa3nyil7LGi1cd2V2fOZqWoUVMgUZwULeisOuTZPhLCSQiFTuRO9HYyyVVNGbtaqRoNFM7WCPUwu96Z0FI_a9nDzf2PA8LTDfZXuRJwjvvnndtVfF9WUw?key=usi2H2xKHRHHROBafeGPKw" alt=""><figcaption><p>Recursion limit 1 on the left, 2 in the middle and 4 on the right</p></figcaption></figure>

{% hint style="info" %}
in the prefab folder of the pro extension you have 2 pro portals included:

* PortalPro&#x20;
  * same portal as in the standard version, just with the new PortalPro script
* PortalPro (Gate)
  * One of the new 3D models with the PortalPro script attached
* **All other Portal prefabs are based on the standard Portal script but but should be easily replaceable with the PortalsPro script**
{% endhint %}
