All Projects â†’ samuelbigos â†’ Godot_2d_global_illumination

samuelbigos / Godot_2d_global_illumination

Licence: mit
2D Global Illumination shader in Godot.

Projects that are alternatives of or similar to Godot 2d global illumination

Godot Nim
Nim bindings for Godot Engine
Stars: ✭ 274 (+158.49%)
Mutual labels:  gamedev, godot
Ruby2d
🎮 The Ruby 2D gem
Stars: ✭ 427 (+302.83%)
Mutual labels:  gamedev, 2d
Spine Runtimes
2D skeletal animation runtimes for Spine.
Stars: ✭ 3,171 (+2891.51%)
Mutual labels:  gamedev, 2d
cage
Cage (Ain't a Game Engine) - write 2D games using plain C
Stars: ✭ 40 (-62.26%)
Mutual labels:  gamedev, 2d
Mdframework
A multiplayer C# game framework for Godot 3.2 Mono.
Stars: ✭ 34 (-67.92%)
Mutual labels:  gamedev, godot
godot-gameshell
Godot export templates and instructions for the GameShell portable game console and other single-board computers
Stars: ✭ 34 (-67.92%)
Mutual labels:  gamedev, godot
Godot Platformer 2d
2d Metroidvania-inspired game for the 2019 GDquest Godot Kickstarter course project.
Stars: ✭ 365 (+244.34%)
Mutual labels:  godot, 2d
emerald
A 2D rust game engine focused on portability.
Stars: ✭ 383 (+261.32%)
Mutual labels:  gamedev, 2d
Space rocks
Asteroids-like game made with Godot Engine 3.0.
Stars: ✭ 20 (-81.13%)
Mutual labels:  gamedev, godot
Godot Open Rpg
Learn to create turn-based combat with this Open Source RPG demo âš”
Stars: ✭ 855 (+706.6%)
Mutual labels:  gamedev, godot
MySQL Module
MySQL connector to Godot Engine.
Stars: ✭ 30 (-71.7%)
Mutual labels:  gamedev, godot
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+10935.85%)
Mutual labels:  gamedev, godot
voltar
WebGL only 2D game engine using Godot as the visual editor
Stars: ✭ 25 (-76.42%)
Mutual labels:  godot, 2d
Godot goodies
Collection of nice stuff for Godot
Stars: ✭ 263 (+148.11%)
Mutual labels:  godot, 2d
godot experiments
Some 2D, 3D & VR experiments and tutorials in Godot 3
Stars: ✭ 181 (+70.75%)
Mutual labels:  godot, 2d
Obengine
2D Game Engine with Lua Scripting made on top of SFML !
Stars: ✭ 335 (+216.04%)
Mutual labels:  gamedev, 2d
surfacer
AI and pathfinding for 2D-platformers in Godot.
Stars: ✭ 56 (-47.17%)
Mutual labels:  godot, 2d
framework
The exomia/framework is used for building 2D and 3D games and more inspired by the XNA/Mono framework.
Stars: ✭ 21 (-80.19%)
Mutual labels:  gamedev, 2d
Pixelvision8
Pixel Vision 8's core philosophy is to teach retro game development with streamlined workflows. PV8 is also a platform that standardizes 8-bit fantasy console limitations built on top of the open-source C# game engine based on MonoGame.
Stars: ✭ 773 (+629.25%)
Mutual labels:  gamedev, 2d
Bytepath
A replayable arcade shooter with a focus on build theorycrafting made using Lua and LÖVE.
Stars: ✭ 1,119 (+955.66%)
Mutual labels:  gamedev, 2d

Godot 2D Global Illumination Demo

Preview Image

This is a demo of 2D global illumination implemented in the Godot game engine. I made it because I didn't find any examples of this sort of 2D rendering in Godot, and no examples in other engines that had publicly available code.

I make no claim that all the code here is written from scratch by me, or that I came up with the algorithms used. I referenced a lot of Shadertoy projects when writing the global illumination and Jump Flood algorithms (to create the Voronoi diagram), and initial ideas and concepts were drawn from work other people had shared on Reddit and other game development communities.

Using this in your game

Feel free to re-use as much code from here as you want (as per the MIT license) in your own projects.

However, at this stage, to make use of this in an actual game will require a deep understanding of the algorithms involved and lots of tweaking and fiddling to make things work. I do plan to continue developing this to make it as plug-and-play as possible, but for now it serves as more of a demo and reference for those looking to implement this sort of rendering technology in their game.

Implementation

The demo uses the Jump Flood algorithm to efficiently generate a Voronoi diagram (which stores the nearest surface for every pixel). The Voronoi diagram is then converted into a distance field.

In the lighting pass, each pixel sends out multiple rays to probe for emissive surfaces. That ray marches using the distance field until it finds a surface, and the pixel adds the surface emission data to itself.

To bounce light, the previous frame is referenced and emissive surfaces from that frame are added to the current frame. This means every frame, light bounces to one additional surface.

References

The primary references used when creating this demo were:

Next steps

As mentioned, I do plan to continue working on this and creating documentation for it. Here's a rough list of things I want to improve on:

  • Easier integration into existing Godot projects (think of the probe system for 3D GI in Godot).
  • Arbitrary GI buffer size for integration into projects where calculating individual lighting data for 1920x1080 pixels would be prohibitively expensive.
  • Blur filter to reduce noise.
  • General optimisations (some passes and colour/emission buffers could probably be combined, branching in shaders reduced, etc).
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].