I’d like to report a visual bug I found when using Megalights directional light, enabled with the commandsr.MegaLights.DirectionalLights 1r.Forward.LightBuffer.Mode 1. (Tested on Unreal Engine 5.6.1)
The volumetric fog’s scattering breaks and abruptly ends halfway through the world when a directional light uses Megalights. This becomes very noticeable if you lower the light intensity (e.g., during sunset, sunrise, or nighttime lighting setups).
The attached images showcase the issue present with Megalights and the expected smooth look that is normally seen without Megalights.
i cannot reproduce this. i’ve not tested mega directional yet, actually. you got some off nomical project settings? or perhaps a vendor specific driver hack is being used? i know intel used to use hacks for volumetric rendering.
maybe you should add your gpu specs and driver version.
i’m completely fogged up here. even autoexposed. works just fine. 3060m. old af 566.36 driver.
nvm… got is aswell at a certain distance. seems to be auto exposure related. if you don’t auto expose it doesn’t do that. one more reason to not use auto exposure. old unstable graphics effects. yep
I reproduced it on both manual and auto exposure. It’s not really about exposure anyway, the issue just shows up at low light intensities, and adjusting the exposure can make it easier to see.
I’m using the default project settings, so it should be pretty easy to reproduce. Anyone implementing a day/night cycle will definitely incur into this once the directional light is low on the horizon.
If you’ve already replicated it yourself, then you know the bug is present and the report is correct, and that’s exactly what reproducing it is for.
The expected behavior is what you see without Megalights enabled: smooth, continuous fog scattering. When using Megalights directional light, the fog rendering breaks, which is a separate issue from exposure. Exposure is just post-processing and it happens later on at an entirely different stage in the pipeline; it can make the problem more noticeable, but it isn’t the cause.
That really sums it up, no need to go in circles and clutter the thread. Hopefully Epic can take a look at this.
well… just noticed this. the other way around. adding to the volume fog glitch. it is indeed somewhat borked. seems to be related to the height component of the fog. and i found the relation to the distribution math vector. could be a temporary fix. and might help figure out this “glitch”. : )
Hi @X-perto, can you try reducing r.MegaLights.Volume.MinSampleWeight?
The default value is quite high in order to improve performance, and can end up skipping necessary samples when the light intensity is low.
neat. 0.07 seems to fix the issue in my test scene with a 10 lux light. at 5 lux i need like 0.0375. threshold when to stop marching the volume? i know this is expensive stuff. : )
When using a Directional Megalight, r.VolumetricFog.InjectRaytracedLights stops working, right? Not allowing ‘God rays’ anymore. Any workaround? (to still use a directional megalight).
water plane in the mirror uses the raytrace switch, btw. in the scene it’s forward translucent. it’s a dupe for the reflection only. masked and custom dithered material i hide in the real scene with the switch. i’d like a tutorial howto get a screenposition in the reflection “layer” and get a nice dither pattern. that’s more lumen than megalights tho. hmmhmm…
I am trying to render at 4K resolution using RTX 4090 (24 GB VRAM) and Unreal Engine version is 5.6.1.
Scene is based on a small closed room with only interior lighting.
”r.MegaLight.DownSampleFactor=0” causes vertical line on screen during render. On one side exposure is good but other side is under exposed. I also tried ”r.MegaLight.DownSampleFactor=1” but result is same any value lower than ”r.MegaLight.DownSampleFactor=2” (default) result in same artifact unless I reduce the resolution but My VRAM has some space during render, around 1 to 2 GB VRAM is free during render so i am sure it’s not related to OOM.
Been trying out the new Megalights directional support and looks great so far! One thing I noticed is that volumetric cloud shadows don’t seem to show up when using it.
Would it be feasible for Megalights to take directional light cloud shadows into account?
Really curious what the roadmap looks like here.
I was wondering if Megalights will ever allow for access to the light/shadow information through BP/C++ for a given pixel and/or the entire scene?
I always felt this was a shortcoming for Lumen since we didn’t have access to the information and had to rely on render target comparisons for the lighting information.
I was thinking of it in regards to light/dark stealth mechanics akin to the Thief and Splinter Cell games.
What you want here is average lighting coming from all directions onto a specific point in space. Kind of like a light meter.
This is pretty different from lighting pixels, which are lit based on the camera position and material properties (e.g. imagine a reflective surface).
So this would need to be a new system, orthogonal to MegaLights, which would compute lighting for given points in space and then download results to CPU.
I admit in my own mind I was picturing the character being full roughness etc. so I hadn’t thought of reflectiveness coming into play.
I was just wondering if it could be implemented into Megalights itself since it’s already doing all the rays from lights to points in worldspace anyway.
That said, I do believe that getting access to the full-scene lighting/shadow information could open up creative possibilities, for example in post-process.
i thought the same. the world grid probes. would still have to downscale that and compute the average. and the density/spacing is “just” a meter. alternative i thought was throwing the bounding box corners or the 2 capsule centers into the world and compute the light values and average that. approximate points in world lighting. hmm.