I am quite curious about Lumen and wanted to start to fiddle with it in C++, I was thinking about coding Logic and have it do specific things that I would like. Having directed how many bounces or distance etc. Is there any documentation that I just can’t find about coding LumenLogic inside of C++ in Unreal Engine 5.
I have extensive knowledge in C# and I have gotten my hands dirty with C++ I am not too worried about that though I am more curious to know if anyone has attempted to look into Lumen more extensively and have coded there own Logic in it.
While I haven’t toyed around with the lumen code directly, I am relatively familiar with how all of it works. I suppose I’m just a bit curious on what you’re looking to accomplish?
Bounces of diffuse GI are essentially infinite via the radiance caching, and tracing distance is similarly adjustable via CVar or PPV. For specular bounce count control, that’s already supported in the _main build. Not trying to discourage you from playing around with the system, just letting you know what it already supports. In terms of documentation? Little to none official from what I’ve found, but they’ve left enough CVars that there’s an incredible versatility of behavior and performance you can unlock with the engine stock.
Alright thanks for the information, Yeah I am just trying to go for a (performance) tweaking. So being able to code logic into Lumen to limit the distance it renders at and how accurate each bounce is, especially if it’s infinite.
Though in all honesty also coding custom parameters for Lumen such as (custom bounces in specific direction/area, Color, temp etc.) I am trying to go for more deep into settings with Lumen. Thus how it works as well, being able to re-program parts of Lumen to my liking to achieve exactly what I like it to.
If you do go down that path it’d be better to find ways to either extend on top of the engine specific to your game while leaving the engine untouched, or make some pull requests where you add this functionality or add hooks into the engine to let a game extend this behavior. It’s gonna eventually be really hard to stay merged with engine changes as it updates, and if this stuff is useful it’d really help overall. The way lumen is coded could just randomly change completely on you with new engine versions and merging would be hard. I’ve seen this over the years of working on ue4 and how much things have changed deep in the engine
Alright I see what you mean, I was honestly hoping to making this a plugin for environment artists and possibly optimizers, to be able to play around with and edit these parameter in the extremally rare case Lumen (Automatically) does not work well with your scene.
And to use it to (fake it tell you make it) so they can change and direct exactly and precisely how Lumen both looks and Interacts with there scenes.
I’m getting a little creative but I can see where your coming from and the issues I will encounter that will have me recoding all my code.
Inevitably over time the Lumen code will probably be easier and easier to make plugins for, or maybe it already is easy to make plugins for even now. You might be one of the people who helps make it easier to make plugins for.
Epic did create a slot in the PPV to allow for external GI and reflections plugins, and there are many corner cases where lumen isn’t as robust as other potential solutions.
I’ve followed the engine pretty extensively on Github and have been pulling down and testing _main builds. Real-time GI, especially a general-purpose solution like lumen, is in its’ extreme infancy. I’ve seen modules get taken apart and rebuilt, certain feature paths added, removed, rolled into a different feature set. In EA, they had support for long-range GI via a reflective shadow map, and that got completely pulled out and replaced with the far-field (with no long-range SWRT solution left, to my knowledge).
So essentially, props to you, I think a more tunable lighting pipeline is always a good thing, but it could be a heck of an undertaking to not have the engine get too far away from you.
Although much of the GI and reflections pipeline is solved, I remember Daniel Wright talking about wanting explicit sampling for emissive surfaces, and the strata team looking into colored shadows.