Hi everyone, I’m starting this thread for feedback and discussion about MegaLights.
MegaLights is an experimental feature developed by me and @TiagoCostaUE. Our dream is to allow artists to work playfully, placing orders of magnitudes more dynamic and shadowed area lights than they could ever before.
We’ll read through this thread and try to address your feedback.
Any plans to support backscattering for SSS/foliage materials? (I saw certain lights can be set to use VSM instead of RT shadows, which I suppose is an effective workaround for this issue)
Any plans for a software raytracing solution? I noticed that we can disable RT shadows via cvar which results in lights tracing the global distance field, just wondering if there are any plans to continue to try to develop this path (maybe using mesh distance fields for better detail?) or if it is just an experiment that didn’t work out.
Any plans to provide more granular control over which scalability of light actors? It would be cool to be able to specify certain lights to only be enabled when megalights is turned on, or to be enabled but only have shadows when megalights is turned on. (would also be nice to have scalability control over these features per-light in general, outside the context of megalights)
As always… amazing work so far Never imagined I’d get to be able to dump shadowcasting lights everywhere, this is really the first hardware raytracing feature I’ve seen and gone “yeah… I need that”
There aren’t that many cases where it’s useful to have more than one directional light in the level, and when the case appears, it’s usually 2 of them at most. Not sure if there’s any Megalight limitation that’d make Directional Light support harder to implement, but so far this doesn’t seem like a big deal.
If all megalights have more or less constant cost, then there would usually be one directional light + all the megalights constant cost.
There’s a big limitation with Directional lights, or the sun. They have a certain degree of soft shadows/area shadows, but if you push it further, like if the sun would be seen through thin clouds, the area shadows would be still pretty hard edged. I’m trying to address this by creating a plugin for area shadows, but it’s hard.
But apparently Megalights is able to create tons of area shadows and with very soft edges. Is this new rendering development able to help in any way the cases with a single directional light or just a few lights ?
so… it sees the formal light of day. good job, dudes.
it’s a good one. i’ll eventually hop back on the test wagon. tied up in other projects and dealing with my cpu thermal paste giving up. can’t change it without removing the intact gpu metal. hmm… shared pipes in laptops.
Any plan to give support to VR. As I can see, when switching to VR, only left eye is rendered correctly, leaving right with a glitched version of the image.
This could be really game-changing fot VR dev.
you do a basic emissive material, disable shadows on the emissive mesh and put a light there - with texture or light function on it or not. works for light bulbs and approximate shapes that can be represented with point, spot or area lamps and works for screen panels. does not work for complex shapes. complex emissive materials are and will most likely not be supported for a bit. the trace precision is not there, yet. it’s not sampling textures (or does it?). it’ll improve, but gonna take a while til everybody has a gpu of a caliber that can do that.
Am I missing something or does it need to have raytracing capable GPU? I have GTX 1660S, but I think UE has turned raytracing off on it, even when Nvidia supports it. I tried with only RectLights and SpotLights, but it looks worse when MegaLight is turned on.
I am getting horribly pixelated ghosting when shadows are in motion and reflections are sparkling all the time. No such issues when MegaLights are turned off. Virtual Shadow Maps for Shadow Method make the shadows more accurate with my GPU, but doesn’t fix the ghosting.
Yes, we want to support directional lights at some point. It’s not a big priority, as VSM handles those relatively fine in games and having BVH covering entire scene is problematic on consoles. Still it feels like a necessary step in order to be able to remove RT shadows, also like mentioned in this thread, sometimes it’s cool to have nice area shadows from the directional light too. So on the todo list, but will need some larger work to get there.
Yes, it’s on the todo list too.
With 5.5 ray tracing push it’s unlikely that we will invest much in the software solution. Still it was easy to add, maybe someone will find use for it for scalability and it allows us to debug MegaLights using RenderDoc, which doesn’t support HWRT.
Yeah, that’s a good point and we have same questions internally. Likely at some point we’ll work on a light scalability tool allowing to override/change lights per platform/scalability settings. Though it’s nothing concrete at this point.
No. MegaLights runs its own lighting pass, which requires a GBuffer as an input and can’t be really run as a part of rasterization.
Still, I’m curious what are you after here? Is it performance of the forward renderer? MSAA? I don’t think we can roll new features into a forward renderer, but maybe deferred renderer can be extended to match VR needs.
No. It only works with analytical lights (spot, point, sphere, rect). At least at the moment we don’t have mesh light (aka emissive analytical light) support, nor we don’t support skylight. Those two are still handled by Lumen.
Yeah, like Arkiras wrote, it does work with skeletal meshes or more specifically anything what’s in the BVH.
If you look at the demo you can self-shadowing all the time:
Shadows on the environment are harder to spot due to camera angle and large area lights, but they are there (easier to see in motion):
10xx series don’t support HWRT. I guess you are getting shadows from distance fields, which likely don’t even exist for that car, so everything fallbacks to screen space contact shadows. Likely won’t work well.
Selecting VSM as a shadowing method will fix it, but it’s pretty expensive as VSM still need to compute shadow maps upfront and have other various CPU/memory costs. This doesn’t really scale well.
As for the ghosting, I need to take a look at a moving car, but yeah, I imagine things may be broken in a such scenario.
@TiagoCostaUE is fixing it for 5.5 (no pressure :)), so it should work in the next 5.5 preview/release. It won’t be an optimal VR oriented solution, but should work.
Currently, megalights do not render properly in Virtual Reality. After changing to Deferred Rendering and then enabling megalights, everything works fine in the editor, but does not render correctly in both eyes in the headset. The lights will render corrently in one eye, but not the other. With the same lights in the scene, if selected and ‘allow megalights’ is toggled off, those same lights will render correctly again.
Initially I thought this might be an issue with Instanced Stereo, but I disabled this, and it was the same result. I am using a Meta Quest 3.
EDIT: I see someone else has reported this, thanks for your response
you can do soft directional light using the source parameters. source angle and source soft angle for the reflections part of it. be aware that the reflection shadows will be rather noisy in a straight mirror scenario. but does fairly well on semi rough materials.
I’ll post again this image. As far as I know you can’t do shadows this soft. And these shadows are from a regular sun size, it’s not even a cloudy sky. With some clouds the shadows would be even blurrier.
In this image the plant closer to the ground projects sharper shadows, while the leaves higher up will project blurry shadows. And the sharp shadows should intersect and overlap like this with the softer ones.