Volumetric Fog feedback thread

^Oh, I haven’t found the ParticleRadius Documentation, I thought it is new in 4.16. THank you :slight_smile:

I dont think PBR and physically based effects etc are only about creating realistic looking games at all. And I did not mean to suggest that extremely deep and confusing learning must be undertaken in order to do something different. My point along those lines was more about how early it is and that people havent yet had much chance to share their tips for how to do various things.

I found it very easy to create stuff with the new system that does not look realistic at all, especially if I start playing with emissive colour of a volume material, or playing with particle lights or the colour of other lights.

I do not mean to claim that there are no missing options, eg it does sound like some additional cutoff controls will be necessary for certain situations. But physically based stuff is more about the underlying maths and the language used to describe options, about consistency and what not to bake into materials for artistic but rigid control. It’s not just about delivering results that must always reflect the way we are used to seeing light behave on planet earth. But depending on the maths used some of the stuff you might want is not simply hidden from the user, waiting to be exposed, but simply not part of the equation at all. Depending on the detail some could be added in quite trivially, whilst others might impede the entire philosophy of the physically based approach but in many situation I think a happy balance will be found that does not leave artists who want to crank things ‘beyond the norm’ out in the cold at all.

I hope in the future we will have some sculpting tools for 3d fog density. Then you can place a ‘fog volume’ and just paint density within it, straight into the level. Then you just don’t paint inside.

Not at the moment. Tyndall effect happens more with Raleigh Scattering, which is caused by tiny atmosphere particles, much smaller than the dust / smoke / haze / fog particles that Volumetric Fog is simulating. It would still be cool though. It adds some cost as you have to store 3 extinctions, one for each channel.

Basically the Volume material is run on every voxel inside the particle’s bounding sphere. You can output Albedo (reflectivity), Extinction and Emissive for every point in that space. Usually you texture using WorldPosition. Only particle sprites supported correctly atm.

Not at the moment. Standalone volumes would be very cool, although it’s hard to integrate them with translucency efficiently.

The main thing they have going on is the fog is restricted to only be dense in the low areas. This is the key to getting cool volumetric lighting without it being so strong. Don’t turn it up globally, then you can’t see to play the game. Have it be more dense in low areas, and in areas where you have ‘painted’ it in with particles, and in areas where you have localized spot lights.

There are a bunch of volumetric fog settings which are not physically based already. VolumetricScatteringIntensity on a light for example, there is no parallel to modifying a light’s participating media scattering separately from its surface scattering in real life. The energy of the light affects both equally.

Saying ‘it should be more stylized’ is not actionable. There are also infinite ways to stylize rendering, we don’t try to support all of them. Where there are clearly useful artist tweaks, we add them.

To some extent, this volumetric fog algorithm is forced to be physically correct because it actually simulates light travelling through every unit of space, and we are limited by that. You can’t just specify the final color.

Cascaded shadowmaps are supported and generally much higher quality than static shadowing from a Stationary directional light. Can you setup in a small test scene and isolate what the difference is?

Thanks for the bug report, I’ll add that to my list to fix. High res screenshot has some unique requirements.

Why do you have to reduce overall shadow quality, or the number of cascades?

Thanks for all the feedback everyone, and keep it coming.

I’m going to be on vacation next week so the replies may be a bit late.

It seems the meshes are ignored. The fog is everywhere and if I set scatter distribution to 1.0 the light shines straight through the mesh. I’l try to isolate why it’s happening.

artifact1.jpg

Think I found something. Cascade Shadow Maps / Num Dynamic Shadow Cascades was set to 10. If you put 6 or higher the it blends outward.

I also found a bug where Volumetric Scatter Intensity (on the directional light) seems to affect the intensity of my skylight. It’s like they are multiplied together.

Here is the Volumetric Scatter Intensity on my direct light turned to 1.0 and 10.0. Settings are untouched on the skylight. (Note that you have to “refresh” your skylight by changing the intensity or clicking something on/off to produce the error)

I managed to get quite good results by leaving the Volumetric Scatter Intensity to 1.0 and just increasing the Fog Density instead.

Maybe I’m just misunderstanding it, but the patch notes stated, “The GPU cost of Volumetric Fog is primarily controlled by the volume texture resolution, which is set from the Engine Shadow Scalability level. Use ‘profilegpu’ to inspect this cost.”

I took that to mean that in order to reduce the cost of the volumetric fog, reducing shadow quality was the way to do it. I did that and reducing the overall scene shadow quality definitely made the biggest impact of the volumetric fog. I was seeing 0.5ms for the “light scattering 151x108x128” on Epic, and .10ms with “76x54x64” on High shadow settings. Am I mixing two different things up then? It seemed at the current moment that the only way to reduce the cost was to reduce the shadow quality globally.

Scalability settings are basically just presets containing different console variable values. The Shadow Scalability setting affects two CVars for volumetric fog (aside from r.VolumetricFog, which enables/disables the effect entirely):

r.VolumetricFog.GridPixelSize (Lower is higher quality, but more expensive)
r.VolumetricFog.GridSizeZ (Higher is better quality, but more expensive)

The Skylight captures the Skybox once you change settings of the Skylight. It does not detect changes of the distance when changing other things like the direcitonal light or the fog.
You have to recapture the Scene again once you change the fog or light.

Out of curiosity, has anyone done a direct comparison with NVIDIA’s volumetric lighting solution in UE4 and the new built-in volumetrics features? Based on what I’ve seen so far, it seems it’s more of lower-fidelity approach (which likely makes it faster) without any raleigh scattering.

For performance comparison, NV’s solution at its absolute highest quality settings on a Geforce 980M GTX ends up taking ~3ms in-editor in total (screens of that setup below):

https://joy-machine.com/wp-content/uploads/2017/03/sh_hr_placeholder_behemoth.png

https://joy-machine.com/wp-content/uploads/2017/03/sh_hr_few_weeks_to_publisher_build.png

Ah okay, thanks for the clarification with the two cvars. I hadn’t see anything on the fog cvars being grouped with the shadows, thus my confusion.

Playing around and if you set r.VolumetricFog.GridPixelSize 0 it crash the engine :smiley:

Fog Density, Fog Height Falloff and Fog Opacity effect the volumetric fog. The rest do not, and it’s been convenient for me to minimize the other effects (height fog, inscattering cubemap, directional inscattering) when tweaking volumetric fog.

“Scattering Distribution” wasn’t what I expected it to be. It biases the scattering towards or away from the light… At 0.9, artifacts are quite visible when looking at the directional light. At -0.9 a similar effect occurs in the opposite direction (retroreflective fluids, anyone?). More control over this distribution (e.g. broadening/tightening) would be fantastic.

Extinction Scale, Fog Density and the brightness of the Albedo color all contribute to the same overall strength of the fog. Albedo/scattering color caps each channel at 1, so I suppose Extinction Scale is intended to scale the color strength, though this also tends to bathe the scene unattractively, so tweaking with Fog Density is preferable, as @Hallatore concluded.

So far the volumetric fog is proving to be everything I hoped and dreamed. And, while I’m certainly not opposed to exposing some extra parameters to allow for more stylized effects, I think the physical accuracy is a huge asset, since it saves time in trying to figure out the “correct” settings. I’d hope that anything non-physical that gets added would at least be indicated as such. I feel the same way about the new tonemapper, too.

Honestly I’m not sure that would even be worth it. As far as I can tell, the high resolution screenshot functionality fails for every feature that relies on accumulating image data from previous frames. Temporal AA doesn’t seem to work at all (which I guess isn’t a huge problem, since you can always just take a larger screenshot to compensate), and screen space reflections seem completely broken as well, which is definitely a huge problem.

I been testing some stuff to try and do nebulas, have a few questions:

So I have found that I can put the volume material straight on a mesh (which is ), you can see the test sphere and test cylinder above.

I’ve also found that I can do pitch black opaque fog on a particle system (a beam in the example above)

For some weird reason though, the black fog material will work on particle systems, but won’t work on meshes.

Also, when I go in close to the meshes, there’s a weird artifact in the fog density:

Any suggestions?

Cos if I can get occluding fog going on a mesh I’m pretty sure I’ll be able to do some pretty spectacular nebulas (combining the fog and custom mesh generation).

Just for a bit of context, here’s a nice nebula mesh I’ve made without the new fog occluding the background:

And here it is positioned in front of the black fog (which occludes bg stars) on the particle beam in the post above:

So, much better.

I don’t want to have to scatter particle systems everywhere though, so if there was a way to do fully opaque fog from a mesh that would be …

I note a recent addition to the 4.16 github branch:

[Copy] Added VolumetricFogEmissive to ExponentialHeightFogComponent

  • Volumetric fog does not yet support precomputed lighting, so this is the only way to get an ambient lighting term
    #rb none
    #jira UE-43984

[CL 3414761 by Wright in 4.16 branch]

I am going to try this as soon as it has compiled on my machine.