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

**URL:** <https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923>\
**Category:** Game Development\
**Tags:** unreal-engine\
**Created:** [September 24, 2014, 1:58am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923 "2014-09-24T01:58:17Z")\
**Posts on this page:** 20\
**Page:** 25

<div class="post-metadata">

**Author:** ![Sitrec](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sitrec](https://forums.unrealengine.com/u/Sitrec)\
**Post date:** [April 26, 2015, 8:24pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/489 "2015-04-26T20:24:10Z")

</div>

Fantastic work ! Really impressive.

---

<div class="post-metadata">

**Author:** ![John\_Alcatraz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@John\_Alcatraz](https://forums.unrealengine.com/u/John_Alcatraz)\
**Post date:** [April 26, 2015, 8:39pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/490 "2015-04-26T20:39:17Z")

</div>

! AHR is looking not worse than DFGI, will be really interesting to see how they both improve in the future 🆒

---

<div class="post-metadata">

**Author:** ![Netrve](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/netrve/32/549870_2.png) [@Netrve](https://forums.unrealengine.com/u/Netrve)\
**Post date:** [April 26, 2015, 9:32pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/491 "2015-04-26T21:32:39Z")

</div>

Great job , I’m really eager to see more of your amazing work!  
I hope that you are getting one of the biggest dev grants ^^ You deserved it!

Also one more great thing is that we don’t have to setup the materials again, like with VXGI, and recompile them. saves a lot of time and annoying work for now 🙂

---

<div class="post-metadata">

**Author:** ![PLASTICA-MAN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plastica-man/32/990043_2.png) [@PLASTICA-MAN](https://forums.unrealengine.com/u/PLASTICA-MAN)\
**Post date:** [April 27, 2015, 6:49am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/492 "2015-04-27T06:49:42Z")

</div>

> [@;279405](#):
>
> Will upload it later.  
> About the multi bounce thing , I already have the system worked out, need to implement it and test if it actually works. It will be a bit of a hack, but should be fast enough. About the reflections, how are things now , on AHR at least, SSR are computed after illumination, so you do get reflections from indirect light. You don’t get reflections from indirect on the reflections traced by AHR, as that get only the info of the voxels, that is direct lighting. With the multi-bounce thing, traced reflections will have indirect, but you still wont really get two bounces, on the way that if you put two mirrors facing each other, you won’t get the mirror reflecting onto itself. Am I making any sense? Have slept really little latetly 😛
> 
> EDIT: Oh, before I forget, i pushed another commit to git. There’s a bug though, when you are on the material editor and you switch again to the main window, without closing the material editor first, the engine crashes with a message about a shader not found. really need to fix that bug.  
> I’m starting with the exams period though, so will be short on updates the next few weeks.
> 
> EDIT 2: I do recommend downloading that new commit, just be careful with closing the material editor window first.

Ah I see, so it means you don’t have recursive reflections for the time being. Anyway, great job, I hope you integrate it someday.

I will download your new build.

Good luck with your exams.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c237df01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c237df01](https://forums.unrealengine.com/u/anonymous_user_c237df01)\
**Post date:** [April 28, 2015, 2:12am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/493 "2015-04-28T02:12:09Z")

</div>

Wow is amazing ! Seriously your talent and hard work is appreciated!

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 1, 2015, 1:27am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/494 "2015-05-01T01:27:10Z")

</div>

Sorry for being a out of the loop few days, been studying like hell. Still have two more weeks to go.  
Anyway, after that I’ll get into some bug fixing, mainly that problem with the material editor / shaders not found. After that I think I’ll get to implement multiple bounces and PBR, so I can have all the features implemented and start to optimize the cr\*\*p out of it.  
'Till later people

---

<div class="post-metadata">

**Author:** ![PLASTICA-MAN](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/plastica-man/32/990043_2.png) [@PLASTICA-MAN](https://forums.unrealengine.com/u/PLASTICA-MAN)\
**Post date:** [May 8, 2015, 4:47pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/495 "2015-05-08T16:47:00Z")

</div>

@, in last page you said that you couldn’t do recursive reflections. Maybe \*\*\*\* can help you with that: [http://www.gamedev.net/topic/647809-recursive-screen-space-reflections/](http://www.gamedev.net/topic/647809-recursive-screen-space-reflections/)

He is often here in forums looking for every GI thread. Contact him.

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 11, 2015, 3:09am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/496 "2015-05-11T03:09:30Z")

</div>

Hey guys, it’s been a while. I completed most of my exams, so I can get again into . Saw that nvidia had posted some screens for two bounces VXGI, and as I can’t be behind 😉 I got right into that.  
Will probably have some screens tomorrow, and have it on the repo by the end of the week. That’s the plan at least.  
Over and out.

---

<div class="post-metadata">

**Author:** ![Netrve](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/netrve/32/549870_2.png) [@Netrve](https://forums.unrealengine.com/u/Netrve)\
**Post date:** [May 11, 2015, 2:53pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/497 "2015-05-11T14:53:09Z")

</div>

You lucky guy, I got my exam period starting tomorrow with my advanced physics exam…  
Anyways, you are doing a great job and even the preview build is .  
Maybe you can provide some written tips to get the best results? Just a general idea ^^

Greetings,  
Dakraid

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 11, 2015, 3:30pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/498 "2015-05-11T15:30:06Z")

</div>

> [@Dakraid;289532](#):
>
> You lucky guy, I got my exam period starting tomorrow with my advanced physics exam…  
> Anyways, you are doing a great job and even the preview build is .  
> Maybe you can provide some written tips to get the best results? Just a general idea ^^
> 
> Greetings,  
> Dakraid

Sure!

1. When possible, use thick walls. For example, if you are doing an interior scene, and you’ll never see the outside, place a BSP block close to the wall. It helps to prevent leaking from the outside. Don’t just make the walls thick, try to get some cheap geometry on the middle of them, like the block i talked before, so that the wall is more “solid”
2. Make the bounds as tight as possible. That will not just make it look better, it’s also a performance tip.
3. is linked to the last one. If you have tight bounds, and set a LostRayColor that represents the color from the sky, you’ll get nice ambient lighting entering from whatever hole you have on your geometry. Lost rays are the ones that exit the bounds, so if you have the bounds close to, let’s say, a window, the rays will exit the window and get the color you set up.
4. All objects (except particles) receive GI, but you can select which ones cast it. That allows you to tweak a bit the voxelization performance
5. Try to have diffuse reflective surfaces. Mirrors work, but you can clearly see the limitations of the voxels.
6. For now you can have only up to 5 lights that affect GI ( and only spot or directional ), so make them count 😉
7. Increasing the samples count will make longer rays. Increasing the displacement will have the same effect, but you will start to get banding as you increase the distance one sample has from the other, and also you may miss some objects. Most of the times is cheaper to increase the displacement than the number of samples.
8. Only touch the Diffuse samples count. The glossy one does nothing, it’s just there cause I’m lazy and haven’t removed it. Same goes for ray count.

Think that’s it, if I think of something else I’ll let you know

---

<div class="post-metadata">

**Author:** ![Blue\_man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Blue\_man](https://forums.unrealengine.com/u/Blue_man)\
**Post date:** [May 11, 2015, 4:15pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/499 "2015-05-11T16:15:35Z")

</div>

> [@;289574](#):
>
> Sure!
> 
> 1. When possible, use thick walls. For example, if you are doing an interior scene, and you’ll never see the outside, place a BSP block close to the wall. It helps to prevent leaking from the outside. Don’t just make the walls thick, try to get some cheap geometry on the middle of them, like the block i talked before, so that the wall is more “solid”
> 2. Make the bounds as tight as possible. That will not just make it look better, it’s also a performance tip.
> 3. is linked to the last one. If you have tight bounds, and set a LostRayColor that represents the color from the sky, you’ll get nice ambient lighting entering from whatever hole you have on your geometry. Lost rays are the ones that exit the bounds, so if you have the bounds close to, let’s say, a window, the rays will exit the window and get the color you set up.
> 4. All objects (except particles) receive GI, but you can select which ones cast it. That allows you to tweak a bit the voxelization performance
> 5. Try to have diffuse reflective surfaces. Mirrors work, but you can clearly see the limitations of the voxels.
> 6. For now you can have only up to 5 lights that affect GI ( and only spot or directional ), so make them count 😉
> 7. Increasing the samples count will make longer rays. Increasing the displacement will have the same effect, but you will start to get banding as you increase the distance one sample has from the other, and also you may miss some objects. Most of the times is cheaper to increase the displacement than the number of samples.
> 8. Only touch the Diffuse samples count. The glossy one does nothing, it’s just there cause I’m lazy and haven’t removed it. Same goes for ray count.
> 
> Think that’s it, if I think of something else I’ll let you know

Are you going to do more then 5 lights and add support for point lights? 🙂

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 11, 2015, 5:34pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/500 "2015-05-11T17:34:39Z")

</div>

> [@Blue man;289610](#):
>
> Are you going to do more then 5 lights and add support for point lights? 🙂

Point lights for sure.  
The problem with having a lot of lights is that it increases the voxelization time. You need to render a separated shadow map for each, and then apply the shading on the voxelization stage. One thing I’m gonna do to improve the situation is to select only the ones inside the current bounds, and from there, select only 5, based either on distance, influence or a priority value.  
For now that’s low on the priority list though

---

<div class="post-metadata">

**Author:** ![Blue\_man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Blue\_man](https://forums.unrealengine.com/u/Blue_man)\
**Post date:** [May 11, 2015, 6:07pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/501 "2015-05-11T18:07:41Z")

</div>

> [@;289690](#):
>
> Point lights for sure.  
> The problem with having a lot of lights is that it increases the voxelization time. You need to render a separated shadow map for each, and then apply the shading on the voxelization stage. One thing I’m gonna do to improve the situation is to select only the ones inside the current bounds, and from there, select only 5, based either on distance, influence or a priority value.  
> For now that’s low on the priority list though

Sounds complicated. 🙂

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_30b5a1e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30b5a1e7](https://forums.unrealengine.com/u/anonymous_user_30b5a1e7)\
**Post date:** [May 11, 2015, 8:35pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/502 "2015-05-11T20:35:37Z")

</div>

is what i get [http://it.tinypic.com/r/1693lo5/8](http://it.tinypic.com/r/1693lo5/8)  
what i’m doing wrong?

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 11, 2015, 9:31pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/503 "2015-05-11T21:31:46Z")

</div>

> [@pac85;289846](#):
>
> is what i get [http://it.tinypic.com/r/1693lo5/8](http://it.tinypic.com/r/1693lo5/8)  
> what i’m doing wrong?

I’m not sure actually. Would seem like the object is not getting shadows, so it’s emitting GI even from the shadowed parts.  
Can you tell me what were your steps with the project, or even better, upload it somewhere?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_30b5a1e7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_30b5a1e7](https://forums.unrealengine.com/u/anonymous_user_30b5a1e7)\
**Post date:** [May 12, 2015, 8:44am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/504 "2015-05-12T08:44:47Z")

</div>

I compiled the ahr ue4 again and surprisingly now it works properly.

---

<div class="post-metadata">

**Author:** ![Blue\_man](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Blue\_man](https://forums.unrealengine.com/u/Blue_man)\
**Post date:** [May 12, 2015, 8:52am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/505 "2015-05-12T08:52:16Z")

</div>

I’m excited for PBR and 2nd bounce.

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 15, 2015, 2:34am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/506 "2015-05-15T02:34:51Z")

</div>

I made a small roadmap for AHR:  
[http://i.imgur.com/2ZG4E4i.png](http://imgur.com/2ZG4E4i)  
It’s more of a guide than anything, all is subject to change, but at least that’s the idea.  
BTW, for some reason the program used Spanish for the months, don’t ask me why. Was a web program so maybe an IP thing?  
In any case, working now on multiple bounces. It’s coming together.  
For PBR I think I know how to use it properly, but I need to work out some math first.

---

<div class="post-metadata">

**Author:** ![diegor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@diegor](https://forums.unrealengine.com/u/diegor)\
**Post date:** [May 15, 2015, 2:13pm UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/507 "2015-05-15T14:13:56Z")

</div>

So you decided against implementing something along the lines of taking the first bounce of gi from one frame and injecting it into the next one to finally remove it from the second frame when the bounce has already been calculated , in order to achieve infinite bounces?

ps: what is the size of the voxels and how big is the voxel grid that you are using to obtain a cost of 10-12 ms ?

---

<div class="post-metadata">

**Author:** ![RyanTorant](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RyanTorant](https://forums.unrealengine.com/u/RyanTorant)\
**Post date:** [May 16, 2015, 12:34am UTC](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923/508 "2015-05-16T00:34:11Z")

</div>

> [@diegor;292501](#):
>
> So you decided against implementing something along the lines of taking the first bounce of gi from one frame and injecting it into the next one to finally remove it from the second frame when the bounce has already been calculated , in order to achieve infinite bounces?
> 
> ps: what is the size of the voxels and how big is the voxel grid that you are using to obtain a cost of 10-12 ms ?

I’m actually gonna do something like that, but you don’t really get unlimited bounces, as if the scene changes you can’t use all the other info. In any case, after 3 diffuse bounces there’s really not much difference, so I’m going to keep just a few frames and then reset.  
You mean a total cost of 10 ms? I have that as a final goal, but still not there. Why you asked?

[Previous page](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923.md?page=24)

[Next page](https://forums.unrealengine.com/t/realtime-dynamic-gi-reflections-ao-emissive-ahr/11923.md?page=26)
