Realtime Dynamic GI + Reflections + AO + Emissive plugin - AHR

***UPDATE 2 : I got hired to finish developing this exclusively for a client, so I won’t be updating the repo on github. It’s still there, but if you want to do something with it, please contact me first. Thank you all ***

Clarifications: Due to limitations both on time and the plugin interface of UE, this is NOT a plugin, but a modification of the engine source
Public release here, but first watch this video.
Also, jump straight to page 10, that’s where the fun starts :wink:
You’ll need to be loged in github to download, with your account that’s linked to your unreal engine account
Test Scene here : MEGA
Old stuff follows

Hy everyone.
I have been developing a technique, called Approximate Hybrid Raytracing (AHR), to render global illumination, reflections, and AO for fully dynamic scenes, approximating the scene with a voxel grid and then raytracing.
I aim mid-range hardware, for example, my FX-6300 and GTX 750 Ti runs the sample demo at 60 FPS for the lowest quality preset and around 27 FPS for a reasonably high quality preset.
I decided to write a plugin for UE4 that integrates AHR into the editor, considering Epic dropped support for dynamic GI, and LPVs doesn’t produce high quality results.

For now, I just have an old video ([SIZE=5][SIZE=4]I say it again. OLD video. It runs about 60% - 70% faster now[/SIZE][/SIZE]) and a few screenshots of AHR inside UE4.

AHR features include:
• Scalable quality
• Fully dynamic scenes
• 1 bounce indirect illumination
• 1 bounce reflections
• Flexible material model
• “Free” (no performance hit over standard GI, just reuses samples) AO
• Unlimited emissive materials with soft shadows

I’ll be updating this with screenshots and demos over this week, and then two weeks later (starting October 6) I’ll start to update this thread every day.

Sweet! Good to see someone working on a dynamic GI solution instead of asking for it for a change. :slight_smile:
Can you post comparison screenshots for lowest and highest quality presets please?

I’m most impressed by the “free” AO, since AO is something that usually comes at a high performance cost. This scene is lit by a single dynamic light, right? Do you have plans to make future updates using an HDR for lighting? I’m definitely watching this thread! Good job, man.

This looks pretty amazing - does it run on all platforms?


What about more diffuse bounces ? 1 bounce doesn’t really cut, but two bounes would be awesome, and three bounces would just amazing.

Anyway, I say, there is job waiting for you in Epic.

I was the test case for running his AHR demo on the NVidia Titan and AMD Radeon A9 290X, and all I can say is very good job, and its going to be awesome in UE4.

Honestly just sounds like voxel cone tracing without the cones:

That’s the original paper. Lot of advancements since then, will finally be coming out in a games soon, The Tomorrow Children, though that’s only an approximate, and I highly suspect Deep Down as well. Both PS4 exclusives, as unfortunately the XBO’s bandwidth to ram is quite low except for its fast 32mbs of Esram. Still, it might be possible to do it there too. Regardless, take a look, as this produces much more temporally stable results and with the automatic filtering lets you do rough specular for cheaper rather than progressively more expensive.

this looks awesome, keep up the good work.

only one question,
what are your plans for the plugin? to be released at all? free or commercial? beta releases or only to be released on a ‘final’ state?

Very nice. I always wanted Dynamic GI in UE4 and this is great news for me.

I’d also like to know about this.

One doubt. IIRC, Epic once said that making plugins for the rendering system is not possible. So how did you manage to pull this off? Is this really a plugin or an enhancement made directly in Engine?

That looks really great! Epic, it’s time to hire this guy before anyone else steals him.

Reflections are a big deal! I’d say they’re more important than GI :D! Can’t wait to see how this develops! How does it perform when scaling to larger scenes?

Nah, we have good deal of solutions for reflections, but none for multibounce diffuse lighting.
In anycase it’s part of the same solution, only difference is accuracy of reflections.

Well, that escalated quickly!
To answer the questions:

  • The plugin will be FREE when I release it
  • I’m still unsure about beta releases. Will see as I go
  • Still haven’t started to code the plugin. That screen was taken modifing the source directly
  • Multiple bounces are easly supported ( is quite like a raytracer ), the problem is performance. I’m still unsure how will it scale
  • Raytracing complexity is independet from scene complexity, but voxelization is not. The voxel resolution suffers on large scenes. I have a few ideas to solve that though
  • AO is free cause I reuse the samples that I took to compute the diffuse bounce
  • I code in DirectX 11, have never tried OpenGL. PS4 and XBOX One should be able to run it, but don’t have them to try :wink: . My system is similar in specs though (GTX 750 Ti + FX-6300), and it runs quite nicely
  • In my demo I use just one direct light, but you can use a relatively small number of them
  • Raytracing is done using HDR (sadly I never had the time to implement correct tone-mapping on my demo, so it get’s out to the screen), but the voxel data is not, as it is limited to a total of 24 bits for the color

About there quality presets, there are a lot of parameters to tweak, such as ray lenght, number of rays, voxel resolution, samples displacement, etc. Here I put some presets

4 rays, 16 samples per ray

4 rays, 32 samples per ray

8 rays, 32 samples per ray

16 rays, 32 samples per ray

32 rays, 45 samples per ray

Well, that’s it for today I think, but ask any other question you might have, if I don’t answer it today, tomorrow will update the thread

This is looking fantastic :smiley: great work here :slight_smile:

So if you are coding in DX11 chances are no Mac/Mobiles etc? (various OpenGL’s)?

Dude, sweet!!!

Best luck for this project, I’m eager to see the progress and how it’ll work when it’ll be released :slight_smile:

Thanks in advance for releasing this plugin for free, this is a huge effort!!!

PS: Consider to add paypal donations :wink:

AFAIK you won’t be able to make plugin for it. I bet you touch quite a bit of rendering code, and rendering plugins are not possible beyond some simple changes, like new shaders.

I’m by no means, expert but there are few optimizations that come to my mind:

  1. Cascading voxels, around camera in set radius (so entire scene won’t be voxelized, and further voxels will be bigger).
  2. Prevoxelize static geometry. Static geometry would be voxelized only once. Do not voxelize characaters and small moveable geometry. It would be possible to extend it by for example revoxelize static geometry when it change state (for example, moved, destroyed), and then again do not update voxelization until next state change. This would probabaly save you a lot of time.
  3. If you really needed to voxelize scene every frame, you might consider updating further cascades over several frames.
  4. Tweak able voxel resolution.
  5. If you would use OpenGL you could make use of ARB_Sparse_Texture, to access voxels saved in 3D texture and save a lot of memory this way, As you wouldn’t have to store everything, only parts which are voxelized.

In any case great work! If you are considering giving it for free I would consider talking with Epic about integrating it into main branch. When it’s ready or usable.

Well, since even a PS4 has difficulties running any kind of GI scheme I think we could just forget about mobile GI for thjis generation.
Seriously guys, forget about it please.
Lightmass is more than fine even for the big games, it’s just that people don’t want to hustle over UVs and baking time.

This is looking good btw!
If i were you i’d take a free scene from the marketplace and get it to work with your GI system, so you can better show the benefits and the quality.
I mean, Sponza sucks really bad uahaha.
Try the new Interior Day and Night scene by Koola, if you get the same quality even 10fps should be ok for now.


If a plugin is not possible, I would love for there to be a Github branch to take a look at how this would look in Caffeine, Which uses baked lighting for the static interior lights (space station) but there is a rotating sun which illuminates some dark rooms.
I may be a bit too excited about this thread… :smiley:

Sorry if I am being disrespectful or rude, but if you say something like this you have obviously no clue what you are talking about. Lightmass is not only the workflow suicide for a huge open world project, it also just crashes because of the unbelievably huge amount of data and is completely unable to handle really large areas. Epic didnt even realize that the Landscape demo from the market place crashes the Engine while baking for most people because they dont have enough RAM. Epic uses 32GB as a standard, so everyone with less than that has super huge issues in building this map.

There are a lot of reasons why its not working and I could talk about that for hours (based on my own experience) but thats not the intention of this thread^^

And yeah…very awesome work. Love the idea of seeing this in action in one of the maps from the market place. Sponza sucks indeed^^