Realtime Dynamic GI + Reflections + AO + Emissive - AHR

I was able to get it running with now issues and I am not a programmer as all so if I can compile it and have it run flawless I think anyone who can read simple instructions will be good. Even found how to add Substance since my models needed it. Now if I can just figure where to put Flex I will be set. O_O. Also for realtime raytracing it is pretty **** fast even on mid-lowend cards. Before my Titan X in a complex scene on my dying 660GTX SuperClocked I got 20-30fps in Editor which is nuts.

Guys, how’s it going? I know it’s been radio silence here lately, and is cause I was with a f*** university project. Finally finished, so can get back in the game.
What I was working on last week were improvements in voxelization, mainly api usage. I’m making a shitload of drawcalls and state changes, and that’s just awful for performance. Trying now to batch stuff as much as possible.
Will let you people know when I have something working :smiley:

Hey i have a question for you. How much do you think reflections are costing the system and
Is it possible to have a option to reduce the reflections to glossy reflections if so to reduce ms.

They are the cheapest part of the algorithm actually. If you just need reflections, you can set the diffuse sample count to 0. Not an optimal solution, but It gives a speed up.
Whenever I actually finish the new reflections algorithm they should be a little more costly, but look much better (mainly, roughness will make them less or more mirror like, depending on the value).
[EDIT] Not sure what you mean with “glossy reflections”
If you want to see how much time are reflections taking, you can do a profile gpu, search for the AHRTrace group and inside you’ll find the reflections trace time

Also wanted to say that I had an idea about the bake system I talked earlier.
Turns out I can adapt the code I use for the normal interpolation trick to allow dynamic lighting on the baked stuff.
What does that mean? It means you can bake, and then move the lights (mostly thought for a single directional light or a bunch of small ones, cost is linear with number of lights), and GI will update accordingly.
Of course, not everything is dynamic. You can’t change the geometry or the materials albedo. Also, not really sure how to handle emissive, still thinking about that one. Lastly but not least, reflections probably wont be supported. They may, but still trying to think how.
In any case, when I actually get around and implement it, it should really help to substitute Lightmass, as you’ll (hopefully) get about the same quality, with really low bake times (few seconds mostly, few minutes in the worst case/best quality), and also the ability to move the lights in run time (similar to what Enlighten allows).
Run time cost, while higher than standard lightmaps, shouldn’t be that bad (as long as you keep the number of lights in check).
Still early to say much more, but it’s one of the ideas I’m playing with, and I think it’s really cool :smiley:

How many lights would you consider in check? I’m also curious as to the performance of it on mobile. :slight_smile:

Ideally, a single directional. Besides that, too early to tell, and no idea on mobile, sorry. Maybe some high end system can run it. Current gen consoles are surely powerful enough for the baked stuff, probably with just a small performance hit.
Feel like I have to repeat, still early stuff, just an idea on my whiteboard for now :smiley:

sounds good. i was just making comparison. In some engines with GI. real time reflections are costly. but since its cheap then it could act as a good full scene real time reflection. I think i read somewhere that SSR in ue4 is 1.5 ms (can’t confirm).
It will be interesting to find out the performance of the AHR reflections only.

That sounds ,do you maybe know what would be performance hit?

Hope to make the run time cost quite small, but too early to tell

I will love you if you could do . :smiley:

I’m quite confident I could do it, the real question is when D:

Darn, I am lighting an interior with lots of point and spot lights.

Don’t get so worked out yet though, have some ideas that might allow for a bunch of lights. We’ll know more when I start implementing it.
Continuing with the hype/ideas train, just got another one to improve reflections with a small performance hit, reusing samples. Still need to work out some math on that though.

Pushed a new commit with a few voxelization improvements. Mainly reduced state change. Performance gains is a strange thing. On the editor I get like a 40% improvement in voxelization, yet in the packed game it would seem to be the same. Really odd.
In any case, fewer state changes never hurt. Will get to work on a new idea I had for the reflections tonight, so stay tunned.

Just a teaser
http://i.imgur.com/vexZ3Y5.png
http://i.imgur.com/WkG9zdZ.png
As you can see, roughness now affects the reflections. Also, it isn’t on photo but you get stretched reflections, like in real life. SSR are disabled
Been working on implementing that paper by DICE, “Stochastic Screen Space Reflections”, because most of the technique is directly applicable to AHR reflections. That’s the beauty of a raytracer, there’s so much work out there to use :smiley:
It’s still a WIP, and has artifacts, but think it looks really cool so far. The idea is to have it up on git by the weekend.

Great work so far ! I still think you deserve some monetary reward for , it is professional level stuff after all. :slight_smile:

how far out can either AHR or VXGI be seen?

I have a project going that is out doors, and while not quite open world it is certainly farther out than a normal view distance that you might see in a typical game.

Thanks! For now my goal is to try and get as most people interested on my work as possible.

Tricky question. Will talk about AHR, as I have no idea about VXGI limits. Technically, you could have as much distance as you want, it’s just making the bounds as large as the entire scene and having a high sample count. In reality, there are limitations, for example, you wont get 1km long rays at a 1 cm voxel size, it’s all on finding the balance between sample count, voxel size and bounds size.
Let’s do some math. Given that you mentioned large scenes, I’ll say you need to use a movable bound. Let’s say 100m by 100m by 20 m(up), which I think it’s about what you’ll need in most scenes, as you can’t really see so much detail after 100 m. I suggest to add an ambient cubemap to fill in the rest.
Also lets say a voxel size of 0.25 m and a sample count of 32. 25 cm precision on a 100m sounds like enough, but you could go even lower, to say 20 or 15, just remember that memory usage is cubic with the number of voxels. With a that settings, the voxel grids will take about 40 mb for t( there’s a few of them, but at most we are talking about 50 mb. The math is simpy SizeX/VoxSize * SizeY/VoxSize * SizeZ/VoxSize, and then multiply by 4 for the emissive grid, and divide by 8 for the binary grid), and the 32 samples gives us a range of 8 m.
The idea behind all talk is that for most uses, range should be enough, but will require tweaking the settings.

How is it when compared to VXGI?