Portal rendering / culling module for Godot
Go to file
lawnjelly 664e8175bf
Dynamic objects now working
Code needs cleaning up though, and replacing Vector with LVector, and adding culling for dynamics.
2019-09-13 19:15:25 +01:00
CoBitField_Dynamic.cpp
CoBitField_Dynamic.h
config.py
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 Dynamic objects now working 2019-09-13 19:15:25 +01:00
LICENSE
lplanes_pool.cpp
lplanes_pool.h
lportal.cpp Dynamic objects now working 2019-09-13 19:15:25 +01:00
lportal.h Dynamic objects now working 2019-09-13 19:15:25 +01:00
lroom_manager.cpp Dynamic objects now working 2019-09-13 19:15:25 +01:00
lroom_manager.h Dynamic objects now working 2019-09-13 19:15:25 +01:00
lroom.cpp Dynamic objects now working 2019-09-13 19:15:25 +01:00
lroom.h Dynamic objects now working 2019-09-13 19:15:25 +01:00
lvector.h Dynamic objects now working 2019-09-13 19:15:25 +01:00
README.md
register_types.cpp
register_types.h
SCsub Dynamic objects now working 2019-09-13 19:15:25 +01:00

godot-lportal

Portal rendering module for Godot

Work in progress, not yet fully functional

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 - Tomorrow
  • 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 'convert' method on the LRoomManager. This will convert room and portal spatials to LRooms and LPortals, and make portals 2 way.
  • Call 'set_camera()' on LRoomManager to set which camera is used for visibility determination (this is useful for debugging)

That's pretty much it for now. There will also be calls to help determine which room the camera starts in, it just defaults to the first room for now. I'll try and figure a way of automatically tracking the camera room.