Real-time Global Illumination: Introducing Latency
Since previously determining that voxels alone weren't really capable of displaying artifact-free motion, I have been restructuring the GI system to favor speed with some tolerance for latency. The idea is that global illumination will get updated incrementally in the background over the course of a number of frames, so the impact of the calculation per frame is small. The new GI result is then smoothly interpolated from the old one, over a period of perhaps half a second. Here's a shot of the restructured system sort-of-working, at least it's writing to and reading from the correct textures, though the lighting is not correct here:
Diffuse lighting gets calculated for each voxel, for each of six directions, so the final scene render just takes the normal and uses the dot product to figure out which GI samples to use in the voxel that point intersects. This greatly lightens the load of the final scene render, since it no longer has to perform several costly cone-step rays. Since specular reflection is view-dependent, that part must be ray-traced in the final scene render, but there are some optimizations I have yet to make that will probably double the framerate here. My best estimate right now is that the GI system reduces framerate by 30% when enabled, and that it's not really dependent on scene complexity. In other words, as the scene gets more objects, the performance cost should stay about the same, and we have already seen that Ultra Engine scales extremely well with scene complexity. So everything looks very good.
From what I have seen, real-time global illumination is the killer feature everyone wants. Spending a few extra weeks on this to get a better result makes sense. I don't think I've ever worked on a feature or system that required so much iteration. I get the system working, start using it in different scenes, testing performance, and then I realize what needs to be different. With this feature, that process seems very extreme, but I really think this is the last restructure needed to get the best result possible for your games. Delivering real-time global illumination while maintaining fast framerates is very much inline with the design goals of Ultra Engine.
- 5
5 Comments
Recommended Comments