@Krzysztof.N I saw that you are working on the main branch on supporting directional light with Megalight. Is there a plan to handle the WPO of foliage with Nanite meshes? This was something that was impossible with the “classic” ray-traced shadows.
You needed to enable Evaluate WPO in the settings of the mesh.
This option does not work at all with Nanite meshes, ray-traced shadows do not evaluate WPO with Nanite meshes, even with this option enabled. It only works on “normal” static meshes (non-Nanite).
Oh, yeah, I think I faced that issue before. Sorry, didn’t remember!
Support for WPO evaluation on Nanite fallback meshes was submitted last week to UE5/Main branch and will be included in 5.6 (https://github.com/EpicGames/UnrealEngine/commit/6eabc9b07a5a9887411ec6ac87d3c2039124af6f)
will this work for “lowpoly” instanced static meshes too?
j/k. the instance hbv build times are a lot. hmm. i’m thinking/wonder if the wpo displacement could be computed at the hit point. maybe with a fixed world seed. sync the shaders in frame. this gonna take another performance hit tho, i guess.
yeh… wip.
Awesome! I saw the push on GitHub this afternoon, and I’m really excited to test it
I assume screen traces should (hopefully) dramatically reduce the cost of having skinned/dynamic meshes like foliage when on screen since I think that should mean that even with evaluate WPO in RT off, they should look correct while on screen. You can probably get away with evaluating WPO only for large casters like trees which have a high likelihood of casting shadows from off screen, and even then only at relatively close distances.
I still strongly think we need a setting to allow/disallow megalights screen space shadows independently from RT shadows. They are very good and I would want to be able to get screen space shadows from objects that don’t make sense to have explicitly in the BVH (like many foliage instances) if possible.
For example, if I have a hundreds of thousands or millions of blades of grass or more on screen it would be unrealistic to enable RT on them - but due to small screen size, they should easily be shadowed in screen space only. The same can be said for small trash, leaves and scree on the ground or sometimes mesh particles.
yep. on screen objects should use screen traces with wpo. the offscreen objects are still a bit of trouble to understand. those shadow rays gotta be cast into the bvh and evaluated. and dynamic geometry in the bvh naturally requires a rebuild of parts of it.
not sure what “fixed it” means in this context.
5.5.1. all new shaders compiled. “r.MegaLights.HardwareRayTracing.EvaluateMaterialMode 1” in the console or begin play.
raytraced shadows of masked materials are still broken.
screenshot 2 (middle) did work at some point in 5.x before. so…
Many thanks, the 5.5.1 hotfix has patched this as predicted
I have a problem with shadows. My version is 5.5.1. When I select raytracing, the shadow of the object with opacity mask material appears limited. But when I select virtual shadow map, there is no problem, but I need to use raytracing.
Yeah, crash with
LightFunctionAtlas::BindGlobalParameters()
was fixed recently and will be included in the new hotfix.
Hello, the crash is still present in 5.5.1. When will the fix be released? Is there a github commit that fixes this that we can cherry pick? We cannot make a packaged build of our game since it crashes constantly
AFAIK this should be included in the last hotfix: https://github.com/EpicGames/UnrealEngine/commit/db752a8781e670a853a4c5c7d49d2b110e2fefc0
I’m still getting this when loading a level though
[2024.12.03-14.30.57:076][864]LogWindows: Error: === Critical error: ===
[2024.12.03-14.30.57:076][864]LogWindows: Error:
[2024.12.03-14.30.57:076][864]LogWindows: Error: Fatal error!
[2024.12.03-14.30.57:076][864]LogWindows: Error:
[2024.12.03-14.30.57:076][864]LogWindows: Error: Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x0000000000000008
[2024.12.03-14.30.57:076][864]LogWindows: Error:
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7acfd6ce0 MyProject.exe!LightFunctionAtlas::BindGlobalParameters() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Renderer\Private\LightFunctionAtlas.cpp:990]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ad2afa8b MyProject.exe!FDeferredShadingSceneRenderer::RenderMegaLights() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Renderer\Private\MegaLights\MegaLights.cpp:1316]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7acc31a64 MyProject.exe!FDeferredShadingSceneRenderer::Render() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Renderer\Private\DeferredShadingRenderer.cpp:2845]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ad920f91 MyProject.exe!RenderViewFamilies_RenderThread() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp:5431]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ad8e00a7 MyProject.exe!`FRendererModule::BeginRenderingViewFamilies'::`96'::<lambda_3>::operator()() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Renderer\Private\SceneRendering.cpp:5734]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ae2402b1 MyProject.exe!`FRenderThreadCommandPipe::EnqueueAndLaunch'::`5'::<lambda_1>::operator()() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:1541]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ae25d1aa MyProject.exe!TGraphTask<TFunctionGraphTaskImpl<void __cdecl(void),1> >::ExecuteTask() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Async\TaskGraphInterfaces.h:635]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7a9931ec3 MyProject.exe!UE::Tasks::Private::FTaskBase::TryExecuteTask() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Public\Tasks\TaskPrivate.h:505]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7a9927f27 MyProject.exe!FNamedTaskThread::ProcessTasksNamedThread() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:779]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7a992836e MyProject.exe!FNamedTaskThread::ProcessTasksUntilQuit() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Private\Async\TaskGraph.cpp:668]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ae283768 MyProject.exe!RenderingThreadMain() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:318]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7ae287009 MyProject.exe!FRenderingThread::Run() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\RenderCore\Private\RenderingThread.cpp:443]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7a9f0d758 MyProject.exe!FRunnableThreadWin::Run() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:159]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ff7a9f04cbf MyProject.exe!FRunnableThreadWin::GuardedRun() [D:\UE_5.5_Git\UnrealEngine\Engine\Source\Runtime\Core\Private\Windows\WindowsRunnableThread.cpp:79]
[2024.12.03-14.30.57:076][864]LogWindows: Error: [Callstack] 0x00007ffaea6a7374 KERNEL32.DLL!UnknownFunction []
[2024.12.03-14.30.57:076][864]LogWindows: Error:
Hi @TiagoCostaUE ,
Just out of curiosity: why directional light is not MegaLights compatible?
I have been making some experiments with a “infinite” spot light and the results are quite great. Performance and quality. And the quality is better than with VSMs projected by a non-ML directional light. But with all spotlight limitations, which is a little unconfortable, of course.
Thanks!
Did you ever figure this out? Geometry collections suffer from this in a way too. Unless I’m missing something but this was a default third person project with megalights enabled on default or raytracing. VSM makes it work, but incurs a perf cost.
It hasn’t been added yet as Megalights is still in development, I think it was already mentioned in this forum post.
I do hope it gets added soon tho
Are all lights always casting a volumetric shadow by default when Megalights is enabled regardless of the Cast Volumetric Shadow
setting on the light?
Seems to be the case from my testing but I couldn’t find anything on this.
Also, are there any plans to support the Shadow Pass Switch
material node with Megalights?
Indeed MegaLights ingnores that flag. Thanks for reporting, will fix it.