Skip to content
Portal rendering / culling module for Godot
C++
Branch: master
Clone or download
Latest commit 1991a43 Feb 24, 2020

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images Delete lportal_boxrooms.jpg Oct 23, 2019
.appveyor.yml Update .appveyor.yml Feb 24, 2020
INSTRUCTIONS.md Update INSTRUCTIONS.md Jan 19, 2020
INSTRUCTIONS_SINGLEROOM.md Update INSTRUCTIONS_SINGLEROOM.md Nov 25, 2019
LICENSE Initial commit Sep 11, 2019
OCCLUSION_CULLING.md Update OCCLUSION_CULLING.md Nov 26, 2019
README.md Update README.md Feb 15, 2020
SCsub Fix compiler command line on windows Feb 15, 2020
config.py Add files via upload Sep 11, 2019
larea.cpp More realtime support Nov 19, 2019
larea.h More realtime support Nov 19, 2019
lbitfield_dynamic.cpp Dynamic objects now working Sep 13, 2019
lbitfield_dynamic.h Dynamic objects now working Sep 13, 2019
lbound.cpp More checks for DOBs moving outside current room Jan 27, 2020
lbound.h More checks for DOBs moving outside current room Jan 27, 2020
ldae_exporter.cpp External lightmap workflow working Dec 3, 2019
ldae_exporter.h External lightmap workflow working Dec 3, 2019
ldebug.cpp More realtime support Nov 19, 2019
ldebug.h Camera dob updated in frame update Jan 14, 2020
ldob.cpp Camera dob updated in frame update Jan 14, 2020
ldob.h Added option to use Godot hide instead of detach from scene tree Jan 9, 2020
lhelper.cpp External lightmap workflow working Dec 3, 2019
lhelper.h External lightmap workflow working Dec 3, 2019
lmain_camera.cpp More realtime support Nov 19, 2019
lmain_camera.h
lplanes_pool.cpp Improved pool Sep 25, 2019
lplanes_pool.h Improved pool Sep 25, 2019
lportal.cpp Switch portal plane normal convention Jan 8, 2020
lportal.h Switch portal plane normal convention Jan 8, 2020
lportal_all.cpp Camera dob updated in frame update Jan 14, 2020
lroom.cpp bug fix in dob_update room detection Jan 28, 2020
lroom.h More realtime support Nov 19, 2019
lroom_converter.cpp More checks for DOBs moving outside current room Jan 27, 2020
lroom_converter.h More checks for DOBs moving outside current room Jan 27, 2020
lroom_manager.cpp teleport message changed to LPRINT Jan 14, 2020
lroom_manager.h Added option to use Godot hide instead of detach from scene tree Jan 9, 2020
lscene_saver.cpp Working with box rooms demo Oct 22, 2019
lscene_saver.h Working with box rooms demo Oct 22, 2019
ltrace.cpp Camera dob updated in frame update Jan 14, 2020
ltrace.h More realtime support Nov 19, 2019
lvector.h More realtime support Nov 19, 2019
register_types.cpp Refactor LRooms and LPortals to no longer be part of scene graph Sep 15, 2019
register_types.h Add files via upload Sep 11, 2019

README.md

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

Features

  • Support for dynamic objects (DOBs)
  • Dynamic lights
  • Optional auto-generation of room bound convex hulls
  • Internal lightmapping workflow (for baking lights in Godot)
  • External lightmapping workflow (for baking lights in Blender etc)
  • Single room mode (for non-portalled levels)

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, I am currently working on a small demo / test first person shooter game. This is helping me find bugs / add usability features as I go.

Note I'm also currently rewriting the Godot 2d GLES renderer in core, so that has to take priority until it is working.

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

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

  • Optimize non-moving statics DONE

  • Optional convex hull bound for rooms DONE

  • Auto convex hull bound generation 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

  • Switchable culling method DONE

  • Bug fixing / testing ONGOING

  • Demo game ONGOING

  • 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.

You can’t perform that action at this time.