Update INSTRUCTIONS_SINGLEROOM.md

This commit is contained in:
lawnjelly 2019-11-20 11:10:49 +00:00 committed by GitHub
parent 18bb1e2b1d
commit bee26631a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,3 +12,16 @@ 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).\
\
_I will refer to the long-lived objects as 'static', and the short-lived as 'dynamic', just to fit the conventions of the rest of LPortal. However, in single room mode all objects can move around, so these names should be taken to refer to the lifetimes._
2) Make sure all the static objects are placed as children / grandchildren of a single Spatial (named anything you like), this will represent your single room.
3) Add an LRoomManager node to the scene graph, but not within the room. This node contains all the functionality of LPortal.
4) You now need to 'link' the LRoomManager to your room. Under the inspector for the LRoomManager, click to assign the roomlist and select your 'room' spatial.
5) When you load your game level at runtime (especially the room), you need to convert it to work with LPortal. To do this you should call
```
LRoomManager.rooms_single_room_convert(true, false)
```