Portal rendering / culling module for Godot
Go to file
2020-01-09 13:47:25 +00:00
images Delete lportal_boxrooms.jpg 2019-10-23 11:22:54 +01:00
config.py
INSTRUCTIONS_SINGLEROOM.md Update INSTRUCTIONS_SINGLEROOM.md 2019-11-25 18:19:59 +00:00
INSTRUCTIONS.md Update INSTRUCTIONS.md 2020-01-09 13:47:25 +00:00
larea.cpp More realtime support 2019-11-19 10:29:53 +00:00
larea.h More realtime support 2019-11-19 10:29:53 +00:00
lbitfield_dynamic.cpp
lbitfield_dynamic.h
lbound.cpp
lbound.h
ldae_exporter.cpp External lightmap workflow working 2019-12-03 15:50:30 +00:00
ldae_exporter.h External lightmap workflow working 2019-12-03 15:50:30 +00:00
ldebug.cpp More realtime support 2019-11-19 10:29:53 +00:00
ldebug.h Properly deal with duplicate verts in portal geometry 2020-01-07 18:16:54 +00:00
ldob.cpp More realtime support 2019-11-19 10:29:53 +00:00
ldob.h More realtime support 2019-11-19 10:29:53 +00:00
lhelper.cpp External lightmap workflow working 2019-12-03 15:50:30 +00:00
lhelper.h External lightmap workflow working 2019-12-03 15:50:30 +00:00
LICENSE
lmain_camera.cpp More realtime support 2019-11-19 10:29:53 +00:00
lmain_camera.h More realtime support 2019-11-19 10:29:53 +00:00
lplanes_pool.cpp
lplanes_pool.h
lportal_all.cpp External lightmap workflow working 2019-12-03 15:50:30 +00:00
lportal.cpp Switch portal plane normal convention 2020-01-08 19:18:06 +00:00
lportal.h Switch portal plane normal convention 2020-01-08 19:18:06 +00:00
lroom_converter.cpp Auto bounds now created with qhull 2020-01-09 13:35:50 +00:00
lroom_converter.h Auto bounds now created with qhull 2020-01-09 13:35:50 +00:00
lroom_manager.cpp Switch portal plane normal convention 2020-01-08 19:18:06 +00:00
lroom_manager.h Switch portal plane normal convention 2020-01-08 19:18:06 +00:00
lroom.cpp More realtime support 2019-11-19 10:29:53 +00:00
lroom.h More realtime support 2019-11-19 10:29:53 +00:00
lscene_saver.cpp
lscene_saver.h
ltrace.cpp More realtime support 2019-11-19 10:29:53 +00:00
ltrace.h More realtime support 2019-11-19 10:29:53 +00:00
lvector.h More realtime support 2019-11-19 10:29:53 +00:00
OCCLUSION_CULLING.md Update OCCLUSION_CULLING.md 2019-11-26 12:27:05 +00:00
README.md Update README.md 2019-12-03 16:31:16 +00:00
register_types.cpp
register_types.h
SCsub Properly deal with duplicate verts in portal geometry 2020-01-07 18:16:54 +00:00

godot-lportal

Portal rendering / Occlusion culling module for Godot 3.2

You can either use LPortal as a full occlusion culling system if you can create your level as rooms and portals, or use it in a simplified single room mode to speed up culling in any 3d level.

Note that this is a Work in progress. Feel free to try out the latest version (master) but recognise that the API may change as I move towards first release.

plane_lines

Video of initial testing:
https://www.youtube.com/watch?v=uVwLltiouBs
https://www.youtube.com/watch?v=xF_3Fe2HRdk
https://www.youtube.com/watch?v=NmlWkkhGoJA

Demos / Tutorials

https://github.com/lawnjelly/lportal-demos

Feel free to leave suggestions / feature requests on the issue tracker, especially regarding ease of use.

Current status

As everything is now basically working, aside from bug fixing, my next stage is to build a demo game to show off the module and better test everything, probably a simple first person shooter.

The external lightmapping workflow is now basically working, as described in the instructions. This allows a higher quality result than is currently possible with the Godot lightmapper. LPortal can export your level as a collada (dae) file which you can uv map and bake a lightmap in blender. Note that I'm not yet exporting the materials, I may add this later as this will enable the material colours and properties to affect the baked lightmap (e.g. a green wall will reflect green colour).

The first demo tutorial (see above) is now working with the internal godot baked lightmap workflow. It shows registering dynamic objects (DOBs), loading and unloading levels.

Dynamic lights are now working, both global (directional lights) and local (omnis and spotlights):
https://www.youtube.com/watch?v=1WT5AXZlsDc

I have added a single room mode, which allows LPortal to speed up culling in games that haven't even been designed as rooms and portals.

Instructions

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 DONE

  • Cleanup code, Optimize DONE

  • Handle special cases (multiple portals views into room etc) DONE

  • Optimize non-moving statics DONE

  • Optional convex hull bound for rooms DONE

  • Add debug graphical view of portal planes DONE

  • Add debug graphical view of room bounds DONE

  • Dealing with shadows from objects outside of view DONE

  • Universal visibility query for camera and dynamic lights DONE

  • Support for global directional lights (like the sun) DONE

  • Internal baked lightmap workflow DONE

  • External baked lightmap workflow DONE

  • Bug fixing / testing ONGOING

  • Demo game

  • Shadow caster optimization

  • Closable portals

  • PVS (primary and secondary)

Installation

You will need to compile Godot from source (for now). See: http://docs.godotengine.org/en/3.0/development/compiling/index.html

Once the engine is compiling okay on your system, to add the module:

  • Create a folder inside godot/modules called 'lportal'
  • Clone / download this repository as a zip file and place the files in the lportal folder
  • Compile the engine as normal, it should automatically pick up the lportal module
  • Note that to export to other platforms you will also have to compile export templates for those platforms

You will know the installation was successful when you see a new Node type 'LRoomManager' in the Godot IDE.