Introduction to Rooms and Portals

    This allows several features:

    • Portal occlusion culling, which can increase performance by reducing the number of objects that are drawn, both to cameras and to shadow maps.

    The trade off for these features is that we have to manually partition our level into rooms, and add portals between them.

    Godot portals should not be confused with those in the game of the same name). They do not warp space, they simply represent a window that the camera (or lights) can see through.

    Although the effort involved in creating rooms for a large level may seem daunting, there are several factors which can make this much easier:

    • If you are “kit bashing” and reusing rooms or areas already, this is an ideal way to save effort. Your level tiles can be rooms, with portals already placed.

    The performance benefits (especially in terms of occlusion) follow an L-shaped curve, with the lion’s share occurring when you have created just a few rooms. So do not be afraid to be lazy - *work smart*.

    In general, when it comes to medium and large-sized levels, it is better to do a little portalling than none at all.

    Some caveats

    Note

    The portal system should be considered an advanced feature of Godot. You should not attempt to use rooms and portals until you are familiar with the Godot editor, and have successfully made at least a couple of test games.