Voxel GI implementation!

Hey there!

For the last few weeks I’ve been working on implementing voxel cone tracing based global illumination for Xenko, and it’s at a stage where it’s kinda working :D. Voxel cone tracing allows for approximate real-time global illumination (bounce lighting, area lights, emissive objects, etc) without any pre-computation or manually placed light probes or whatnot, at the cost of frame rate and memory usage.

Here’s a comparison screenshot:
GI Off


GI On

There are many more features that I’m intending to add, feel free to check out the Git Hub page for a fuller list and also more detailed explanations on how it all works, and instructions for if you want to test it out yourself!

Git Hub Repository

It’s not optimized at all yet, so I only get 40fps at 720p on my GTX 750ti (albeit with the overhead of running a Windows build through WINE on Linux).

It is my hope that this can be integrated into the Xenko codebase at some point. So while I’ve been writing it just as scripts in a Xenko project, I’m also making sure it’ll be really easy to merge in to the engine properly if it’s accepted.

I’d love if any of the devs would be able to take a look and share any thoughts they have on how viable it would be to merge it when it’s further developed.

Thanks!

12 Likes

Impressive work @spike1. It is so cool to see someone just taking their own path and producing something so complex but beautiful. Keep up the good work.

Thank you for the implementations this useful feature!

this is a great job! Thanks for your work!

Wow, great job!
Impressed you managed to do all that without much help on Xenko internals!

Thanks y’all :slight_smile:

Sorry for taking so long to get back here! But I come bearing screenshots and demos!

The White Room Demo
In this demo you can move around the sun, and toggle all the lights and whatnot off and on; here’s a list of controls:

Ctrl-Shift-P - Hide debug info
WASD - Move around
Left/Right/Up/Down - Rotate sun
1 - Toggle sun
2 - Toggle emissive lamp
G - Toggle global illumination
V - Toggle voxelization

A lot of work has been done on this since the first post. It’s a fair bit faster now (I get 60fps in the demo above) and has many more features (anisotropic voxelization, clip maps, anti aliased voxelization, debug visualization, reflections, etc). There’s still a bit to go regarding stability and features, but it’s getting there :slight_smile:

Soooo…

@xen2 I was wondering if there’s any interest in having this merged in when it’s a bit further developed. The general architecture is falling into place and I’m hoping that for the most part the code base isn’t too hard to look at. So, I was wondering if you’d be interested in taking a look at the repository when you have time and giving some general thoughts on what sort of direction it should be taking?

Perhaps it’s over engineered, or maybe the configuration should happen in the graphics compositor rather than per scene as a component, or there’s some other issue, so I’d be really grateful for your thoughts!

Thanks if you can :slight_smile:

(Also wow thanks for the fast Interlocked merge haha)

I also really want to thank @david_j for his part in this. He’s been sponsoring the development of this feature, which I’m extremely grateful for. It’s been a great project to work on and I hope it ends up being helpful to Xenko :slight_smile:

8 Likes

Awesome work, thanks again!
I would definitely be happy to help in merging this feature.

I will take a look at the repo over the next few days.

It’s nice that you could achieve most of it in a separate project.
It probably means it would lend quite well to the new module/plugin architecture (i.e. an optional Xenko.VoxelGI). Would that make sense?

3 Likes

Wow that looks insanely beautiful. My respect to you sir/madam.

The still image doesn’t do this work justice, so I made a quick video… What @spike1 has done here is really impressive.

5 Likes

The video looks impressive, thanks for uploading. Really great to see this happening!

Sorry I didn’t get to it yet, finishing last sprint to release 3.1 (and some family matters).
Still one of the high priority things I want to focus on next!

Took a quick look at the repo, looks good to me.
Xenko will need some improvements later (Graphics Compositor) to more easily integrate this kind of feature, but for now the way you integrated is good enough.
Let me know when you feel ready to merge part of it in Xenko itself (as a Xenko.VoxelGI plugin?), I could help if needed.

Thanks again and keep up the great work!

3 Likes

this looks amazing i really hope this is coming to this engine soon for people making indoor Adventure escape type games this is perfect :slight_smile:

1 Like