From d60db7f19a5e21a4059571a0cdfa6ee362e8e7ee Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Wed, 20 Nov 2019 11:15:55 +0000 Subject: [PATCH] Update INSTRUCTIONS_SINGLEROOM.md --- INSTRUCTIONS_SINGLEROOM.md | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/INSTRUCTIONS_SINGLEROOM.md b/INSTRUCTIONS_SINGLEROOM.md index 6cee7c5..887d776 100644 --- a/INSTRUCTIONS_SINGLEROOM.md +++ b/INSTRUCTIONS_SINGLEROOM.md @@ -4,6 +4,8 @@ Although LPortal is primarily designed for occlusion culling with rooms and portals, it also contains some optimizations to increase the accuracy of general culling (both for the camera and lights). While I couldn't easily integrate these into Godot 3.2 core (because of shadow map caching), they can still be used relatively simply with most 3d games via LPortal. ### How does it work? +Single room mode uses a subset of the functionality of LPortal to speed up culling in a general situation. It works by treating your entire game level as a single room, without portals (so there will be no occlusion culling). However the meshes / lights within will be culled by LPortal. + The optimizations speed up and increase the accuracy of general camera / light culling using several methods, especially the following: * Shadow casters are culled so that only those that affect the camera frustum are drawn to shadow maps @@ -12,8 +14,6 @@ The optimizations speed up and increase the accuracy of general camera / light c Note that these methods will primarily speed up rendering in games that use realtime lighting, rather than baked lighting. They aren't designed to work with GI probe and may produce artefacts (such as shadow popping) when used with GI probe. -SingleRoom mode works by treating your entire game level as a single room, without portals (so there will be no occlusion culling). However the meshes / lights within will be culled by LPortal. - ### How to 1) You will typically need to separate the objects in your game into those that are long-lived (staying present throughout a game level) and those that may be added and removed dynamically (such as players).\ \ @@ -25,3 +25,13 @@ _I will refer to the long-lived objects as 'static', and the short-lived as 'dyn ``` LRoomManager.rooms_single_room_convert(true, false) ``` +6) There is one further step to get started, you must setup your camera to work with LPortal. The camera should NOT be in the room. +7) First you have to register the camera as a dynamic object (DOB) within LPortal: +``` +# where $Camera is your camera node +LRoomManager.dob_register($Camera, 0) +``` +8) Next you have to select this camera as the active camera: +``` +LRoomManager.rooms_set_camera($Camera) +```