From e032f66c2ee81a245a321b4840019ca014c9db89 Mon Sep 17 00:00:00 2001 From: lawnjelly Date: Mon, 23 Sep 2019 11:20:02 +0100 Subject: [PATCH] Update INSTRUCTIONS.md --- INSTRUCTIONS.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/INSTRUCTIONS.md b/INSTRUCTIONS.md index 2f6cf2c..af78019 100644 --- a/INSTRUCTIONS.md +++ b/INSTRUCTIONS.md @@ -279,7 +279,9 @@ ROOM 'myroom_x0y0' planes 6 portals 3 Outside plane 0.996257, 0, -0.086442, 0 CULLED (outside planes) ``` -Visibility starts from the room the camera is in, checks the objects within against the clipping planes (just the view frustum at first), then checks each portal to see if it is visible. If it is visible it checks the room on the other side of the portal, and continues the process recursively. Each time it moves through a portal it adds clipping planes from the camera to the edges of the portal. This ensures that objects that are hidden by portal planes are not rendered. +Visibility starts from the room the camera is in, checks the objects within against the clipping planes (just the view frustum at first), then checks each portal to see if it is visible. If it is visible it checks the room on the other side of the portal, and continues the process recursively. Each time it moves through a portal it adds clipping planes from the camera to the edges of the portal. This ensures that objects that are hidden by portal planes are not rendered. + +You can show the portal culling graphically by calling `rooms_set_debug_planes(true)`. #### Getting maximum performance LPortal is very efficient, and the culling process itself is only likely to be a bottleneck if you are creating too high a density of portals. On each frame, every portal the camera 'sees' through creates a new set of clipping planes for each edge of the portal, which can be a lot to check when you are seeing an object through a door, through a window, through another window etc. So bear this in mind when building levels. @@ -295,6 +297,7 @@ Level design is thus a balancing act between creating a higher density of rooms * `void rooms_set_active(bool bActive)` - turns on and off lportal * `void rooms_log_frame()` - output debug logs for the next frame * `void rooms_set_logging(int level)` - set debug logging level, 0 - 6 (0 is none, 6 is most) +* `void rooms_set_debug_planes(bool bActive)` - turns on and off graphic debugging of portal planes * `bool dob_register(Node * pDOB, float radius)` - have lportal find start room * `bool dob_register_hint(Node * pDOB, float radius, Node * pRoom)` - user provides start room