Portal rendering / culling module for Godot
Go to file
2019-09-15 15:39:01 +01:00
config.py Add files via upload 2019-09-11 08:09:36 +01:00
lbitfield_dynamic.cpp Dynamic objects now working 2019-09-13 19:15:25 +01:00
lbitfield_dynamic.h Dynamic objects now working 2019-09-13 19:15:25 +01:00
ldob.cpp Dynamic objects now working 2019-09-13 19:15:25 +01:00
ldob.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
LICENSE Initial commit 2019-09-11 08:04:27 +01:00
lplanes_pool.cpp Using pool and vector wrapper for planes to prevent allocations 2019-09-12 19:53:24 +01:00
lplanes_pool.h Using pool and vector wrapper for planes to prevent allocations 2019-09-12 19:53:24 +01:00
lportal.cpp Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lportal.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom_converter.cpp Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom_converter.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom_manager.cpp Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom_manager.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom.cpp Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lroom.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
lvector.h Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
README.md Update README.md 2019-09-14 12:10:48 +01:00
register_types.cpp Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00
register_types.h Add files via upload 2019-09-11 08:09:36 +01:00
SCsub Refactor LRooms and LPortals to no longer be part of scene graph 2019-09-15 15:39:01 +01:00

godot-lportal

Portal rendering module for Godot Work in progress, not yet fully functional

Current status

Refactoring LRooms and LPortals outside the scene graph (they will be lists on LRoomManager). This is both for optimization purposes and to make it easier to store fast data on the nodes, instead of using Object metadata.

Roadmap

  • Auto conversion of named room spatials and portal mesh instances to LRoom and LPortal DONE
  • Auto creation of mirror portals DONE
  • Recursive determine visibility DONE
  • Prevent memory allocations (use pools for plane vectors) DONE
  • Add support for objects moving between rooms - cameras, players, physics etc - DONE
  • Refactor code, moving LRooms and LPortals outside scene graph
  • Handle special cases (multiple portals views into room etc)
  • Cleanup code, Optimize
  • Investigate multiple passes (shadows, lights)

Instructions

This is all subject to change, but to give a rough idea of the current process:

  • Make a list of spatials for each room under a parent spatial (which will become the room manager)
  • Name the rooms 'room_kitchen', where kitchen is your room name
  • Place your objects within the room as children of the room
  • Also place portals inside the rooms
  • Portals should be MeshInstances, and convex polygons (e.g. you can create a plane and move it into position for a door)
  • Portals should be named 'portal_hall', where hall is the name of the room the portal should link to
  • Portals only need to be made in one of the adjoining rooms, the system will automatically create the mirror image portal

Once this structure is set up in the scene graph:

  • Convert the parent of the rooms to an LRoomManager node
  • At game / level start, call 'rooms_convert' method on the LRoomManager. This will convert room and portal spatials to LRooms and LPortals, and make portals 2 way.
  • Call 'rooms_set_camera()' on LRoomManager to set which camera is used for visibility determination (this is useful for debugging)

Dynamic objects (DOBs) like players, boxes etc are handled slightly differently. You currently can maintain them outside the roomlist, but instead of adding them to the rooms directly, you call:

  • void register_dob(Node * pDOB); to register with room system, so the DOB will be culled as part of the system. This will automatically move the DOB between rooms when it crosses portals.